1 #define LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ LDKCVec_TransactionOutputsZ
2 #define CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free CVec_TransactionOutputsZ_free
7 // These should be provided...somehow...
8 void *memset(void *s, int c, size_t n);
9 void *memcpy(void *dest, const void *src, size_t n);
10 int memcmp(const void *s1, const void *s2, size_t n);
12 extern void __attribute__((noreturn)) abort(void);
13 static inline void assert(bool expression) {
14 if (!expression) { abort(); }
17 uint32_t __attribute__((export_name("test_bigint_pass_deadbeef0badf00d"))) test_bigint_pass_deadbeef0badf00d(uint64_t val) {
18 return val == 0xdeadbeef0badf00dULL;
22 void *malloc(size_t size);
25 #define MALLOC(a, _) malloc(a)
26 #define do_MALLOC(a, _b, _c) malloc(a)
27 #define FREE(p) if ((unsigned long)(p) > 4096) { free(p); }
28 #define DO_ASSERT(a) (void)(a)
30 #define CHECK_ACCESS(p)
31 #define CHECK_INNER_FIELD_ACCESS_OR_NULL(v)
33 // We assume that CVec_u8Z and u8slice are the same size and layout (and thus pointers to the two can be mixed)
34 _Static_assert(sizeof(LDKCVec_u8Z) == sizeof(LDKu8slice), "Vec<u8> and [u8] need to have been mapped identically");
35 _Static_assert(offsetof(LDKCVec_u8Z, data) == offsetof(LDKu8slice, data), "Vec<u8> and [u8] need to have been mapped identically");
36 _Static_assert(offsetof(LDKCVec_u8Z, datalen) == offsetof(LDKu8slice, datalen), "Vec<u8> and [u8] need to have been mapped identically");
38 _Static_assert(sizeof(void*) == 4, "Pointers mut be 32 bits");
40 #define DECL_ARR_TYPE(ty, name) \
41 struct name##array { \
42 uint64_t arr_len; /* uint32_t would suffice but we want to align uint64_ts as well */ \
45 typedef struct name##array * name##Array; \
46 static inline name##Array init_##name##Array(size_t arr_len, int lineno) { \
47 name##Array arr = (name##Array)do_MALLOC(arr_len * sizeof(ty) + sizeof(uint64_t), #name" array init", lineno); \
48 arr->arr_len = arr_len; \
52 DECL_ARR_TYPE(int64_t, int64_t);
53 DECL_ARR_TYPE(uint64_t, uint64_t);
54 DECL_ARR_TYPE(int8_t, int8_t);
55 DECL_ARR_TYPE(uint32_t, uint32_t);
56 DECL_ARR_TYPE(void*, ptr);
57 DECL_ARR_TYPE(char, char);
58 typedef charArray jstring;
60 static inline jstring str_ref_to_ts(const char* chars, size_t len) {
61 charArray arr = init_charArray(len, __LINE__);
62 memcpy(arr->elems, chars, len);
65 static inline LDKStr str_ref_to_owned_c(const jstring str) {
66 char* newchars = MALLOC(str->arr_len + 1, "String chars");
67 memcpy(newchars, str->elems, str->arr_len);
68 newchars[str->arr_len] = 0;
72 .chars_is_owned = true
77 typedef bool jboolean;
79 uint32_t __attribute__((export_name("TS_malloc"))) TS_malloc(uint32_t size) {
80 return (uint32_t)MALLOC(size, "JS-Called malloc");
82 void __attribute__((export_name("TS_free"))) TS_free(uint32_t ptr) {
86 jstring __attribute__((export_name("TS_get_ldk_c_bindings_version"))) TS_get_ldk_c_bindings_version() {
87 const char *res = check_get_ldk_bindings_version();
88 if (res == NULL) return NULL;
89 return str_ref_to_ts(res, strlen(res));
91 jstring __attribute__((export_name("TS_get_ldk_version"))) get_ldk_version() {
92 const char *res = check_get_ldk_version();
93 if (res == NULL) return NULL;
94 return str_ref_to_ts(res, strlen(res));
97 static inline struct LDKThirtyTwoBytes ThirtyTwoBytes_clone(const struct LDKThirtyTwoBytes *orig) { struct LDKThirtyTwoBytes ret; memcpy(ret.data, orig->data, 32); return ret; }
99 static inline void* untag_ptr(uint64_t ptr) {
100 if (ptr < 4096) return (void*)ptr;
101 if (sizeof(void*) == 4) {
102 // For 32-bit systems, store pointers as 64-bit ints and use the 31st bit
103 return (void*)(uintptr_t)ptr;
105 // For 64-bit systems, assume the top byte is used for tagging, then
106 // use bit 9 ^ bit 10.
107 uint64_t tenth_bit = (((uintptr_t)ptr) & (1ULL << 54)) >> 54;
108 uintptr_t p = (ptr & ~(1ULL << 55)) | (tenth_bit << 55);
109 #ifdef LDK_DEBUG_BUILD
110 // On debug builds we also use the 11th bit as a debug flag
111 uintptr_t eleventh_bit = (((uintptr_t)ptr) & (1ULL << 53)) >> 53;
112 CHECK(tenth_bit != eleventh_bit);
118 static inline bool ptr_is_owned(uint64_t ptr) {
119 if(ptr < 4096) return true;
120 if (sizeof(void*) == 4) {
121 return ptr & (1ULL << 32);
123 uintptr_t ninth_bit = (((uintptr_t)ptr) & (1ULL << 55)) >> 55;
124 uintptr_t tenth_bit = (((uintptr_t)ptr) & (1ULL << 54)) >> 54;
125 #ifdef LDK_DEBUG_BUILD
126 // On debug builds we also use the 11th bit as a debug flag
127 uintptr_t eleventh_bit = (((uintptr_t)ptr) & (1ULL << 53)) >> 53;
128 CHECK(tenth_bit != eleventh_bit);
130 return (ninth_bit ^ tenth_bit) ? true : false;
133 static inline uint64_t tag_ptr(const void* ptr, bool is_owned) {
134 if ((uintptr_t)ptr < 4096) return (uint64_t)ptr;
135 if (sizeof(void*) == 4) {
136 return (((uint64_t)ptr) | ((is_owned ? 1ULL : 0) << 32));
138 CHECK(sizeof(uintptr_t) == 8);
139 uintptr_t tenth_bit = (((uintptr_t)ptr) & (1ULL << 54)) >> 54;
140 uintptr_t t = (((uintptr_t)ptr) | (((is_owned ? 1ULL : 0ULL) ^ tenth_bit) << 55));
141 #ifdef LDK_DEBUG_BUILD
142 uintptr_t ninth_bit = (((uintptr_t)ptr) & (1ULL << 55)) >> 55;
143 uintptr_t eleventh_bit = (((uintptr_t)ptr) & (1ULL << 53)) >> 53;
144 CHECK(ninth_bit == tenth_bit);
145 CHECK(ninth_bit == eleventh_bit);
148 CHECK(ptr_is_owned(t) == is_owned);
149 CHECK(untag_ptr(t) == ptr);
154 static inline LDKAccessError LDKAccessError_from_js(int32_t ord) {
156 case 0: return LDKAccessError_UnknownChain;
157 case 1: return LDKAccessError_UnknownTx;
161 static inline int32_t LDKAccessError_to_js(LDKAccessError val) {
163 case LDKAccessError_UnknownChain: return 0;
164 case LDKAccessError_UnknownTx: return 1;
168 static inline LDKCOption_NoneZ LDKCOption_NoneZ_from_js(int32_t ord) {
170 case 0: return LDKCOption_NoneZ_Some;
171 case 1: return LDKCOption_NoneZ_None;
175 static inline int32_t LDKCOption_NoneZ_to_js(LDKCOption_NoneZ val) {
177 case LDKCOption_NoneZ_Some: return 0;
178 case LDKCOption_NoneZ_None: return 1;
182 static inline LDKChannelMonitorUpdateErr LDKChannelMonitorUpdateErr_from_js(int32_t ord) {
184 case 0: return LDKChannelMonitorUpdateErr_TemporaryFailure;
185 case 1: return LDKChannelMonitorUpdateErr_PermanentFailure;
189 static inline int32_t LDKChannelMonitorUpdateErr_to_js(LDKChannelMonitorUpdateErr val) {
191 case LDKChannelMonitorUpdateErr_TemporaryFailure: return 0;
192 case LDKChannelMonitorUpdateErr_PermanentFailure: return 1;
196 static inline LDKConfirmationTarget LDKConfirmationTarget_from_js(int32_t ord) {
198 case 0: return LDKConfirmationTarget_Background;
199 case 1: return LDKConfirmationTarget_Normal;
200 case 2: return LDKConfirmationTarget_HighPriority;
204 static inline int32_t LDKConfirmationTarget_to_js(LDKConfirmationTarget val) {
206 case LDKConfirmationTarget_Background: return 0;
207 case LDKConfirmationTarget_Normal: return 1;
208 case LDKConfirmationTarget_HighPriority: return 2;
212 static inline LDKCreationError LDKCreationError_from_js(int32_t ord) {
214 case 0: return LDKCreationError_DescriptionTooLong;
215 case 1: return LDKCreationError_RouteTooLong;
216 case 2: return LDKCreationError_TimestampOutOfBounds;
217 case 3: return LDKCreationError_InvalidAmount;
218 case 4: return LDKCreationError_MissingRouteHints;
222 static inline int32_t LDKCreationError_to_js(LDKCreationError val) {
224 case LDKCreationError_DescriptionTooLong: return 0;
225 case LDKCreationError_RouteTooLong: return 1;
226 case LDKCreationError_TimestampOutOfBounds: return 2;
227 case LDKCreationError_InvalidAmount: return 3;
228 case LDKCreationError_MissingRouteHints: return 4;
232 static inline LDKCurrency LDKCurrency_from_js(int32_t ord) {
234 case 0: return LDKCurrency_Bitcoin;
235 case 1: return LDKCurrency_BitcoinTestnet;
236 case 2: return LDKCurrency_Regtest;
237 case 3: return LDKCurrency_Simnet;
238 case 4: return LDKCurrency_Signet;
242 static inline int32_t LDKCurrency_to_js(LDKCurrency val) {
244 case LDKCurrency_Bitcoin: return 0;
245 case LDKCurrency_BitcoinTestnet: return 1;
246 case LDKCurrency_Regtest: return 2;
247 case LDKCurrency_Simnet: return 3;
248 case LDKCurrency_Signet: return 4;
252 static inline LDKIOError LDKIOError_from_js(int32_t ord) {
254 case 0: return LDKIOError_NotFound;
255 case 1: return LDKIOError_PermissionDenied;
256 case 2: return LDKIOError_ConnectionRefused;
257 case 3: return LDKIOError_ConnectionReset;
258 case 4: return LDKIOError_ConnectionAborted;
259 case 5: return LDKIOError_NotConnected;
260 case 6: return LDKIOError_AddrInUse;
261 case 7: return LDKIOError_AddrNotAvailable;
262 case 8: return LDKIOError_BrokenPipe;
263 case 9: return LDKIOError_AlreadyExists;
264 case 10: return LDKIOError_WouldBlock;
265 case 11: return LDKIOError_InvalidInput;
266 case 12: return LDKIOError_InvalidData;
267 case 13: return LDKIOError_TimedOut;
268 case 14: return LDKIOError_WriteZero;
269 case 15: return LDKIOError_Interrupted;
270 case 16: return LDKIOError_Other;
271 case 17: return LDKIOError_UnexpectedEof;
275 static inline int32_t LDKIOError_to_js(LDKIOError val) {
277 case LDKIOError_NotFound: return 0;
278 case LDKIOError_PermissionDenied: return 1;
279 case LDKIOError_ConnectionRefused: return 2;
280 case LDKIOError_ConnectionReset: return 3;
281 case LDKIOError_ConnectionAborted: return 4;
282 case LDKIOError_NotConnected: return 5;
283 case LDKIOError_AddrInUse: return 6;
284 case LDKIOError_AddrNotAvailable: return 7;
285 case LDKIOError_BrokenPipe: return 8;
286 case LDKIOError_AlreadyExists: return 9;
287 case LDKIOError_WouldBlock: return 10;
288 case LDKIOError_InvalidInput: return 11;
289 case LDKIOError_InvalidData: return 12;
290 case LDKIOError_TimedOut: return 13;
291 case LDKIOError_WriteZero: return 14;
292 case LDKIOError_Interrupted: return 15;
293 case LDKIOError_Other: return 16;
294 case LDKIOError_UnexpectedEof: return 17;
298 static inline LDKLevel LDKLevel_from_js(int32_t ord) {
300 case 0: return LDKLevel_Gossip;
301 case 1: return LDKLevel_Trace;
302 case 2: return LDKLevel_Debug;
303 case 3: return LDKLevel_Info;
304 case 4: return LDKLevel_Warn;
305 case 5: return LDKLevel_Error;
309 static inline int32_t LDKLevel_to_js(LDKLevel val) {
311 case LDKLevel_Gossip: return 0;
312 case LDKLevel_Trace: return 1;
313 case LDKLevel_Debug: return 2;
314 case LDKLevel_Info: return 3;
315 case LDKLevel_Warn: return 4;
316 case LDKLevel_Error: return 5;
320 static inline LDKNetwork LDKNetwork_from_js(int32_t ord) {
322 case 0: return LDKNetwork_Bitcoin;
323 case 1: return LDKNetwork_Testnet;
324 case 2: return LDKNetwork_Regtest;
325 case 3: return LDKNetwork_Signet;
329 static inline int32_t LDKNetwork_to_js(LDKNetwork val) {
331 case LDKNetwork_Bitcoin: return 0;
332 case LDKNetwork_Testnet: return 1;
333 case LDKNetwork_Regtest: return 2;
334 case LDKNetwork_Signet: return 3;
338 static inline LDKRecipient LDKRecipient_from_js(int32_t ord) {
340 case 0: return LDKRecipient_Node;
341 case 1: return LDKRecipient_PhantomNode;
345 static inline int32_t LDKRecipient_to_js(LDKRecipient val) {
347 case LDKRecipient_Node: return 0;
348 case LDKRecipient_PhantomNode: return 1;
352 static inline LDKSecp256k1Error LDKSecp256k1Error_from_js(int32_t ord) {
354 case 0: return LDKSecp256k1Error_IncorrectSignature;
355 case 1: return LDKSecp256k1Error_InvalidMessage;
356 case 2: return LDKSecp256k1Error_InvalidPublicKey;
357 case 3: return LDKSecp256k1Error_InvalidSignature;
358 case 4: return LDKSecp256k1Error_InvalidSecretKey;
359 case 5: return LDKSecp256k1Error_InvalidSharedSecret;
360 case 6: return LDKSecp256k1Error_InvalidRecoveryId;
361 case 7: return LDKSecp256k1Error_InvalidTweak;
362 case 8: return LDKSecp256k1Error_NotEnoughMemory;
363 case 9: return LDKSecp256k1Error_InvalidPublicKeySum;
364 case 10: return LDKSecp256k1Error_InvalidParityValue;
368 static inline int32_t LDKSecp256k1Error_to_js(LDKSecp256k1Error val) {
370 case LDKSecp256k1Error_IncorrectSignature: return 0;
371 case LDKSecp256k1Error_InvalidMessage: return 1;
372 case LDKSecp256k1Error_InvalidPublicKey: return 2;
373 case LDKSecp256k1Error_InvalidSignature: return 3;
374 case LDKSecp256k1Error_InvalidSecretKey: return 4;
375 case LDKSecp256k1Error_InvalidSharedSecret: return 5;
376 case LDKSecp256k1Error_InvalidRecoveryId: return 6;
377 case LDKSecp256k1Error_InvalidTweak: return 7;
378 case LDKSecp256k1Error_NotEnoughMemory: return 8;
379 case LDKSecp256k1Error_InvalidPublicKeySum: return 9;
380 case LDKSecp256k1Error_InvalidParityValue: return 10;
384 static inline LDKSemanticError LDKSemanticError_from_js(int32_t ord) {
386 case 0: return LDKSemanticError_NoPaymentHash;
387 case 1: return LDKSemanticError_MultiplePaymentHashes;
388 case 2: return LDKSemanticError_NoDescription;
389 case 3: return LDKSemanticError_MultipleDescriptions;
390 case 4: return LDKSemanticError_NoPaymentSecret;
391 case 5: return LDKSemanticError_MultiplePaymentSecrets;
392 case 6: return LDKSemanticError_InvalidFeatures;
393 case 7: return LDKSemanticError_InvalidRecoveryId;
394 case 8: return LDKSemanticError_InvalidSignature;
395 case 9: return LDKSemanticError_ImpreciseAmount;
399 static inline int32_t LDKSemanticError_to_js(LDKSemanticError val) {
401 case LDKSemanticError_NoPaymentHash: return 0;
402 case LDKSemanticError_MultiplePaymentHashes: return 1;
403 case LDKSemanticError_NoDescription: return 2;
404 case LDKSemanticError_MultipleDescriptions: return 3;
405 case LDKSemanticError_NoPaymentSecret: return 4;
406 case LDKSemanticError_MultiplePaymentSecrets: return 5;
407 case LDKSemanticError_InvalidFeatures: return 6;
408 case LDKSemanticError_InvalidRecoveryId: return 7;
409 case LDKSemanticError_InvalidSignature: return 8;
410 case LDKSemanticError_ImpreciseAmount: return 9;
414 static inline LDKSiPrefix LDKSiPrefix_from_js(int32_t ord) {
416 case 0: return LDKSiPrefix_Milli;
417 case 1: return LDKSiPrefix_Micro;
418 case 2: return LDKSiPrefix_Nano;
419 case 3: return LDKSiPrefix_Pico;
423 static inline int32_t LDKSiPrefix_to_js(LDKSiPrefix val) {
425 case LDKSiPrefix_Milli: return 0;
426 case LDKSiPrefix_Micro: return 1;
427 case LDKSiPrefix_Nano: return 2;
428 case LDKSiPrefix_Pico: return 3;
432 uint32_t __attribute__((export_name("TS_LDKBech32Error_ty_from_ptr"))) TS_LDKBech32Error_ty_from_ptr(uint64_t ptr) {
433 LDKBech32Error *obj = (LDKBech32Error*)untag_ptr(ptr);
435 case LDKBech32Error_MissingSeparator: return 0;
436 case LDKBech32Error_InvalidChecksum: return 1;
437 case LDKBech32Error_InvalidLength: return 2;
438 case LDKBech32Error_InvalidChar: return 3;
439 case LDKBech32Error_InvalidData: return 4;
440 case LDKBech32Error_InvalidPadding: return 5;
441 case LDKBech32Error_MixedCase: return 6;
445 int32_t __attribute__((export_name("TS_LDKBech32Error_InvalidChar_get_invalid_char"))) TS_LDKBech32Error_InvalidChar_get_invalid_char(uint64_t ptr) {
446 LDKBech32Error *obj = (LDKBech32Error*)untag_ptr(ptr);
447 assert(obj->tag == LDKBech32Error_InvalidChar);
448 int32_t invalid_char_conv = obj->invalid_char;
449 return invalid_char_conv;
451 int8_t __attribute__((export_name("TS_LDKBech32Error_InvalidData_get_invalid_data"))) TS_LDKBech32Error_InvalidData_get_invalid_data(uint64_t ptr) {
452 LDKBech32Error *obj = (LDKBech32Error*)untag_ptr(ptr);
453 assert(obj->tag == LDKBech32Error_InvalidData);
454 int8_t invalid_data_conv = obj->invalid_data;
455 return invalid_data_conv;
457 static inline LDKCVec_u8Z CVec_u8Z_clone(const LDKCVec_u8Z *orig) {
458 LDKCVec_u8Z ret = { .data = MALLOC(sizeof(int8_t) * orig->datalen, "LDKCVec_u8Z clone bytes"), .datalen = orig->datalen };
459 memcpy(ret.data, orig->data, sizeof(int8_t) * ret.datalen);
462 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) {
463 LDKTxOut* thing_conv = (LDKTxOut*)untag_ptr(thing);
464 LDKCVec_u8Z ret_var = TxOut_get_script_pubkey(thing_conv);
465 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
466 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
467 CVec_u8Z_free(ret_var);
471 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) {
472 LDKTxOut* thing_conv = (LDKTxOut*)untag_ptr(thing);
473 int64_t ret_conv = TxOut_get_value(thing_conv);
477 static inline void CResult_NoneNoneZ_get_ok(LDKCResult_NoneNoneZ *NONNULL_PTR owner){
478 CHECK(owner->result_ok);
479 return *owner->contents.result;
481 void __attribute__((export_name("TS_CResult_NoneNoneZ_get_ok"))) TS_CResult_NoneNoneZ_get_ok(uint64_t owner) {
482 LDKCResult_NoneNoneZ* owner_conv = (LDKCResult_NoneNoneZ*)untag_ptr(owner);
483 CResult_NoneNoneZ_get_ok(owner_conv);
486 static inline void CResult_NoneNoneZ_get_err(LDKCResult_NoneNoneZ *NONNULL_PTR owner){
487 CHECK(!owner->result_ok);
488 return *owner->contents.err;
490 void __attribute__((export_name("TS_CResult_NoneNoneZ_get_err"))) TS_CResult_NoneNoneZ_get_err(uint64_t owner) {
491 LDKCResult_NoneNoneZ* owner_conv = (LDKCResult_NoneNoneZ*)untag_ptr(owner);
492 CResult_NoneNoneZ_get_err(owner_conv);
495 static inline struct LDKCounterpartyCommitmentSecrets CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_ok(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR owner){
496 LDKCounterpartyCommitmentSecrets ret = *owner->contents.result;
497 ret.is_owned = false;
500 uint64_t __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_ok"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_ok(uint64_t owner) {
501 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(owner);
502 LDKCounterpartyCommitmentSecrets ret_var = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_ok(owner_conv);
503 uint64_t ret_ref = 0;
504 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
505 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
509 static inline struct LDKDecodeError CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR owner){
510 LDKDecodeError ret = *owner->contents.err;
511 ret.is_owned = false;
514 uint64_t __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err(uint64_t owner) {
515 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(owner);
516 LDKDecodeError ret_var = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err(owner_conv);
517 uint64_t ret_ref = 0;
518 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
519 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
523 static inline struct LDKSecretKey CResult_SecretKeyErrorZ_get_ok(LDKCResult_SecretKeyErrorZ *NONNULL_PTR owner){
524 CHECK(owner->result_ok);
525 return *owner->contents.result;
527 int8_tArray __attribute__((export_name("TS_CResult_SecretKeyErrorZ_get_ok"))) TS_CResult_SecretKeyErrorZ_get_ok(uint64_t owner) {
528 LDKCResult_SecretKeyErrorZ* owner_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(owner);
529 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
530 memcpy(ret_arr->elems, CResult_SecretKeyErrorZ_get_ok(owner_conv).bytes, 32);
534 static inline enum LDKSecp256k1Error CResult_SecretKeyErrorZ_get_err(LDKCResult_SecretKeyErrorZ *NONNULL_PTR owner){
535 CHECK(!owner->result_ok);
536 return *owner->contents.err;
538 uint32_t __attribute__((export_name("TS_CResult_SecretKeyErrorZ_get_err"))) TS_CResult_SecretKeyErrorZ_get_err(uint64_t owner) {
539 LDKCResult_SecretKeyErrorZ* owner_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(owner);
540 uint32_t ret_conv = LDKSecp256k1Error_to_js(CResult_SecretKeyErrorZ_get_err(owner_conv));
544 static inline struct LDKPublicKey CResult_PublicKeyErrorZ_get_ok(LDKCResult_PublicKeyErrorZ *NONNULL_PTR owner){
545 CHECK(owner->result_ok);
546 return *owner->contents.result;
548 int8_tArray __attribute__((export_name("TS_CResult_PublicKeyErrorZ_get_ok"))) TS_CResult_PublicKeyErrorZ_get_ok(uint64_t owner) {
549 LDKCResult_PublicKeyErrorZ* owner_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(owner);
550 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
551 memcpy(ret_arr->elems, CResult_PublicKeyErrorZ_get_ok(owner_conv).compressed_form, 33);
555 static inline enum LDKSecp256k1Error CResult_PublicKeyErrorZ_get_err(LDKCResult_PublicKeyErrorZ *NONNULL_PTR owner){
556 CHECK(!owner->result_ok);
557 return *owner->contents.err;
559 uint32_t __attribute__((export_name("TS_CResult_PublicKeyErrorZ_get_err"))) TS_CResult_PublicKeyErrorZ_get_err(uint64_t owner) {
560 LDKCResult_PublicKeyErrorZ* owner_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(owner);
561 uint32_t ret_conv = LDKSecp256k1Error_to_js(CResult_PublicKeyErrorZ_get_err(owner_conv));
565 static inline struct LDKTxCreationKeys CResult_TxCreationKeysDecodeErrorZ_get_ok(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR owner){
566 LDKTxCreationKeys ret = *owner->contents.result;
567 ret.is_owned = false;
570 uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_get_ok"))) TS_CResult_TxCreationKeysDecodeErrorZ_get_ok(uint64_t owner) {
571 LDKCResult_TxCreationKeysDecodeErrorZ* owner_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(owner);
572 LDKTxCreationKeys ret_var = CResult_TxCreationKeysDecodeErrorZ_get_ok(owner_conv);
573 uint64_t ret_ref = 0;
574 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
575 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
579 static inline struct LDKDecodeError CResult_TxCreationKeysDecodeErrorZ_get_err(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR owner){
580 LDKDecodeError ret = *owner->contents.err;
581 ret.is_owned = false;
584 uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_get_err"))) TS_CResult_TxCreationKeysDecodeErrorZ_get_err(uint64_t owner) {
585 LDKCResult_TxCreationKeysDecodeErrorZ* owner_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(owner);
586 LDKDecodeError ret_var = CResult_TxCreationKeysDecodeErrorZ_get_err(owner_conv);
587 uint64_t ret_ref = 0;
588 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
589 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
593 static inline struct LDKChannelPublicKeys CResult_ChannelPublicKeysDecodeErrorZ_get_ok(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR owner){
594 LDKChannelPublicKeys ret = *owner->contents.result;
595 ret.is_owned = false;
598 uint64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_get_ok"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_get_ok(uint64_t owner) {
599 LDKCResult_ChannelPublicKeysDecodeErrorZ* owner_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(owner);
600 LDKChannelPublicKeys ret_var = CResult_ChannelPublicKeysDecodeErrorZ_get_ok(owner_conv);
601 uint64_t ret_ref = 0;
602 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
603 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
607 static inline struct LDKDecodeError CResult_ChannelPublicKeysDecodeErrorZ_get_err(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR owner){
608 LDKDecodeError ret = *owner->contents.err;
609 ret.is_owned = false;
612 uint64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_get_err"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_get_err(uint64_t owner) {
613 LDKCResult_ChannelPublicKeysDecodeErrorZ* owner_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(owner);
614 LDKDecodeError ret_var = CResult_ChannelPublicKeysDecodeErrorZ_get_err(owner_conv);
615 uint64_t ret_ref = 0;
616 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
617 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
621 static inline struct LDKTxCreationKeys CResult_TxCreationKeysErrorZ_get_ok(LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR owner){
622 LDKTxCreationKeys ret = *owner->contents.result;
623 ret.is_owned = false;
626 uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_get_ok"))) TS_CResult_TxCreationKeysErrorZ_get_ok(uint64_t owner) {
627 LDKCResult_TxCreationKeysErrorZ* owner_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(owner);
628 LDKTxCreationKeys ret_var = CResult_TxCreationKeysErrorZ_get_ok(owner_conv);
629 uint64_t ret_ref = 0;
630 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
631 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
635 static inline enum LDKSecp256k1Error CResult_TxCreationKeysErrorZ_get_err(LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR owner){
636 CHECK(!owner->result_ok);
637 return *owner->contents.err;
639 uint32_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_get_err"))) TS_CResult_TxCreationKeysErrorZ_get_err(uint64_t owner) {
640 LDKCResult_TxCreationKeysErrorZ* owner_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(owner);
641 uint32_t ret_conv = LDKSecp256k1Error_to_js(CResult_TxCreationKeysErrorZ_get_err(owner_conv));
645 uint32_t __attribute__((export_name("TS_LDKCOption_u32Z_ty_from_ptr"))) TS_LDKCOption_u32Z_ty_from_ptr(uint64_t ptr) {
646 LDKCOption_u32Z *obj = (LDKCOption_u32Z*)untag_ptr(ptr);
648 case LDKCOption_u32Z_Some: return 0;
649 case LDKCOption_u32Z_None: return 1;
653 int32_t __attribute__((export_name("TS_LDKCOption_u32Z_Some_get_some"))) TS_LDKCOption_u32Z_Some_get_some(uint64_t ptr) {
654 LDKCOption_u32Z *obj = (LDKCOption_u32Z*)untag_ptr(ptr);
655 assert(obj->tag == LDKCOption_u32Z_Some);
656 int32_t some_conv = obj->some;
659 static inline struct LDKHTLCOutputInCommitment CResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR owner){
660 LDKHTLCOutputInCommitment ret = *owner->contents.result;
661 ret.is_owned = false;
664 uint64_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok(uint64_t owner) {
665 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* owner_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(owner);
666 LDKHTLCOutputInCommitment ret_var = CResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok(owner_conv);
667 uint64_t ret_ref = 0;
668 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
669 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
673 static inline struct LDKDecodeError CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR owner){
674 LDKDecodeError ret = *owner->contents.err;
675 ret.is_owned = false;
678 uint64_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(uint64_t owner) {
679 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* owner_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(owner);
680 LDKDecodeError ret_var = CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(owner_conv);
681 uint64_t ret_ref = 0;
682 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
683 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
687 static inline struct LDKCounterpartyChannelTransactionParameters CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner){
688 LDKCounterpartyChannelTransactionParameters ret = *owner->contents.result;
689 ret.is_owned = false;
692 uint64_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok(uint64_t owner) {
693 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(owner);
694 LDKCounterpartyChannelTransactionParameters ret_var = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok(owner_conv);
695 uint64_t ret_ref = 0;
696 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
697 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
701 static inline struct LDKDecodeError CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner){
702 LDKDecodeError ret = *owner->contents.err;
703 ret.is_owned = false;
706 uint64_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(uint64_t owner) {
707 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(owner);
708 LDKDecodeError ret_var = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(owner_conv);
709 uint64_t ret_ref = 0;
710 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
711 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
715 static inline struct LDKChannelTransactionParameters CResult_ChannelTransactionParametersDecodeErrorZ_get_ok(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner){
716 LDKChannelTransactionParameters ret = *owner->contents.result;
717 ret.is_owned = false;
720 uint64_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_get_ok"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_get_ok(uint64_t owner) {
721 LDKCResult_ChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(owner);
722 LDKChannelTransactionParameters ret_var = CResult_ChannelTransactionParametersDecodeErrorZ_get_ok(owner_conv);
723 uint64_t ret_ref = 0;
724 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
725 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
729 static inline struct LDKDecodeError CResult_ChannelTransactionParametersDecodeErrorZ_get_err(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner){
730 LDKDecodeError ret = *owner->contents.err;
731 ret.is_owned = false;
734 uint64_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_get_err"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_get_err(uint64_t owner) {
735 LDKCResult_ChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(owner);
736 LDKDecodeError ret_var = CResult_ChannelTransactionParametersDecodeErrorZ_get_err(owner_conv);
737 uint64_t ret_ref = 0;
738 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
739 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
743 static inline struct LDKHolderCommitmentTransaction CResult_HolderCommitmentTransactionDecodeErrorZ_get_ok(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
744 LDKHolderCommitmentTransaction ret = *owner->contents.result;
745 ret.is_owned = false;
748 uint64_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_get_ok"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_get_ok(uint64_t owner) {
749 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
750 LDKHolderCommitmentTransaction ret_var = CResult_HolderCommitmentTransactionDecodeErrorZ_get_ok(owner_conv);
751 uint64_t ret_ref = 0;
752 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
753 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
757 static inline struct LDKDecodeError CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
758 LDKDecodeError ret = *owner->contents.err;
759 ret.is_owned = false;
762 uint64_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_get_err"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(uint64_t owner) {
763 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
764 LDKDecodeError ret_var = CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(owner_conv);
765 uint64_t ret_ref = 0;
766 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
767 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
771 static inline struct LDKBuiltCommitmentTransaction CResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
772 LDKBuiltCommitmentTransaction ret = *owner->contents.result;
773 ret.is_owned = false;
776 uint64_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok(uint64_t owner) {
777 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
778 LDKBuiltCommitmentTransaction ret_var = CResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok(owner_conv);
779 uint64_t ret_ref = 0;
780 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
781 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
785 static inline struct LDKDecodeError CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
786 LDKDecodeError ret = *owner->contents.err;
787 ret.is_owned = false;
790 uint64_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(uint64_t owner) {
791 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
792 LDKDecodeError ret_var = CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(owner_conv);
793 uint64_t ret_ref = 0;
794 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
795 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
799 static inline struct LDKTrustedClosingTransaction CResult_TrustedClosingTransactionNoneZ_get_ok(LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR owner){
800 LDKTrustedClosingTransaction ret = *owner->contents.result;
801 ret.is_owned = false;
804 uint64_t __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_get_ok"))) TS_CResult_TrustedClosingTransactionNoneZ_get_ok(uint64_t owner) {
805 LDKCResult_TrustedClosingTransactionNoneZ* owner_conv = (LDKCResult_TrustedClosingTransactionNoneZ*)untag_ptr(owner);
806 LDKTrustedClosingTransaction ret_var = CResult_TrustedClosingTransactionNoneZ_get_ok(owner_conv);
807 uint64_t ret_ref = 0;
808 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
809 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
813 static inline void CResult_TrustedClosingTransactionNoneZ_get_err(LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR owner){
814 CHECK(!owner->result_ok);
815 return *owner->contents.err;
817 void __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_get_err"))) TS_CResult_TrustedClosingTransactionNoneZ_get_err(uint64_t owner) {
818 LDKCResult_TrustedClosingTransactionNoneZ* owner_conv = (LDKCResult_TrustedClosingTransactionNoneZ*)untag_ptr(owner);
819 CResult_TrustedClosingTransactionNoneZ_get_err(owner_conv);
822 static inline struct LDKCommitmentTransaction CResult_CommitmentTransactionDecodeErrorZ_get_ok(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
823 LDKCommitmentTransaction ret = *owner->contents.result;
824 ret.is_owned = false;
827 uint64_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_get_ok"))) TS_CResult_CommitmentTransactionDecodeErrorZ_get_ok(uint64_t owner) {
828 LDKCResult_CommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
829 LDKCommitmentTransaction ret_var = CResult_CommitmentTransactionDecodeErrorZ_get_ok(owner_conv);
830 uint64_t ret_ref = 0;
831 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
832 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
836 static inline struct LDKDecodeError CResult_CommitmentTransactionDecodeErrorZ_get_err(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
837 LDKDecodeError ret = *owner->contents.err;
838 ret.is_owned = false;
841 uint64_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_get_err"))) TS_CResult_CommitmentTransactionDecodeErrorZ_get_err(uint64_t owner) {
842 LDKCResult_CommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
843 LDKDecodeError ret_var = CResult_CommitmentTransactionDecodeErrorZ_get_err(owner_conv);
844 uint64_t ret_ref = 0;
845 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
846 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
850 static inline struct LDKTrustedCommitmentTransaction CResult_TrustedCommitmentTransactionNoneZ_get_ok(LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR owner){
851 LDKTrustedCommitmentTransaction ret = *owner->contents.result;
852 ret.is_owned = false;
855 uint64_t __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNoneZ_get_ok"))) TS_CResult_TrustedCommitmentTransactionNoneZ_get_ok(uint64_t owner) {
856 LDKCResult_TrustedCommitmentTransactionNoneZ* owner_conv = (LDKCResult_TrustedCommitmentTransactionNoneZ*)untag_ptr(owner);
857 LDKTrustedCommitmentTransaction ret_var = CResult_TrustedCommitmentTransactionNoneZ_get_ok(owner_conv);
858 uint64_t ret_ref = 0;
859 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
860 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
864 static inline void CResult_TrustedCommitmentTransactionNoneZ_get_err(LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR owner){
865 CHECK(!owner->result_ok);
866 return *owner->contents.err;
868 void __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNoneZ_get_err"))) TS_CResult_TrustedCommitmentTransactionNoneZ_get_err(uint64_t owner) {
869 LDKCResult_TrustedCommitmentTransactionNoneZ* owner_conv = (LDKCResult_TrustedCommitmentTransactionNoneZ*)untag_ptr(owner);
870 CResult_TrustedCommitmentTransactionNoneZ_get_err(owner_conv);
873 static inline struct LDKCVec_SignatureZ CResult_CVec_SignatureZNoneZ_get_ok(LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR owner){
874 CHECK(owner->result_ok);
875 return *owner->contents.result;
877 ptrArray __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_get_ok"))) TS_CResult_CVec_SignatureZNoneZ_get_ok(uint64_t owner) {
878 LDKCResult_CVec_SignatureZNoneZ* owner_conv = (LDKCResult_CVec_SignatureZNoneZ*)untag_ptr(owner);
879 LDKCVec_SignatureZ ret_var = CResult_CVec_SignatureZNoneZ_get_ok(owner_conv);
880 ptrArray ret_arr = NULL;
881 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
882 int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8);
883 for (size_t m = 0; m < ret_var.datalen; m++) {
884 int8_tArray ret_conv_12_arr = init_int8_tArray(64, __LINE__);
885 memcpy(ret_conv_12_arr->elems, ret_var.data[m].compact_form, 64);
886 ret_arr_ptr[m] = ret_conv_12_arr;
892 static inline void CResult_CVec_SignatureZNoneZ_get_err(LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR owner){
893 CHECK(!owner->result_ok);
894 return *owner->contents.err;
896 void __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_get_err"))) TS_CResult_CVec_SignatureZNoneZ_get_err(uint64_t owner) {
897 LDKCResult_CVec_SignatureZNoneZ* owner_conv = (LDKCResult_CVec_SignatureZNoneZ*)untag_ptr(owner);
898 CResult_CVec_SignatureZNoneZ_get_err(owner_conv);
901 static inline struct LDKShutdownScript CResult_ShutdownScriptDecodeErrorZ_get_ok(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR owner){
902 LDKShutdownScript ret = *owner->contents.result;
903 ret.is_owned = false;
906 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_get_ok"))) TS_CResult_ShutdownScriptDecodeErrorZ_get_ok(uint64_t owner) {
907 LDKCResult_ShutdownScriptDecodeErrorZ* owner_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(owner);
908 LDKShutdownScript ret_var = CResult_ShutdownScriptDecodeErrorZ_get_ok(owner_conv);
909 uint64_t ret_ref = 0;
910 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
911 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
915 static inline struct LDKDecodeError CResult_ShutdownScriptDecodeErrorZ_get_err(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR owner){
916 LDKDecodeError ret = *owner->contents.err;
917 ret.is_owned = false;
920 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_get_err"))) TS_CResult_ShutdownScriptDecodeErrorZ_get_err(uint64_t owner) {
921 LDKCResult_ShutdownScriptDecodeErrorZ* owner_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(owner);
922 LDKDecodeError ret_var = CResult_ShutdownScriptDecodeErrorZ_get_err(owner_conv);
923 uint64_t ret_ref = 0;
924 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
925 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
929 static inline struct LDKShutdownScript CResult_ShutdownScriptInvalidShutdownScriptZ_get_ok(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR owner){
930 LDKShutdownScript ret = *owner->contents.result;
931 ret.is_owned = false;
934 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_get_ok"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_get_ok(uint64_t owner) {
935 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* owner_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(owner);
936 LDKShutdownScript ret_var = CResult_ShutdownScriptInvalidShutdownScriptZ_get_ok(owner_conv);
937 uint64_t ret_ref = 0;
938 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
939 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
943 static inline struct LDKInvalidShutdownScript CResult_ShutdownScriptInvalidShutdownScriptZ_get_err(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR owner){
944 LDKInvalidShutdownScript ret = *owner->contents.err;
945 ret.is_owned = false;
948 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_get_err"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_get_err(uint64_t owner) {
949 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* owner_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(owner);
950 LDKInvalidShutdownScript ret_var = CResult_ShutdownScriptInvalidShutdownScriptZ_get_err(owner_conv);
951 uint64_t ret_ref = 0;
952 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
953 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
957 static inline struct LDKRouteHop CResult_RouteHopDecodeErrorZ_get_ok(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR owner){
958 LDKRouteHop ret = *owner->contents.result;
959 ret.is_owned = false;
962 uint64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_get_ok"))) TS_CResult_RouteHopDecodeErrorZ_get_ok(uint64_t owner) {
963 LDKCResult_RouteHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(owner);
964 LDKRouteHop ret_var = CResult_RouteHopDecodeErrorZ_get_ok(owner_conv);
965 uint64_t ret_ref = 0;
966 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
967 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
971 static inline struct LDKDecodeError CResult_RouteHopDecodeErrorZ_get_err(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR owner){
972 LDKDecodeError ret = *owner->contents.err;
973 ret.is_owned = false;
976 uint64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_get_err"))) TS_CResult_RouteHopDecodeErrorZ_get_err(uint64_t owner) {
977 LDKCResult_RouteHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(owner);
978 LDKDecodeError ret_var = CResult_RouteHopDecodeErrorZ_get_err(owner_conv);
979 uint64_t ret_ref = 0;
980 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
981 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
985 static inline LDKCVec_RouteHopZ CVec_RouteHopZ_clone(const LDKCVec_RouteHopZ *orig) {
986 LDKCVec_RouteHopZ ret = { .data = MALLOC(sizeof(LDKRouteHop) * orig->datalen, "LDKCVec_RouteHopZ clone bytes"), .datalen = orig->datalen };
987 for (size_t i = 0; i < ret.datalen; i++) {
988 ret.data[i] = RouteHop_clone(&orig->data[i]);
992 static inline LDKCVec_CVec_RouteHopZZ CVec_CVec_RouteHopZZ_clone(const LDKCVec_CVec_RouteHopZZ *orig) {
993 LDKCVec_CVec_RouteHopZZ ret = { .data = MALLOC(sizeof(LDKCVec_RouteHopZ) * orig->datalen, "LDKCVec_CVec_RouteHopZZ clone bytes"), .datalen = orig->datalen };
994 for (size_t i = 0; i < ret.datalen; i++) {
995 ret.data[i] = CVec_RouteHopZ_clone(&orig->data[i]);
999 static inline struct LDKRoute CResult_RouteDecodeErrorZ_get_ok(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR owner){
1000 LDKRoute ret = *owner->contents.result;
1001 ret.is_owned = false;
1004 uint64_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_get_ok"))) TS_CResult_RouteDecodeErrorZ_get_ok(uint64_t owner) {
1005 LDKCResult_RouteDecodeErrorZ* owner_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(owner);
1006 LDKRoute ret_var = CResult_RouteDecodeErrorZ_get_ok(owner_conv);
1007 uint64_t ret_ref = 0;
1008 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1009 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1013 static inline struct LDKDecodeError CResult_RouteDecodeErrorZ_get_err(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR owner){
1014 LDKDecodeError ret = *owner->contents.err;
1015 ret.is_owned = false;
1018 uint64_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_get_err"))) TS_CResult_RouteDecodeErrorZ_get_err(uint64_t owner) {
1019 LDKCResult_RouteDecodeErrorZ* owner_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(owner);
1020 LDKDecodeError ret_var = CResult_RouteDecodeErrorZ_get_err(owner_conv);
1021 uint64_t ret_ref = 0;
1022 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1023 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1027 static inline struct LDKRouteParameters CResult_RouteParametersDecodeErrorZ_get_ok(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR owner){
1028 LDKRouteParameters ret = *owner->contents.result;
1029 ret.is_owned = false;
1032 uint64_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_get_ok"))) TS_CResult_RouteParametersDecodeErrorZ_get_ok(uint64_t owner) {
1033 LDKCResult_RouteParametersDecodeErrorZ* owner_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(owner);
1034 LDKRouteParameters ret_var = CResult_RouteParametersDecodeErrorZ_get_ok(owner_conv);
1035 uint64_t ret_ref = 0;
1036 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1037 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1041 static inline struct LDKDecodeError CResult_RouteParametersDecodeErrorZ_get_err(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR owner){
1042 LDKDecodeError ret = *owner->contents.err;
1043 ret.is_owned = false;
1046 uint64_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_get_err"))) TS_CResult_RouteParametersDecodeErrorZ_get_err(uint64_t owner) {
1047 LDKCResult_RouteParametersDecodeErrorZ* owner_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(owner);
1048 LDKDecodeError ret_var = CResult_RouteParametersDecodeErrorZ_get_err(owner_conv);
1049 uint64_t ret_ref = 0;
1050 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1051 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1055 static inline LDKCVec_RouteHintZ CVec_RouteHintZ_clone(const LDKCVec_RouteHintZ *orig) {
1056 LDKCVec_RouteHintZ ret = { .data = MALLOC(sizeof(LDKRouteHint) * orig->datalen, "LDKCVec_RouteHintZ clone bytes"), .datalen = orig->datalen };
1057 for (size_t i = 0; i < ret.datalen; i++) {
1058 ret.data[i] = RouteHint_clone(&orig->data[i]);
1062 uint32_t __attribute__((export_name("TS_LDKCOption_u64Z_ty_from_ptr"))) TS_LDKCOption_u64Z_ty_from_ptr(uint64_t ptr) {
1063 LDKCOption_u64Z *obj = (LDKCOption_u64Z*)untag_ptr(ptr);
1065 case LDKCOption_u64Z_Some: return 0;
1066 case LDKCOption_u64Z_None: return 1;
1070 int64_t __attribute__((export_name("TS_LDKCOption_u64Z_Some_get_some"))) TS_LDKCOption_u64Z_Some_get_some(uint64_t ptr) {
1071 LDKCOption_u64Z *obj = (LDKCOption_u64Z*)untag_ptr(ptr);
1072 assert(obj->tag == LDKCOption_u64Z_Some);
1073 int64_t some_conv = obj->some;
1076 static inline LDKCVec_u64Z CVec_u64Z_clone(const LDKCVec_u64Z *orig) {
1077 LDKCVec_u64Z ret = { .data = MALLOC(sizeof(int64_t) * orig->datalen, "LDKCVec_u64Z clone bytes"), .datalen = orig->datalen };
1078 memcpy(ret.data, orig->data, sizeof(int64_t) * ret.datalen);
1081 static inline struct LDKPaymentParameters CResult_PaymentParametersDecodeErrorZ_get_ok(LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR owner){
1082 LDKPaymentParameters ret = *owner->contents.result;
1083 ret.is_owned = false;
1086 uint64_t __attribute__((export_name("TS_CResult_PaymentParametersDecodeErrorZ_get_ok"))) TS_CResult_PaymentParametersDecodeErrorZ_get_ok(uint64_t owner) {
1087 LDKCResult_PaymentParametersDecodeErrorZ* owner_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(owner);
1088 LDKPaymentParameters ret_var = CResult_PaymentParametersDecodeErrorZ_get_ok(owner_conv);
1089 uint64_t ret_ref = 0;
1090 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1091 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1095 static inline struct LDKDecodeError CResult_PaymentParametersDecodeErrorZ_get_err(LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR owner){
1096 LDKDecodeError ret = *owner->contents.err;
1097 ret.is_owned = false;
1100 uint64_t __attribute__((export_name("TS_CResult_PaymentParametersDecodeErrorZ_get_err"))) TS_CResult_PaymentParametersDecodeErrorZ_get_err(uint64_t owner) {
1101 LDKCResult_PaymentParametersDecodeErrorZ* owner_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(owner);
1102 LDKDecodeError ret_var = CResult_PaymentParametersDecodeErrorZ_get_err(owner_conv);
1103 uint64_t ret_ref = 0;
1104 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1105 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1109 static inline LDKCVec_RouteHintHopZ CVec_RouteHintHopZ_clone(const LDKCVec_RouteHintHopZ *orig) {
1110 LDKCVec_RouteHintHopZ ret = { .data = MALLOC(sizeof(LDKRouteHintHop) * orig->datalen, "LDKCVec_RouteHintHopZ clone bytes"), .datalen = orig->datalen };
1111 for (size_t i = 0; i < ret.datalen; i++) {
1112 ret.data[i] = RouteHintHop_clone(&orig->data[i]);
1116 static inline struct LDKRouteHint CResult_RouteHintDecodeErrorZ_get_ok(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR owner){
1117 LDKRouteHint ret = *owner->contents.result;
1118 ret.is_owned = false;
1121 uint64_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_get_ok"))) TS_CResult_RouteHintDecodeErrorZ_get_ok(uint64_t owner) {
1122 LDKCResult_RouteHintDecodeErrorZ* owner_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(owner);
1123 LDKRouteHint ret_var = CResult_RouteHintDecodeErrorZ_get_ok(owner_conv);
1124 uint64_t ret_ref = 0;
1125 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1126 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1130 static inline struct LDKDecodeError CResult_RouteHintDecodeErrorZ_get_err(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR owner){
1131 LDKDecodeError ret = *owner->contents.err;
1132 ret.is_owned = false;
1135 uint64_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_get_err"))) TS_CResult_RouteHintDecodeErrorZ_get_err(uint64_t owner) {
1136 LDKCResult_RouteHintDecodeErrorZ* owner_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(owner);
1137 LDKDecodeError ret_var = CResult_RouteHintDecodeErrorZ_get_err(owner_conv);
1138 uint64_t ret_ref = 0;
1139 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1140 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1144 static inline struct LDKRouteHintHop CResult_RouteHintHopDecodeErrorZ_get_ok(LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR owner){
1145 LDKRouteHintHop ret = *owner->contents.result;
1146 ret.is_owned = false;
1149 uint64_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_get_ok"))) TS_CResult_RouteHintHopDecodeErrorZ_get_ok(uint64_t owner) {
1150 LDKCResult_RouteHintHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(owner);
1151 LDKRouteHintHop ret_var = CResult_RouteHintHopDecodeErrorZ_get_ok(owner_conv);
1152 uint64_t ret_ref = 0;
1153 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1154 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1158 static inline struct LDKDecodeError CResult_RouteHintHopDecodeErrorZ_get_err(LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR owner){
1159 LDKDecodeError ret = *owner->contents.err;
1160 ret.is_owned = false;
1163 uint64_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_get_err"))) TS_CResult_RouteHintHopDecodeErrorZ_get_err(uint64_t owner) {
1164 LDKCResult_RouteHintHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(owner);
1165 LDKDecodeError ret_var = CResult_RouteHintHopDecodeErrorZ_get_err(owner_conv);
1166 uint64_t ret_ref = 0;
1167 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1168 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1172 static inline LDKCVec_ChannelDetailsZ CVec_ChannelDetailsZ_clone(const LDKCVec_ChannelDetailsZ *orig) {
1173 LDKCVec_ChannelDetailsZ ret = { .data = MALLOC(sizeof(LDKChannelDetails) * orig->datalen, "LDKCVec_ChannelDetailsZ clone bytes"), .datalen = orig->datalen };
1174 for (size_t i = 0; i < ret.datalen; i++) {
1175 ret.data[i] = ChannelDetails_clone(&orig->data[i]);
1179 static inline struct LDKRoute CResult_RouteLightningErrorZ_get_ok(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner){
1180 LDKRoute ret = *owner->contents.result;
1181 ret.is_owned = false;
1184 uint64_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_get_ok"))) TS_CResult_RouteLightningErrorZ_get_ok(uint64_t owner) {
1185 LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(owner);
1186 LDKRoute ret_var = CResult_RouteLightningErrorZ_get_ok(owner_conv);
1187 uint64_t ret_ref = 0;
1188 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1189 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1193 static inline struct LDKLightningError CResult_RouteLightningErrorZ_get_err(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner){
1194 LDKLightningError ret = *owner->contents.err;
1195 ret.is_owned = false;
1198 uint64_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_get_err"))) TS_CResult_RouteLightningErrorZ_get_err(uint64_t owner) {
1199 LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(owner);
1200 LDKLightningError ret_var = CResult_RouteLightningErrorZ_get_err(owner_conv);
1201 uint64_t ret_ref = 0;
1202 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1203 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1207 uint32_t __attribute__((export_name("TS_LDKPaymentPurpose_ty_from_ptr"))) TS_LDKPaymentPurpose_ty_from_ptr(uint64_t ptr) {
1208 LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr);
1210 case LDKPaymentPurpose_InvoicePayment: return 0;
1211 case LDKPaymentPurpose_SpontaneousPayment: return 1;
1215 int8_tArray __attribute__((export_name("TS_LDKPaymentPurpose_InvoicePayment_get_payment_preimage"))) TS_LDKPaymentPurpose_InvoicePayment_get_payment_preimage(uint64_t ptr) {
1216 LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr);
1217 assert(obj->tag == LDKPaymentPurpose_InvoicePayment);
1218 int8_tArray payment_preimage_arr = init_int8_tArray(32, __LINE__);
1219 memcpy(payment_preimage_arr->elems, obj->invoice_payment.payment_preimage.data, 32);
1220 return payment_preimage_arr;
1222 int8_tArray __attribute__((export_name("TS_LDKPaymentPurpose_InvoicePayment_get_payment_secret"))) TS_LDKPaymentPurpose_InvoicePayment_get_payment_secret(uint64_t ptr) {
1223 LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr);
1224 assert(obj->tag == LDKPaymentPurpose_InvoicePayment);
1225 int8_tArray payment_secret_arr = init_int8_tArray(32, __LINE__);
1226 memcpy(payment_secret_arr->elems, obj->invoice_payment.payment_secret.data, 32);
1227 return payment_secret_arr;
1229 int8_tArray __attribute__((export_name("TS_LDKPaymentPurpose_SpontaneousPayment_get_spontaneous_payment"))) TS_LDKPaymentPurpose_SpontaneousPayment_get_spontaneous_payment(uint64_t ptr) {
1230 LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr);
1231 assert(obj->tag == LDKPaymentPurpose_SpontaneousPayment);
1232 int8_tArray spontaneous_payment_arr = init_int8_tArray(32, __LINE__);
1233 memcpy(spontaneous_payment_arr->elems, obj->spontaneous_payment.data, 32);
1234 return spontaneous_payment_arr;
1236 static inline struct LDKPaymentPurpose CResult_PaymentPurposeDecodeErrorZ_get_ok(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR owner){
1237 CHECK(owner->result_ok);
1238 return PaymentPurpose_clone(&*owner->contents.result);
1240 uint64_t __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_get_ok"))) TS_CResult_PaymentPurposeDecodeErrorZ_get_ok(uint64_t owner) {
1241 LDKCResult_PaymentPurposeDecodeErrorZ* owner_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(owner);
1242 LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
1243 *ret_copy = CResult_PaymentPurposeDecodeErrorZ_get_ok(owner_conv);
1244 uint64_t ret_ref = tag_ptr(ret_copy, true);
1248 static inline struct LDKDecodeError CResult_PaymentPurposeDecodeErrorZ_get_err(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR owner){
1249 LDKDecodeError ret = *owner->contents.err;
1250 ret.is_owned = false;
1253 uint64_t __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_get_err"))) TS_CResult_PaymentPurposeDecodeErrorZ_get_err(uint64_t owner) {
1254 LDKCResult_PaymentPurposeDecodeErrorZ* owner_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(owner);
1255 LDKDecodeError ret_var = CResult_PaymentPurposeDecodeErrorZ_get_err(owner_conv);
1256 uint64_t ret_ref = 0;
1257 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1258 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1262 uint32_t __attribute__((export_name("TS_LDKClosureReason_ty_from_ptr"))) TS_LDKClosureReason_ty_from_ptr(uint64_t ptr) {
1263 LDKClosureReason *obj = (LDKClosureReason*)untag_ptr(ptr);
1265 case LDKClosureReason_CounterpartyForceClosed: return 0;
1266 case LDKClosureReason_HolderForceClosed: return 1;
1267 case LDKClosureReason_CooperativeClosure: return 2;
1268 case LDKClosureReason_CommitmentTxConfirmed: return 3;
1269 case LDKClosureReason_FundingTimedOut: return 4;
1270 case LDKClosureReason_ProcessingError: return 5;
1271 case LDKClosureReason_DisconnectedPeer: return 6;
1272 case LDKClosureReason_OutdatedChannelManager: return 7;
1276 jstring __attribute__((export_name("TS_LDKClosureReason_CounterpartyForceClosed_get_peer_msg"))) TS_LDKClosureReason_CounterpartyForceClosed_get_peer_msg(uint64_t ptr) {
1277 LDKClosureReason *obj = (LDKClosureReason*)untag_ptr(ptr);
1278 assert(obj->tag == LDKClosureReason_CounterpartyForceClosed);
1279 LDKStr peer_msg_str = obj->counterparty_force_closed.peer_msg;
1280 jstring peer_msg_conv = str_ref_to_ts(peer_msg_str.chars, peer_msg_str.len);
1281 return peer_msg_conv;
1283 jstring __attribute__((export_name("TS_LDKClosureReason_ProcessingError_get_err"))) TS_LDKClosureReason_ProcessingError_get_err(uint64_t ptr) {
1284 LDKClosureReason *obj = (LDKClosureReason*)untag_ptr(ptr);
1285 assert(obj->tag == LDKClosureReason_ProcessingError);
1286 LDKStr err_str = obj->processing_error.err;
1287 jstring err_conv = str_ref_to_ts(err_str.chars, err_str.len);
1290 uint32_t __attribute__((export_name("TS_LDKCOption_ClosureReasonZ_ty_from_ptr"))) TS_LDKCOption_ClosureReasonZ_ty_from_ptr(uint64_t ptr) {
1291 LDKCOption_ClosureReasonZ *obj = (LDKCOption_ClosureReasonZ*)untag_ptr(ptr);
1293 case LDKCOption_ClosureReasonZ_Some: return 0;
1294 case LDKCOption_ClosureReasonZ_None: return 1;
1298 uint64_t __attribute__((export_name("TS_LDKCOption_ClosureReasonZ_Some_get_some"))) TS_LDKCOption_ClosureReasonZ_Some_get_some(uint64_t ptr) {
1299 LDKCOption_ClosureReasonZ *obj = (LDKCOption_ClosureReasonZ*)untag_ptr(ptr);
1300 assert(obj->tag == LDKCOption_ClosureReasonZ_Some);
1301 uint64_t some_ref = tag_ptr(&obj->some, false);
1304 static inline struct LDKCOption_ClosureReasonZ CResult_COption_ClosureReasonZDecodeErrorZ_get_ok(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR owner){
1305 CHECK(owner->result_ok);
1306 return COption_ClosureReasonZ_clone(&*owner->contents.result);
1308 uint64_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_get_ok"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_get_ok(uint64_t owner) {
1309 LDKCResult_COption_ClosureReasonZDecodeErrorZ* owner_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(owner);
1310 LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
1311 *ret_copy = CResult_COption_ClosureReasonZDecodeErrorZ_get_ok(owner_conv);
1312 uint64_t ret_ref = tag_ptr(ret_copy, true);
1316 static inline struct LDKDecodeError CResult_COption_ClosureReasonZDecodeErrorZ_get_err(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR owner){
1317 LDKDecodeError ret = *owner->contents.err;
1318 ret.is_owned = false;
1321 uint64_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_get_err"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_get_err(uint64_t owner) {
1322 LDKCResult_COption_ClosureReasonZDecodeErrorZ* owner_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(owner);
1323 LDKDecodeError ret_var = CResult_COption_ClosureReasonZDecodeErrorZ_get_err(owner_conv);
1324 uint64_t ret_ref = 0;
1325 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1326 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1330 uint32_t __attribute__((export_name("TS_LDKHTLCDestination_ty_from_ptr"))) TS_LDKHTLCDestination_ty_from_ptr(uint64_t ptr) {
1331 LDKHTLCDestination *obj = (LDKHTLCDestination*)untag_ptr(ptr);
1333 case LDKHTLCDestination_NextHopChannel: return 0;
1334 case LDKHTLCDestination_UnknownNextHop: return 1;
1335 case LDKHTLCDestination_FailedPayment: return 2;
1339 int8_tArray __attribute__((export_name("TS_LDKHTLCDestination_NextHopChannel_get_node_id"))) TS_LDKHTLCDestination_NextHopChannel_get_node_id(uint64_t ptr) {
1340 LDKHTLCDestination *obj = (LDKHTLCDestination*)untag_ptr(ptr);
1341 assert(obj->tag == LDKHTLCDestination_NextHopChannel);
1342 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
1343 memcpy(node_id_arr->elems, obj->next_hop_channel.node_id.compressed_form, 33);
1346 int8_tArray __attribute__((export_name("TS_LDKHTLCDestination_NextHopChannel_get_channel_id"))) TS_LDKHTLCDestination_NextHopChannel_get_channel_id(uint64_t ptr) {
1347 LDKHTLCDestination *obj = (LDKHTLCDestination*)untag_ptr(ptr);
1348 assert(obj->tag == LDKHTLCDestination_NextHopChannel);
1349 int8_tArray channel_id_arr = init_int8_tArray(32, __LINE__);
1350 memcpy(channel_id_arr->elems, obj->next_hop_channel.channel_id.data, 32);
1351 return channel_id_arr;
1353 int64_t __attribute__((export_name("TS_LDKHTLCDestination_UnknownNextHop_get_requested_forward_scid"))) TS_LDKHTLCDestination_UnknownNextHop_get_requested_forward_scid(uint64_t ptr) {
1354 LDKHTLCDestination *obj = (LDKHTLCDestination*)untag_ptr(ptr);
1355 assert(obj->tag == LDKHTLCDestination_UnknownNextHop);
1356 int64_t requested_forward_scid_conv = obj->unknown_next_hop.requested_forward_scid;
1357 return requested_forward_scid_conv;
1359 int8_tArray __attribute__((export_name("TS_LDKHTLCDestination_FailedPayment_get_payment_hash"))) TS_LDKHTLCDestination_FailedPayment_get_payment_hash(uint64_t ptr) {
1360 LDKHTLCDestination *obj = (LDKHTLCDestination*)untag_ptr(ptr);
1361 assert(obj->tag == LDKHTLCDestination_FailedPayment);
1362 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
1363 memcpy(payment_hash_arr->elems, obj->failed_payment.payment_hash.data, 32);
1364 return payment_hash_arr;
1366 uint32_t __attribute__((export_name("TS_LDKCOption_HTLCDestinationZ_ty_from_ptr"))) TS_LDKCOption_HTLCDestinationZ_ty_from_ptr(uint64_t ptr) {
1367 LDKCOption_HTLCDestinationZ *obj = (LDKCOption_HTLCDestinationZ*)untag_ptr(ptr);
1369 case LDKCOption_HTLCDestinationZ_Some: return 0;
1370 case LDKCOption_HTLCDestinationZ_None: return 1;
1374 uint64_t __attribute__((export_name("TS_LDKCOption_HTLCDestinationZ_Some_get_some"))) TS_LDKCOption_HTLCDestinationZ_Some_get_some(uint64_t ptr) {
1375 LDKCOption_HTLCDestinationZ *obj = (LDKCOption_HTLCDestinationZ*)untag_ptr(ptr);
1376 assert(obj->tag == LDKCOption_HTLCDestinationZ_Some);
1377 uint64_t some_ref = tag_ptr(&obj->some, false);
1380 static inline struct LDKCOption_HTLCDestinationZ CResult_COption_HTLCDestinationZDecodeErrorZ_get_ok(LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR owner){
1381 CHECK(owner->result_ok);
1382 return COption_HTLCDestinationZ_clone(&*owner->contents.result);
1384 uint64_t __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_get_ok"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_get_ok(uint64_t owner) {
1385 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* owner_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(owner);
1386 LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ");
1387 *ret_copy = CResult_COption_HTLCDestinationZDecodeErrorZ_get_ok(owner_conv);
1388 uint64_t ret_ref = tag_ptr(ret_copy, true);
1392 static inline struct LDKDecodeError CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR owner){
1393 LDKDecodeError ret = *owner->contents.err;
1394 ret.is_owned = false;
1397 uint64_t __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_get_err"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(uint64_t owner) {
1398 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* owner_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(owner);
1399 LDKDecodeError ret_var = CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(owner_conv);
1400 uint64_t ret_ref = 0;
1401 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1402 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1406 uint32_t __attribute__((export_name("TS_LDKNetworkUpdate_ty_from_ptr"))) TS_LDKNetworkUpdate_ty_from_ptr(uint64_t ptr) {
1407 LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr);
1409 case LDKNetworkUpdate_ChannelUpdateMessage: return 0;
1410 case LDKNetworkUpdate_ChannelFailure: return 1;
1411 case LDKNetworkUpdate_NodeFailure: return 2;
1415 uint64_t __attribute__((export_name("TS_LDKNetworkUpdate_ChannelUpdateMessage_get_msg"))) TS_LDKNetworkUpdate_ChannelUpdateMessage_get_msg(uint64_t ptr) {
1416 LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr);
1417 assert(obj->tag == LDKNetworkUpdate_ChannelUpdateMessage);
1418 LDKChannelUpdate msg_var = obj->channel_update_message.msg;
1419 uint64_t msg_ref = 0;
1420 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
1421 msg_ref = tag_ptr(msg_var.inner, false);
1424 int64_t __attribute__((export_name("TS_LDKNetworkUpdate_ChannelFailure_get_short_channel_id"))) TS_LDKNetworkUpdate_ChannelFailure_get_short_channel_id(uint64_t ptr) {
1425 LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr);
1426 assert(obj->tag == LDKNetworkUpdate_ChannelFailure);
1427 int64_t short_channel_id_conv = obj->channel_failure.short_channel_id;
1428 return short_channel_id_conv;
1430 jboolean __attribute__((export_name("TS_LDKNetworkUpdate_ChannelFailure_get_is_permanent"))) TS_LDKNetworkUpdate_ChannelFailure_get_is_permanent(uint64_t ptr) {
1431 LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr);
1432 assert(obj->tag == LDKNetworkUpdate_ChannelFailure);
1433 jboolean is_permanent_conv = obj->channel_failure.is_permanent;
1434 return is_permanent_conv;
1436 int8_tArray __attribute__((export_name("TS_LDKNetworkUpdate_NodeFailure_get_node_id"))) TS_LDKNetworkUpdate_NodeFailure_get_node_id(uint64_t ptr) {
1437 LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr);
1438 assert(obj->tag == LDKNetworkUpdate_NodeFailure);
1439 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
1440 memcpy(node_id_arr->elems, obj->node_failure.node_id.compressed_form, 33);
1443 jboolean __attribute__((export_name("TS_LDKNetworkUpdate_NodeFailure_get_is_permanent"))) TS_LDKNetworkUpdate_NodeFailure_get_is_permanent(uint64_t ptr) {
1444 LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr);
1445 assert(obj->tag == LDKNetworkUpdate_NodeFailure);
1446 jboolean is_permanent_conv = obj->node_failure.is_permanent;
1447 return is_permanent_conv;
1449 uint32_t __attribute__((export_name("TS_LDKCOption_NetworkUpdateZ_ty_from_ptr"))) TS_LDKCOption_NetworkUpdateZ_ty_from_ptr(uint64_t ptr) {
1450 LDKCOption_NetworkUpdateZ *obj = (LDKCOption_NetworkUpdateZ*)untag_ptr(ptr);
1452 case LDKCOption_NetworkUpdateZ_Some: return 0;
1453 case LDKCOption_NetworkUpdateZ_None: return 1;
1457 uint64_t __attribute__((export_name("TS_LDKCOption_NetworkUpdateZ_Some_get_some"))) TS_LDKCOption_NetworkUpdateZ_Some_get_some(uint64_t ptr) {
1458 LDKCOption_NetworkUpdateZ *obj = (LDKCOption_NetworkUpdateZ*)untag_ptr(ptr);
1459 assert(obj->tag == LDKCOption_NetworkUpdateZ_Some);
1460 uint64_t some_ref = tag_ptr(&obj->some, false);
1463 uint32_t __attribute__((export_name("TS_LDKSpendableOutputDescriptor_ty_from_ptr"))) TS_LDKSpendableOutputDescriptor_ty_from_ptr(uint64_t ptr) {
1464 LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)untag_ptr(ptr);
1466 case LDKSpendableOutputDescriptor_StaticOutput: return 0;
1467 case LDKSpendableOutputDescriptor_DelayedPaymentOutput: return 1;
1468 case LDKSpendableOutputDescriptor_StaticPaymentOutput: return 2;
1472 uint64_t __attribute__((export_name("TS_LDKSpendableOutputDescriptor_StaticOutput_get_outpoint"))) TS_LDKSpendableOutputDescriptor_StaticOutput_get_outpoint(uint64_t ptr) {
1473 LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)untag_ptr(ptr);
1474 assert(obj->tag == LDKSpendableOutputDescriptor_StaticOutput);
1475 LDKOutPoint outpoint_var = obj->static_output.outpoint;
1476 uint64_t outpoint_ref = 0;
1477 CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_var);
1478 outpoint_ref = tag_ptr(outpoint_var.inner, false);
1479 return outpoint_ref;
1481 uint64_t __attribute__((export_name("TS_LDKSpendableOutputDescriptor_StaticOutput_get_output"))) TS_LDKSpendableOutputDescriptor_StaticOutput_get_output(uint64_t ptr) {
1482 LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)untag_ptr(ptr);
1483 assert(obj->tag == LDKSpendableOutputDescriptor_StaticOutput);
1484 LDKTxOut* output_ref = &obj->static_output.output;
1485 return tag_ptr(output_ref, false);
1487 uint64_t __attribute__((export_name("TS_LDKSpendableOutputDescriptor_DelayedPaymentOutput_get_delayed_payment_output"))) TS_LDKSpendableOutputDescriptor_DelayedPaymentOutput_get_delayed_payment_output(uint64_t ptr) {
1488 LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)untag_ptr(ptr);
1489 assert(obj->tag == LDKSpendableOutputDescriptor_DelayedPaymentOutput);
1490 LDKDelayedPaymentOutputDescriptor delayed_payment_output_var = obj->delayed_payment_output;
1491 uint64_t delayed_payment_output_ref = 0;
1492 CHECK_INNER_FIELD_ACCESS_OR_NULL(delayed_payment_output_var);
1493 delayed_payment_output_ref = tag_ptr(delayed_payment_output_var.inner, false);
1494 return delayed_payment_output_ref;
1496 uint64_t __attribute__((export_name("TS_LDKSpendableOutputDescriptor_StaticPaymentOutput_get_static_payment_output"))) TS_LDKSpendableOutputDescriptor_StaticPaymentOutput_get_static_payment_output(uint64_t ptr) {
1497 LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)untag_ptr(ptr);
1498 assert(obj->tag == LDKSpendableOutputDescriptor_StaticPaymentOutput);
1499 LDKStaticPaymentOutputDescriptor static_payment_output_var = obj->static_payment_output;
1500 uint64_t static_payment_output_ref = 0;
1501 CHECK_INNER_FIELD_ACCESS_OR_NULL(static_payment_output_var);
1502 static_payment_output_ref = tag_ptr(static_payment_output_var.inner, false);
1503 return static_payment_output_ref;
1505 static inline LDKCVec_SpendableOutputDescriptorZ CVec_SpendableOutputDescriptorZ_clone(const LDKCVec_SpendableOutputDescriptorZ *orig) {
1506 LDKCVec_SpendableOutputDescriptorZ ret = { .data = MALLOC(sizeof(LDKSpendableOutputDescriptor) * orig->datalen, "LDKCVec_SpendableOutputDescriptorZ clone bytes"), .datalen = orig->datalen };
1507 for (size_t i = 0; i < ret.datalen; i++) {
1508 ret.data[i] = SpendableOutputDescriptor_clone(&orig->data[i]);
1512 uint32_t __attribute__((export_name("TS_LDKEvent_ty_from_ptr"))) TS_LDKEvent_ty_from_ptr(uint64_t ptr) {
1513 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1515 case LDKEvent_FundingGenerationReady: return 0;
1516 case LDKEvent_PaymentReceived: return 1;
1517 case LDKEvent_PaymentClaimed: return 2;
1518 case LDKEvent_PaymentSent: return 3;
1519 case LDKEvent_PaymentFailed: return 4;
1520 case LDKEvent_PaymentPathSuccessful: return 5;
1521 case LDKEvent_PaymentPathFailed: return 6;
1522 case LDKEvent_ProbeSuccessful: return 7;
1523 case LDKEvent_ProbeFailed: return 8;
1524 case LDKEvent_PendingHTLCsForwardable: return 9;
1525 case LDKEvent_SpendableOutputs: return 10;
1526 case LDKEvent_PaymentForwarded: return 11;
1527 case LDKEvent_ChannelClosed: return 12;
1528 case LDKEvent_DiscardFunding: return 13;
1529 case LDKEvent_OpenChannelRequest: return 14;
1530 case LDKEvent_HTLCHandlingFailed: return 15;
1534 int8_tArray __attribute__((export_name("TS_LDKEvent_FundingGenerationReady_get_temporary_channel_id"))) TS_LDKEvent_FundingGenerationReady_get_temporary_channel_id(uint64_t ptr) {
1535 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1536 assert(obj->tag == LDKEvent_FundingGenerationReady);
1537 int8_tArray temporary_channel_id_arr = init_int8_tArray(32, __LINE__);
1538 memcpy(temporary_channel_id_arr->elems, obj->funding_generation_ready.temporary_channel_id.data, 32);
1539 return temporary_channel_id_arr;
1541 int8_tArray __attribute__((export_name("TS_LDKEvent_FundingGenerationReady_get_counterparty_node_id"))) TS_LDKEvent_FundingGenerationReady_get_counterparty_node_id(uint64_t ptr) {
1542 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1543 assert(obj->tag == LDKEvent_FundingGenerationReady);
1544 int8_tArray counterparty_node_id_arr = init_int8_tArray(33, __LINE__);
1545 memcpy(counterparty_node_id_arr->elems, obj->funding_generation_ready.counterparty_node_id.compressed_form, 33);
1546 return counterparty_node_id_arr;
1548 int64_t __attribute__((export_name("TS_LDKEvent_FundingGenerationReady_get_channel_value_satoshis"))) TS_LDKEvent_FundingGenerationReady_get_channel_value_satoshis(uint64_t ptr) {
1549 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1550 assert(obj->tag == LDKEvent_FundingGenerationReady);
1551 int64_t channel_value_satoshis_conv = obj->funding_generation_ready.channel_value_satoshis;
1552 return channel_value_satoshis_conv;
1554 int8_tArray __attribute__((export_name("TS_LDKEvent_FundingGenerationReady_get_output_script"))) TS_LDKEvent_FundingGenerationReady_get_output_script(uint64_t ptr) {
1555 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1556 assert(obj->tag == LDKEvent_FundingGenerationReady);
1557 LDKCVec_u8Z output_script_var = obj->funding_generation_ready.output_script;
1558 int8_tArray output_script_arr = init_int8_tArray(output_script_var.datalen, __LINE__);
1559 memcpy(output_script_arr->elems, output_script_var.data, output_script_var.datalen);
1560 return output_script_arr;
1562 int64_t __attribute__((export_name("TS_LDKEvent_FundingGenerationReady_get_user_channel_id"))) TS_LDKEvent_FundingGenerationReady_get_user_channel_id(uint64_t ptr) {
1563 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1564 assert(obj->tag == LDKEvent_FundingGenerationReady);
1565 int64_t user_channel_id_conv = obj->funding_generation_ready.user_channel_id;
1566 return user_channel_id_conv;
1568 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentReceived_get_payment_hash"))) TS_LDKEvent_PaymentReceived_get_payment_hash(uint64_t ptr) {
1569 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1570 assert(obj->tag == LDKEvent_PaymentReceived);
1571 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
1572 memcpy(payment_hash_arr->elems, obj->payment_received.payment_hash.data, 32);
1573 return payment_hash_arr;
1575 int64_t __attribute__((export_name("TS_LDKEvent_PaymentReceived_get_amount_msat"))) TS_LDKEvent_PaymentReceived_get_amount_msat(uint64_t ptr) {
1576 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1577 assert(obj->tag == LDKEvent_PaymentReceived);
1578 int64_t amount_msat_conv = obj->payment_received.amount_msat;
1579 return amount_msat_conv;
1581 uint64_t __attribute__((export_name("TS_LDKEvent_PaymentReceived_get_purpose"))) TS_LDKEvent_PaymentReceived_get_purpose(uint64_t ptr) {
1582 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1583 assert(obj->tag == LDKEvent_PaymentReceived);
1584 uint64_t purpose_ref = tag_ptr(&obj->payment_received.purpose, false);
1587 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentClaimed_get_payment_hash"))) TS_LDKEvent_PaymentClaimed_get_payment_hash(uint64_t ptr) {
1588 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1589 assert(obj->tag == LDKEvent_PaymentClaimed);
1590 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
1591 memcpy(payment_hash_arr->elems, obj->payment_claimed.payment_hash.data, 32);
1592 return payment_hash_arr;
1594 int64_t __attribute__((export_name("TS_LDKEvent_PaymentClaimed_get_amount_msat"))) TS_LDKEvent_PaymentClaimed_get_amount_msat(uint64_t ptr) {
1595 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1596 assert(obj->tag == LDKEvent_PaymentClaimed);
1597 int64_t amount_msat_conv = obj->payment_claimed.amount_msat;
1598 return amount_msat_conv;
1600 uint64_t __attribute__((export_name("TS_LDKEvent_PaymentClaimed_get_purpose"))) TS_LDKEvent_PaymentClaimed_get_purpose(uint64_t ptr) {
1601 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1602 assert(obj->tag == LDKEvent_PaymentClaimed);
1603 uint64_t purpose_ref = tag_ptr(&obj->payment_claimed.purpose, false);
1606 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentSent_get_payment_id"))) TS_LDKEvent_PaymentSent_get_payment_id(uint64_t ptr) {
1607 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1608 assert(obj->tag == LDKEvent_PaymentSent);
1609 int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
1610 memcpy(payment_id_arr->elems, obj->payment_sent.payment_id.data, 32);
1611 return payment_id_arr;
1613 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentSent_get_payment_preimage"))) TS_LDKEvent_PaymentSent_get_payment_preimage(uint64_t ptr) {
1614 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1615 assert(obj->tag == LDKEvent_PaymentSent);
1616 int8_tArray payment_preimage_arr = init_int8_tArray(32, __LINE__);
1617 memcpy(payment_preimage_arr->elems, obj->payment_sent.payment_preimage.data, 32);
1618 return payment_preimage_arr;
1620 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentSent_get_payment_hash"))) TS_LDKEvent_PaymentSent_get_payment_hash(uint64_t ptr) {
1621 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1622 assert(obj->tag == LDKEvent_PaymentSent);
1623 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
1624 memcpy(payment_hash_arr->elems, obj->payment_sent.payment_hash.data, 32);
1625 return payment_hash_arr;
1627 uint64_t __attribute__((export_name("TS_LDKEvent_PaymentSent_get_fee_paid_msat"))) TS_LDKEvent_PaymentSent_get_fee_paid_msat(uint64_t ptr) {
1628 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1629 assert(obj->tag == LDKEvent_PaymentSent);
1630 uint64_t fee_paid_msat_ref = tag_ptr(&obj->payment_sent.fee_paid_msat, false);
1631 return fee_paid_msat_ref;
1633 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentFailed_get_payment_id"))) TS_LDKEvent_PaymentFailed_get_payment_id(uint64_t ptr) {
1634 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1635 assert(obj->tag == LDKEvent_PaymentFailed);
1636 int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
1637 memcpy(payment_id_arr->elems, obj->payment_failed.payment_id.data, 32);
1638 return payment_id_arr;
1640 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentFailed_get_payment_hash"))) TS_LDKEvent_PaymentFailed_get_payment_hash(uint64_t ptr) {
1641 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1642 assert(obj->tag == LDKEvent_PaymentFailed);
1643 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
1644 memcpy(payment_hash_arr->elems, obj->payment_failed.payment_hash.data, 32);
1645 return payment_hash_arr;
1647 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathSuccessful_get_payment_id"))) TS_LDKEvent_PaymentPathSuccessful_get_payment_id(uint64_t ptr) {
1648 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1649 assert(obj->tag == LDKEvent_PaymentPathSuccessful);
1650 int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
1651 memcpy(payment_id_arr->elems, obj->payment_path_successful.payment_id.data, 32);
1652 return payment_id_arr;
1654 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathSuccessful_get_payment_hash"))) TS_LDKEvent_PaymentPathSuccessful_get_payment_hash(uint64_t ptr) {
1655 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1656 assert(obj->tag == LDKEvent_PaymentPathSuccessful);
1657 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
1658 memcpy(payment_hash_arr->elems, obj->payment_path_successful.payment_hash.data, 32);
1659 return payment_hash_arr;
1661 uint64_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathSuccessful_get_path"))) TS_LDKEvent_PaymentPathSuccessful_get_path(uint64_t ptr) {
1662 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1663 assert(obj->tag == LDKEvent_PaymentPathSuccessful);
1664 LDKCVec_RouteHopZ path_var = obj->payment_path_successful.path;
1665 uint64_tArray path_arr = NULL;
1666 path_arr = init_uint64_tArray(path_var.datalen, __LINE__);
1667 uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8);
1668 for (size_t k = 0; k < path_var.datalen; k++) {
1669 LDKRouteHop path_conv_10_var = path_var.data[k];
1670 uint64_t path_conv_10_ref = 0;
1671 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
1672 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, false);
1673 path_arr_ptr[k] = path_conv_10_ref;
1678 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_payment_id"))) TS_LDKEvent_PaymentPathFailed_get_payment_id(uint64_t ptr) {
1679 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1680 assert(obj->tag == LDKEvent_PaymentPathFailed);
1681 int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
1682 memcpy(payment_id_arr->elems, obj->payment_path_failed.payment_id.data, 32);
1683 return payment_id_arr;
1685 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_payment_hash"))) TS_LDKEvent_PaymentPathFailed_get_payment_hash(uint64_t ptr) {
1686 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1687 assert(obj->tag == LDKEvent_PaymentPathFailed);
1688 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
1689 memcpy(payment_hash_arr->elems, obj->payment_path_failed.payment_hash.data, 32);
1690 return payment_hash_arr;
1692 jboolean __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_rejected_by_dest"))) TS_LDKEvent_PaymentPathFailed_get_rejected_by_dest(uint64_t ptr) {
1693 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1694 assert(obj->tag == LDKEvent_PaymentPathFailed);
1695 jboolean rejected_by_dest_conv = obj->payment_path_failed.rejected_by_dest;
1696 return rejected_by_dest_conv;
1698 uint64_t __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_network_update"))) TS_LDKEvent_PaymentPathFailed_get_network_update(uint64_t ptr) {
1699 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1700 assert(obj->tag == LDKEvent_PaymentPathFailed);
1701 uint64_t network_update_ref = tag_ptr(&obj->payment_path_failed.network_update, false);
1702 return network_update_ref;
1704 jboolean __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_all_paths_failed"))) TS_LDKEvent_PaymentPathFailed_get_all_paths_failed(uint64_t ptr) {
1705 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1706 assert(obj->tag == LDKEvent_PaymentPathFailed);
1707 jboolean all_paths_failed_conv = obj->payment_path_failed.all_paths_failed;
1708 return all_paths_failed_conv;
1710 uint64_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_path"))) TS_LDKEvent_PaymentPathFailed_get_path(uint64_t ptr) {
1711 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1712 assert(obj->tag == LDKEvent_PaymentPathFailed);
1713 LDKCVec_RouteHopZ path_var = obj->payment_path_failed.path;
1714 uint64_tArray path_arr = NULL;
1715 path_arr = init_uint64_tArray(path_var.datalen, __LINE__);
1716 uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8);
1717 for (size_t k = 0; k < path_var.datalen; k++) {
1718 LDKRouteHop path_conv_10_var = path_var.data[k];
1719 uint64_t path_conv_10_ref = 0;
1720 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
1721 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, false);
1722 path_arr_ptr[k] = path_conv_10_ref;
1727 uint64_t __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_short_channel_id"))) TS_LDKEvent_PaymentPathFailed_get_short_channel_id(uint64_t ptr) {
1728 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1729 assert(obj->tag == LDKEvent_PaymentPathFailed);
1730 uint64_t short_channel_id_ref = tag_ptr(&obj->payment_path_failed.short_channel_id, false);
1731 return short_channel_id_ref;
1733 uint64_t __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_retry"))) TS_LDKEvent_PaymentPathFailed_get_retry(uint64_t ptr) {
1734 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1735 assert(obj->tag == LDKEvent_PaymentPathFailed);
1736 LDKRouteParameters retry_var = obj->payment_path_failed.retry;
1737 uint64_t retry_ref = 0;
1738 CHECK_INNER_FIELD_ACCESS_OR_NULL(retry_var);
1739 retry_ref = tag_ptr(retry_var.inner, false);
1742 int8_tArray __attribute__((export_name("TS_LDKEvent_ProbeSuccessful_get_payment_id"))) TS_LDKEvent_ProbeSuccessful_get_payment_id(uint64_t ptr) {
1743 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1744 assert(obj->tag == LDKEvent_ProbeSuccessful);
1745 int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
1746 memcpy(payment_id_arr->elems, obj->probe_successful.payment_id.data, 32);
1747 return payment_id_arr;
1749 int8_tArray __attribute__((export_name("TS_LDKEvent_ProbeSuccessful_get_payment_hash"))) TS_LDKEvent_ProbeSuccessful_get_payment_hash(uint64_t ptr) {
1750 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1751 assert(obj->tag == LDKEvent_ProbeSuccessful);
1752 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
1753 memcpy(payment_hash_arr->elems, obj->probe_successful.payment_hash.data, 32);
1754 return payment_hash_arr;
1756 uint64_tArray __attribute__((export_name("TS_LDKEvent_ProbeSuccessful_get_path"))) TS_LDKEvent_ProbeSuccessful_get_path(uint64_t ptr) {
1757 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1758 assert(obj->tag == LDKEvent_ProbeSuccessful);
1759 LDKCVec_RouteHopZ path_var = obj->probe_successful.path;
1760 uint64_tArray path_arr = NULL;
1761 path_arr = init_uint64_tArray(path_var.datalen, __LINE__);
1762 uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8);
1763 for (size_t k = 0; k < path_var.datalen; k++) {
1764 LDKRouteHop path_conv_10_var = path_var.data[k];
1765 uint64_t path_conv_10_ref = 0;
1766 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
1767 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, false);
1768 path_arr_ptr[k] = path_conv_10_ref;
1773 int8_tArray __attribute__((export_name("TS_LDKEvent_ProbeFailed_get_payment_id"))) TS_LDKEvent_ProbeFailed_get_payment_id(uint64_t ptr) {
1774 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1775 assert(obj->tag == LDKEvent_ProbeFailed);
1776 int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
1777 memcpy(payment_id_arr->elems, obj->probe_failed.payment_id.data, 32);
1778 return payment_id_arr;
1780 int8_tArray __attribute__((export_name("TS_LDKEvent_ProbeFailed_get_payment_hash"))) TS_LDKEvent_ProbeFailed_get_payment_hash(uint64_t ptr) {
1781 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1782 assert(obj->tag == LDKEvent_ProbeFailed);
1783 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
1784 memcpy(payment_hash_arr->elems, obj->probe_failed.payment_hash.data, 32);
1785 return payment_hash_arr;
1787 uint64_tArray __attribute__((export_name("TS_LDKEvent_ProbeFailed_get_path"))) TS_LDKEvent_ProbeFailed_get_path(uint64_t ptr) {
1788 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1789 assert(obj->tag == LDKEvent_ProbeFailed);
1790 LDKCVec_RouteHopZ path_var = obj->probe_failed.path;
1791 uint64_tArray path_arr = NULL;
1792 path_arr = init_uint64_tArray(path_var.datalen, __LINE__);
1793 uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8);
1794 for (size_t k = 0; k < path_var.datalen; k++) {
1795 LDKRouteHop path_conv_10_var = path_var.data[k];
1796 uint64_t path_conv_10_ref = 0;
1797 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
1798 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, false);
1799 path_arr_ptr[k] = path_conv_10_ref;
1804 uint64_t __attribute__((export_name("TS_LDKEvent_ProbeFailed_get_short_channel_id"))) TS_LDKEvent_ProbeFailed_get_short_channel_id(uint64_t ptr) {
1805 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1806 assert(obj->tag == LDKEvent_ProbeFailed);
1807 uint64_t short_channel_id_ref = tag_ptr(&obj->probe_failed.short_channel_id, false);
1808 return short_channel_id_ref;
1810 int64_t __attribute__((export_name("TS_LDKEvent_PendingHTLCsForwardable_get_time_forwardable"))) TS_LDKEvent_PendingHTLCsForwardable_get_time_forwardable(uint64_t ptr) {
1811 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1812 assert(obj->tag == LDKEvent_PendingHTLCsForwardable);
1813 int64_t time_forwardable_conv = obj->pending_htl_cs_forwardable.time_forwardable;
1814 return time_forwardable_conv;
1816 uint64_tArray __attribute__((export_name("TS_LDKEvent_SpendableOutputs_get_outputs"))) TS_LDKEvent_SpendableOutputs_get_outputs(uint64_t ptr) {
1817 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1818 assert(obj->tag == LDKEvent_SpendableOutputs);
1819 LDKCVec_SpendableOutputDescriptorZ outputs_var = obj->spendable_outputs.outputs;
1820 uint64_tArray outputs_arr = NULL;
1821 outputs_arr = init_uint64_tArray(outputs_var.datalen, __LINE__);
1822 uint64_t *outputs_arr_ptr = (uint64_t*)(((uint8_t*)outputs_arr) + 8);
1823 for (size_t b = 0; b < outputs_var.datalen; b++) {
1824 uint64_t outputs_conv_27_ref = tag_ptr(&outputs_var.data[b], false);
1825 outputs_arr_ptr[b] = outputs_conv_27_ref;
1830 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentForwarded_get_prev_channel_id"))) TS_LDKEvent_PaymentForwarded_get_prev_channel_id(uint64_t ptr) {
1831 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1832 assert(obj->tag == LDKEvent_PaymentForwarded);
1833 int8_tArray prev_channel_id_arr = init_int8_tArray(32, __LINE__);
1834 memcpy(prev_channel_id_arr->elems, obj->payment_forwarded.prev_channel_id.data, 32);
1835 return prev_channel_id_arr;
1837 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentForwarded_get_next_channel_id"))) TS_LDKEvent_PaymentForwarded_get_next_channel_id(uint64_t ptr) {
1838 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1839 assert(obj->tag == LDKEvent_PaymentForwarded);
1840 int8_tArray next_channel_id_arr = init_int8_tArray(32, __LINE__);
1841 memcpy(next_channel_id_arr->elems, obj->payment_forwarded.next_channel_id.data, 32);
1842 return next_channel_id_arr;
1844 uint64_t __attribute__((export_name("TS_LDKEvent_PaymentForwarded_get_fee_earned_msat"))) TS_LDKEvent_PaymentForwarded_get_fee_earned_msat(uint64_t ptr) {
1845 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1846 assert(obj->tag == LDKEvent_PaymentForwarded);
1847 uint64_t fee_earned_msat_ref = tag_ptr(&obj->payment_forwarded.fee_earned_msat, false);
1848 return fee_earned_msat_ref;
1850 jboolean __attribute__((export_name("TS_LDKEvent_PaymentForwarded_get_claim_from_onchain_tx"))) TS_LDKEvent_PaymentForwarded_get_claim_from_onchain_tx(uint64_t ptr) {
1851 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1852 assert(obj->tag == LDKEvent_PaymentForwarded);
1853 jboolean claim_from_onchain_tx_conv = obj->payment_forwarded.claim_from_onchain_tx;
1854 return claim_from_onchain_tx_conv;
1856 int8_tArray __attribute__((export_name("TS_LDKEvent_ChannelClosed_get_channel_id"))) TS_LDKEvent_ChannelClosed_get_channel_id(uint64_t ptr) {
1857 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1858 assert(obj->tag == LDKEvent_ChannelClosed);
1859 int8_tArray channel_id_arr = init_int8_tArray(32, __LINE__);
1860 memcpy(channel_id_arr->elems, obj->channel_closed.channel_id.data, 32);
1861 return channel_id_arr;
1863 int64_t __attribute__((export_name("TS_LDKEvent_ChannelClosed_get_user_channel_id"))) TS_LDKEvent_ChannelClosed_get_user_channel_id(uint64_t ptr) {
1864 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1865 assert(obj->tag == LDKEvent_ChannelClosed);
1866 int64_t user_channel_id_conv = obj->channel_closed.user_channel_id;
1867 return user_channel_id_conv;
1869 uint64_t __attribute__((export_name("TS_LDKEvent_ChannelClosed_get_reason"))) TS_LDKEvent_ChannelClosed_get_reason(uint64_t ptr) {
1870 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1871 assert(obj->tag == LDKEvent_ChannelClosed);
1872 uint64_t reason_ref = tag_ptr(&obj->channel_closed.reason, false);
1875 int8_tArray __attribute__((export_name("TS_LDKEvent_DiscardFunding_get_channel_id"))) TS_LDKEvent_DiscardFunding_get_channel_id(uint64_t ptr) {
1876 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1877 assert(obj->tag == LDKEvent_DiscardFunding);
1878 int8_tArray channel_id_arr = init_int8_tArray(32, __LINE__);
1879 memcpy(channel_id_arr->elems, obj->discard_funding.channel_id.data, 32);
1880 return channel_id_arr;
1882 int8_tArray __attribute__((export_name("TS_LDKEvent_DiscardFunding_get_transaction"))) TS_LDKEvent_DiscardFunding_get_transaction(uint64_t ptr) {
1883 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1884 assert(obj->tag == LDKEvent_DiscardFunding);
1885 LDKTransaction transaction_var = obj->discard_funding.transaction;
1886 int8_tArray transaction_arr = init_int8_tArray(transaction_var.datalen, __LINE__);
1887 memcpy(transaction_arr->elems, transaction_var.data, transaction_var.datalen);
1888 return transaction_arr;
1890 int8_tArray __attribute__((export_name("TS_LDKEvent_OpenChannelRequest_get_temporary_channel_id"))) TS_LDKEvent_OpenChannelRequest_get_temporary_channel_id(uint64_t ptr) {
1891 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1892 assert(obj->tag == LDKEvent_OpenChannelRequest);
1893 int8_tArray temporary_channel_id_arr = init_int8_tArray(32, __LINE__);
1894 memcpy(temporary_channel_id_arr->elems, obj->open_channel_request.temporary_channel_id.data, 32);
1895 return temporary_channel_id_arr;
1897 int8_tArray __attribute__((export_name("TS_LDKEvent_OpenChannelRequest_get_counterparty_node_id"))) TS_LDKEvent_OpenChannelRequest_get_counterparty_node_id(uint64_t ptr) {
1898 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1899 assert(obj->tag == LDKEvent_OpenChannelRequest);
1900 int8_tArray counterparty_node_id_arr = init_int8_tArray(33, __LINE__);
1901 memcpy(counterparty_node_id_arr->elems, obj->open_channel_request.counterparty_node_id.compressed_form, 33);
1902 return counterparty_node_id_arr;
1904 int64_t __attribute__((export_name("TS_LDKEvent_OpenChannelRequest_get_funding_satoshis"))) TS_LDKEvent_OpenChannelRequest_get_funding_satoshis(uint64_t ptr) {
1905 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1906 assert(obj->tag == LDKEvent_OpenChannelRequest);
1907 int64_t funding_satoshis_conv = obj->open_channel_request.funding_satoshis;
1908 return funding_satoshis_conv;
1910 int64_t __attribute__((export_name("TS_LDKEvent_OpenChannelRequest_get_push_msat"))) TS_LDKEvent_OpenChannelRequest_get_push_msat(uint64_t ptr) {
1911 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1912 assert(obj->tag == LDKEvent_OpenChannelRequest);
1913 int64_t push_msat_conv = obj->open_channel_request.push_msat;
1914 return push_msat_conv;
1916 uint64_t __attribute__((export_name("TS_LDKEvent_OpenChannelRequest_get_channel_type"))) TS_LDKEvent_OpenChannelRequest_get_channel_type(uint64_t ptr) {
1917 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1918 assert(obj->tag == LDKEvent_OpenChannelRequest);
1919 LDKChannelTypeFeatures channel_type_var = obj->open_channel_request.channel_type;
1920 uint64_t channel_type_ref = 0;
1921 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_var);
1922 channel_type_ref = tag_ptr(channel_type_var.inner, false);
1923 return channel_type_ref;
1925 int8_tArray __attribute__((export_name("TS_LDKEvent_HTLCHandlingFailed_get_prev_channel_id"))) TS_LDKEvent_HTLCHandlingFailed_get_prev_channel_id(uint64_t ptr) {
1926 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1927 assert(obj->tag == LDKEvent_HTLCHandlingFailed);
1928 int8_tArray prev_channel_id_arr = init_int8_tArray(32, __LINE__);
1929 memcpy(prev_channel_id_arr->elems, obj->htlc_handling_failed.prev_channel_id.data, 32);
1930 return prev_channel_id_arr;
1932 uint64_t __attribute__((export_name("TS_LDKEvent_HTLCHandlingFailed_get_failed_next_destination"))) TS_LDKEvent_HTLCHandlingFailed_get_failed_next_destination(uint64_t ptr) {
1933 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1934 assert(obj->tag == LDKEvent_HTLCHandlingFailed);
1935 uint64_t failed_next_destination_ref = tag_ptr(&obj->htlc_handling_failed.failed_next_destination, false);
1936 return failed_next_destination_ref;
1938 uint32_t __attribute__((export_name("TS_LDKCOption_EventZ_ty_from_ptr"))) TS_LDKCOption_EventZ_ty_from_ptr(uint64_t ptr) {
1939 LDKCOption_EventZ *obj = (LDKCOption_EventZ*)untag_ptr(ptr);
1941 case LDKCOption_EventZ_Some: return 0;
1942 case LDKCOption_EventZ_None: return 1;
1946 uint64_t __attribute__((export_name("TS_LDKCOption_EventZ_Some_get_some"))) TS_LDKCOption_EventZ_Some_get_some(uint64_t ptr) {
1947 LDKCOption_EventZ *obj = (LDKCOption_EventZ*)untag_ptr(ptr);
1948 assert(obj->tag == LDKCOption_EventZ_Some);
1949 uint64_t some_ref = tag_ptr(&obj->some, false);
1952 static inline struct LDKCOption_EventZ CResult_COption_EventZDecodeErrorZ_get_ok(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR owner){
1953 CHECK(owner->result_ok);
1954 return COption_EventZ_clone(&*owner->contents.result);
1956 uint64_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_get_ok"))) TS_CResult_COption_EventZDecodeErrorZ_get_ok(uint64_t owner) {
1957 LDKCResult_COption_EventZDecodeErrorZ* owner_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(owner);
1958 LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
1959 *ret_copy = CResult_COption_EventZDecodeErrorZ_get_ok(owner_conv);
1960 uint64_t ret_ref = tag_ptr(ret_copy, true);
1964 static inline struct LDKDecodeError CResult_COption_EventZDecodeErrorZ_get_err(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR owner){
1965 LDKDecodeError ret = *owner->contents.err;
1966 ret.is_owned = false;
1969 uint64_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_get_err"))) TS_CResult_COption_EventZDecodeErrorZ_get_err(uint64_t owner) {
1970 LDKCResult_COption_EventZDecodeErrorZ* owner_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(owner);
1971 LDKDecodeError ret_var = CResult_COption_EventZDecodeErrorZ_get_err(owner_conv);
1972 uint64_t ret_ref = 0;
1973 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1974 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1978 uint32_t __attribute__((export_name("TS_LDKErrorAction_ty_from_ptr"))) TS_LDKErrorAction_ty_from_ptr(uint64_t ptr) {
1979 LDKErrorAction *obj = (LDKErrorAction*)untag_ptr(ptr);
1981 case LDKErrorAction_DisconnectPeer: return 0;
1982 case LDKErrorAction_IgnoreError: return 1;
1983 case LDKErrorAction_IgnoreAndLog: return 2;
1984 case LDKErrorAction_IgnoreDuplicateGossip: return 3;
1985 case LDKErrorAction_SendErrorMessage: return 4;
1986 case LDKErrorAction_SendWarningMessage: return 5;
1990 uint64_t __attribute__((export_name("TS_LDKErrorAction_DisconnectPeer_get_msg"))) TS_LDKErrorAction_DisconnectPeer_get_msg(uint64_t ptr) {
1991 LDKErrorAction *obj = (LDKErrorAction*)untag_ptr(ptr);
1992 assert(obj->tag == LDKErrorAction_DisconnectPeer);
1993 LDKErrorMessage msg_var = obj->disconnect_peer.msg;
1994 uint64_t msg_ref = 0;
1995 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
1996 msg_ref = tag_ptr(msg_var.inner, false);
1999 uint32_t __attribute__((export_name("TS_LDKErrorAction_IgnoreAndLog_get_ignore_and_log"))) TS_LDKErrorAction_IgnoreAndLog_get_ignore_and_log(uint64_t ptr) {
2000 LDKErrorAction *obj = (LDKErrorAction*)untag_ptr(ptr);
2001 assert(obj->tag == LDKErrorAction_IgnoreAndLog);
2002 uint32_t ignore_and_log_conv = LDKLevel_to_js(obj->ignore_and_log);
2003 return ignore_and_log_conv;
2005 uint64_t __attribute__((export_name("TS_LDKErrorAction_SendErrorMessage_get_msg"))) TS_LDKErrorAction_SendErrorMessage_get_msg(uint64_t ptr) {
2006 LDKErrorAction *obj = (LDKErrorAction*)untag_ptr(ptr);
2007 assert(obj->tag == LDKErrorAction_SendErrorMessage);
2008 LDKErrorMessage msg_var = obj->send_error_message.msg;
2009 uint64_t msg_ref = 0;
2010 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2011 msg_ref = tag_ptr(msg_var.inner, false);
2014 uint64_t __attribute__((export_name("TS_LDKErrorAction_SendWarningMessage_get_msg"))) TS_LDKErrorAction_SendWarningMessage_get_msg(uint64_t ptr) {
2015 LDKErrorAction *obj = (LDKErrorAction*)untag_ptr(ptr);
2016 assert(obj->tag == LDKErrorAction_SendWarningMessage);
2017 LDKWarningMessage msg_var = obj->send_warning_message.msg;
2018 uint64_t msg_ref = 0;
2019 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2020 msg_ref = tag_ptr(msg_var.inner, false);
2023 uint32_t __attribute__((export_name("TS_LDKErrorAction_SendWarningMessage_get_log_level"))) TS_LDKErrorAction_SendWarningMessage_get_log_level(uint64_t ptr) {
2024 LDKErrorAction *obj = (LDKErrorAction*)untag_ptr(ptr);
2025 assert(obj->tag == LDKErrorAction_SendWarningMessage);
2026 uint32_t log_level_conv = LDKLevel_to_js(obj->send_warning_message.log_level);
2027 return log_level_conv;
2029 uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_ty_from_ptr"))) TS_LDKMessageSendEvent_ty_from_ptr(uint64_t ptr) {
2030 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2032 case LDKMessageSendEvent_SendAcceptChannel: return 0;
2033 case LDKMessageSendEvent_SendOpenChannel: return 1;
2034 case LDKMessageSendEvent_SendFundingCreated: return 2;
2035 case LDKMessageSendEvent_SendFundingSigned: return 3;
2036 case LDKMessageSendEvent_SendChannelReady: return 4;
2037 case LDKMessageSendEvent_SendAnnouncementSignatures: return 5;
2038 case LDKMessageSendEvent_UpdateHTLCs: return 6;
2039 case LDKMessageSendEvent_SendRevokeAndACK: return 7;
2040 case LDKMessageSendEvent_SendClosingSigned: return 8;
2041 case LDKMessageSendEvent_SendShutdown: return 9;
2042 case LDKMessageSendEvent_SendChannelReestablish: return 10;
2043 case LDKMessageSendEvent_BroadcastChannelAnnouncement: return 11;
2044 case LDKMessageSendEvent_BroadcastNodeAnnouncement: return 12;
2045 case LDKMessageSendEvent_BroadcastChannelUpdate: return 13;
2046 case LDKMessageSendEvent_SendChannelUpdate: return 14;
2047 case LDKMessageSendEvent_HandleError: return 15;
2048 case LDKMessageSendEvent_SendChannelRangeQuery: return 16;
2049 case LDKMessageSendEvent_SendShortIdsQuery: return 17;
2050 case LDKMessageSendEvent_SendReplyChannelRange: return 18;
2051 case LDKMessageSendEvent_SendGossipTimestampFilter: return 19;
2055 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendAcceptChannel_get_node_id"))) TS_LDKMessageSendEvent_SendAcceptChannel_get_node_id(uint64_t ptr) {
2056 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2057 assert(obj->tag == LDKMessageSendEvent_SendAcceptChannel);
2058 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2059 memcpy(node_id_arr->elems, obj->send_accept_channel.node_id.compressed_form, 33);
2062 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendAcceptChannel_get_msg"))) TS_LDKMessageSendEvent_SendAcceptChannel_get_msg(uint64_t ptr) {
2063 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2064 assert(obj->tag == LDKMessageSendEvent_SendAcceptChannel);
2065 LDKAcceptChannel msg_var = obj->send_accept_channel.msg;
2066 uint64_t msg_ref = 0;
2067 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2068 msg_ref = tag_ptr(msg_var.inner, false);
2071 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendOpenChannel_get_node_id"))) TS_LDKMessageSendEvent_SendOpenChannel_get_node_id(uint64_t ptr) {
2072 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2073 assert(obj->tag == LDKMessageSendEvent_SendOpenChannel);
2074 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2075 memcpy(node_id_arr->elems, obj->send_open_channel.node_id.compressed_form, 33);
2078 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendOpenChannel_get_msg"))) TS_LDKMessageSendEvent_SendOpenChannel_get_msg(uint64_t ptr) {
2079 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2080 assert(obj->tag == LDKMessageSendEvent_SendOpenChannel);
2081 LDKOpenChannel msg_var = obj->send_open_channel.msg;
2082 uint64_t msg_ref = 0;
2083 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2084 msg_ref = tag_ptr(msg_var.inner, false);
2087 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendFundingCreated_get_node_id"))) TS_LDKMessageSendEvent_SendFundingCreated_get_node_id(uint64_t ptr) {
2088 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2089 assert(obj->tag == LDKMessageSendEvent_SendFundingCreated);
2090 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2091 memcpy(node_id_arr->elems, obj->send_funding_created.node_id.compressed_form, 33);
2094 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendFundingCreated_get_msg"))) TS_LDKMessageSendEvent_SendFundingCreated_get_msg(uint64_t ptr) {
2095 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2096 assert(obj->tag == LDKMessageSendEvent_SendFundingCreated);
2097 LDKFundingCreated msg_var = obj->send_funding_created.msg;
2098 uint64_t msg_ref = 0;
2099 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2100 msg_ref = tag_ptr(msg_var.inner, false);
2103 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendFundingSigned_get_node_id"))) TS_LDKMessageSendEvent_SendFundingSigned_get_node_id(uint64_t ptr) {
2104 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2105 assert(obj->tag == LDKMessageSendEvent_SendFundingSigned);
2106 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2107 memcpy(node_id_arr->elems, obj->send_funding_signed.node_id.compressed_form, 33);
2110 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendFundingSigned_get_msg"))) TS_LDKMessageSendEvent_SendFundingSigned_get_msg(uint64_t ptr) {
2111 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2112 assert(obj->tag == LDKMessageSendEvent_SendFundingSigned);
2113 LDKFundingSigned msg_var = obj->send_funding_signed.msg;
2114 uint64_t msg_ref = 0;
2115 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2116 msg_ref = tag_ptr(msg_var.inner, false);
2119 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelReady_get_node_id"))) TS_LDKMessageSendEvent_SendChannelReady_get_node_id(uint64_t ptr) {
2120 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2121 assert(obj->tag == LDKMessageSendEvent_SendChannelReady);
2122 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2123 memcpy(node_id_arr->elems, obj->send_channel_ready.node_id.compressed_form, 33);
2126 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelReady_get_msg"))) TS_LDKMessageSendEvent_SendChannelReady_get_msg(uint64_t ptr) {
2127 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2128 assert(obj->tag == LDKMessageSendEvent_SendChannelReady);
2129 LDKChannelReady msg_var = obj->send_channel_ready.msg;
2130 uint64_t msg_ref = 0;
2131 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2132 msg_ref = tag_ptr(msg_var.inner, false);
2135 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendAnnouncementSignatures_get_node_id"))) TS_LDKMessageSendEvent_SendAnnouncementSignatures_get_node_id(uint64_t ptr) {
2136 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2137 assert(obj->tag == LDKMessageSendEvent_SendAnnouncementSignatures);
2138 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2139 memcpy(node_id_arr->elems, obj->send_announcement_signatures.node_id.compressed_form, 33);
2142 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendAnnouncementSignatures_get_msg"))) TS_LDKMessageSendEvent_SendAnnouncementSignatures_get_msg(uint64_t ptr) {
2143 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2144 assert(obj->tag == LDKMessageSendEvent_SendAnnouncementSignatures);
2145 LDKAnnouncementSignatures msg_var = obj->send_announcement_signatures.msg;
2146 uint64_t msg_ref = 0;
2147 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2148 msg_ref = tag_ptr(msg_var.inner, false);
2151 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_UpdateHTLCs_get_node_id"))) TS_LDKMessageSendEvent_UpdateHTLCs_get_node_id(uint64_t ptr) {
2152 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2153 assert(obj->tag == LDKMessageSendEvent_UpdateHTLCs);
2154 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2155 memcpy(node_id_arr->elems, obj->update_htl_cs.node_id.compressed_form, 33);
2158 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_UpdateHTLCs_get_updates"))) TS_LDKMessageSendEvent_UpdateHTLCs_get_updates(uint64_t ptr) {
2159 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2160 assert(obj->tag == LDKMessageSendEvent_UpdateHTLCs);
2161 LDKCommitmentUpdate updates_var = obj->update_htl_cs.updates;
2162 uint64_t updates_ref = 0;
2163 CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_var);
2164 updates_ref = tag_ptr(updates_var.inner, false);
2167 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendRevokeAndACK_get_node_id"))) TS_LDKMessageSendEvent_SendRevokeAndACK_get_node_id(uint64_t ptr) {
2168 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2169 assert(obj->tag == LDKMessageSendEvent_SendRevokeAndACK);
2170 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2171 memcpy(node_id_arr->elems, obj->send_revoke_and_ack.node_id.compressed_form, 33);
2174 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendRevokeAndACK_get_msg"))) TS_LDKMessageSendEvent_SendRevokeAndACK_get_msg(uint64_t ptr) {
2175 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2176 assert(obj->tag == LDKMessageSendEvent_SendRevokeAndACK);
2177 LDKRevokeAndACK msg_var = obj->send_revoke_and_ack.msg;
2178 uint64_t msg_ref = 0;
2179 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2180 msg_ref = tag_ptr(msg_var.inner, false);
2183 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendClosingSigned_get_node_id"))) TS_LDKMessageSendEvent_SendClosingSigned_get_node_id(uint64_t ptr) {
2184 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2185 assert(obj->tag == LDKMessageSendEvent_SendClosingSigned);
2186 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2187 memcpy(node_id_arr->elems, obj->send_closing_signed.node_id.compressed_form, 33);
2190 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendClosingSigned_get_msg"))) TS_LDKMessageSendEvent_SendClosingSigned_get_msg(uint64_t ptr) {
2191 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2192 assert(obj->tag == LDKMessageSendEvent_SendClosingSigned);
2193 LDKClosingSigned msg_var = obj->send_closing_signed.msg;
2194 uint64_t msg_ref = 0;
2195 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2196 msg_ref = tag_ptr(msg_var.inner, false);
2199 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendShutdown_get_node_id"))) TS_LDKMessageSendEvent_SendShutdown_get_node_id(uint64_t ptr) {
2200 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2201 assert(obj->tag == LDKMessageSendEvent_SendShutdown);
2202 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2203 memcpy(node_id_arr->elems, obj->send_shutdown.node_id.compressed_form, 33);
2206 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendShutdown_get_msg"))) TS_LDKMessageSendEvent_SendShutdown_get_msg(uint64_t ptr) {
2207 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2208 assert(obj->tag == LDKMessageSendEvent_SendShutdown);
2209 LDKShutdown msg_var = obj->send_shutdown.msg;
2210 uint64_t msg_ref = 0;
2211 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2212 msg_ref = tag_ptr(msg_var.inner, false);
2215 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelReestablish_get_node_id"))) TS_LDKMessageSendEvent_SendChannelReestablish_get_node_id(uint64_t ptr) {
2216 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2217 assert(obj->tag == LDKMessageSendEvent_SendChannelReestablish);
2218 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2219 memcpy(node_id_arr->elems, obj->send_channel_reestablish.node_id.compressed_form, 33);
2222 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelReestablish_get_msg"))) TS_LDKMessageSendEvent_SendChannelReestablish_get_msg(uint64_t ptr) {
2223 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2224 assert(obj->tag == LDKMessageSendEvent_SendChannelReestablish);
2225 LDKChannelReestablish msg_var = obj->send_channel_reestablish.msg;
2226 uint64_t msg_ref = 0;
2227 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2228 msg_ref = tag_ptr(msg_var.inner, false);
2231 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_BroadcastChannelAnnouncement_get_msg"))) TS_LDKMessageSendEvent_BroadcastChannelAnnouncement_get_msg(uint64_t ptr) {
2232 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2233 assert(obj->tag == LDKMessageSendEvent_BroadcastChannelAnnouncement);
2234 LDKChannelAnnouncement msg_var = obj->broadcast_channel_announcement.msg;
2235 uint64_t msg_ref = 0;
2236 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2237 msg_ref = tag_ptr(msg_var.inner, false);
2240 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_BroadcastChannelAnnouncement_get_update_msg"))) TS_LDKMessageSendEvent_BroadcastChannelAnnouncement_get_update_msg(uint64_t ptr) {
2241 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2242 assert(obj->tag == LDKMessageSendEvent_BroadcastChannelAnnouncement);
2243 LDKChannelUpdate update_msg_var = obj->broadcast_channel_announcement.update_msg;
2244 uint64_t update_msg_ref = 0;
2245 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_var);
2246 update_msg_ref = tag_ptr(update_msg_var.inner, false);
2247 return update_msg_ref;
2249 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_BroadcastNodeAnnouncement_get_msg"))) TS_LDKMessageSendEvent_BroadcastNodeAnnouncement_get_msg(uint64_t ptr) {
2250 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2251 assert(obj->tag == LDKMessageSendEvent_BroadcastNodeAnnouncement);
2252 LDKNodeAnnouncement msg_var = obj->broadcast_node_announcement.msg;
2253 uint64_t msg_ref = 0;
2254 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2255 msg_ref = tag_ptr(msg_var.inner, false);
2258 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_BroadcastChannelUpdate_get_msg"))) TS_LDKMessageSendEvent_BroadcastChannelUpdate_get_msg(uint64_t ptr) {
2259 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2260 assert(obj->tag == LDKMessageSendEvent_BroadcastChannelUpdate);
2261 LDKChannelUpdate msg_var = obj->broadcast_channel_update.msg;
2262 uint64_t msg_ref = 0;
2263 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2264 msg_ref = tag_ptr(msg_var.inner, false);
2267 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelUpdate_get_node_id"))) TS_LDKMessageSendEvent_SendChannelUpdate_get_node_id(uint64_t ptr) {
2268 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2269 assert(obj->tag == LDKMessageSendEvent_SendChannelUpdate);
2270 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2271 memcpy(node_id_arr->elems, obj->send_channel_update.node_id.compressed_form, 33);
2274 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelUpdate_get_msg"))) TS_LDKMessageSendEvent_SendChannelUpdate_get_msg(uint64_t ptr) {
2275 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2276 assert(obj->tag == LDKMessageSendEvent_SendChannelUpdate);
2277 LDKChannelUpdate msg_var = obj->send_channel_update.msg;
2278 uint64_t msg_ref = 0;
2279 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2280 msg_ref = tag_ptr(msg_var.inner, false);
2283 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_HandleError_get_node_id"))) TS_LDKMessageSendEvent_HandleError_get_node_id(uint64_t ptr) {
2284 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2285 assert(obj->tag == LDKMessageSendEvent_HandleError);
2286 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2287 memcpy(node_id_arr->elems, obj->handle_error.node_id.compressed_form, 33);
2290 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_HandleError_get_action"))) TS_LDKMessageSendEvent_HandleError_get_action(uint64_t ptr) {
2291 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2292 assert(obj->tag == LDKMessageSendEvent_HandleError);
2293 uint64_t action_ref = tag_ptr(&obj->handle_error.action, false);
2296 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelRangeQuery_get_node_id"))) TS_LDKMessageSendEvent_SendChannelRangeQuery_get_node_id(uint64_t ptr) {
2297 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2298 assert(obj->tag == LDKMessageSendEvent_SendChannelRangeQuery);
2299 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2300 memcpy(node_id_arr->elems, obj->send_channel_range_query.node_id.compressed_form, 33);
2303 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelRangeQuery_get_msg"))) TS_LDKMessageSendEvent_SendChannelRangeQuery_get_msg(uint64_t ptr) {
2304 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2305 assert(obj->tag == LDKMessageSendEvent_SendChannelRangeQuery);
2306 LDKQueryChannelRange msg_var = obj->send_channel_range_query.msg;
2307 uint64_t msg_ref = 0;
2308 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2309 msg_ref = tag_ptr(msg_var.inner, false);
2312 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendShortIdsQuery_get_node_id"))) TS_LDKMessageSendEvent_SendShortIdsQuery_get_node_id(uint64_t ptr) {
2313 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2314 assert(obj->tag == LDKMessageSendEvent_SendShortIdsQuery);
2315 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2316 memcpy(node_id_arr->elems, obj->send_short_ids_query.node_id.compressed_form, 33);
2319 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendShortIdsQuery_get_msg"))) TS_LDKMessageSendEvent_SendShortIdsQuery_get_msg(uint64_t ptr) {
2320 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2321 assert(obj->tag == LDKMessageSendEvent_SendShortIdsQuery);
2322 LDKQueryShortChannelIds msg_var = obj->send_short_ids_query.msg;
2323 uint64_t msg_ref = 0;
2324 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2325 msg_ref = tag_ptr(msg_var.inner, false);
2328 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendReplyChannelRange_get_node_id"))) TS_LDKMessageSendEvent_SendReplyChannelRange_get_node_id(uint64_t ptr) {
2329 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2330 assert(obj->tag == LDKMessageSendEvent_SendReplyChannelRange);
2331 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2332 memcpy(node_id_arr->elems, obj->send_reply_channel_range.node_id.compressed_form, 33);
2335 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendReplyChannelRange_get_msg"))) TS_LDKMessageSendEvent_SendReplyChannelRange_get_msg(uint64_t ptr) {
2336 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2337 assert(obj->tag == LDKMessageSendEvent_SendReplyChannelRange);
2338 LDKReplyChannelRange msg_var = obj->send_reply_channel_range.msg;
2339 uint64_t msg_ref = 0;
2340 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2341 msg_ref = tag_ptr(msg_var.inner, false);
2344 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendGossipTimestampFilter_get_node_id"))) TS_LDKMessageSendEvent_SendGossipTimestampFilter_get_node_id(uint64_t ptr) {
2345 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2346 assert(obj->tag == LDKMessageSendEvent_SendGossipTimestampFilter);
2347 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2348 memcpy(node_id_arr->elems, obj->send_gossip_timestamp_filter.node_id.compressed_form, 33);
2351 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendGossipTimestampFilter_get_msg"))) TS_LDKMessageSendEvent_SendGossipTimestampFilter_get_msg(uint64_t ptr) {
2352 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2353 assert(obj->tag == LDKMessageSendEvent_SendGossipTimestampFilter);
2354 LDKGossipTimestampFilter msg_var = obj->send_gossip_timestamp_filter.msg;
2355 uint64_t msg_ref = 0;
2356 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2357 msg_ref = tag_ptr(msg_var.inner, false);
2360 static inline LDKCVec_MessageSendEventZ CVec_MessageSendEventZ_clone(const LDKCVec_MessageSendEventZ *orig) {
2361 LDKCVec_MessageSendEventZ ret = { .data = MALLOC(sizeof(LDKMessageSendEvent) * orig->datalen, "LDKCVec_MessageSendEventZ clone bytes"), .datalen = orig->datalen };
2362 for (size_t i = 0; i < ret.datalen; i++) {
2363 ret.data[i] = MessageSendEvent_clone(&orig->data[i]);
2367 static inline struct LDKTxOut CResult_TxOutAccessErrorZ_get_ok(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR owner){
2368 CHECK(owner->result_ok);
2369 return TxOut_clone(&*owner->contents.result);
2371 uint64_t __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_get_ok"))) TS_CResult_TxOutAccessErrorZ_get_ok(uint64_t owner) {
2372 LDKCResult_TxOutAccessErrorZ* owner_conv = (LDKCResult_TxOutAccessErrorZ*)untag_ptr(owner);
2373 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
2374 *ret_ref = CResult_TxOutAccessErrorZ_get_ok(owner_conv);
2375 return tag_ptr(ret_ref, true);
2378 static inline enum LDKAccessError CResult_TxOutAccessErrorZ_get_err(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR owner){
2379 CHECK(!owner->result_ok);
2380 return AccessError_clone(&*owner->contents.err);
2382 uint32_t __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_get_err"))) TS_CResult_TxOutAccessErrorZ_get_err(uint64_t owner) {
2383 LDKCResult_TxOutAccessErrorZ* owner_conv = (LDKCResult_TxOutAccessErrorZ*)untag_ptr(owner);
2384 uint32_t ret_conv = LDKAccessError_to_js(CResult_TxOutAccessErrorZ_get_err(owner_conv));
2388 static inline uintptr_t C2Tuple_usizeTransactionZ_get_a(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR owner){
2391 uint32_t __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_get_a"))) TS_C2Tuple_usizeTransactionZ_get_a(uint64_t owner) {
2392 LDKC2Tuple_usizeTransactionZ* owner_conv = (LDKC2Tuple_usizeTransactionZ*)untag_ptr(owner);
2393 uint32_t ret_conv = C2Tuple_usizeTransactionZ_get_a(owner_conv);
2397 static inline struct LDKTransaction C2Tuple_usizeTransactionZ_get_b(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR owner){
2400 int8_tArray __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_get_b"))) TS_C2Tuple_usizeTransactionZ_get_b(uint64_t owner) {
2401 LDKC2Tuple_usizeTransactionZ* owner_conv = (LDKC2Tuple_usizeTransactionZ*)untag_ptr(owner);
2402 LDKTransaction ret_var = C2Tuple_usizeTransactionZ_get_b(owner_conv);
2403 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
2404 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
2408 static inline LDKCVec_C2Tuple_usizeTransactionZZ CVec_C2Tuple_usizeTransactionZZ_clone(const LDKCVec_C2Tuple_usizeTransactionZZ *orig) {
2409 LDKCVec_C2Tuple_usizeTransactionZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ) * orig->datalen, "LDKCVec_C2Tuple_usizeTransactionZZ clone bytes"), .datalen = orig->datalen };
2410 for (size_t i = 0; i < ret.datalen; i++) {
2411 ret.data[i] = C2Tuple_usizeTransactionZ_clone(&orig->data[i]);
2415 static inline LDKCVec_TxidZ CVec_TxidZ_clone(const LDKCVec_TxidZ *orig) {
2416 LDKCVec_TxidZ ret = { .data = MALLOC(sizeof(LDKThirtyTwoBytes) * orig->datalen, "LDKCVec_TxidZ clone bytes"), .datalen = orig->datalen };
2417 for (size_t i = 0; i < ret.datalen; i++) {
2418 ret.data[i] = ThirtyTwoBytes_clone(&orig->data[i]);
2422 static inline void CResult_NoneChannelMonitorUpdateErrZ_get_ok(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR owner){
2423 CHECK(owner->result_ok);
2424 return *owner->contents.result;
2426 void __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_get_ok"))) TS_CResult_NoneChannelMonitorUpdateErrZ_get_ok(uint64_t owner) {
2427 LDKCResult_NoneChannelMonitorUpdateErrZ* owner_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)untag_ptr(owner);
2428 CResult_NoneChannelMonitorUpdateErrZ_get_ok(owner_conv);
2431 static inline enum LDKChannelMonitorUpdateErr CResult_NoneChannelMonitorUpdateErrZ_get_err(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR owner){
2432 CHECK(!owner->result_ok);
2433 return ChannelMonitorUpdateErr_clone(&*owner->contents.err);
2435 uint32_t __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_get_err"))) TS_CResult_NoneChannelMonitorUpdateErrZ_get_err(uint64_t owner) {
2436 LDKCResult_NoneChannelMonitorUpdateErrZ* owner_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)untag_ptr(owner);
2437 uint32_t ret_conv = LDKChannelMonitorUpdateErr_to_js(CResult_NoneChannelMonitorUpdateErrZ_get_err(owner_conv));
2441 uint32_t __attribute__((export_name("TS_LDKMonitorEvent_ty_from_ptr"))) TS_LDKMonitorEvent_ty_from_ptr(uint64_t ptr) {
2442 LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr);
2444 case LDKMonitorEvent_HTLCEvent: return 0;
2445 case LDKMonitorEvent_CommitmentTxConfirmed: return 1;
2446 case LDKMonitorEvent_UpdateCompleted: return 2;
2447 case LDKMonitorEvent_UpdateFailed: return 3;
2451 uint64_t __attribute__((export_name("TS_LDKMonitorEvent_HTLCEvent_get_htlc_event"))) TS_LDKMonitorEvent_HTLCEvent_get_htlc_event(uint64_t ptr) {
2452 LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr);
2453 assert(obj->tag == LDKMonitorEvent_HTLCEvent);
2454 LDKHTLCUpdate htlc_event_var = obj->htlc_event;
2455 uint64_t htlc_event_ref = 0;
2456 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_event_var);
2457 htlc_event_ref = tag_ptr(htlc_event_var.inner, false);
2458 return htlc_event_ref;
2460 uint64_t __attribute__((export_name("TS_LDKMonitorEvent_CommitmentTxConfirmed_get_commitment_tx_confirmed"))) TS_LDKMonitorEvent_CommitmentTxConfirmed_get_commitment_tx_confirmed(uint64_t ptr) {
2461 LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr);
2462 assert(obj->tag == LDKMonitorEvent_CommitmentTxConfirmed);
2463 LDKOutPoint commitment_tx_confirmed_var = obj->commitment_tx_confirmed;
2464 uint64_t commitment_tx_confirmed_ref = 0;
2465 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_confirmed_var);
2466 commitment_tx_confirmed_ref = tag_ptr(commitment_tx_confirmed_var.inner, false);
2467 return commitment_tx_confirmed_ref;
2469 uint64_t __attribute__((export_name("TS_LDKMonitorEvent_UpdateCompleted_get_funding_txo"))) TS_LDKMonitorEvent_UpdateCompleted_get_funding_txo(uint64_t ptr) {
2470 LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr);
2471 assert(obj->tag == LDKMonitorEvent_UpdateCompleted);
2472 LDKOutPoint funding_txo_var = obj->update_completed.funding_txo;
2473 uint64_t funding_txo_ref = 0;
2474 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var);
2475 funding_txo_ref = tag_ptr(funding_txo_var.inner, false);
2476 return funding_txo_ref;
2478 int64_t __attribute__((export_name("TS_LDKMonitorEvent_UpdateCompleted_get_monitor_update_id"))) TS_LDKMonitorEvent_UpdateCompleted_get_monitor_update_id(uint64_t ptr) {
2479 LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr);
2480 assert(obj->tag == LDKMonitorEvent_UpdateCompleted);
2481 int64_t monitor_update_id_conv = obj->update_completed.monitor_update_id;
2482 return monitor_update_id_conv;
2484 uint64_t __attribute__((export_name("TS_LDKMonitorEvent_UpdateFailed_get_update_failed"))) TS_LDKMonitorEvent_UpdateFailed_get_update_failed(uint64_t ptr) {
2485 LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr);
2486 assert(obj->tag == LDKMonitorEvent_UpdateFailed);
2487 LDKOutPoint update_failed_var = obj->update_failed;
2488 uint64_t update_failed_ref = 0;
2489 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_failed_var);
2490 update_failed_ref = tag_ptr(update_failed_var.inner, false);
2491 return update_failed_ref;
2493 static inline LDKCVec_MonitorEventZ CVec_MonitorEventZ_clone(const LDKCVec_MonitorEventZ *orig) {
2494 LDKCVec_MonitorEventZ ret = { .data = MALLOC(sizeof(LDKMonitorEvent) * orig->datalen, "LDKCVec_MonitorEventZ clone bytes"), .datalen = orig->datalen };
2495 for (size_t i = 0; i < ret.datalen; i++) {
2496 ret.data[i] = MonitorEvent_clone(&orig->data[i]);
2500 static inline struct LDKOutPoint C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner){
2501 LDKOutPoint ret = owner->a;
2502 ret.is_owned = false;
2505 uint64_t __attribute__((export_name("TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a(uint64_t owner) {
2506 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner);
2507 LDKOutPoint ret_var = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a(owner_conv);
2508 uint64_t ret_ref = 0;
2509 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2510 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2514 static inline struct LDKCVec_MonitorEventZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner){
2515 return CVec_MonitorEventZ_clone(&owner->b);
2517 uint64_tArray __attribute__((export_name("TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b(uint64_t owner) {
2518 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner);
2519 LDKCVec_MonitorEventZ ret_var = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b(owner_conv);
2520 uint64_tArray ret_arr = NULL;
2521 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
2522 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
2523 for (size_t o = 0; o < ret_var.datalen; o++) {
2524 LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
2525 *ret_conv_14_copy = ret_var.data[o];
2526 uint64_t ret_conv_14_ref = tag_ptr(ret_conv_14_copy, true);
2527 ret_arr_ptr[o] = ret_conv_14_ref;
2534 static inline struct LDKPublicKey C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner){
2537 int8_tArray __attribute__((export_name("TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c(uint64_t owner) {
2538 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner);
2539 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
2540 memcpy(ret_arr->elems, C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c(owner_conv).compressed_form, 33);
2544 static inline LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_clone(const LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ *orig) {
2545 LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ ret = { .data = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ) * orig->datalen, "LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ clone bytes"), .datalen = orig->datalen };
2546 for (size_t i = 0; i < ret.datalen; i++) {
2547 ret.data[i] = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(&orig->data[i]);
2551 uint32_t __attribute__((export_name("TS_LDKCOption_C2Tuple_usizeTransactionZZ_ty_from_ptr"))) TS_LDKCOption_C2Tuple_usizeTransactionZZ_ty_from_ptr(uint64_t ptr) {
2552 LDKCOption_C2Tuple_usizeTransactionZZ *obj = (LDKCOption_C2Tuple_usizeTransactionZZ*)untag_ptr(ptr);
2554 case LDKCOption_C2Tuple_usizeTransactionZZ_Some: return 0;
2555 case LDKCOption_C2Tuple_usizeTransactionZZ_None: return 1;
2559 uint64_t __attribute__((export_name("TS_LDKCOption_C2Tuple_usizeTransactionZZ_Some_get_some"))) TS_LDKCOption_C2Tuple_usizeTransactionZZ_Some_get_some(uint64_t ptr) {
2560 LDKCOption_C2Tuple_usizeTransactionZZ *obj = (LDKCOption_C2Tuple_usizeTransactionZZ*)untag_ptr(ptr);
2561 assert(obj->tag == LDKCOption_C2Tuple_usizeTransactionZZ_Some);
2562 LDKC2Tuple_usizeTransactionZ* some_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
2563 *some_conv = obj->some;
2564 *some_conv = C2Tuple_usizeTransactionZ_clone(some_conv);
2565 return tag_ptr(some_conv, true);
2567 static inline struct LDKFixedPenaltyScorer CResult_FixedPenaltyScorerDecodeErrorZ_get_ok(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR owner){
2568 LDKFixedPenaltyScorer ret = *owner->contents.result;
2569 ret.is_owned = false;
2572 uint64_t __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_get_ok"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_get_ok(uint64_t owner) {
2573 LDKCResult_FixedPenaltyScorerDecodeErrorZ* owner_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(owner);
2574 LDKFixedPenaltyScorer ret_var = CResult_FixedPenaltyScorerDecodeErrorZ_get_ok(owner_conv);
2575 uint64_t ret_ref = 0;
2576 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2577 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2581 static inline struct LDKDecodeError CResult_FixedPenaltyScorerDecodeErrorZ_get_err(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR owner){
2582 LDKDecodeError ret = *owner->contents.err;
2583 ret.is_owned = false;
2586 uint64_t __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_get_err"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_get_err(uint64_t owner) {
2587 LDKCResult_FixedPenaltyScorerDecodeErrorZ* owner_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(owner);
2588 LDKDecodeError ret_var = CResult_FixedPenaltyScorerDecodeErrorZ_get_err(owner_conv);
2589 uint64_t ret_ref = 0;
2590 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2591 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2595 static inline uint64_t C2Tuple_u64u64Z_get_a(LDKC2Tuple_u64u64Z *NONNULL_PTR owner){
2598 int64_t __attribute__((export_name("TS_C2Tuple_u64u64Z_get_a"))) TS_C2Tuple_u64u64Z_get_a(uint64_t owner) {
2599 LDKC2Tuple_u64u64Z* owner_conv = (LDKC2Tuple_u64u64Z*)untag_ptr(owner);
2600 int64_t ret_conv = C2Tuple_u64u64Z_get_a(owner_conv);
2604 static inline uint64_t C2Tuple_u64u64Z_get_b(LDKC2Tuple_u64u64Z *NONNULL_PTR owner){
2607 int64_t __attribute__((export_name("TS_C2Tuple_u64u64Z_get_b"))) TS_C2Tuple_u64u64Z_get_b(uint64_t owner) {
2608 LDKC2Tuple_u64u64Z* owner_conv = (LDKC2Tuple_u64u64Z*)untag_ptr(owner);
2609 int64_t ret_conv = C2Tuple_u64u64Z_get_b(owner_conv);
2613 uint32_t __attribute__((export_name("TS_LDKCOption_C2Tuple_u64u64ZZ_ty_from_ptr"))) TS_LDKCOption_C2Tuple_u64u64ZZ_ty_from_ptr(uint64_t ptr) {
2614 LDKCOption_C2Tuple_u64u64ZZ *obj = (LDKCOption_C2Tuple_u64u64ZZ*)untag_ptr(ptr);
2616 case LDKCOption_C2Tuple_u64u64ZZ_Some: return 0;
2617 case LDKCOption_C2Tuple_u64u64ZZ_None: return 1;
2621 uint64_t __attribute__((export_name("TS_LDKCOption_C2Tuple_u64u64ZZ_Some_get_some"))) TS_LDKCOption_C2Tuple_u64u64ZZ_Some_get_some(uint64_t ptr) {
2622 LDKCOption_C2Tuple_u64u64ZZ *obj = (LDKCOption_C2Tuple_u64u64ZZ*)untag_ptr(ptr);
2623 assert(obj->tag == LDKCOption_C2Tuple_u64u64ZZ_Some);
2624 LDKC2Tuple_u64u64Z* some_conv = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
2625 *some_conv = obj->some;
2626 *some_conv = C2Tuple_u64u64Z_clone(some_conv);
2627 return tag_ptr(some_conv, true);
2629 static inline LDKCVec_NodeIdZ CVec_NodeIdZ_clone(const LDKCVec_NodeIdZ *orig) {
2630 LDKCVec_NodeIdZ ret = { .data = MALLOC(sizeof(LDKNodeId) * orig->datalen, "LDKCVec_NodeIdZ clone bytes"), .datalen = orig->datalen };
2631 for (size_t i = 0; i < ret.datalen; i++) {
2632 ret.data[i] = NodeId_clone(&orig->data[i]);
2636 typedef struct LDKLogger_JCalls {
2637 atomic_size_t refcnt;
2638 uint32_t instance_ptr;
2640 static void LDKLogger_JCalls_free(void* this_arg) {
2641 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
2642 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
2646 void log_LDKLogger_jcall(const void* this_arg, const LDKRecord * record) {
2647 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
2648 LDKRecord record_var = *record;
2649 uint64_t record_ref = 0;
2650 record_var = Record_clone(&record_var);
2651 CHECK_INNER_FIELD_ACCESS_OR_NULL(record_var);
2652 record_ref = tag_ptr(record_var.inner, record_var.is_owned);
2653 js_invoke_function_buuuuu(j_calls->instance_ptr, 0, record_ref, 0, 0, 0, 0, 0);
2655 static void LDKLogger_JCalls_cloned(LDKLogger* new_obj) {
2656 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) new_obj->this_arg;
2657 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
2659 static inline LDKLogger LDKLogger_init (JSValue o) {
2660 LDKLogger_JCalls *calls = MALLOC(sizeof(LDKLogger_JCalls), "LDKLogger_JCalls");
2661 atomic_init(&calls->refcnt, 1);
2662 calls->instance_ptr = o;
2665 .this_arg = (void*) calls,
2666 .log = log_LDKLogger_jcall,
2667 .free = LDKLogger_JCalls_free,
2671 uint64_t __attribute__((export_name("TS_LDKLogger_new"))) TS_LDKLogger_new(JSValue o) {
2672 LDKLogger *res_ptr = MALLOC(sizeof(LDKLogger), "LDKLogger");
2673 *res_ptr = LDKLogger_init(o);
2674 return tag_ptr(res_ptr, true);
2676 static inline struct LDKProbabilisticScorer CResult_ProbabilisticScorerDecodeErrorZ_get_ok(LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR owner){
2677 LDKProbabilisticScorer ret = *owner->contents.result;
2678 ret.is_owned = false;
2681 uint64_t __attribute__((export_name("TS_CResult_ProbabilisticScorerDecodeErrorZ_get_ok"))) TS_CResult_ProbabilisticScorerDecodeErrorZ_get_ok(uint64_t owner) {
2682 LDKCResult_ProbabilisticScorerDecodeErrorZ* owner_conv = (LDKCResult_ProbabilisticScorerDecodeErrorZ*)untag_ptr(owner);
2683 LDKProbabilisticScorer ret_var = CResult_ProbabilisticScorerDecodeErrorZ_get_ok(owner_conv);
2684 uint64_t ret_ref = 0;
2685 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2686 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2690 static inline struct LDKDecodeError CResult_ProbabilisticScorerDecodeErrorZ_get_err(LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR owner){
2691 LDKDecodeError ret = *owner->contents.err;
2692 ret.is_owned = false;
2695 uint64_t __attribute__((export_name("TS_CResult_ProbabilisticScorerDecodeErrorZ_get_err"))) TS_CResult_ProbabilisticScorerDecodeErrorZ_get_err(uint64_t owner) {
2696 LDKCResult_ProbabilisticScorerDecodeErrorZ* owner_conv = (LDKCResult_ProbabilisticScorerDecodeErrorZ*)untag_ptr(owner);
2697 LDKDecodeError ret_var = CResult_ProbabilisticScorerDecodeErrorZ_get_err(owner_conv);
2698 uint64_t ret_ref = 0;
2699 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2700 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2704 static inline struct LDKInitFeatures CResult_InitFeaturesDecodeErrorZ_get_ok(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR owner){
2705 LDKInitFeatures ret = *owner->contents.result;
2706 ret.is_owned = false;
2709 uint64_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_get_ok"))) TS_CResult_InitFeaturesDecodeErrorZ_get_ok(uint64_t owner) {
2710 LDKCResult_InitFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(owner);
2711 LDKInitFeatures ret_var = CResult_InitFeaturesDecodeErrorZ_get_ok(owner_conv);
2712 uint64_t ret_ref = 0;
2713 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2714 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2718 static inline struct LDKDecodeError CResult_InitFeaturesDecodeErrorZ_get_err(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR owner){
2719 LDKDecodeError ret = *owner->contents.err;
2720 ret.is_owned = false;
2723 uint64_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_get_err"))) TS_CResult_InitFeaturesDecodeErrorZ_get_err(uint64_t owner) {
2724 LDKCResult_InitFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(owner);
2725 LDKDecodeError ret_var = CResult_InitFeaturesDecodeErrorZ_get_err(owner_conv);
2726 uint64_t ret_ref = 0;
2727 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2728 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2732 static inline struct LDKChannelFeatures CResult_ChannelFeaturesDecodeErrorZ_get_ok(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR owner){
2733 LDKChannelFeatures ret = *owner->contents.result;
2734 ret.is_owned = false;
2737 uint64_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_get_ok"))) TS_CResult_ChannelFeaturesDecodeErrorZ_get_ok(uint64_t owner) {
2738 LDKCResult_ChannelFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(owner);
2739 LDKChannelFeatures ret_var = CResult_ChannelFeaturesDecodeErrorZ_get_ok(owner_conv);
2740 uint64_t ret_ref = 0;
2741 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2742 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2746 static inline struct LDKDecodeError CResult_ChannelFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR owner){
2747 LDKDecodeError ret = *owner->contents.err;
2748 ret.is_owned = false;
2751 uint64_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_get_err"))) TS_CResult_ChannelFeaturesDecodeErrorZ_get_err(uint64_t owner) {
2752 LDKCResult_ChannelFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(owner);
2753 LDKDecodeError ret_var = CResult_ChannelFeaturesDecodeErrorZ_get_err(owner_conv);
2754 uint64_t ret_ref = 0;
2755 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2756 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2760 static inline struct LDKNodeFeatures CResult_NodeFeaturesDecodeErrorZ_get_ok(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR owner){
2761 LDKNodeFeatures ret = *owner->contents.result;
2762 ret.is_owned = false;
2765 uint64_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_get_ok"))) TS_CResult_NodeFeaturesDecodeErrorZ_get_ok(uint64_t owner) {
2766 LDKCResult_NodeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(owner);
2767 LDKNodeFeatures ret_var = CResult_NodeFeaturesDecodeErrorZ_get_ok(owner_conv);
2768 uint64_t ret_ref = 0;
2769 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2770 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2774 static inline struct LDKDecodeError CResult_NodeFeaturesDecodeErrorZ_get_err(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR owner){
2775 LDKDecodeError ret = *owner->contents.err;
2776 ret.is_owned = false;
2779 uint64_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_get_err"))) TS_CResult_NodeFeaturesDecodeErrorZ_get_err(uint64_t owner) {
2780 LDKCResult_NodeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(owner);
2781 LDKDecodeError ret_var = CResult_NodeFeaturesDecodeErrorZ_get_err(owner_conv);
2782 uint64_t ret_ref = 0;
2783 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2784 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2788 static inline struct LDKInvoiceFeatures CResult_InvoiceFeaturesDecodeErrorZ_get_ok(LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner){
2789 LDKInvoiceFeatures ret = *owner->contents.result;
2790 ret.is_owned = false;
2793 uint64_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_get_ok"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_get_ok(uint64_t owner) {
2794 LDKCResult_InvoiceFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(owner);
2795 LDKInvoiceFeatures ret_var = CResult_InvoiceFeaturesDecodeErrorZ_get_ok(owner_conv);
2796 uint64_t ret_ref = 0;
2797 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2798 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2802 static inline struct LDKDecodeError CResult_InvoiceFeaturesDecodeErrorZ_get_err(LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner){
2803 LDKDecodeError ret = *owner->contents.err;
2804 ret.is_owned = false;
2807 uint64_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_get_err"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_get_err(uint64_t owner) {
2808 LDKCResult_InvoiceFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(owner);
2809 LDKDecodeError ret_var = CResult_InvoiceFeaturesDecodeErrorZ_get_err(owner_conv);
2810 uint64_t ret_ref = 0;
2811 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2812 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2816 static inline struct LDKChannelTypeFeatures CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR owner){
2817 LDKChannelTypeFeatures ret = *owner->contents.result;
2818 ret.is_owned = false;
2821 uint64_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(uint64_t owner) {
2822 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(owner);
2823 LDKChannelTypeFeatures ret_var = CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(owner_conv);
2824 uint64_t ret_ref = 0;
2825 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2826 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2830 static inline struct LDKDecodeError CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR owner){
2831 LDKDecodeError ret = *owner->contents.err;
2832 ret.is_owned = false;
2835 uint64_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_get_err"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(uint64_t owner) {
2836 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(owner);
2837 LDKDecodeError ret_var = CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(owner_conv);
2838 uint64_t ret_ref = 0;
2839 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2840 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2844 static inline struct LDKNodeId CResult_NodeIdDecodeErrorZ_get_ok(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner){
2845 LDKNodeId ret = *owner->contents.result;
2846 ret.is_owned = false;
2849 uint64_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_get_ok"))) TS_CResult_NodeIdDecodeErrorZ_get_ok(uint64_t owner) {
2850 LDKCResult_NodeIdDecodeErrorZ* owner_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(owner);
2851 LDKNodeId ret_var = CResult_NodeIdDecodeErrorZ_get_ok(owner_conv);
2852 uint64_t ret_ref = 0;
2853 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2854 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2858 static inline struct LDKDecodeError CResult_NodeIdDecodeErrorZ_get_err(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner){
2859 LDKDecodeError ret = *owner->contents.err;
2860 ret.is_owned = false;
2863 uint64_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_get_err"))) TS_CResult_NodeIdDecodeErrorZ_get_err(uint64_t owner) {
2864 LDKCResult_NodeIdDecodeErrorZ* owner_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(owner);
2865 LDKDecodeError ret_var = CResult_NodeIdDecodeErrorZ_get_err(owner_conv);
2866 uint64_t ret_ref = 0;
2867 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2868 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2872 static inline struct LDKCOption_NetworkUpdateZ CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR owner){
2873 CHECK(owner->result_ok);
2874 return COption_NetworkUpdateZ_clone(&*owner->contents.result);
2876 uint64_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(uint64_t owner) {
2877 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* owner_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(owner);
2878 LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
2879 *ret_copy = CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(owner_conv);
2880 uint64_t ret_ref = tag_ptr(ret_copy, true);
2884 static inline struct LDKDecodeError CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR owner){
2885 LDKDecodeError ret = *owner->contents.err;
2886 ret.is_owned = false;
2889 uint64_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_get_err"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(uint64_t owner) {
2890 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* owner_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(owner);
2891 LDKDecodeError ret_var = CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(owner_conv);
2892 uint64_t ret_ref = 0;
2893 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2894 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2898 typedef struct LDKAccess_JCalls {
2899 atomic_size_t refcnt;
2900 uint32_t instance_ptr;
2902 static void LDKAccess_JCalls_free(void* this_arg) {
2903 LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg;
2904 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
2908 LDKCResult_TxOutAccessErrorZ get_utxo_LDKAccess_jcall(const void* this_arg, const uint8_t (* genesis_hash)[32], uint64_t short_channel_id) {
2909 LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg;
2910 int8_tArray genesis_hash_arr = init_int8_tArray(32, __LINE__);
2911 memcpy(genesis_hash_arr->elems, *genesis_hash, 32);
2912 int64_t short_channel_id_conv = short_channel_id;
2913 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);
2914 void* ret_ptr = untag_ptr(ret);
2915 CHECK_ACCESS(ret_ptr);
2916 LDKCResult_TxOutAccessErrorZ ret_conv = *(LDKCResult_TxOutAccessErrorZ*)(ret_ptr);
2917 FREE(untag_ptr(ret));
2920 static void LDKAccess_JCalls_cloned(LDKAccess* new_obj) {
2921 LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) new_obj->this_arg;
2922 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
2924 static inline LDKAccess LDKAccess_init (JSValue o) {
2925 LDKAccess_JCalls *calls = MALLOC(sizeof(LDKAccess_JCalls), "LDKAccess_JCalls");
2926 atomic_init(&calls->refcnt, 1);
2927 calls->instance_ptr = o;
2930 .this_arg = (void*) calls,
2931 .get_utxo = get_utxo_LDKAccess_jcall,
2932 .free = LDKAccess_JCalls_free,
2936 uint64_t __attribute__((export_name("TS_LDKAccess_new"))) TS_LDKAccess_new(JSValue o) {
2937 LDKAccess *res_ptr = MALLOC(sizeof(LDKAccess), "LDKAccess");
2938 *res_ptr = LDKAccess_init(o);
2939 return tag_ptr(res_ptr, true);
2941 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) {
2942 void* this_arg_ptr = untag_ptr(this_arg);
2943 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
2944 LDKAccess* this_arg_conv = (LDKAccess*)this_arg_ptr;
2945 unsigned char genesis_hash_arr[32];
2946 CHECK(genesis_hash->arr_len == 32);
2947 memcpy(genesis_hash_arr, genesis_hash->elems, 32); FREE(genesis_hash);
2948 unsigned char (*genesis_hash_ref)[32] = &genesis_hash_arr;
2949 LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
2950 *ret_conv = (this_arg_conv->get_utxo)(this_arg_conv->this_arg, genesis_hash_ref, short_channel_id);
2951 return tag_ptr(ret_conv, true);
2954 uint32_t __attribute__((export_name("TS_LDKCOption_AccessZ_ty_from_ptr"))) TS_LDKCOption_AccessZ_ty_from_ptr(uint64_t ptr) {
2955 LDKCOption_AccessZ *obj = (LDKCOption_AccessZ*)untag_ptr(ptr);
2957 case LDKCOption_AccessZ_Some: return 0;
2958 case LDKCOption_AccessZ_None: return 1;
2962 uint64_t __attribute__((export_name("TS_LDKCOption_AccessZ_Some_get_some"))) TS_LDKCOption_AccessZ_Some_get_some(uint64_t ptr) {
2963 LDKCOption_AccessZ *obj = (LDKCOption_AccessZ*)untag_ptr(ptr);
2964 assert(obj->tag == LDKCOption_AccessZ_Some);
2965 LDKAccess* some_ret = MALLOC(sizeof(LDKAccess), "LDKAccess");
2966 *some_ret = obj->some;
2967 // WARNING: We likely need to clone here, but no clone is available, so we just do it for Java instances
2968 if ((*some_ret).free == LDKAccess_JCalls_free) {
2969 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
2970 LDKAccess_JCalls_cloned(&(*some_ret));
2972 return tag_ptr(some_ret, true);
2974 static inline bool CResult_boolLightningErrorZ_get_ok(LDKCResult_boolLightningErrorZ *NONNULL_PTR owner){
2975 CHECK(owner->result_ok);
2976 return *owner->contents.result;
2978 jboolean __attribute__((export_name("TS_CResult_boolLightningErrorZ_get_ok"))) TS_CResult_boolLightningErrorZ_get_ok(uint64_t owner) {
2979 LDKCResult_boolLightningErrorZ* owner_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(owner);
2980 jboolean ret_conv = CResult_boolLightningErrorZ_get_ok(owner_conv);
2984 static inline struct LDKLightningError CResult_boolLightningErrorZ_get_err(LDKCResult_boolLightningErrorZ *NONNULL_PTR owner){
2985 LDKLightningError ret = *owner->contents.err;
2986 ret.is_owned = false;
2989 uint64_t __attribute__((export_name("TS_CResult_boolLightningErrorZ_get_err"))) TS_CResult_boolLightningErrorZ_get_err(uint64_t owner) {
2990 LDKCResult_boolLightningErrorZ* owner_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(owner);
2991 LDKLightningError ret_var = CResult_boolLightningErrorZ_get_err(owner_conv);
2992 uint64_t ret_ref = 0;
2993 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2994 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2998 static inline struct LDKChannelAnnouncement C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner){
2999 LDKChannelAnnouncement ret = owner->a;
3000 ret.is_owned = false;
3003 uint64_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(uint64_t owner) {
3004 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(owner);
3005 LDKChannelAnnouncement ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(owner_conv);
3006 uint64_t ret_ref = 0;
3007 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3008 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3012 static inline struct LDKChannelUpdate C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner){
3013 LDKChannelUpdate ret = owner->b;
3014 ret.is_owned = false;
3017 uint64_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(uint64_t owner) {
3018 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(owner);
3019 LDKChannelUpdate ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(owner_conv);
3020 uint64_t ret_ref = 0;
3021 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3022 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3026 static inline struct LDKChannelUpdate C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner){
3027 LDKChannelUpdate ret = owner->c;
3028 ret.is_owned = false;
3031 uint64_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(uint64_t owner) {
3032 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(owner);
3033 LDKChannelUpdate ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(owner_conv);
3034 uint64_t ret_ref = 0;
3035 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3036 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3040 static inline LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(const LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *orig) {
3041 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret = { .data = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ) * orig->datalen, "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ clone bytes"), .datalen = orig->datalen };
3042 for (size_t i = 0; i < ret.datalen; i++) {
3043 ret.data[i] = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(&orig->data[i]);
3047 static inline LDKCVec_NodeAnnouncementZ CVec_NodeAnnouncementZ_clone(const LDKCVec_NodeAnnouncementZ *orig) {
3048 LDKCVec_NodeAnnouncementZ ret = { .data = MALLOC(sizeof(LDKNodeAnnouncement) * orig->datalen, "LDKCVec_NodeAnnouncementZ clone bytes"), .datalen = orig->datalen };
3049 for (size_t i = 0; i < ret.datalen; i++) {
3050 ret.data[i] = NodeAnnouncement_clone(&orig->data[i]);
3054 static inline void CResult_NoneLightningErrorZ_get_ok(LDKCResult_NoneLightningErrorZ *NONNULL_PTR owner){
3055 CHECK(owner->result_ok);
3056 return *owner->contents.result;
3058 void __attribute__((export_name("TS_CResult_NoneLightningErrorZ_get_ok"))) TS_CResult_NoneLightningErrorZ_get_ok(uint64_t owner) {
3059 LDKCResult_NoneLightningErrorZ* owner_conv = (LDKCResult_NoneLightningErrorZ*)untag_ptr(owner);
3060 CResult_NoneLightningErrorZ_get_ok(owner_conv);
3063 static inline struct LDKLightningError CResult_NoneLightningErrorZ_get_err(LDKCResult_NoneLightningErrorZ *NONNULL_PTR owner){
3064 LDKLightningError ret = *owner->contents.err;
3065 ret.is_owned = false;
3068 uint64_t __attribute__((export_name("TS_CResult_NoneLightningErrorZ_get_err"))) TS_CResult_NoneLightningErrorZ_get_err(uint64_t owner) {
3069 LDKCResult_NoneLightningErrorZ* owner_conv = (LDKCResult_NoneLightningErrorZ*)untag_ptr(owner);
3070 LDKLightningError ret_var = CResult_NoneLightningErrorZ_get_err(owner_conv);
3071 uint64_t ret_ref = 0;
3072 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3073 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3077 static inline struct LDKChannelUpdateInfo CResult_ChannelUpdateInfoDecodeErrorZ_get_ok(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR owner){
3078 LDKChannelUpdateInfo ret = *owner->contents.result;
3079 ret.is_owned = false;
3082 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateInfoDecodeErrorZ_get_ok"))) TS_CResult_ChannelUpdateInfoDecodeErrorZ_get_ok(uint64_t owner) {
3083 LDKCResult_ChannelUpdateInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(owner);
3084 LDKChannelUpdateInfo ret_var = CResult_ChannelUpdateInfoDecodeErrorZ_get_ok(owner_conv);
3085 uint64_t ret_ref = 0;
3086 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3087 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3091 static inline struct LDKDecodeError CResult_ChannelUpdateInfoDecodeErrorZ_get_err(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR owner){
3092 LDKDecodeError ret = *owner->contents.err;
3093 ret.is_owned = false;
3096 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateInfoDecodeErrorZ_get_err"))) TS_CResult_ChannelUpdateInfoDecodeErrorZ_get_err(uint64_t owner) {
3097 LDKCResult_ChannelUpdateInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(owner);
3098 LDKDecodeError ret_var = CResult_ChannelUpdateInfoDecodeErrorZ_get_err(owner_conv);
3099 uint64_t ret_ref = 0;
3100 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3101 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3105 static inline struct LDKChannelInfo CResult_ChannelInfoDecodeErrorZ_get_ok(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR owner){
3106 LDKChannelInfo ret = *owner->contents.result;
3107 ret.is_owned = false;
3110 uint64_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_get_ok"))) TS_CResult_ChannelInfoDecodeErrorZ_get_ok(uint64_t owner) {
3111 LDKCResult_ChannelInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(owner);
3112 LDKChannelInfo ret_var = CResult_ChannelInfoDecodeErrorZ_get_ok(owner_conv);
3113 uint64_t ret_ref = 0;
3114 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3115 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3119 static inline struct LDKDecodeError CResult_ChannelInfoDecodeErrorZ_get_err(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR owner){
3120 LDKDecodeError ret = *owner->contents.err;
3121 ret.is_owned = false;
3124 uint64_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_get_err"))) TS_CResult_ChannelInfoDecodeErrorZ_get_err(uint64_t owner) {
3125 LDKCResult_ChannelInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(owner);
3126 LDKDecodeError ret_var = CResult_ChannelInfoDecodeErrorZ_get_err(owner_conv);
3127 uint64_t ret_ref = 0;
3128 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3129 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3133 static inline struct LDKRoutingFees CResult_RoutingFeesDecodeErrorZ_get_ok(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR owner){
3134 LDKRoutingFees ret = *owner->contents.result;
3135 ret.is_owned = false;
3138 uint64_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_get_ok"))) TS_CResult_RoutingFeesDecodeErrorZ_get_ok(uint64_t owner) {
3139 LDKCResult_RoutingFeesDecodeErrorZ* owner_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(owner);
3140 LDKRoutingFees ret_var = CResult_RoutingFeesDecodeErrorZ_get_ok(owner_conv);
3141 uint64_t ret_ref = 0;
3142 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3143 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3147 static inline struct LDKDecodeError CResult_RoutingFeesDecodeErrorZ_get_err(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR owner){
3148 LDKDecodeError ret = *owner->contents.err;
3149 ret.is_owned = false;
3152 uint64_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_get_err"))) TS_CResult_RoutingFeesDecodeErrorZ_get_err(uint64_t owner) {
3153 LDKCResult_RoutingFeesDecodeErrorZ* owner_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(owner);
3154 LDKDecodeError ret_var = CResult_RoutingFeesDecodeErrorZ_get_err(owner_conv);
3155 uint64_t ret_ref = 0;
3156 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3157 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3161 uint32_t __attribute__((export_name("TS_LDKNetAddress_ty_from_ptr"))) TS_LDKNetAddress_ty_from_ptr(uint64_t ptr) {
3162 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3164 case LDKNetAddress_IPv4: return 0;
3165 case LDKNetAddress_IPv6: return 1;
3166 case LDKNetAddress_OnionV2: return 2;
3167 case LDKNetAddress_OnionV3: return 3;
3168 case LDKNetAddress_Hostname: return 4;
3172 int8_tArray __attribute__((export_name("TS_LDKNetAddress_IPv4_get_addr"))) TS_LDKNetAddress_IPv4_get_addr(uint64_t ptr) {
3173 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3174 assert(obj->tag == LDKNetAddress_IPv4);
3175 int8_tArray addr_arr = init_int8_tArray(4, __LINE__);
3176 memcpy(addr_arr->elems, obj->i_pv4.addr.data, 4);
3179 int16_t __attribute__((export_name("TS_LDKNetAddress_IPv4_get_port"))) TS_LDKNetAddress_IPv4_get_port(uint64_t ptr) {
3180 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3181 assert(obj->tag == LDKNetAddress_IPv4);
3182 int16_t port_conv = obj->i_pv4.port;
3185 int8_tArray __attribute__((export_name("TS_LDKNetAddress_IPv6_get_addr"))) TS_LDKNetAddress_IPv6_get_addr(uint64_t ptr) {
3186 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3187 assert(obj->tag == LDKNetAddress_IPv6);
3188 int8_tArray addr_arr = init_int8_tArray(16, __LINE__);
3189 memcpy(addr_arr->elems, obj->i_pv6.addr.data, 16);
3192 int16_t __attribute__((export_name("TS_LDKNetAddress_IPv6_get_port"))) TS_LDKNetAddress_IPv6_get_port(uint64_t ptr) {
3193 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3194 assert(obj->tag == LDKNetAddress_IPv6);
3195 int16_t port_conv = obj->i_pv6.port;
3198 int8_tArray __attribute__((export_name("TS_LDKNetAddress_OnionV2_get_onion_v2"))) TS_LDKNetAddress_OnionV2_get_onion_v2(uint64_t ptr) {
3199 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3200 assert(obj->tag == LDKNetAddress_OnionV2);
3201 int8_tArray onion_v2_arr = init_int8_tArray(12, __LINE__);
3202 memcpy(onion_v2_arr->elems, obj->onion_v2.data, 12);
3203 return onion_v2_arr;
3205 int8_tArray __attribute__((export_name("TS_LDKNetAddress_OnionV3_get_ed25519_pubkey"))) TS_LDKNetAddress_OnionV3_get_ed25519_pubkey(uint64_t ptr) {
3206 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3207 assert(obj->tag == LDKNetAddress_OnionV3);
3208 int8_tArray ed25519_pubkey_arr = init_int8_tArray(32, __LINE__);
3209 memcpy(ed25519_pubkey_arr->elems, obj->onion_v3.ed25519_pubkey.data, 32);
3210 return ed25519_pubkey_arr;
3212 int16_t __attribute__((export_name("TS_LDKNetAddress_OnionV3_get_checksum"))) TS_LDKNetAddress_OnionV3_get_checksum(uint64_t ptr) {
3213 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3214 assert(obj->tag == LDKNetAddress_OnionV3);
3215 int16_t checksum_conv = obj->onion_v3.checksum;
3216 return checksum_conv;
3218 int8_t __attribute__((export_name("TS_LDKNetAddress_OnionV3_get_version"))) TS_LDKNetAddress_OnionV3_get_version(uint64_t ptr) {
3219 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3220 assert(obj->tag == LDKNetAddress_OnionV3);
3221 int8_t version_conv = obj->onion_v3.version;
3222 return version_conv;
3224 int16_t __attribute__((export_name("TS_LDKNetAddress_OnionV3_get_port"))) TS_LDKNetAddress_OnionV3_get_port(uint64_t ptr) {
3225 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3226 assert(obj->tag == LDKNetAddress_OnionV3);
3227 int16_t port_conv = obj->onion_v3.port;
3230 uint64_t __attribute__((export_name("TS_LDKNetAddress_Hostname_get_hostname"))) TS_LDKNetAddress_Hostname_get_hostname(uint64_t ptr) {
3231 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3232 assert(obj->tag == LDKNetAddress_Hostname);
3233 LDKHostname hostname_var = obj->hostname.hostname;
3234 uint64_t hostname_ref = 0;
3235 CHECK_INNER_FIELD_ACCESS_OR_NULL(hostname_var);
3236 hostname_ref = tag_ptr(hostname_var.inner, false);
3237 return hostname_ref;
3239 int16_t __attribute__((export_name("TS_LDKNetAddress_Hostname_get_port"))) TS_LDKNetAddress_Hostname_get_port(uint64_t ptr) {
3240 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3241 assert(obj->tag == LDKNetAddress_Hostname);
3242 int16_t port_conv = obj->hostname.port;
3245 static inline LDKCVec_NetAddressZ CVec_NetAddressZ_clone(const LDKCVec_NetAddressZ *orig) {
3246 LDKCVec_NetAddressZ ret = { .data = MALLOC(sizeof(LDKNetAddress) * orig->datalen, "LDKCVec_NetAddressZ clone bytes"), .datalen = orig->datalen };
3247 for (size_t i = 0; i < ret.datalen; i++) {
3248 ret.data[i] = NetAddress_clone(&orig->data[i]);
3252 static inline struct LDKNodeAnnouncementInfo CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR owner){
3253 LDKNodeAnnouncementInfo ret = *owner->contents.result;
3254 ret.is_owned = false;
3257 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(uint64_t owner) {
3258 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(owner);
3259 LDKNodeAnnouncementInfo ret_var = CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(owner_conv);
3260 uint64_t ret_ref = 0;
3261 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3262 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3266 static inline struct LDKDecodeError CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR owner){
3267 LDKDecodeError ret = *owner->contents.err;
3268 ret.is_owned = false;
3271 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_get_err"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(uint64_t owner) {
3272 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(owner);
3273 LDKDecodeError ret_var = CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(owner_conv);
3274 uint64_t ret_ref = 0;
3275 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3276 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3280 static inline struct LDKNodeAlias CResult_NodeAliasDecodeErrorZ_get_ok(LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR owner){
3281 LDKNodeAlias ret = *owner->contents.result;
3282 ret.is_owned = false;
3285 uint64_t __attribute__((export_name("TS_CResult_NodeAliasDecodeErrorZ_get_ok"))) TS_CResult_NodeAliasDecodeErrorZ_get_ok(uint64_t owner) {
3286 LDKCResult_NodeAliasDecodeErrorZ* owner_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(owner);
3287 LDKNodeAlias ret_var = CResult_NodeAliasDecodeErrorZ_get_ok(owner_conv);
3288 uint64_t ret_ref = 0;
3289 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3290 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3294 static inline struct LDKDecodeError CResult_NodeAliasDecodeErrorZ_get_err(LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR owner){
3295 LDKDecodeError ret = *owner->contents.err;
3296 ret.is_owned = false;
3299 uint64_t __attribute__((export_name("TS_CResult_NodeAliasDecodeErrorZ_get_err"))) TS_CResult_NodeAliasDecodeErrorZ_get_err(uint64_t owner) {
3300 LDKCResult_NodeAliasDecodeErrorZ* owner_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(owner);
3301 LDKDecodeError ret_var = CResult_NodeAliasDecodeErrorZ_get_err(owner_conv);
3302 uint64_t ret_ref = 0;
3303 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3304 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3308 static inline struct LDKNodeInfo CResult_NodeInfoDecodeErrorZ_get_ok(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR owner){
3309 LDKNodeInfo ret = *owner->contents.result;
3310 ret.is_owned = false;
3313 uint64_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_get_ok"))) TS_CResult_NodeInfoDecodeErrorZ_get_ok(uint64_t owner) {
3314 LDKCResult_NodeInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(owner);
3315 LDKNodeInfo ret_var = CResult_NodeInfoDecodeErrorZ_get_ok(owner_conv);
3316 uint64_t ret_ref = 0;
3317 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3318 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3322 static inline struct LDKDecodeError CResult_NodeInfoDecodeErrorZ_get_err(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR owner){
3323 LDKDecodeError ret = *owner->contents.err;
3324 ret.is_owned = false;
3327 uint64_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_get_err"))) TS_CResult_NodeInfoDecodeErrorZ_get_err(uint64_t owner) {
3328 LDKCResult_NodeInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(owner);
3329 LDKDecodeError ret_var = CResult_NodeInfoDecodeErrorZ_get_err(owner_conv);
3330 uint64_t ret_ref = 0;
3331 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3332 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3336 static inline struct LDKNetworkGraph CResult_NetworkGraphDecodeErrorZ_get_ok(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR owner){
3337 LDKNetworkGraph ret = *owner->contents.result;
3338 ret.is_owned = false;
3341 uint64_t __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_get_ok"))) TS_CResult_NetworkGraphDecodeErrorZ_get_ok(uint64_t owner) {
3342 LDKCResult_NetworkGraphDecodeErrorZ* owner_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)untag_ptr(owner);
3343 LDKNetworkGraph ret_var = CResult_NetworkGraphDecodeErrorZ_get_ok(owner_conv);
3344 uint64_t ret_ref = 0;
3345 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3346 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3350 static inline struct LDKDecodeError CResult_NetworkGraphDecodeErrorZ_get_err(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR owner){
3351 LDKDecodeError ret = *owner->contents.err;
3352 ret.is_owned = false;
3355 uint64_t __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_get_err"))) TS_CResult_NetworkGraphDecodeErrorZ_get_err(uint64_t owner) {
3356 LDKCResult_NetworkGraphDecodeErrorZ* owner_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)untag_ptr(owner);
3357 LDKDecodeError ret_var = CResult_NetworkGraphDecodeErrorZ_get_err(owner_conv);
3358 uint64_t ret_ref = 0;
3359 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3360 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3364 uint32_t __attribute__((export_name("TS_LDKCOption_CVec_NetAddressZZ_ty_from_ptr"))) TS_LDKCOption_CVec_NetAddressZZ_ty_from_ptr(uint64_t ptr) {
3365 LDKCOption_CVec_NetAddressZZ *obj = (LDKCOption_CVec_NetAddressZZ*)untag_ptr(ptr);
3367 case LDKCOption_CVec_NetAddressZZ_Some: return 0;
3368 case LDKCOption_CVec_NetAddressZZ_None: return 1;
3372 uint64_tArray __attribute__((export_name("TS_LDKCOption_CVec_NetAddressZZ_Some_get_some"))) TS_LDKCOption_CVec_NetAddressZZ_Some_get_some(uint64_t ptr) {
3373 LDKCOption_CVec_NetAddressZZ *obj = (LDKCOption_CVec_NetAddressZZ*)untag_ptr(ptr);
3374 assert(obj->tag == LDKCOption_CVec_NetAddressZZ_Some);
3375 LDKCVec_NetAddressZ some_var = obj->some;
3376 uint64_tArray some_arr = NULL;
3377 some_arr = init_uint64_tArray(some_var.datalen, __LINE__);
3378 uint64_t *some_arr_ptr = (uint64_t*)(((uint8_t*)some_arr) + 8);
3379 for (size_t m = 0; m < some_var.datalen; m++) {
3380 uint64_t some_conv_12_ref = tag_ptr(&some_var.data[m], false);
3381 some_arr_ptr[m] = some_conv_12_ref;
3386 static inline struct LDKDelayedPaymentOutputDescriptor CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
3387 LDKDelayedPaymentOutputDescriptor ret = *owner->contents.result;
3388 ret.is_owned = false;
3391 uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(uint64_t owner) {
3392 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
3393 LDKDelayedPaymentOutputDescriptor ret_var = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(owner_conv);
3394 uint64_t ret_ref = 0;
3395 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3396 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3400 static inline struct LDKDecodeError CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
3401 LDKDecodeError ret = *owner->contents.err;
3402 ret.is_owned = false;
3405 uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(uint64_t owner) {
3406 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
3407 LDKDecodeError ret_var = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(owner_conv);
3408 uint64_t ret_ref = 0;
3409 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3410 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3414 static inline struct LDKStaticPaymentOutputDescriptor CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
3415 LDKStaticPaymentOutputDescriptor ret = *owner->contents.result;
3416 ret.is_owned = false;
3419 uint64_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(uint64_t owner) {
3420 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
3421 LDKStaticPaymentOutputDescriptor ret_var = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(owner_conv);
3422 uint64_t ret_ref = 0;
3423 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3424 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3428 static inline struct LDKDecodeError CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
3429 LDKDecodeError ret = *owner->contents.err;
3430 ret.is_owned = false;
3433 uint64_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(uint64_t owner) {
3434 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
3435 LDKDecodeError ret_var = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(owner_conv);
3436 uint64_t ret_ref = 0;
3437 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3438 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3442 static inline struct LDKSpendableOutputDescriptor CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
3443 CHECK(owner->result_ok);
3444 return SpendableOutputDescriptor_clone(&*owner->contents.result);
3446 uint64_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(uint64_t owner) {
3447 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
3448 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
3449 *ret_copy = CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(owner_conv);
3450 uint64_t ret_ref = tag_ptr(ret_copy, true);
3454 static inline struct LDKDecodeError CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
3455 LDKDecodeError ret = *owner->contents.err;
3456 ret.is_owned = false;
3459 uint64_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_get_err"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(uint64_t owner) {
3460 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
3461 LDKDecodeError ret_var = CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(owner_conv);
3462 uint64_t ret_ref = 0;
3463 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3464 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3468 static inline LDKCVec_PaymentPreimageZ CVec_PaymentPreimageZ_clone(const LDKCVec_PaymentPreimageZ *orig) {
3469 LDKCVec_PaymentPreimageZ ret = { .data = MALLOC(sizeof(LDKThirtyTwoBytes) * orig->datalen, "LDKCVec_PaymentPreimageZ clone bytes"), .datalen = orig->datalen };
3470 for (size_t i = 0; i < ret.datalen; i++) {
3471 ret.data[i] = ThirtyTwoBytes_clone(&orig->data[i]);
3475 static inline struct LDKSignature C2Tuple_SignatureCVec_SignatureZZ_get_a(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR owner){
3478 int8_tArray __attribute__((export_name("TS_C2Tuple_SignatureCVec_SignatureZZ_get_a"))) TS_C2Tuple_SignatureCVec_SignatureZZ_get_a(uint64_t owner) {
3479 LDKC2Tuple_SignatureCVec_SignatureZZ* owner_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)untag_ptr(owner);
3480 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
3481 memcpy(ret_arr->elems, C2Tuple_SignatureCVec_SignatureZZ_get_a(owner_conv).compact_form, 64);
3485 static inline struct LDKCVec_SignatureZ C2Tuple_SignatureCVec_SignatureZZ_get_b(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR owner){
3488 ptrArray __attribute__((export_name("TS_C2Tuple_SignatureCVec_SignatureZZ_get_b"))) TS_C2Tuple_SignatureCVec_SignatureZZ_get_b(uint64_t owner) {
3489 LDKC2Tuple_SignatureCVec_SignatureZZ* owner_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)untag_ptr(owner);
3490 LDKCVec_SignatureZ ret_var = C2Tuple_SignatureCVec_SignatureZZ_get_b(owner_conv);
3491 ptrArray ret_arr = NULL;
3492 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
3493 int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8);
3494 for (size_t m = 0; m < ret_var.datalen; m++) {
3495 int8_tArray ret_conv_12_arr = init_int8_tArray(64, __LINE__);
3496 memcpy(ret_conv_12_arr->elems, ret_var.data[m].compact_form, 64);
3497 ret_arr_ptr[m] = ret_conv_12_arr;
3503 static inline struct LDKC2Tuple_SignatureCVec_SignatureZZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR owner){
3504 CHECK(owner->result_ok);
3505 return C2Tuple_SignatureCVec_SignatureZZ_clone(&*owner->contents.result);
3507 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(uint64_t owner) {
3508 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)untag_ptr(owner);
3509 LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
3510 *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(owner_conv);
3511 return tag_ptr(ret_conv, true);
3514 static inline void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR owner){
3515 CHECK(!owner->result_ok);
3516 return *owner->contents.err;
3518 void __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err(uint64_t owner) {
3519 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)untag_ptr(owner);
3520 CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err(owner_conv);
3523 static inline struct LDKSignature CResult_SignatureNoneZ_get_ok(LDKCResult_SignatureNoneZ *NONNULL_PTR owner){
3524 CHECK(owner->result_ok);
3525 return *owner->contents.result;
3527 int8_tArray __attribute__((export_name("TS_CResult_SignatureNoneZ_get_ok"))) TS_CResult_SignatureNoneZ_get_ok(uint64_t owner) {
3528 LDKCResult_SignatureNoneZ* owner_conv = (LDKCResult_SignatureNoneZ*)untag_ptr(owner);
3529 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
3530 memcpy(ret_arr->elems, CResult_SignatureNoneZ_get_ok(owner_conv).compact_form, 64);
3534 static inline void CResult_SignatureNoneZ_get_err(LDKCResult_SignatureNoneZ *NONNULL_PTR owner){
3535 CHECK(!owner->result_ok);
3536 return *owner->contents.err;
3538 void __attribute__((export_name("TS_CResult_SignatureNoneZ_get_err"))) TS_CResult_SignatureNoneZ_get_err(uint64_t owner) {
3539 LDKCResult_SignatureNoneZ* owner_conv = (LDKCResult_SignatureNoneZ*)untag_ptr(owner);
3540 CResult_SignatureNoneZ_get_err(owner_conv);
3543 static inline struct LDKSignature C2Tuple_SignatureSignatureZ_get_a(LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR owner){
3546 int8_tArray __attribute__((export_name("TS_C2Tuple_SignatureSignatureZ_get_a"))) TS_C2Tuple_SignatureSignatureZ_get_a(uint64_t owner) {
3547 LDKC2Tuple_SignatureSignatureZ* owner_conv = (LDKC2Tuple_SignatureSignatureZ*)untag_ptr(owner);
3548 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
3549 memcpy(ret_arr->elems, C2Tuple_SignatureSignatureZ_get_a(owner_conv).compact_form, 64);
3553 static inline struct LDKSignature C2Tuple_SignatureSignatureZ_get_b(LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR owner){
3556 int8_tArray __attribute__((export_name("TS_C2Tuple_SignatureSignatureZ_get_b"))) TS_C2Tuple_SignatureSignatureZ_get_b(uint64_t owner) {
3557 LDKC2Tuple_SignatureSignatureZ* owner_conv = (LDKC2Tuple_SignatureSignatureZ*)untag_ptr(owner);
3558 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
3559 memcpy(ret_arr->elems, C2Tuple_SignatureSignatureZ_get_b(owner_conv).compact_form, 64);
3563 static inline struct LDKC2Tuple_SignatureSignatureZ CResult_C2Tuple_SignatureSignatureZNoneZ_get_ok(LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR owner){
3564 CHECK(owner->result_ok);
3565 return C2Tuple_SignatureSignatureZ_clone(&*owner->contents.result);
3567 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureSignatureZNoneZ_get_ok"))) TS_CResult_C2Tuple_SignatureSignatureZNoneZ_get_ok(uint64_t owner) {
3568 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)untag_ptr(owner);
3569 LDKC2Tuple_SignatureSignatureZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureSignatureZ), "LDKC2Tuple_SignatureSignatureZ");
3570 *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_get_ok(owner_conv);
3571 return tag_ptr(ret_conv, true);
3574 static inline void CResult_C2Tuple_SignatureSignatureZNoneZ_get_err(LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR owner){
3575 CHECK(!owner->result_ok);
3576 return *owner->contents.err;
3578 void __attribute__((export_name("TS_CResult_C2Tuple_SignatureSignatureZNoneZ_get_err"))) TS_CResult_C2Tuple_SignatureSignatureZNoneZ_get_err(uint64_t owner) {
3579 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)untag_ptr(owner);
3580 CResult_C2Tuple_SignatureSignatureZNoneZ_get_err(owner_conv);
3583 static inline struct LDKSecretKey CResult_SecretKeyNoneZ_get_ok(LDKCResult_SecretKeyNoneZ *NONNULL_PTR owner){
3584 CHECK(owner->result_ok);
3585 return *owner->contents.result;
3587 int8_tArray __attribute__((export_name("TS_CResult_SecretKeyNoneZ_get_ok"))) TS_CResult_SecretKeyNoneZ_get_ok(uint64_t owner) {
3588 LDKCResult_SecretKeyNoneZ* owner_conv = (LDKCResult_SecretKeyNoneZ*)untag_ptr(owner);
3589 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
3590 memcpy(ret_arr->elems, CResult_SecretKeyNoneZ_get_ok(owner_conv).bytes, 32);
3594 static inline void CResult_SecretKeyNoneZ_get_err(LDKCResult_SecretKeyNoneZ *NONNULL_PTR owner){
3595 CHECK(!owner->result_ok);
3596 return *owner->contents.err;
3598 void __attribute__((export_name("TS_CResult_SecretKeyNoneZ_get_err"))) TS_CResult_SecretKeyNoneZ_get_err(uint64_t owner) {
3599 LDKCResult_SecretKeyNoneZ* owner_conv = (LDKCResult_SecretKeyNoneZ*)untag_ptr(owner);
3600 CResult_SecretKeyNoneZ_get_err(owner_conv);
3603 typedef struct LDKBaseSign_JCalls {
3604 atomic_size_t refcnt;
3605 uint32_t instance_ptr;
3606 } LDKBaseSign_JCalls;
3607 static void LDKBaseSign_JCalls_free(void* this_arg) {
3608 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3609 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
3613 LDKPublicKey get_per_commitment_point_LDKBaseSign_jcall(const void* this_arg, uint64_t idx) {
3614 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3615 int64_t idx_conv = idx;
3616 int8_tArray ret = (int8_tArray)js_invoke_function_buuuuu(j_calls->instance_ptr, 2, idx_conv, 0, 0, 0, 0, 0);
3617 LDKPublicKey ret_ref;
3618 CHECK(ret->arr_len == 33);
3619 memcpy(ret_ref.compressed_form, ret->elems, 33); FREE(ret);
3622 LDKThirtyTwoBytes release_commitment_secret_LDKBaseSign_jcall(const void* this_arg, uint64_t idx) {
3623 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3624 int64_t idx_conv = idx;
3625 int8_tArray ret = (int8_tArray)js_invoke_function_buuuuu(j_calls->instance_ptr, 3, idx_conv, 0, 0, 0, 0, 0);
3626 LDKThirtyTwoBytes ret_ref;
3627 CHECK(ret->arr_len == 32);
3628 memcpy(ret_ref.data, ret->elems, 32); FREE(ret);
3631 LDKCResult_NoneNoneZ validate_holder_commitment_LDKBaseSign_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * holder_tx, LDKCVec_PaymentPreimageZ preimages) {
3632 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3633 LDKHolderCommitmentTransaction holder_tx_var = *holder_tx;
3634 uint64_t holder_tx_ref = 0;
3635 holder_tx_var = HolderCommitmentTransaction_clone(&holder_tx_var);
3636 CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_tx_var);
3637 holder_tx_ref = tag_ptr(holder_tx_var.inner, holder_tx_var.is_owned);
3638 LDKCVec_PaymentPreimageZ preimages_var = preimages;
3639 ptrArray preimages_arr = NULL;
3640 preimages_arr = init_ptrArray(preimages_var.datalen, __LINE__);
3641 int8_tArray *preimages_arr_ptr = (int8_tArray*)(((uint8_t*)preimages_arr) + 8);
3642 for (size_t m = 0; m < preimages_var.datalen; m++) {
3643 int8_tArray preimages_conv_12_arr = init_int8_tArray(32, __LINE__);
3644 memcpy(preimages_conv_12_arr->elems, preimages_var.data[m].data, 32);
3645 preimages_arr_ptr[m] = preimages_conv_12_arr;
3648 FREE(preimages_var.data);
3649 uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 4, holder_tx_ref, (uint32_t)preimages_arr, 0, 0, 0, 0);
3650 void* ret_ptr = untag_ptr(ret);
3651 CHECK_ACCESS(ret_ptr);
3652 LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
3653 FREE(untag_ptr(ret));
3656 LDKThirtyTwoBytes channel_keys_id_LDKBaseSign_jcall(const void* this_arg) {
3657 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3658 int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 5, 0, 0, 0, 0, 0, 0);
3659 LDKThirtyTwoBytes ret_ref;
3660 CHECK(ret->arr_len == 32);
3661 memcpy(ret_ref.data, ret->elems, 32); FREE(ret);
3664 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment_LDKBaseSign_jcall(const void* this_arg, const LDKCommitmentTransaction * commitment_tx, LDKCVec_PaymentPreimageZ preimages) {
3665 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3666 LDKCommitmentTransaction commitment_tx_var = *commitment_tx;
3667 uint64_t commitment_tx_ref = 0;
3668 commitment_tx_var = CommitmentTransaction_clone(&commitment_tx_var);
3669 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_var);
3670 commitment_tx_ref = tag_ptr(commitment_tx_var.inner, commitment_tx_var.is_owned);
3671 LDKCVec_PaymentPreimageZ preimages_var = preimages;
3672 ptrArray preimages_arr = NULL;
3673 preimages_arr = init_ptrArray(preimages_var.datalen, __LINE__);
3674 int8_tArray *preimages_arr_ptr = (int8_tArray*)(((uint8_t*)preimages_arr) + 8);
3675 for (size_t m = 0; m < preimages_var.datalen; m++) {
3676 int8_tArray preimages_conv_12_arr = init_int8_tArray(32, __LINE__);
3677 memcpy(preimages_conv_12_arr->elems, preimages_var.data[m].data, 32);
3678 preimages_arr_ptr[m] = preimages_conv_12_arr;
3681 FREE(preimages_var.data);
3682 uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 6, commitment_tx_ref, (uint32_t)preimages_arr, 0, 0, 0, 0);
3683 void* ret_ptr = untag_ptr(ret);
3684 CHECK_ACCESS(ret_ptr);
3685 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(ret_ptr);
3686 FREE(untag_ptr(ret));
3689 LDKCResult_NoneNoneZ validate_counterparty_revocation_LDKBaseSign_jcall(const void* this_arg, uint64_t idx, const uint8_t (* secret)[32]) {
3690 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3691 int64_t idx_conv = idx;
3692 int8_tArray secret_arr = init_int8_tArray(32, __LINE__);
3693 memcpy(secret_arr->elems, *secret, 32);
3694 uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 7, idx_conv, (uint32_t)secret_arr, 0, 0, 0, 0);
3695 void* ret_ptr = untag_ptr(ret);
3696 CHECK_ACCESS(ret_ptr);
3697 LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
3698 FREE(untag_ptr(ret));
3701 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htlcs_LDKBaseSign_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * commitment_tx) {
3702 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3703 LDKHolderCommitmentTransaction commitment_tx_var = *commitment_tx;
3704 uint64_t commitment_tx_ref = 0;
3705 commitment_tx_var = HolderCommitmentTransaction_clone(&commitment_tx_var);
3706 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_var);
3707 commitment_tx_ref = tag_ptr(commitment_tx_var.inner, commitment_tx_var.is_owned);
3708 uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 8, commitment_tx_ref, 0, 0, 0, 0, 0);
3709 void* ret_ptr = untag_ptr(ret);
3710 CHECK_ACCESS(ret_ptr);
3711 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(ret_ptr);
3712 FREE(untag_ptr(ret));
3715 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]) {
3716 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3717 LDKTransaction justice_tx_var = justice_tx;
3718 int8_tArray justice_tx_arr = init_int8_tArray(justice_tx_var.datalen, __LINE__);
3719 memcpy(justice_tx_arr->elems, justice_tx_var.data, justice_tx_var.datalen);
3720 Transaction_free(justice_tx_var);
3721 uint32_t input_conv = input;
3722 int64_t amount_conv = amount;
3723 int8_tArray per_commitment_key_arr = init_int8_tArray(32, __LINE__);
3724 memcpy(per_commitment_key_arr->elems, *per_commitment_key, 32);
3725 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);
3726 void* ret_ptr = untag_ptr(ret);
3727 CHECK_ACCESS(ret_ptr);
3728 LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
3729 FREE(untag_ptr(ret));
3732 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) {
3733 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3734 LDKTransaction justice_tx_var = justice_tx;
3735 int8_tArray justice_tx_arr = init_int8_tArray(justice_tx_var.datalen, __LINE__);
3736 memcpy(justice_tx_arr->elems, justice_tx_var.data, justice_tx_var.datalen);
3737 Transaction_free(justice_tx_var);
3738 uint32_t input_conv = input;
3739 int64_t amount_conv = amount;
3740 int8_tArray per_commitment_key_arr = init_int8_tArray(32, __LINE__);
3741 memcpy(per_commitment_key_arr->elems, *per_commitment_key, 32);
3742 LDKHTLCOutputInCommitment htlc_var = *htlc;
3743 uint64_t htlc_ref = 0;
3744 htlc_var = HTLCOutputInCommitment_clone(&htlc_var);
3745 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_var);
3746 htlc_ref = tag_ptr(htlc_var.inner, htlc_var.is_owned);
3747 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);
3748 void* ret_ptr = untag_ptr(ret);
3749 CHECK_ACCESS(ret_ptr);
3750 LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
3751 FREE(untag_ptr(ret));
3754 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) {
3755 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3756 LDKTransaction htlc_tx_var = htlc_tx;
3757 int8_tArray htlc_tx_arr = init_int8_tArray(htlc_tx_var.datalen, __LINE__);
3758 memcpy(htlc_tx_arr->elems, htlc_tx_var.data, htlc_tx_var.datalen);
3759 Transaction_free(htlc_tx_var);
3760 uint32_t input_conv = input;
3761 int64_t amount_conv = amount;
3762 int8_tArray per_commitment_point_arr = init_int8_tArray(33, __LINE__);
3763 memcpy(per_commitment_point_arr->elems, per_commitment_point.compressed_form, 33);
3764 LDKHTLCOutputInCommitment htlc_var = *htlc;
3765 uint64_t htlc_ref = 0;
3766 htlc_var = HTLCOutputInCommitment_clone(&htlc_var);
3767 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_var);
3768 htlc_ref = tag_ptr(htlc_var.inner, htlc_var.is_owned);
3769 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);
3770 void* ret_ptr = untag_ptr(ret);
3771 CHECK_ACCESS(ret_ptr);
3772 LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
3773 FREE(untag_ptr(ret));
3776 LDKCResult_SignatureNoneZ sign_closing_transaction_LDKBaseSign_jcall(const void* this_arg, const LDKClosingTransaction * closing_tx) {
3777 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3778 LDKClosingTransaction closing_tx_var = *closing_tx;
3779 uint64_t closing_tx_ref = 0;
3780 closing_tx_var = ClosingTransaction_clone(&closing_tx_var);
3781 CHECK_INNER_FIELD_ACCESS_OR_NULL(closing_tx_var);
3782 closing_tx_ref = tag_ptr(closing_tx_var.inner, closing_tx_var.is_owned);
3783 uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 12, closing_tx_ref, 0, 0, 0, 0, 0);
3784 void* ret_ptr = untag_ptr(ret);
3785 CHECK_ACCESS(ret_ptr);
3786 LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
3787 FREE(untag_ptr(ret));
3790 LDKCResult_C2Tuple_SignatureSignatureZNoneZ sign_channel_announcement_LDKBaseSign_jcall(const void* this_arg, const LDKUnsignedChannelAnnouncement * msg) {
3791 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3792 LDKUnsignedChannelAnnouncement msg_var = *msg;
3793 uint64_t msg_ref = 0;
3794 msg_var = UnsignedChannelAnnouncement_clone(&msg_var);
3795 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
3796 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
3797 uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 13, msg_ref, 0, 0, 0, 0, 0);
3798 void* ret_ptr = untag_ptr(ret);
3799 CHECK_ACCESS(ret_ptr);
3800 LDKCResult_C2Tuple_SignatureSignatureZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)(ret_ptr);
3801 FREE(untag_ptr(ret));
3804 void ready_channel_LDKBaseSign_jcall(void* this_arg, const LDKChannelTransactionParameters * channel_parameters) {
3805 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3806 LDKChannelTransactionParameters channel_parameters_var = *channel_parameters;
3807 uint64_t channel_parameters_ref = 0;
3808 channel_parameters_var = ChannelTransactionParameters_clone(&channel_parameters_var);
3809 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_var);
3810 channel_parameters_ref = tag_ptr(channel_parameters_var.inner, channel_parameters_var.is_owned);
3811 js_invoke_function_buuuuu(j_calls->instance_ptr, 14, channel_parameters_ref, 0, 0, 0, 0, 0);
3813 static void LDKBaseSign_JCalls_cloned(LDKBaseSign* new_obj) {
3814 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) new_obj->this_arg;
3815 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
3817 static inline LDKBaseSign LDKBaseSign_init (JSValue o, uint64_t pubkeys) {
3818 LDKBaseSign_JCalls *calls = MALLOC(sizeof(LDKBaseSign_JCalls), "LDKBaseSign_JCalls");
3819 atomic_init(&calls->refcnt, 1);
3820 calls->instance_ptr = o;
3822 LDKChannelPublicKeys pubkeys_conv;
3823 pubkeys_conv.inner = untag_ptr(pubkeys);
3824 pubkeys_conv.is_owned = ptr_is_owned(pubkeys);
3825 CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_conv);
3828 .this_arg = (void*) calls,
3829 .get_per_commitment_point = get_per_commitment_point_LDKBaseSign_jcall,
3830 .release_commitment_secret = release_commitment_secret_LDKBaseSign_jcall,
3831 .validate_holder_commitment = validate_holder_commitment_LDKBaseSign_jcall,
3832 .channel_keys_id = channel_keys_id_LDKBaseSign_jcall,
3833 .sign_counterparty_commitment = sign_counterparty_commitment_LDKBaseSign_jcall,
3834 .validate_counterparty_revocation = validate_counterparty_revocation_LDKBaseSign_jcall,
3835 .sign_holder_commitment_and_htlcs = sign_holder_commitment_and_htlcs_LDKBaseSign_jcall,
3836 .sign_justice_revoked_output = sign_justice_revoked_output_LDKBaseSign_jcall,
3837 .sign_justice_revoked_htlc = sign_justice_revoked_htlc_LDKBaseSign_jcall,
3838 .sign_counterparty_htlc_transaction = sign_counterparty_htlc_transaction_LDKBaseSign_jcall,
3839 .sign_closing_transaction = sign_closing_transaction_LDKBaseSign_jcall,
3840 .sign_channel_announcement = sign_channel_announcement_LDKBaseSign_jcall,
3841 .ready_channel = ready_channel_LDKBaseSign_jcall,
3842 .free = LDKBaseSign_JCalls_free,
3843 .pubkeys = pubkeys_conv,
3844 .set_pubkeys = NULL,
3848 uint64_t __attribute__((export_name("TS_LDKBaseSign_new"))) TS_LDKBaseSign_new(JSValue o, uint64_t pubkeys) {
3849 LDKBaseSign *res_ptr = MALLOC(sizeof(LDKBaseSign), "LDKBaseSign");
3850 *res_ptr = LDKBaseSign_init(o, pubkeys);
3851 return tag_ptr(res_ptr, true);
3853 int8_tArray __attribute__((export_name("TS_BaseSign_get_per_commitment_point"))) TS_BaseSign_get_per_commitment_point(uint64_t this_arg, int64_t idx) {
3854 void* this_arg_ptr = untag_ptr(this_arg);
3855 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
3856 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
3857 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
3858 memcpy(ret_arr->elems, (this_arg_conv->get_per_commitment_point)(this_arg_conv->this_arg, idx).compressed_form, 33);
3862 int8_tArray __attribute__((export_name("TS_BaseSign_release_commitment_secret"))) TS_BaseSign_release_commitment_secret(uint64_t this_arg, int64_t idx) {
3863 void* this_arg_ptr = untag_ptr(this_arg);
3864 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
3865 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
3866 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
3867 memcpy(ret_arr->elems, (this_arg_conv->release_commitment_secret)(this_arg_conv->this_arg, idx).data, 32);
3871 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) {
3872 void* this_arg_ptr = untag_ptr(this_arg);
3873 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
3874 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
3875 LDKHolderCommitmentTransaction holder_tx_conv;
3876 holder_tx_conv.inner = untag_ptr(holder_tx);
3877 holder_tx_conv.is_owned = ptr_is_owned(holder_tx);
3878 CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_tx_conv);
3879 holder_tx_conv.is_owned = false;
3880 LDKCVec_PaymentPreimageZ preimages_constr;
3881 preimages_constr.datalen = preimages->arr_len;
3882 if (preimages_constr.datalen > 0)
3883 preimages_constr.data = MALLOC(preimages_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_PaymentPreimageZ Elements");
3885 preimages_constr.data = NULL;
3886 int8_tArray* preimages_vals = (void*) preimages->elems;
3887 for (size_t m = 0; m < preimages_constr.datalen; m++) {
3888 int8_tArray preimages_conv_12 = preimages_vals[m];
3889 LDKThirtyTwoBytes preimages_conv_12_ref;
3890 CHECK(preimages_conv_12->arr_len == 32);
3891 memcpy(preimages_conv_12_ref.data, preimages_conv_12->elems, 32); FREE(preimages_conv_12);
3892 preimages_constr.data[m] = preimages_conv_12_ref;
3895 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
3896 *ret_conv = (this_arg_conv->validate_holder_commitment)(this_arg_conv->this_arg, &holder_tx_conv, preimages_constr);
3897 return tag_ptr(ret_conv, true);
3900 int8_tArray __attribute__((export_name("TS_BaseSign_channel_keys_id"))) TS_BaseSign_channel_keys_id(uint64_t this_arg) {
3901 void* this_arg_ptr = untag_ptr(this_arg);
3902 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
3903 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
3904 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
3905 memcpy(ret_arr->elems, (this_arg_conv->channel_keys_id)(this_arg_conv->this_arg).data, 32);
3909 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) {
3910 void* this_arg_ptr = untag_ptr(this_arg);
3911 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
3912 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
3913 LDKCommitmentTransaction commitment_tx_conv;
3914 commitment_tx_conv.inner = untag_ptr(commitment_tx);
3915 commitment_tx_conv.is_owned = ptr_is_owned(commitment_tx);
3916 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv);
3917 commitment_tx_conv.is_owned = false;
3918 LDKCVec_PaymentPreimageZ preimages_constr;
3919 preimages_constr.datalen = preimages->arr_len;
3920 if (preimages_constr.datalen > 0)
3921 preimages_constr.data = MALLOC(preimages_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_PaymentPreimageZ Elements");
3923 preimages_constr.data = NULL;
3924 int8_tArray* preimages_vals = (void*) preimages->elems;
3925 for (size_t m = 0; m < preimages_constr.datalen; m++) {
3926 int8_tArray preimages_conv_12 = preimages_vals[m];
3927 LDKThirtyTwoBytes preimages_conv_12_ref;
3928 CHECK(preimages_conv_12->arr_len == 32);
3929 memcpy(preimages_conv_12_ref.data, preimages_conv_12->elems, 32); FREE(preimages_conv_12);
3930 preimages_constr.data[m] = preimages_conv_12_ref;
3933 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
3934 *ret_conv = (this_arg_conv->sign_counterparty_commitment)(this_arg_conv->this_arg, &commitment_tx_conv, preimages_constr);
3935 return tag_ptr(ret_conv, true);
3938 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) {
3939 void* this_arg_ptr = untag_ptr(this_arg);
3940 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
3941 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
3942 unsigned char secret_arr[32];
3943 CHECK(secret->arr_len == 32);
3944 memcpy(secret_arr, secret->elems, 32); FREE(secret);
3945 unsigned char (*secret_ref)[32] = &secret_arr;
3946 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
3947 *ret_conv = (this_arg_conv->validate_counterparty_revocation)(this_arg_conv->this_arg, idx, secret_ref);
3948 return tag_ptr(ret_conv, true);
3951 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) {
3952 void* this_arg_ptr = untag_ptr(this_arg);
3953 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
3954 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
3955 LDKHolderCommitmentTransaction commitment_tx_conv;
3956 commitment_tx_conv.inner = untag_ptr(commitment_tx);
3957 commitment_tx_conv.is_owned = ptr_is_owned(commitment_tx);
3958 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv);
3959 commitment_tx_conv.is_owned = false;
3960 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
3961 *ret_conv = (this_arg_conv->sign_holder_commitment_and_htlcs)(this_arg_conv->this_arg, &commitment_tx_conv);
3962 return tag_ptr(ret_conv, true);
3965 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) {
3966 void* this_arg_ptr = untag_ptr(this_arg);
3967 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
3968 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
3969 LDKTransaction justice_tx_ref;
3970 justice_tx_ref.datalen = justice_tx->arr_len;
3971 justice_tx_ref.data = MALLOC(justice_tx_ref.datalen, "LDKTransaction Bytes");
3972 memcpy(justice_tx_ref.data, justice_tx->elems, justice_tx_ref.datalen); FREE(justice_tx);
3973 justice_tx_ref.data_is_owned = true;
3974 unsigned char per_commitment_key_arr[32];
3975 CHECK(per_commitment_key->arr_len == 32);
3976 memcpy(per_commitment_key_arr, per_commitment_key->elems, 32); FREE(per_commitment_key);
3977 unsigned char (*per_commitment_key_ref)[32] = &per_commitment_key_arr;
3978 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
3979 *ret_conv = (this_arg_conv->sign_justice_revoked_output)(this_arg_conv->this_arg, justice_tx_ref, input, amount, per_commitment_key_ref);
3980 return tag_ptr(ret_conv, true);
3983 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) {
3984 void* this_arg_ptr = untag_ptr(this_arg);
3985 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
3986 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
3987 LDKTransaction justice_tx_ref;
3988 justice_tx_ref.datalen = justice_tx->arr_len;
3989 justice_tx_ref.data = MALLOC(justice_tx_ref.datalen, "LDKTransaction Bytes");
3990 memcpy(justice_tx_ref.data, justice_tx->elems, justice_tx_ref.datalen); FREE(justice_tx);
3991 justice_tx_ref.data_is_owned = true;
3992 unsigned char per_commitment_key_arr[32];
3993 CHECK(per_commitment_key->arr_len == 32);
3994 memcpy(per_commitment_key_arr, per_commitment_key->elems, 32); FREE(per_commitment_key);
3995 unsigned char (*per_commitment_key_ref)[32] = &per_commitment_key_arr;
3996 LDKHTLCOutputInCommitment htlc_conv;
3997 htlc_conv.inner = untag_ptr(htlc);
3998 htlc_conv.is_owned = ptr_is_owned(htlc);
3999 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv);
4000 htlc_conv.is_owned = false;
4001 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
4002 *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);
4003 return tag_ptr(ret_conv, true);
4006 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) {
4007 void* this_arg_ptr = untag_ptr(this_arg);
4008 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4009 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
4010 LDKTransaction htlc_tx_ref;
4011 htlc_tx_ref.datalen = htlc_tx->arr_len;
4012 htlc_tx_ref.data = MALLOC(htlc_tx_ref.datalen, "LDKTransaction Bytes");
4013 memcpy(htlc_tx_ref.data, htlc_tx->elems, htlc_tx_ref.datalen); FREE(htlc_tx);
4014 htlc_tx_ref.data_is_owned = true;
4015 LDKPublicKey per_commitment_point_ref;
4016 CHECK(per_commitment_point->arr_len == 33);
4017 memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point);
4018 LDKHTLCOutputInCommitment htlc_conv;
4019 htlc_conv.inner = untag_ptr(htlc);
4020 htlc_conv.is_owned = ptr_is_owned(htlc);
4021 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv);
4022 htlc_conv.is_owned = false;
4023 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
4024 *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);
4025 return tag_ptr(ret_conv, true);
4028 uint64_t __attribute__((export_name("TS_BaseSign_sign_closing_transaction"))) TS_BaseSign_sign_closing_transaction(uint64_t this_arg, uint64_t closing_tx) {
4029 void* this_arg_ptr = untag_ptr(this_arg);
4030 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4031 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
4032 LDKClosingTransaction closing_tx_conv;
4033 closing_tx_conv.inner = untag_ptr(closing_tx);
4034 closing_tx_conv.is_owned = ptr_is_owned(closing_tx);
4035 CHECK_INNER_FIELD_ACCESS_OR_NULL(closing_tx_conv);
4036 closing_tx_conv.is_owned = false;
4037 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
4038 *ret_conv = (this_arg_conv->sign_closing_transaction)(this_arg_conv->this_arg, &closing_tx_conv);
4039 return tag_ptr(ret_conv, true);
4042 uint64_t __attribute__((export_name("TS_BaseSign_sign_channel_announcement"))) TS_BaseSign_sign_channel_announcement(uint64_t this_arg, uint64_t msg) {
4043 void* this_arg_ptr = untag_ptr(this_arg);
4044 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4045 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
4046 LDKUnsignedChannelAnnouncement msg_conv;
4047 msg_conv.inner = untag_ptr(msg);
4048 msg_conv.is_owned = ptr_is_owned(msg);
4049 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
4050 msg_conv.is_owned = false;
4051 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ");
4052 *ret_conv = (this_arg_conv->sign_channel_announcement)(this_arg_conv->this_arg, &msg_conv);
4053 return tag_ptr(ret_conv, true);
4056 void __attribute__((export_name("TS_BaseSign_ready_channel"))) TS_BaseSign_ready_channel(uint64_t this_arg, uint64_t channel_parameters) {
4057 void* this_arg_ptr = untag_ptr(this_arg);
4058 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4059 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
4060 LDKChannelTransactionParameters channel_parameters_conv;
4061 channel_parameters_conv.inner = untag_ptr(channel_parameters);
4062 channel_parameters_conv.is_owned = ptr_is_owned(channel_parameters);
4063 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv);
4064 channel_parameters_conv.is_owned = false;
4065 (this_arg_conv->ready_channel)(this_arg_conv->this_arg, &channel_parameters_conv);
4068 LDKChannelPublicKeys LDKBaseSign_set_get_pubkeys(LDKBaseSign* this_arg) {
4069 if (this_arg->set_pubkeys != NULL)
4070 this_arg->set_pubkeys(this_arg);
4071 return this_arg->pubkeys;
4073 uint64_t __attribute__((export_name("TS_BaseSign_get_pubkeys"))) TS_BaseSign_get_pubkeys(uint64_t this_arg) {
4074 void* this_arg_ptr = untag_ptr(this_arg);
4075 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4076 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
4077 LDKChannelPublicKeys ret_var = LDKBaseSign_set_get_pubkeys(this_arg_conv);
4078 uint64_t ret_ref = 0;
4079 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4080 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4084 typedef struct LDKSign_JCalls {
4085 atomic_size_t refcnt;
4086 uint32_t instance_ptr;
4087 LDKBaseSign_JCalls* BaseSign;
4089 static void LDKSign_JCalls_free(void* this_arg) {
4090 LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
4091 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
4095 LDKCVec_u8Z write_LDKSign_jcall(const void* this_arg) {
4096 LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
4097 int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 15, 0, 0, 0, 0, 0, 0);
4098 LDKCVec_u8Z ret_ref;
4099 ret_ref.datalen = ret->arr_len;
4100 ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
4101 memcpy(ret_ref.data, ret->elems, ret_ref.datalen); FREE(ret);
4104 static void LDKSign_JCalls_cloned(LDKSign* new_obj) {
4105 LDKSign_JCalls *j_calls = (LDKSign_JCalls*) new_obj->this_arg;
4106 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
4107 atomic_fetch_add_explicit(&j_calls->BaseSign->refcnt, 1, memory_order_release);
4109 static inline LDKSign LDKSign_init (JSValue o, JSValue BaseSign, uint64_t pubkeys) {
4110 LDKSign_JCalls *calls = MALLOC(sizeof(LDKSign_JCalls), "LDKSign_JCalls");
4111 atomic_init(&calls->refcnt, 1);
4112 calls->instance_ptr = o;
4114 LDKChannelPublicKeys pubkeys_conv;
4115 pubkeys_conv.inner = untag_ptr(pubkeys);
4116 pubkeys_conv.is_owned = ptr_is_owned(pubkeys);
4117 CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_conv);
4120 .this_arg = (void*) calls,
4121 .write = write_LDKSign_jcall,
4122 .cloned = LDKSign_JCalls_cloned,
4123 .free = LDKSign_JCalls_free,
4124 .BaseSign = LDKBaseSign_init(BaseSign, pubkeys),
4126 calls->BaseSign = ret.BaseSign.this_arg;
4129 uint64_t __attribute__((export_name("TS_LDKSign_new"))) TS_LDKSign_new(JSValue o, JSValue BaseSign, uint64_t pubkeys) {
4130 LDKSign *res_ptr = MALLOC(sizeof(LDKSign), "LDKSign");
4131 *res_ptr = LDKSign_init(o, BaseSign, pubkeys);
4132 return tag_ptr(res_ptr, true);
4134 int8_tArray __attribute__((export_name("TS_Sign_write"))) TS_Sign_write(uint64_t this_arg) {
4135 void* this_arg_ptr = untag_ptr(this_arg);
4136 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4137 LDKSign* this_arg_conv = (LDKSign*)this_arg_ptr;
4138 LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
4139 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
4140 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
4141 CVec_u8Z_free(ret_var);
4145 static inline struct LDKSign CResult_SignDecodeErrorZ_get_ok(LDKCResult_SignDecodeErrorZ *NONNULL_PTR owner){
4146 CHECK(owner->result_ok);
4147 return Sign_clone(&*owner->contents.result);
4149 uint64_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_get_ok"))) TS_CResult_SignDecodeErrorZ_get_ok(uint64_t owner) {
4150 LDKCResult_SignDecodeErrorZ* owner_conv = (LDKCResult_SignDecodeErrorZ*)untag_ptr(owner);
4151 LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
4152 *ret_ret = CResult_SignDecodeErrorZ_get_ok(owner_conv);
4153 return tag_ptr(ret_ret, true);
4156 static inline struct LDKDecodeError CResult_SignDecodeErrorZ_get_err(LDKCResult_SignDecodeErrorZ *NONNULL_PTR owner){
4157 LDKDecodeError ret = *owner->contents.err;
4158 ret.is_owned = false;
4161 uint64_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_get_err"))) TS_CResult_SignDecodeErrorZ_get_err(uint64_t owner) {
4162 LDKCResult_SignDecodeErrorZ* owner_conv = (LDKCResult_SignDecodeErrorZ*)untag_ptr(owner);
4163 LDKDecodeError ret_var = CResult_SignDecodeErrorZ_get_err(owner_conv);
4164 uint64_t ret_ref = 0;
4165 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4166 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4170 static inline struct LDKRecoverableSignature CResult_RecoverableSignatureNoneZ_get_ok(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR owner){
4171 CHECK(owner->result_ok);
4172 return *owner->contents.result;
4174 int8_tArray __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_get_ok"))) TS_CResult_RecoverableSignatureNoneZ_get_ok(uint64_t owner) {
4175 LDKCResult_RecoverableSignatureNoneZ* owner_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(owner);
4176 int8_tArray ret_arr = init_int8_tArray(68, __LINE__);
4177 memcpy(ret_arr->elems, CResult_RecoverableSignatureNoneZ_get_ok(owner_conv).serialized_form, 68);
4181 static inline void CResult_RecoverableSignatureNoneZ_get_err(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR owner){
4182 CHECK(!owner->result_ok);
4183 return *owner->contents.err;
4185 void __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_get_err"))) TS_CResult_RecoverableSignatureNoneZ_get_err(uint64_t owner) {
4186 LDKCResult_RecoverableSignatureNoneZ* owner_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(owner);
4187 CResult_RecoverableSignatureNoneZ_get_err(owner_conv);
4190 static inline LDKCVec_CVec_u8ZZ CVec_CVec_u8ZZ_clone(const LDKCVec_CVec_u8ZZ *orig) {
4191 LDKCVec_CVec_u8ZZ ret = { .data = MALLOC(sizeof(LDKCVec_u8Z) * orig->datalen, "LDKCVec_CVec_u8ZZ clone bytes"), .datalen = orig->datalen };
4192 for (size_t i = 0; i < ret.datalen; i++) {
4193 ret.data[i] = CVec_u8Z_clone(&orig->data[i]);
4197 static inline struct LDKCVec_CVec_u8ZZ CResult_CVec_CVec_u8ZZNoneZ_get_ok(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR owner){
4198 CHECK(owner->result_ok);
4199 return CVec_CVec_u8ZZ_clone(&*owner->contents.result);
4201 ptrArray __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_get_ok"))) TS_CResult_CVec_CVec_u8ZZNoneZ_get_ok(uint64_t owner) {
4202 LDKCResult_CVec_CVec_u8ZZNoneZ* owner_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(owner);
4203 LDKCVec_CVec_u8ZZ ret_var = CResult_CVec_CVec_u8ZZNoneZ_get_ok(owner_conv);
4204 ptrArray ret_arr = NULL;
4205 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
4206 int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8);
4207 for (size_t m = 0; m < ret_var.datalen; m++) {
4208 LDKCVec_u8Z ret_conv_12_var = ret_var.data[m];
4209 int8_tArray ret_conv_12_arr = init_int8_tArray(ret_conv_12_var.datalen, __LINE__);
4210 memcpy(ret_conv_12_arr->elems, ret_conv_12_var.data, ret_conv_12_var.datalen);
4211 CVec_u8Z_free(ret_conv_12_var);
4212 ret_arr_ptr[m] = ret_conv_12_arr;
4219 static inline void CResult_CVec_CVec_u8ZZNoneZ_get_err(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR owner){
4220 CHECK(!owner->result_ok);
4221 return *owner->contents.err;
4223 void __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_get_err"))) TS_CResult_CVec_CVec_u8ZZNoneZ_get_err(uint64_t owner) {
4224 LDKCResult_CVec_CVec_u8ZZNoneZ* owner_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(owner);
4225 CResult_CVec_CVec_u8ZZNoneZ_get_err(owner_conv);
4228 static inline struct LDKInMemorySigner CResult_InMemorySignerDecodeErrorZ_get_ok(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR owner){
4229 LDKInMemorySigner ret = *owner->contents.result;
4230 ret.is_owned = false;
4233 uint64_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_get_ok"))) TS_CResult_InMemorySignerDecodeErrorZ_get_ok(uint64_t owner) {
4234 LDKCResult_InMemorySignerDecodeErrorZ* owner_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(owner);
4235 LDKInMemorySigner ret_var = CResult_InMemorySignerDecodeErrorZ_get_ok(owner_conv);
4236 uint64_t ret_ref = 0;
4237 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4238 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4242 static inline struct LDKDecodeError CResult_InMemorySignerDecodeErrorZ_get_err(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR owner){
4243 LDKDecodeError ret = *owner->contents.err;
4244 ret.is_owned = false;
4247 uint64_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_get_err"))) TS_CResult_InMemorySignerDecodeErrorZ_get_err(uint64_t owner) {
4248 LDKCResult_InMemorySignerDecodeErrorZ* owner_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(owner);
4249 LDKDecodeError ret_var = CResult_InMemorySignerDecodeErrorZ_get_err(owner_conv);
4250 uint64_t ret_ref = 0;
4251 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4252 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4256 static inline LDKCVec_TxOutZ CVec_TxOutZ_clone(const LDKCVec_TxOutZ *orig) {
4257 LDKCVec_TxOutZ ret = { .data = MALLOC(sizeof(LDKTxOut) * orig->datalen, "LDKCVec_TxOutZ clone bytes"), .datalen = orig->datalen };
4258 for (size_t i = 0; i < ret.datalen; i++) {
4259 ret.data[i] = TxOut_clone(&orig->data[i]);
4263 static inline struct LDKTransaction CResult_TransactionNoneZ_get_ok(LDKCResult_TransactionNoneZ *NONNULL_PTR owner){
4264 CHECK(owner->result_ok);
4265 return *owner->contents.result;
4267 int8_tArray __attribute__((export_name("TS_CResult_TransactionNoneZ_get_ok"))) TS_CResult_TransactionNoneZ_get_ok(uint64_t owner) {
4268 LDKCResult_TransactionNoneZ* owner_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(owner);
4269 LDKTransaction ret_var = CResult_TransactionNoneZ_get_ok(owner_conv);
4270 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
4271 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
4275 static inline void CResult_TransactionNoneZ_get_err(LDKCResult_TransactionNoneZ *NONNULL_PTR owner){
4276 CHECK(!owner->result_ok);
4277 return *owner->contents.err;
4279 void __attribute__((export_name("TS_CResult_TransactionNoneZ_get_err"))) TS_CResult_TransactionNoneZ_get_err(uint64_t owner) {
4280 LDKCResult_TransactionNoneZ* owner_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(owner);
4281 CResult_TransactionNoneZ_get_err(owner_conv);
4284 uint32_t __attribute__((export_name("TS_LDKCOption_u16Z_ty_from_ptr"))) TS_LDKCOption_u16Z_ty_from_ptr(uint64_t ptr) {
4285 LDKCOption_u16Z *obj = (LDKCOption_u16Z*)untag_ptr(ptr);
4287 case LDKCOption_u16Z_Some: return 0;
4288 case LDKCOption_u16Z_None: return 1;
4292 int16_t __attribute__((export_name("TS_LDKCOption_u16Z_Some_get_some"))) TS_LDKCOption_u16Z_Some_get_some(uint64_t ptr) {
4293 LDKCOption_u16Z *obj = (LDKCOption_u16Z*)untag_ptr(ptr);
4294 assert(obj->tag == LDKCOption_u16Z_Some);
4295 int16_t some_conv = obj->some;
4298 uint32_t __attribute__((export_name("TS_LDKAPIError_ty_from_ptr"))) TS_LDKAPIError_ty_from_ptr(uint64_t ptr) {
4299 LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
4301 case LDKAPIError_APIMisuseError: return 0;
4302 case LDKAPIError_FeeRateTooHigh: return 1;
4303 case LDKAPIError_RouteError: return 2;
4304 case LDKAPIError_ChannelUnavailable: return 3;
4305 case LDKAPIError_MonitorUpdateFailed: return 4;
4306 case LDKAPIError_IncompatibleShutdownScript: return 5;
4310 jstring __attribute__((export_name("TS_LDKAPIError_APIMisuseError_get_err"))) TS_LDKAPIError_APIMisuseError_get_err(uint64_t ptr) {
4311 LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
4312 assert(obj->tag == LDKAPIError_APIMisuseError);
4313 LDKStr err_str = obj->api_misuse_error.err;
4314 jstring err_conv = str_ref_to_ts(err_str.chars, err_str.len);
4317 jstring __attribute__((export_name("TS_LDKAPIError_FeeRateTooHigh_get_err"))) TS_LDKAPIError_FeeRateTooHigh_get_err(uint64_t ptr) {
4318 LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
4319 assert(obj->tag == LDKAPIError_FeeRateTooHigh);
4320 LDKStr err_str = obj->fee_rate_too_high.err;
4321 jstring err_conv = str_ref_to_ts(err_str.chars, err_str.len);
4324 int32_t __attribute__((export_name("TS_LDKAPIError_FeeRateTooHigh_get_feerate"))) TS_LDKAPIError_FeeRateTooHigh_get_feerate(uint64_t ptr) {
4325 LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
4326 assert(obj->tag == LDKAPIError_FeeRateTooHigh);
4327 int32_t feerate_conv = obj->fee_rate_too_high.feerate;
4328 return feerate_conv;
4330 jstring __attribute__((export_name("TS_LDKAPIError_RouteError_get_err"))) TS_LDKAPIError_RouteError_get_err(uint64_t ptr) {
4331 LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
4332 assert(obj->tag == LDKAPIError_RouteError);
4333 LDKStr err_str = obj->route_error.err;
4334 jstring err_conv = str_ref_to_ts(err_str.chars, err_str.len);
4337 jstring __attribute__((export_name("TS_LDKAPIError_ChannelUnavailable_get_err"))) TS_LDKAPIError_ChannelUnavailable_get_err(uint64_t ptr) {
4338 LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
4339 assert(obj->tag == LDKAPIError_ChannelUnavailable);
4340 LDKStr err_str = obj->channel_unavailable.err;
4341 jstring err_conv = str_ref_to_ts(err_str.chars, err_str.len);
4344 uint64_t __attribute__((export_name("TS_LDKAPIError_IncompatibleShutdownScript_get_script"))) TS_LDKAPIError_IncompatibleShutdownScript_get_script(uint64_t ptr) {
4345 LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
4346 assert(obj->tag == LDKAPIError_IncompatibleShutdownScript);
4347 LDKShutdownScript script_var = obj->incompatible_shutdown_script.script;
4348 uint64_t script_ref = 0;
4349 CHECK_INNER_FIELD_ACCESS_OR_NULL(script_var);
4350 script_ref = tag_ptr(script_var.inner, false);
4353 static inline void CResult_NoneAPIErrorZ_get_ok(LDKCResult_NoneAPIErrorZ *NONNULL_PTR owner){
4354 CHECK(owner->result_ok);
4355 return *owner->contents.result;
4357 void __attribute__((export_name("TS_CResult_NoneAPIErrorZ_get_ok"))) TS_CResult_NoneAPIErrorZ_get_ok(uint64_t owner) {
4358 LDKCResult_NoneAPIErrorZ* owner_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(owner);
4359 CResult_NoneAPIErrorZ_get_ok(owner_conv);
4362 static inline struct LDKAPIError CResult_NoneAPIErrorZ_get_err(LDKCResult_NoneAPIErrorZ *NONNULL_PTR owner){
4363 CHECK(!owner->result_ok);
4364 return APIError_clone(&*owner->contents.err);
4366 uint64_t __attribute__((export_name("TS_CResult_NoneAPIErrorZ_get_err"))) TS_CResult_NoneAPIErrorZ_get_err(uint64_t owner) {
4367 LDKCResult_NoneAPIErrorZ* owner_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(owner);
4368 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
4369 *ret_copy = CResult_NoneAPIErrorZ_get_err(owner_conv);
4370 uint64_t ret_ref = tag_ptr(ret_copy, true);
4374 static inline LDKCVec_CResult_NoneAPIErrorZZ CVec_CResult_NoneAPIErrorZZ_clone(const LDKCVec_CResult_NoneAPIErrorZZ *orig) {
4375 LDKCVec_CResult_NoneAPIErrorZZ ret = { .data = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ) * orig->datalen, "LDKCVec_CResult_NoneAPIErrorZZ clone bytes"), .datalen = orig->datalen };
4376 for (size_t i = 0; i < ret.datalen; i++) {
4377 ret.data[i] = CResult_NoneAPIErrorZ_clone(&orig->data[i]);
4381 static inline LDKCVec_APIErrorZ CVec_APIErrorZ_clone(const LDKCVec_APIErrorZ *orig) {
4382 LDKCVec_APIErrorZ ret = { .data = MALLOC(sizeof(LDKAPIError) * orig->datalen, "LDKCVec_APIErrorZ clone bytes"), .datalen = orig->datalen };
4383 for (size_t i = 0; i < ret.datalen; i++) {
4384 ret.data[i] = APIError_clone(&orig->data[i]);
4388 static inline struct LDKThirtyTwoBytes CResult__u832APIErrorZ_get_ok(LDKCResult__u832APIErrorZ *NONNULL_PTR owner){
4389 CHECK(owner->result_ok);
4390 return ThirtyTwoBytes_clone(&*owner->contents.result);
4392 int8_tArray __attribute__((export_name("TS_CResult__u832APIErrorZ_get_ok"))) TS_CResult__u832APIErrorZ_get_ok(uint64_t owner) {
4393 LDKCResult__u832APIErrorZ* owner_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(owner);
4394 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
4395 memcpy(ret_arr->elems, CResult__u832APIErrorZ_get_ok(owner_conv).data, 32);
4399 static inline struct LDKAPIError CResult__u832APIErrorZ_get_err(LDKCResult__u832APIErrorZ *NONNULL_PTR owner){
4400 CHECK(!owner->result_ok);
4401 return APIError_clone(&*owner->contents.err);
4403 uint64_t __attribute__((export_name("TS_CResult__u832APIErrorZ_get_err"))) TS_CResult__u832APIErrorZ_get_err(uint64_t owner) {
4404 LDKCResult__u832APIErrorZ* owner_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(owner);
4405 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
4406 *ret_copy = CResult__u832APIErrorZ_get_err(owner_conv);
4407 uint64_t ret_ref = tag_ptr(ret_copy, true);
4411 uint32_t __attribute__((export_name("TS_LDKPaymentSendFailure_ty_from_ptr"))) TS_LDKPaymentSendFailure_ty_from_ptr(uint64_t ptr) {
4412 LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)untag_ptr(ptr);
4414 case LDKPaymentSendFailure_ParameterError: return 0;
4415 case LDKPaymentSendFailure_PathParameterError: return 1;
4416 case LDKPaymentSendFailure_AllFailedRetrySafe: return 2;
4417 case LDKPaymentSendFailure_PartialFailure: return 3;
4421 uint64_t __attribute__((export_name("TS_LDKPaymentSendFailure_ParameterError_get_parameter_error"))) TS_LDKPaymentSendFailure_ParameterError_get_parameter_error(uint64_t ptr) {
4422 LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)untag_ptr(ptr);
4423 assert(obj->tag == LDKPaymentSendFailure_ParameterError);
4424 uint64_t parameter_error_ref = tag_ptr(&obj->parameter_error, false);
4425 return parameter_error_ref;
4427 uint64_tArray __attribute__((export_name("TS_LDKPaymentSendFailure_PathParameterError_get_path_parameter_error"))) TS_LDKPaymentSendFailure_PathParameterError_get_path_parameter_error(uint64_t ptr) {
4428 LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)untag_ptr(ptr);
4429 assert(obj->tag == LDKPaymentSendFailure_PathParameterError);
4430 LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error_var = obj->path_parameter_error;
4431 uint64_tArray path_parameter_error_arr = NULL;
4432 path_parameter_error_arr = init_uint64_tArray(path_parameter_error_var.datalen, __LINE__);
4433 uint64_t *path_parameter_error_arr_ptr = (uint64_t*)(((uint8_t*)path_parameter_error_arr) + 8);
4434 for (size_t w = 0; w < path_parameter_error_var.datalen; w++) {
4435 LDKCResult_NoneAPIErrorZ* path_parameter_error_conv_22_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
4436 *path_parameter_error_conv_22_conv = path_parameter_error_var.data[w];
4437 *path_parameter_error_conv_22_conv = CResult_NoneAPIErrorZ_clone(path_parameter_error_conv_22_conv);
4438 path_parameter_error_arr_ptr[w] = tag_ptr(path_parameter_error_conv_22_conv, true);
4441 return path_parameter_error_arr;
4443 uint64_tArray __attribute__((export_name("TS_LDKPaymentSendFailure_AllFailedRetrySafe_get_all_failed_retry_safe"))) TS_LDKPaymentSendFailure_AllFailedRetrySafe_get_all_failed_retry_safe(uint64_t ptr) {
4444 LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)untag_ptr(ptr);
4445 assert(obj->tag == LDKPaymentSendFailure_AllFailedRetrySafe);
4446 LDKCVec_APIErrorZ all_failed_retry_safe_var = obj->all_failed_retry_safe;
4447 uint64_tArray all_failed_retry_safe_arr = NULL;
4448 all_failed_retry_safe_arr = init_uint64_tArray(all_failed_retry_safe_var.datalen, __LINE__);
4449 uint64_t *all_failed_retry_safe_arr_ptr = (uint64_t*)(((uint8_t*)all_failed_retry_safe_arr) + 8);
4450 for (size_t k = 0; k < all_failed_retry_safe_var.datalen; k++) {
4451 uint64_t all_failed_retry_safe_conv_10_ref = tag_ptr(&all_failed_retry_safe_var.data[k], false);
4452 all_failed_retry_safe_arr_ptr[k] = all_failed_retry_safe_conv_10_ref;
4455 return all_failed_retry_safe_arr;
4457 uint64_tArray __attribute__((export_name("TS_LDKPaymentSendFailure_PartialFailure_get_results"))) TS_LDKPaymentSendFailure_PartialFailure_get_results(uint64_t ptr) {
4458 LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)untag_ptr(ptr);
4459 assert(obj->tag == LDKPaymentSendFailure_PartialFailure);
4460 LDKCVec_CResult_NoneAPIErrorZZ results_var = obj->partial_failure.results;
4461 uint64_tArray results_arr = NULL;
4462 results_arr = init_uint64_tArray(results_var.datalen, __LINE__);
4463 uint64_t *results_arr_ptr = (uint64_t*)(((uint8_t*)results_arr) + 8);
4464 for (size_t w = 0; w < results_var.datalen; w++) {
4465 LDKCResult_NoneAPIErrorZ* results_conv_22_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
4466 *results_conv_22_conv = results_var.data[w];
4467 *results_conv_22_conv = CResult_NoneAPIErrorZ_clone(results_conv_22_conv);
4468 results_arr_ptr[w] = tag_ptr(results_conv_22_conv, true);
4473 uint64_t __attribute__((export_name("TS_LDKPaymentSendFailure_PartialFailure_get_failed_paths_retry"))) TS_LDKPaymentSendFailure_PartialFailure_get_failed_paths_retry(uint64_t ptr) {
4474 LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)untag_ptr(ptr);
4475 assert(obj->tag == LDKPaymentSendFailure_PartialFailure);
4476 LDKRouteParameters failed_paths_retry_var = obj->partial_failure.failed_paths_retry;
4477 uint64_t failed_paths_retry_ref = 0;
4478 CHECK_INNER_FIELD_ACCESS_OR_NULL(failed_paths_retry_var);
4479 failed_paths_retry_ref = tag_ptr(failed_paths_retry_var.inner, false);
4480 return failed_paths_retry_ref;
4482 int8_tArray __attribute__((export_name("TS_LDKPaymentSendFailure_PartialFailure_get_payment_id"))) TS_LDKPaymentSendFailure_PartialFailure_get_payment_id(uint64_t ptr) {
4483 LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)untag_ptr(ptr);
4484 assert(obj->tag == LDKPaymentSendFailure_PartialFailure);
4485 int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
4486 memcpy(payment_id_arr->elems, obj->partial_failure.payment_id.data, 32);
4487 return payment_id_arr;
4489 static inline struct LDKThirtyTwoBytes CResult_PaymentIdPaymentSendFailureZ_get_ok(LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR owner){
4490 CHECK(owner->result_ok);
4491 return ThirtyTwoBytes_clone(&*owner->contents.result);
4493 int8_tArray __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_get_ok"))) TS_CResult_PaymentIdPaymentSendFailureZ_get_ok(uint64_t owner) {
4494 LDKCResult_PaymentIdPaymentSendFailureZ* owner_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)untag_ptr(owner);
4495 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
4496 memcpy(ret_arr->elems, CResult_PaymentIdPaymentSendFailureZ_get_ok(owner_conv).data, 32);
4500 static inline struct LDKPaymentSendFailure CResult_PaymentIdPaymentSendFailureZ_get_err(LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR owner){
4501 CHECK(!owner->result_ok);
4502 return PaymentSendFailure_clone(&*owner->contents.err);
4504 uint64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_get_err"))) TS_CResult_PaymentIdPaymentSendFailureZ_get_err(uint64_t owner) {
4505 LDKCResult_PaymentIdPaymentSendFailureZ* owner_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)untag_ptr(owner);
4506 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
4507 *ret_copy = CResult_PaymentIdPaymentSendFailureZ_get_err(owner_conv);
4508 uint64_t ret_ref = tag_ptr(ret_copy, true);
4512 static inline void CResult_NonePaymentSendFailureZ_get_ok(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR owner){
4513 CHECK(owner->result_ok);
4514 return *owner->contents.result;
4516 void __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_get_ok"))) TS_CResult_NonePaymentSendFailureZ_get_ok(uint64_t owner) {
4517 LDKCResult_NonePaymentSendFailureZ* owner_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(owner);
4518 CResult_NonePaymentSendFailureZ_get_ok(owner_conv);
4521 static inline struct LDKPaymentSendFailure CResult_NonePaymentSendFailureZ_get_err(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR owner){
4522 CHECK(!owner->result_ok);
4523 return PaymentSendFailure_clone(&*owner->contents.err);
4525 uint64_t __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_get_err"))) TS_CResult_NonePaymentSendFailureZ_get_err(uint64_t owner) {
4526 LDKCResult_NonePaymentSendFailureZ* owner_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(owner);
4527 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
4528 *ret_copy = CResult_NonePaymentSendFailureZ_get_err(owner_conv);
4529 uint64_t ret_ref = tag_ptr(ret_copy, true);
4533 static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentIdZ_get_a(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR owner){
4534 return ThirtyTwoBytes_clone(&owner->a);
4536 int8_tArray __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentIdZ_get_a"))) TS_C2Tuple_PaymentHashPaymentIdZ_get_a(uint64_t owner) {
4537 LDKC2Tuple_PaymentHashPaymentIdZ* owner_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)untag_ptr(owner);
4538 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
4539 memcpy(ret_arr->elems, C2Tuple_PaymentHashPaymentIdZ_get_a(owner_conv).data, 32);
4543 static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentIdZ_get_b(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR owner){
4544 return ThirtyTwoBytes_clone(&owner->b);
4546 int8_tArray __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentIdZ_get_b"))) TS_C2Tuple_PaymentHashPaymentIdZ_get_b(uint64_t owner) {
4547 LDKC2Tuple_PaymentHashPaymentIdZ* owner_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)untag_ptr(owner);
4548 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
4549 memcpy(ret_arr->elems, C2Tuple_PaymentHashPaymentIdZ_get_b(owner_conv).data, 32);
4553 static inline struct LDKC2Tuple_PaymentHashPaymentIdZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_ok(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR owner){
4554 CHECK(owner->result_ok);
4555 return C2Tuple_PaymentHashPaymentIdZ_clone(&*owner->contents.result);
4557 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_ok(uint64_t owner) {
4558 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)untag_ptr(owner);
4559 LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ");
4560 *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_ok(owner_conv);
4561 return tag_ptr(ret_conv, true);
4564 static inline struct LDKPaymentSendFailure CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_err(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR owner){
4565 CHECK(!owner->result_ok);
4566 return PaymentSendFailure_clone(&*owner->contents.err);
4568 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_err"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_err(uint64_t owner) {
4569 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)untag_ptr(owner);
4570 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
4571 *ret_copy = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_err(owner_conv);
4572 uint64_t ret_ref = tag_ptr(ret_copy, true);
4576 static inline LDKCVec_ThirtyTwoBytesZ CVec_ThirtyTwoBytesZ_clone(const LDKCVec_ThirtyTwoBytesZ *orig) {
4577 LDKCVec_ThirtyTwoBytesZ ret = { .data = MALLOC(sizeof(LDKThirtyTwoBytes) * orig->datalen, "LDKCVec_ThirtyTwoBytesZ clone bytes"), .datalen = orig->datalen };
4578 for (size_t i = 0; i < ret.datalen; i++) {
4579 ret.data[i] = ThirtyTwoBytes_clone(&orig->data[i]);
4583 static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentSecretZ_get_a(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR owner){
4584 return ThirtyTwoBytes_clone(&owner->a);
4586 int8_tArray __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentSecretZ_get_a"))) TS_C2Tuple_PaymentHashPaymentSecretZ_get_a(uint64_t owner) {
4587 LDKC2Tuple_PaymentHashPaymentSecretZ* owner_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(owner);
4588 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
4589 memcpy(ret_arr->elems, C2Tuple_PaymentHashPaymentSecretZ_get_a(owner_conv).data, 32);
4593 static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentSecretZ_get_b(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR owner){
4594 return ThirtyTwoBytes_clone(&owner->b);
4596 int8_tArray __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentSecretZ_get_b"))) TS_C2Tuple_PaymentHashPaymentSecretZ_get_b(uint64_t owner) {
4597 LDKC2Tuple_PaymentHashPaymentSecretZ* owner_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(owner);
4598 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
4599 memcpy(ret_arr->elems, C2Tuple_PaymentHashPaymentSecretZ_get_b(owner_conv).data, 32);
4603 static inline struct LDKC2Tuple_PaymentHashPaymentSecretZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_ok(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR owner){
4604 CHECK(owner->result_ok);
4605 return C2Tuple_PaymentHashPaymentSecretZ_clone(&*owner->contents.result);
4607 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_ok(uint64_t owner) {
4608 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)untag_ptr(owner);
4609 LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
4610 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_ok(owner_conv);
4611 return tag_ptr(ret_conv, true);
4614 static inline void CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_err(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR owner){
4615 CHECK(!owner->result_ok);
4616 return *owner->contents.err;
4618 void __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_err"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_err(uint64_t owner) {
4619 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)untag_ptr(owner);
4620 CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_err(owner_conv);
4623 static inline struct LDKC2Tuple_PaymentHashPaymentSecretZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_ok(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR owner){
4624 CHECK(owner->result_ok);
4625 return C2Tuple_PaymentHashPaymentSecretZ_clone(&*owner->contents.result);
4627 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_ok(uint64_t owner) {
4628 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)untag_ptr(owner);
4629 LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
4630 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_ok(owner_conv);
4631 return tag_ptr(ret_conv, true);
4634 static inline struct LDKAPIError CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_err(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR owner){
4635 CHECK(!owner->result_ok);
4636 return APIError_clone(&*owner->contents.err);
4638 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_err"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_err(uint64_t owner) {
4639 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)untag_ptr(owner);
4640 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
4641 *ret_copy = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_err(owner_conv);
4642 uint64_t ret_ref = tag_ptr(ret_copy, true);
4646 static inline struct LDKThirtyTwoBytes CResult_PaymentSecretNoneZ_get_ok(LDKCResult_PaymentSecretNoneZ *NONNULL_PTR owner){
4647 CHECK(owner->result_ok);
4648 return ThirtyTwoBytes_clone(&*owner->contents.result);
4650 int8_tArray __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_get_ok"))) TS_CResult_PaymentSecretNoneZ_get_ok(uint64_t owner) {
4651 LDKCResult_PaymentSecretNoneZ* owner_conv = (LDKCResult_PaymentSecretNoneZ*)untag_ptr(owner);
4652 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
4653 memcpy(ret_arr->elems, CResult_PaymentSecretNoneZ_get_ok(owner_conv).data, 32);
4657 static inline void CResult_PaymentSecretNoneZ_get_err(LDKCResult_PaymentSecretNoneZ *NONNULL_PTR owner){
4658 CHECK(!owner->result_ok);
4659 return *owner->contents.err;
4661 void __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_get_err"))) TS_CResult_PaymentSecretNoneZ_get_err(uint64_t owner) {
4662 LDKCResult_PaymentSecretNoneZ* owner_conv = (LDKCResult_PaymentSecretNoneZ*)untag_ptr(owner);
4663 CResult_PaymentSecretNoneZ_get_err(owner_conv);
4666 static inline struct LDKThirtyTwoBytes CResult_PaymentSecretAPIErrorZ_get_ok(LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR owner){
4667 CHECK(owner->result_ok);
4668 return ThirtyTwoBytes_clone(&*owner->contents.result);
4670 int8_tArray __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_get_ok"))) TS_CResult_PaymentSecretAPIErrorZ_get_ok(uint64_t owner) {
4671 LDKCResult_PaymentSecretAPIErrorZ* owner_conv = (LDKCResult_PaymentSecretAPIErrorZ*)untag_ptr(owner);
4672 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
4673 memcpy(ret_arr->elems, CResult_PaymentSecretAPIErrorZ_get_ok(owner_conv).data, 32);
4677 static inline struct LDKAPIError CResult_PaymentSecretAPIErrorZ_get_err(LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR owner){
4678 CHECK(!owner->result_ok);
4679 return APIError_clone(&*owner->contents.err);
4681 uint64_t __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_get_err"))) TS_CResult_PaymentSecretAPIErrorZ_get_err(uint64_t owner) {
4682 LDKCResult_PaymentSecretAPIErrorZ* owner_conv = (LDKCResult_PaymentSecretAPIErrorZ*)untag_ptr(owner);
4683 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
4684 *ret_copy = CResult_PaymentSecretAPIErrorZ_get_err(owner_conv);
4685 uint64_t ret_ref = tag_ptr(ret_copy, true);
4689 static inline struct LDKThirtyTwoBytes CResult_PaymentPreimageAPIErrorZ_get_ok(LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR owner){
4690 CHECK(owner->result_ok);
4691 return ThirtyTwoBytes_clone(&*owner->contents.result);
4693 int8_tArray __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_get_ok"))) TS_CResult_PaymentPreimageAPIErrorZ_get_ok(uint64_t owner) {
4694 LDKCResult_PaymentPreimageAPIErrorZ* owner_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)untag_ptr(owner);
4695 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
4696 memcpy(ret_arr->elems, CResult_PaymentPreimageAPIErrorZ_get_ok(owner_conv).data, 32);
4700 static inline struct LDKAPIError CResult_PaymentPreimageAPIErrorZ_get_err(LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR owner){
4701 CHECK(!owner->result_ok);
4702 return APIError_clone(&*owner->contents.err);
4704 uint64_t __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_get_err"))) TS_CResult_PaymentPreimageAPIErrorZ_get_err(uint64_t owner) {
4705 LDKCResult_PaymentPreimageAPIErrorZ* owner_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)untag_ptr(owner);
4706 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
4707 *ret_copy = CResult_PaymentPreimageAPIErrorZ_get_err(owner_conv);
4708 uint64_t ret_ref = tag_ptr(ret_copy, true);
4712 static inline struct LDKCounterpartyForwardingInfo CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR owner){
4713 LDKCounterpartyForwardingInfo ret = *owner->contents.result;
4714 ret.is_owned = false;
4717 uint64_t __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok(uint64_t owner) {
4718 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(owner);
4719 LDKCounterpartyForwardingInfo ret_var = CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok(owner_conv);
4720 uint64_t ret_ref = 0;
4721 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4722 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4726 static inline struct LDKDecodeError CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR owner){
4727 LDKDecodeError ret = *owner->contents.err;
4728 ret.is_owned = false;
4731 uint64_t __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(uint64_t owner) {
4732 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(owner);
4733 LDKDecodeError ret_var = CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(owner_conv);
4734 uint64_t ret_ref = 0;
4735 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4736 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4740 static inline struct LDKChannelCounterparty CResult_ChannelCounterpartyDecodeErrorZ_get_ok(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR owner){
4741 LDKChannelCounterparty ret = *owner->contents.result;
4742 ret.is_owned = false;
4745 uint64_t __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_get_ok"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_get_ok(uint64_t owner) {
4746 LDKCResult_ChannelCounterpartyDecodeErrorZ* owner_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(owner);
4747 LDKChannelCounterparty ret_var = CResult_ChannelCounterpartyDecodeErrorZ_get_ok(owner_conv);
4748 uint64_t ret_ref = 0;
4749 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4750 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4754 static inline struct LDKDecodeError CResult_ChannelCounterpartyDecodeErrorZ_get_err(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR owner){
4755 LDKDecodeError ret = *owner->contents.err;
4756 ret.is_owned = false;
4759 uint64_t __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_get_err"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_get_err(uint64_t owner) {
4760 LDKCResult_ChannelCounterpartyDecodeErrorZ* owner_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(owner);
4761 LDKDecodeError ret_var = CResult_ChannelCounterpartyDecodeErrorZ_get_err(owner_conv);
4762 uint64_t ret_ref = 0;
4763 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4764 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4768 static inline struct LDKChannelDetails CResult_ChannelDetailsDecodeErrorZ_get_ok(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR owner){
4769 LDKChannelDetails ret = *owner->contents.result;
4770 ret.is_owned = false;
4773 uint64_t __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_get_ok"))) TS_CResult_ChannelDetailsDecodeErrorZ_get_ok(uint64_t owner) {
4774 LDKCResult_ChannelDetailsDecodeErrorZ* owner_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(owner);
4775 LDKChannelDetails ret_var = CResult_ChannelDetailsDecodeErrorZ_get_ok(owner_conv);
4776 uint64_t ret_ref = 0;
4777 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4778 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4782 static inline struct LDKDecodeError CResult_ChannelDetailsDecodeErrorZ_get_err(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR owner){
4783 LDKDecodeError ret = *owner->contents.err;
4784 ret.is_owned = false;
4787 uint64_t __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_get_err"))) TS_CResult_ChannelDetailsDecodeErrorZ_get_err(uint64_t owner) {
4788 LDKCResult_ChannelDetailsDecodeErrorZ* owner_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(owner);
4789 LDKDecodeError ret_var = CResult_ChannelDetailsDecodeErrorZ_get_err(owner_conv);
4790 uint64_t ret_ref = 0;
4791 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4792 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4796 static inline struct LDKPhantomRouteHints CResult_PhantomRouteHintsDecodeErrorZ_get_ok(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR owner){
4797 LDKPhantomRouteHints ret = *owner->contents.result;
4798 ret.is_owned = false;
4801 uint64_t __attribute__((export_name("TS_CResult_PhantomRouteHintsDecodeErrorZ_get_ok"))) TS_CResult_PhantomRouteHintsDecodeErrorZ_get_ok(uint64_t owner) {
4802 LDKCResult_PhantomRouteHintsDecodeErrorZ* owner_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(owner);
4803 LDKPhantomRouteHints ret_var = CResult_PhantomRouteHintsDecodeErrorZ_get_ok(owner_conv);
4804 uint64_t ret_ref = 0;
4805 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4806 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4810 static inline struct LDKDecodeError CResult_PhantomRouteHintsDecodeErrorZ_get_err(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR owner){
4811 LDKDecodeError ret = *owner->contents.err;
4812 ret.is_owned = false;
4815 uint64_t __attribute__((export_name("TS_CResult_PhantomRouteHintsDecodeErrorZ_get_err"))) TS_CResult_PhantomRouteHintsDecodeErrorZ_get_err(uint64_t owner) {
4816 LDKCResult_PhantomRouteHintsDecodeErrorZ* owner_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(owner);
4817 LDKDecodeError ret_var = CResult_PhantomRouteHintsDecodeErrorZ_get_err(owner_conv);
4818 uint64_t ret_ref = 0;
4819 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4820 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4824 static inline LDKCVec_ChannelMonitorZ CVec_ChannelMonitorZ_clone(const LDKCVec_ChannelMonitorZ *orig) {
4825 LDKCVec_ChannelMonitorZ ret = { .data = MALLOC(sizeof(LDKChannelMonitor) * orig->datalen, "LDKCVec_ChannelMonitorZ clone bytes"), .datalen = orig->datalen };
4826 for (size_t i = 0; i < ret.datalen; i++) {
4827 ret.data[i] = ChannelMonitor_clone(&orig->data[i]);
4831 typedef struct LDKWatch_JCalls {
4832 atomic_size_t refcnt;
4833 uint32_t instance_ptr;
4835 static void LDKWatch_JCalls_free(void* this_arg) {
4836 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
4837 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
4841 LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_LDKWatch_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitor monitor) {
4842 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
4843 LDKOutPoint funding_txo_var = funding_txo;
4844 uint64_t funding_txo_ref = 0;
4845 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var);
4846 funding_txo_ref = tag_ptr(funding_txo_var.inner, funding_txo_var.is_owned);
4847 LDKChannelMonitor monitor_var = monitor;
4848 uint64_t monitor_ref = 0;
4849 CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_var);
4850 monitor_ref = tag_ptr(monitor_var.inner, monitor_var.is_owned);
4851 uint32_t ret = js_invoke_function_bbuuuu(j_calls->instance_ptr, 16, funding_txo_ref, monitor_ref, 0, 0, 0, 0);
4852 void* ret_ptr = untag_ptr(ret);
4853 CHECK_ACCESS(ret_ptr);
4854 LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
4855 FREE(untag_ptr(ret));
4858 LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_LDKWatch_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitorUpdate update) {
4859 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
4860 LDKOutPoint funding_txo_var = funding_txo;
4861 uint64_t funding_txo_ref = 0;
4862 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var);
4863 funding_txo_ref = tag_ptr(funding_txo_var.inner, funding_txo_var.is_owned);
4864 LDKChannelMonitorUpdate update_var = update;
4865 uint64_t update_ref = 0;
4866 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_var);
4867 update_ref = tag_ptr(update_var.inner, update_var.is_owned);
4868 uint32_t ret = js_invoke_function_bbuuuu(j_calls->instance_ptr, 17, funding_txo_ref, update_ref, 0, 0, 0, 0);
4869 void* ret_ptr = untag_ptr(ret);
4870 CHECK_ACCESS(ret_ptr);
4871 LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
4872 FREE(untag_ptr(ret));
4875 LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ release_pending_monitor_events_LDKWatch_jcall(const void* this_arg) {
4876 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
4877 uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 18, 0, 0, 0, 0, 0, 0);
4878 LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ ret_constr;
4879 ret_constr.datalen = ret->arr_len;
4880 if (ret_constr.datalen > 0)
4881 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ Elements");
4883 ret_constr.data = NULL;
4884 uint64_t* ret_vals = ret->elems;
4885 for (size_t x = 0; x < ret_constr.datalen; x++) {
4886 uint64_t ret_conv_49 = ret_vals[x];
4887 void* ret_conv_49_ptr = untag_ptr(ret_conv_49);
4888 CHECK_ACCESS(ret_conv_49_ptr);
4889 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ ret_conv_49_conv = *(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)(ret_conv_49_ptr);
4890 FREE(untag_ptr(ret_conv_49));
4891 ret_constr.data[x] = ret_conv_49_conv;
4896 static void LDKWatch_JCalls_cloned(LDKWatch* new_obj) {
4897 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) new_obj->this_arg;
4898 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
4900 static inline LDKWatch LDKWatch_init (JSValue o) {
4901 LDKWatch_JCalls *calls = MALLOC(sizeof(LDKWatch_JCalls), "LDKWatch_JCalls");
4902 atomic_init(&calls->refcnt, 1);
4903 calls->instance_ptr = o;
4906 .this_arg = (void*) calls,
4907 .watch_channel = watch_channel_LDKWatch_jcall,
4908 .update_channel = update_channel_LDKWatch_jcall,
4909 .release_pending_monitor_events = release_pending_monitor_events_LDKWatch_jcall,
4910 .free = LDKWatch_JCalls_free,
4914 uint64_t __attribute__((export_name("TS_LDKWatch_new"))) TS_LDKWatch_new(JSValue o) {
4915 LDKWatch *res_ptr = MALLOC(sizeof(LDKWatch), "LDKWatch");
4916 *res_ptr = LDKWatch_init(o);
4917 return tag_ptr(res_ptr, true);
4919 uint64_t __attribute__((export_name("TS_Watch_watch_channel"))) TS_Watch_watch_channel(uint64_t this_arg, uint64_t funding_txo, uint64_t monitor) {
4920 void* this_arg_ptr = untag_ptr(this_arg);
4921 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4922 LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
4923 LDKOutPoint funding_txo_conv;
4924 funding_txo_conv.inner = untag_ptr(funding_txo);
4925 funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
4926 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
4927 funding_txo_conv = OutPoint_clone(&funding_txo_conv);
4928 LDKChannelMonitor monitor_conv;
4929 monitor_conv.inner = untag_ptr(monitor);
4930 monitor_conv.is_owned = ptr_is_owned(monitor);
4931 CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_conv);
4932 monitor_conv = ChannelMonitor_clone(&monitor_conv);
4933 LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
4934 *ret_conv = (this_arg_conv->watch_channel)(this_arg_conv->this_arg, funding_txo_conv, monitor_conv);
4935 return tag_ptr(ret_conv, true);
4938 uint64_t __attribute__((export_name("TS_Watch_update_channel"))) TS_Watch_update_channel(uint64_t this_arg, uint64_t funding_txo, uint64_t update) {
4939 void* this_arg_ptr = untag_ptr(this_arg);
4940 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4941 LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
4942 LDKOutPoint funding_txo_conv;
4943 funding_txo_conv.inner = untag_ptr(funding_txo);
4944 funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
4945 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
4946 funding_txo_conv = OutPoint_clone(&funding_txo_conv);
4947 LDKChannelMonitorUpdate update_conv;
4948 update_conv.inner = untag_ptr(update);
4949 update_conv.is_owned = ptr_is_owned(update);
4950 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv);
4951 update_conv = ChannelMonitorUpdate_clone(&update_conv);
4952 LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
4953 *ret_conv = (this_arg_conv->update_channel)(this_arg_conv->this_arg, funding_txo_conv, update_conv);
4954 return tag_ptr(ret_conv, true);
4957 uint64_tArray __attribute__((export_name("TS_Watch_release_pending_monitor_events"))) TS_Watch_release_pending_monitor_events(uint64_t this_arg) {
4958 void* this_arg_ptr = untag_ptr(this_arg);
4959 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4960 LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
4961 LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ ret_var = (this_arg_conv->release_pending_monitor_events)(this_arg_conv->this_arg);
4962 uint64_tArray ret_arr = NULL;
4963 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
4964 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
4965 for (size_t x = 0; x < ret_var.datalen; x++) {
4966 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* ret_conv_49_conv = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ");
4967 *ret_conv_49_conv = ret_var.data[x];
4968 ret_arr_ptr[x] = tag_ptr(ret_conv_49_conv, true);
4975 typedef struct LDKBroadcasterInterface_JCalls {
4976 atomic_size_t refcnt;
4977 uint32_t instance_ptr;
4978 } LDKBroadcasterInterface_JCalls;
4979 static void LDKBroadcasterInterface_JCalls_free(void* this_arg) {
4980 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
4981 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
4985 void broadcast_transaction_LDKBroadcasterInterface_jcall(const void* this_arg, LDKTransaction tx) {
4986 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
4987 LDKTransaction tx_var = tx;
4988 int8_tArray tx_arr = init_int8_tArray(tx_var.datalen, __LINE__);
4989 memcpy(tx_arr->elems, tx_var.data, tx_var.datalen);
4990 Transaction_free(tx_var);
4991 js_invoke_function_uuuuuu(j_calls->instance_ptr, 19, (uint32_t)tx_arr, 0, 0, 0, 0, 0);
4993 static void LDKBroadcasterInterface_JCalls_cloned(LDKBroadcasterInterface* new_obj) {
4994 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) new_obj->this_arg;
4995 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
4997 static inline LDKBroadcasterInterface LDKBroadcasterInterface_init (JSValue o) {
4998 LDKBroadcasterInterface_JCalls *calls = MALLOC(sizeof(LDKBroadcasterInterface_JCalls), "LDKBroadcasterInterface_JCalls");
4999 atomic_init(&calls->refcnt, 1);
5000 calls->instance_ptr = o;
5002 LDKBroadcasterInterface ret = {
5003 .this_arg = (void*) calls,
5004 .broadcast_transaction = broadcast_transaction_LDKBroadcasterInterface_jcall,
5005 .free = LDKBroadcasterInterface_JCalls_free,
5009 uint64_t __attribute__((export_name("TS_LDKBroadcasterInterface_new"))) TS_LDKBroadcasterInterface_new(JSValue o) {
5010 LDKBroadcasterInterface *res_ptr = MALLOC(sizeof(LDKBroadcasterInterface), "LDKBroadcasterInterface");
5011 *res_ptr = LDKBroadcasterInterface_init(o);
5012 return tag_ptr(res_ptr, true);
5014 void __attribute__((export_name("TS_BroadcasterInterface_broadcast_transaction"))) TS_BroadcasterInterface_broadcast_transaction(uint64_t this_arg, int8_tArray tx) {
5015 void* this_arg_ptr = untag_ptr(this_arg);
5016 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5017 LDKBroadcasterInterface* this_arg_conv = (LDKBroadcasterInterface*)this_arg_ptr;
5018 LDKTransaction tx_ref;
5019 tx_ref.datalen = tx->arr_len;
5020 tx_ref.data = MALLOC(tx_ref.datalen, "LDKTransaction Bytes");
5021 memcpy(tx_ref.data, tx->elems, tx_ref.datalen); FREE(tx);
5022 tx_ref.data_is_owned = true;
5023 (this_arg_conv->broadcast_transaction)(this_arg_conv->this_arg, tx_ref);
5026 typedef struct LDKKeysInterface_JCalls {
5027 atomic_size_t refcnt;
5028 uint32_t instance_ptr;
5029 } LDKKeysInterface_JCalls;
5030 static void LDKKeysInterface_JCalls_free(void* this_arg) {
5031 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
5032 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
5036 LDKCResult_SecretKeyNoneZ get_node_secret_LDKKeysInterface_jcall(const void* this_arg, LDKRecipient recipient) {
5037 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
5038 uint32_t recipient_conv = LDKRecipient_to_js(recipient);
5039 uint32_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 20, recipient_conv, 0, 0, 0, 0, 0);
5040 void* ret_ptr = untag_ptr(ret);
5041 CHECK_ACCESS(ret_ptr);
5042 LDKCResult_SecretKeyNoneZ ret_conv = *(LDKCResult_SecretKeyNoneZ*)(ret_ptr);
5043 FREE(untag_ptr(ret));
5046 LDKCVec_u8Z get_destination_script_LDKKeysInterface_jcall(const void* this_arg) {
5047 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
5048 int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 21, 0, 0, 0, 0, 0, 0);
5049 LDKCVec_u8Z ret_ref;
5050 ret_ref.datalen = ret->arr_len;
5051 ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
5052 memcpy(ret_ref.data, ret->elems, ret_ref.datalen); FREE(ret);
5055 LDKShutdownScript get_shutdown_scriptpubkey_LDKKeysInterface_jcall(const void* this_arg) {
5056 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
5057 uint32_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 22, 0, 0, 0, 0, 0, 0);
5058 LDKShutdownScript ret_conv;
5059 ret_conv.inner = untag_ptr(ret);
5060 ret_conv.is_owned = ptr_is_owned(ret);
5061 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
5064 LDKSign get_channel_signer_LDKKeysInterface_jcall(const void* this_arg, bool inbound, uint64_t channel_value_satoshis) {
5065 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
5066 jboolean inbound_conv = inbound;
5067 int64_t channel_value_satoshis_conv = channel_value_satoshis;
5068 uint32_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 23, inbound_conv, channel_value_satoshis_conv, 0, 0, 0, 0);
5069 void* ret_ptr = untag_ptr(ret);
5070 CHECK_ACCESS(ret_ptr);
5071 LDKSign ret_conv = *(LDKSign*)(ret_ptr);
5072 FREE(untag_ptr(ret));
5075 LDKThirtyTwoBytes get_secure_random_bytes_LDKKeysInterface_jcall(const void* this_arg) {
5076 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
5077 int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 24, 0, 0, 0, 0, 0, 0);
5078 LDKThirtyTwoBytes ret_ref;
5079 CHECK(ret->arr_len == 32);
5080 memcpy(ret_ref.data, ret->elems, 32); FREE(ret);
5083 LDKCResult_SignDecodeErrorZ read_chan_signer_LDKKeysInterface_jcall(const void* this_arg, LDKu8slice reader) {
5084 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
5085 LDKu8slice reader_var = reader;
5086 int8_tArray reader_arr = init_int8_tArray(reader_var.datalen, __LINE__);
5087 memcpy(reader_arr->elems, reader_var.data, reader_var.datalen);
5088 uint32_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 25, (uint32_t)reader_arr, 0, 0, 0, 0, 0);
5089 void* ret_ptr = untag_ptr(ret);
5090 CHECK_ACCESS(ret_ptr);
5091 LDKCResult_SignDecodeErrorZ ret_conv = *(LDKCResult_SignDecodeErrorZ*)(ret_ptr);
5092 FREE(untag_ptr(ret));
5095 LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKKeysInterface_jcall(const void* this_arg, LDKu8slice hrp_bytes, LDKCVec_u5Z invoice_data, LDKRecipient receipient) {
5096 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
5097 LDKu8slice hrp_bytes_var = hrp_bytes;
5098 int8_tArray hrp_bytes_arr = init_int8_tArray(hrp_bytes_var.datalen, __LINE__);
5099 memcpy(hrp_bytes_arr->elems, hrp_bytes_var.data, hrp_bytes_var.datalen);
5100 LDKCVec_u5Z invoice_data_var = invoice_data;
5101 ptrArray invoice_data_arr = NULL;
5102 invoice_data_arr = init_ptrArray(invoice_data_var.datalen, __LINE__);
5103 int8_t *invoice_data_arr_ptr = (int8_t*)(((uint8_t*)invoice_data_arr) + 8);
5104 for (size_t h = 0; h < invoice_data_var.datalen; h++) {
5105 uint8_t invoice_data_conv_7_val = invoice_data_var.data[h]._0;
5106 invoice_data_arr_ptr[h] = invoice_data_conv_7_val;
5109 FREE(invoice_data_var.data);
5110 uint32_t receipient_conv = LDKRecipient_to_js(receipient);
5111 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);
5112 void* ret_ptr = untag_ptr(ret);
5113 CHECK_ACCESS(ret_ptr);
5114 LDKCResult_RecoverableSignatureNoneZ ret_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(ret_ptr);
5115 FREE(untag_ptr(ret));
5118 LDKThirtyTwoBytes get_inbound_payment_key_material_LDKKeysInterface_jcall(const void* this_arg) {
5119 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
5120 int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 27, 0, 0, 0, 0, 0, 0);
5121 LDKThirtyTwoBytes ret_ref;
5122 CHECK(ret->arr_len == 32);
5123 memcpy(ret_ref.data, ret->elems, 32); FREE(ret);
5126 static void LDKKeysInterface_JCalls_cloned(LDKKeysInterface* new_obj) {
5127 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) new_obj->this_arg;
5128 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
5130 static inline LDKKeysInterface LDKKeysInterface_init (JSValue o) {
5131 LDKKeysInterface_JCalls *calls = MALLOC(sizeof(LDKKeysInterface_JCalls), "LDKKeysInterface_JCalls");
5132 atomic_init(&calls->refcnt, 1);
5133 calls->instance_ptr = o;
5135 LDKKeysInterface ret = {
5136 .this_arg = (void*) calls,
5137 .get_node_secret = get_node_secret_LDKKeysInterface_jcall,
5138 .get_destination_script = get_destination_script_LDKKeysInterface_jcall,
5139 .get_shutdown_scriptpubkey = get_shutdown_scriptpubkey_LDKKeysInterface_jcall,
5140 .get_channel_signer = get_channel_signer_LDKKeysInterface_jcall,
5141 .get_secure_random_bytes = get_secure_random_bytes_LDKKeysInterface_jcall,
5142 .read_chan_signer = read_chan_signer_LDKKeysInterface_jcall,
5143 .sign_invoice = sign_invoice_LDKKeysInterface_jcall,
5144 .get_inbound_payment_key_material = get_inbound_payment_key_material_LDKKeysInterface_jcall,
5145 .free = LDKKeysInterface_JCalls_free,
5149 uint64_t __attribute__((export_name("TS_LDKKeysInterface_new"))) TS_LDKKeysInterface_new(JSValue o) {
5150 LDKKeysInterface *res_ptr = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
5151 *res_ptr = LDKKeysInterface_init(o);
5152 return tag_ptr(res_ptr, true);
5154 uint64_t __attribute__((export_name("TS_KeysInterface_get_node_secret"))) TS_KeysInterface_get_node_secret(uint64_t this_arg, uint32_t recipient) {
5155 void* this_arg_ptr = untag_ptr(this_arg);
5156 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5157 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
5158 LDKRecipient recipient_conv = LDKRecipient_from_js(recipient);
5159 LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ");
5160 *ret_conv = (this_arg_conv->get_node_secret)(this_arg_conv->this_arg, recipient_conv);
5161 return tag_ptr(ret_conv, true);
5164 int8_tArray __attribute__((export_name("TS_KeysInterface_get_destination_script"))) TS_KeysInterface_get_destination_script(uint64_t this_arg) {
5165 void* this_arg_ptr = untag_ptr(this_arg);
5166 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5167 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
5168 LDKCVec_u8Z ret_var = (this_arg_conv->get_destination_script)(this_arg_conv->this_arg);
5169 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
5170 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
5171 CVec_u8Z_free(ret_var);
5175 uint64_t __attribute__((export_name("TS_KeysInterface_get_shutdown_scriptpubkey"))) TS_KeysInterface_get_shutdown_scriptpubkey(uint64_t this_arg) {
5176 void* this_arg_ptr = untag_ptr(this_arg);
5177 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5178 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
5179 LDKShutdownScript ret_var = (this_arg_conv->get_shutdown_scriptpubkey)(this_arg_conv->this_arg);
5180 uint64_t ret_ref = 0;
5181 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5182 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5186 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) {
5187 void* this_arg_ptr = untag_ptr(this_arg);
5188 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5189 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
5190 LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
5191 *ret_ret = (this_arg_conv->get_channel_signer)(this_arg_conv->this_arg, inbound, channel_value_satoshis);
5192 return tag_ptr(ret_ret, true);
5195 int8_tArray __attribute__((export_name("TS_KeysInterface_get_secure_random_bytes"))) TS_KeysInterface_get_secure_random_bytes(uint64_t this_arg) {
5196 void* this_arg_ptr = untag_ptr(this_arg);
5197 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5198 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
5199 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
5200 memcpy(ret_arr->elems, (this_arg_conv->get_secure_random_bytes)(this_arg_conv->this_arg).data, 32);
5204 uint64_t __attribute__((export_name("TS_KeysInterface_read_chan_signer"))) TS_KeysInterface_read_chan_signer(uint64_t this_arg, int8_tArray reader) {
5205 void* this_arg_ptr = untag_ptr(this_arg);
5206 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5207 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
5208 LDKu8slice reader_ref;
5209 reader_ref.datalen = reader->arr_len;
5210 reader_ref.data = reader->elems;
5211 LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
5212 *ret_conv = (this_arg_conv->read_chan_signer)(this_arg_conv->this_arg, reader_ref);
5214 return tag_ptr(ret_conv, true);
5217 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) {
5218 void* this_arg_ptr = untag_ptr(this_arg);
5219 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5220 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
5221 LDKu8slice hrp_bytes_ref;
5222 hrp_bytes_ref.datalen = hrp_bytes->arr_len;
5223 hrp_bytes_ref.data = hrp_bytes->elems;
5224 LDKCVec_u5Z invoice_data_constr;
5225 invoice_data_constr.datalen = invoice_data->arr_len;
5226 if (invoice_data_constr.datalen > 0)
5227 invoice_data_constr.data = MALLOC(invoice_data_constr.datalen * sizeof(LDKu5), "LDKCVec_u5Z Elements");
5229 invoice_data_constr.data = NULL;
5230 int8_t* invoice_data_vals = (void*) invoice_data->elems;
5231 for (size_t h = 0; h < invoice_data_constr.datalen; h++) {
5232 int8_t invoice_data_conv_7 = invoice_data_vals[h];
5234 invoice_data_constr.data[h] = (LDKu5){ ._0 = invoice_data_conv_7 };
5237 LDKRecipient receipient_conv = LDKRecipient_from_js(receipient);
5238 LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
5239 *ret_conv = (this_arg_conv->sign_invoice)(this_arg_conv->this_arg, hrp_bytes_ref, invoice_data_constr, receipient_conv);
5241 return tag_ptr(ret_conv, true);
5244 int8_tArray __attribute__((export_name("TS_KeysInterface_get_inbound_payment_key_material"))) TS_KeysInterface_get_inbound_payment_key_material(uint64_t this_arg) {
5245 void* this_arg_ptr = untag_ptr(this_arg);
5246 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5247 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
5248 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
5249 memcpy(ret_arr->elems, (this_arg_conv->get_inbound_payment_key_material)(this_arg_conv->this_arg).data, 32);
5253 typedef struct LDKFeeEstimator_JCalls {
5254 atomic_size_t refcnt;
5255 uint32_t instance_ptr;
5256 } LDKFeeEstimator_JCalls;
5257 static void LDKFeeEstimator_JCalls_free(void* this_arg) {
5258 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
5259 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
5263 uint32_t get_est_sat_per_1000_weight_LDKFeeEstimator_jcall(const void* this_arg, LDKConfirmationTarget confirmation_target) {
5264 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
5265 uint32_t confirmation_target_conv = LDKConfirmationTarget_to_js(confirmation_target);
5266 return js_invoke_function_uuuuuu(j_calls->instance_ptr, 28, confirmation_target_conv, 0, 0, 0, 0, 0);
5268 static void LDKFeeEstimator_JCalls_cloned(LDKFeeEstimator* new_obj) {
5269 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) new_obj->this_arg;
5270 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
5272 static inline LDKFeeEstimator LDKFeeEstimator_init (JSValue o) {
5273 LDKFeeEstimator_JCalls *calls = MALLOC(sizeof(LDKFeeEstimator_JCalls), "LDKFeeEstimator_JCalls");
5274 atomic_init(&calls->refcnt, 1);
5275 calls->instance_ptr = o;
5277 LDKFeeEstimator ret = {
5278 .this_arg = (void*) calls,
5279 .get_est_sat_per_1000_weight = get_est_sat_per_1000_weight_LDKFeeEstimator_jcall,
5280 .free = LDKFeeEstimator_JCalls_free,
5284 uint64_t __attribute__((export_name("TS_LDKFeeEstimator_new"))) TS_LDKFeeEstimator_new(JSValue o) {
5285 LDKFeeEstimator *res_ptr = MALLOC(sizeof(LDKFeeEstimator), "LDKFeeEstimator");
5286 *res_ptr = LDKFeeEstimator_init(o);
5287 return tag_ptr(res_ptr, true);
5289 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) {
5290 void* this_arg_ptr = untag_ptr(this_arg);
5291 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5292 LDKFeeEstimator* this_arg_conv = (LDKFeeEstimator*)this_arg_ptr;
5293 LDKConfirmationTarget confirmation_target_conv = LDKConfirmationTarget_from_js(confirmation_target);
5294 int32_t ret_conv = (this_arg_conv->get_est_sat_per_1000_weight)(this_arg_conv->this_arg, confirmation_target_conv);
5298 static inline struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelManagerZ_get_a(LDKC2Tuple_BlockHashChannelManagerZ *NONNULL_PTR owner){
5299 return ThirtyTwoBytes_clone(&owner->a);
5301 int8_tArray __attribute__((export_name("TS_C2Tuple_BlockHashChannelManagerZ_get_a"))) TS_C2Tuple_BlockHashChannelManagerZ_get_a(uint64_t owner) {
5302 LDKC2Tuple_BlockHashChannelManagerZ* owner_conv = (LDKC2Tuple_BlockHashChannelManagerZ*)untag_ptr(owner);
5303 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
5304 memcpy(ret_arr->elems, C2Tuple_BlockHashChannelManagerZ_get_a(owner_conv).data, 32);
5308 static inline struct LDKChannelManager C2Tuple_BlockHashChannelManagerZ_get_b(LDKC2Tuple_BlockHashChannelManagerZ *NONNULL_PTR owner){
5309 LDKChannelManager ret = owner->b;
5310 ret.is_owned = false;
5313 uint64_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelManagerZ_get_b"))) TS_C2Tuple_BlockHashChannelManagerZ_get_b(uint64_t owner) {
5314 LDKC2Tuple_BlockHashChannelManagerZ* owner_conv = (LDKC2Tuple_BlockHashChannelManagerZ*)untag_ptr(owner);
5315 LDKChannelManager ret_var = C2Tuple_BlockHashChannelManagerZ_get_b(owner_conv);
5316 uint64_t ret_ref = 0;
5317 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5318 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5322 static inline struct LDKC2Tuple_BlockHashChannelManagerZ *CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *NONNULL_PTR owner){
5323 CHECK(owner->result_ok);
5324 return &*owner->contents.result;
5326 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(uint64_t owner) {
5327 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)untag_ptr(owner);
5328 uint64_t ret_ret = tag_ptr(CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(owner_conv), false);
5332 static inline struct LDKDecodeError CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *NONNULL_PTR owner){
5333 LDKDecodeError ret = *owner->contents.err;
5334 ret.is_owned = false;
5337 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(uint64_t owner) {
5338 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)untag_ptr(owner);
5339 LDKDecodeError ret_var = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(owner_conv);
5340 uint64_t ret_ref = 0;
5341 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5342 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5346 static inline struct LDKChannelConfig CResult_ChannelConfigDecodeErrorZ_get_ok(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR owner){
5347 LDKChannelConfig ret = *owner->contents.result;
5348 ret.is_owned = false;
5351 uint64_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_get_ok"))) TS_CResult_ChannelConfigDecodeErrorZ_get_ok(uint64_t owner) {
5352 LDKCResult_ChannelConfigDecodeErrorZ* owner_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(owner);
5353 LDKChannelConfig ret_var = CResult_ChannelConfigDecodeErrorZ_get_ok(owner_conv);
5354 uint64_t ret_ref = 0;
5355 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5356 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5360 static inline struct LDKDecodeError CResult_ChannelConfigDecodeErrorZ_get_err(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR owner){
5361 LDKDecodeError ret = *owner->contents.err;
5362 ret.is_owned = false;
5365 uint64_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_get_err"))) TS_CResult_ChannelConfigDecodeErrorZ_get_err(uint64_t owner) {
5366 LDKCResult_ChannelConfigDecodeErrorZ* owner_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(owner);
5367 LDKDecodeError ret_var = CResult_ChannelConfigDecodeErrorZ_get_err(owner_conv);
5368 uint64_t ret_ref = 0;
5369 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5370 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5374 static inline struct LDKOutPoint CResult_OutPointDecodeErrorZ_get_ok(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR owner){
5375 LDKOutPoint ret = *owner->contents.result;
5376 ret.is_owned = false;
5379 uint64_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_get_ok"))) TS_CResult_OutPointDecodeErrorZ_get_ok(uint64_t owner) {
5380 LDKCResult_OutPointDecodeErrorZ* owner_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(owner);
5381 LDKOutPoint ret_var = CResult_OutPointDecodeErrorZ_get_ok(owner_conv);
5382 uint64_t ret_ref = 0;
5383 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5384 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5388 static inline struct LDKDecodeError CResult_OutPointDecodeErrorZ_get_err(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR owner){
5389 LDKDecodeError ret = *owner->contents.err;
5390 ret.is_owned = false;
5393 uint64_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_get_err"))) TS_CResult_OutPointDecodeErrorZ_get_err(uint64_t owner) {
5394 LDKCResult_OutPointDecodeErrorZ* owner_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(owner);
5395 LDKDecodeError ret_var = CResult_OutPointDecodeErrorZ_get_err(owner_conv);
5396 uint64_t ret_ref = 0;
5397 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5398 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5402 typedef struct LDKType_JCalls {
5403 atomic_size_t refcnt;
5404 uint32_t instance_ptr;
5406 static void LDKType_JCalls_free(void* this_arg) {
5407 LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg;
5408 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
5412 uint16_t type_id_LDKType_jcall(const void* this_arg) {
5413 LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg;
5414 return js_invoke_function_uuuuuu(j_calls->instance_ptr, 29, 0, 0, 0, 0, 0, 0);
5416 LDKStr debug_str_LDKType_jcall(const void* this_arg) {
5417 LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg;
5418 jstring ret = (jstring)js_invoke_function_uuuuuu(j_calls->instance_ptr, 30, 0, 0, 0, 0, 0, 0);
5419 LDKStr ret_conv = str_ref_to_owned_c(ret);
5422 LDKCVec_u8Z write_LDKType_jcall(const void* this_arg) {
5423 LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg;
5424 int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 31, 0, 0, 0, 0, 0, 0);
5425 LDKCVec_u8Z ret_ref;
5426 ret_ref.datalen = ret->arr_len;
5427 ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
5428 memcpy(ret_ref.data, ret->elems, ret_ref.datalen); FREE(ret);
5431 static void LDKType_JCalls_cloned(LDKType* new_obj) {
5432 LDKType_JCalls *j_calls = (LDKType_JCalls*) new_obj->this_arg;
5433 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
5435 static inline LDKType LDKType_init (JSValue o) {
5436 LDKType_JCalls *calls = MALLOC(sizeof(LDKType_JCalls), "LDKType_JCalls");
5437 atomic_init(&calls->refcnt, 1);
5438 calls->instance_ptr = o;
5441 .this_arg = (void*) calls,
5442 .type_id = type_id_LDKType_jcall,
5443 .debug_str = debug_str_LDKType_jcall,
5444 .write = write_LDKType_jcall,
5445 .cloned = LDKType_JCalls_cloned,
5446 .free = LDKType_JCalls_free,
5450 uint64_t __attribute__((export_name("TS_LDKType_new"))) TS_LDKType_new(JSValue o) {
5451 LDKType *res_ptr = MALLOC(sizeof(LDKType), "LDKType");
5452 *res_ptr = LDKType_init(o);
5453 return tag_ptr(res_ptr, true);
5455 int16_t __attribute__((export_name("TS_Type_type_id"))) TS_Type_type_id(uint64_t this_arg) {
5456 void* this_arg_ptr = untag_ptr(this_arg);
5457 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5458 LDKType* this_arg_conv = (LDKType*)this_arg_ptr;
5459 int16_t ret_conv = (this_arg_conv->type_id)(this_arg_conv->this_arg);
5463 jstring __attribute__((export_name("TS_Type_debug_str"))) TS_Type_debug_str(uint64_t this_arg) {
5464 void* this_arg_ptr = untag_ptr(this_arg);
5465 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5466 LDKType* this_arg_conv = (LDKType*)this_arg_ptr;
5467 LDKStr ret_str = (this_arg_conv->debug_str)(this_arg_conv->this_arg);
5468 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
5473 int8_tArray __attribute__((export_name("TS_Type_write"))) TS_Type_write(uint64_t this_arg) {
5474 void* this_arg_ptr = untag_ptr(this_arg);
5475 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5476 LDKType* this_arg_conv = (LDKType*)this_arg_ptr;
5477 LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
5478 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
5479 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
5480 CVec_u8Z_free(ret_var);
5484 uint32_t __attribute__((export_name("TS_LDKCOption_TypeZ_ty_from_ptr"))) TS_LDKCOption_TypeZ_ty_from_ptr(uint64_t ptr) {
5485 LDKCOption_TypeZ *obj = (LDKCOption_TypeZ*)untag_ptr(ptr);
5487 case LDKCOption_TypeZ_Some: return 0;
5488 case LDKCOption_TypeZ_None: return 1;
5492 uint64_t __attribute__((export_name("TS_LDKCOption_TypeZ_Some_get_some"))) TS_LDKCOption_TypeZ_Some_get_some(uint64_t ptr) {
5493 LDKCOption_TypeZ *obj = (LDKCOption_TypeZ*)untag_ptr(ptr);
5494 assert(obj->tag == LDKCOption_TypeZ_Some);
5495 LDKType* some_ret = MALLOC(sizeof(LDKType), "LDKType");
5496 *some_ret = Type_clone(&obj->some);
5497 return tag_ptr(some_ret, true);
5499 static inline struct LDKCOption_TypeZ CResult_COption_TypeZDecodeErrorZ_get_ok(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR owner){
5500 CHECK(owner->result_ok);
5501 return COption_TypeZ_clone(&*owner->contents.result);
5503 uint64_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_get_ok"))) TS_CResult_COption_TypeZDecodeErrorZ_get_ok(uint64_t owner) {
5504 LDKCResult_COption_TypeZDecodeErrorZ* owner_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(owner);
5505 LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
5506 *ret_copy = CResult_COption_TypeZDecodeErrorZ_get_ok(owner_conv);
5507 uint64_t ret_ref = tag_ptr(ret_copy, true);
5511 static inline struct LDKDecodeError CResult_COption_TypeZDecodeErrorZ_get_err(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR owner){
5512 LDKDecodeError ret = *owner->contents.err;
5513 ret.is_owned = false;
5516 uint64_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_get_err"))) TS_CResult_COption_TypeZDecodeErrorZ_get_err(uint64_t owner) {
5517 LDKCResult_COption_TypeZDecodeErrorZ* owner_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(owner);
5518 LDKDecodeError ret_var = CResult_COption_TypeZDecodeErrorZ_get_err(owner_conv);
5519 uint64_t ret_ref = 0;
5520 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5521 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5525 uint32_t __attribute__((export_name("TS_LDKPaymentError_ty_from_ptr"))) TS_LDKPaymentError_ty_from_ptr(uint64_t ptr) {
5526 LDKPaymentError *obj = (LDKPaymentError*)untag_ptr(ptr);
5528 case LDKPaymentError_Invoice: return 0;
5529 case LDKPaymentError_Routing: return 1;
5530 case LDKPaymentError_Sending: return 2;
5534 jstring __attribute__((export_name("TS_LDKPaymentError_Invoice_get_invoice"))) TS_LDKPaymentError_Invoice_get_invoice(uint64_t ptr) {
5535 LDKPaymentError *obj = (LDKPaymentError*)untag_ptr(ptr);
5536 assert(obj->tag == LDKPaymentError_Invoice);
5537 LDKStr invoice_str = obj->invoice;
5538 jstring invoice_conv = str_ref_to_ts(invoice_str.chars, invoice_str.len);
5539 return invoice_conv;
5541 uint64_t __attribute__((export_name("TS_LDKPaymentError_Routing_get_routing"))) TS_LDKPaymentError_Routing_get_routing(uint64_t ptr) {
5542 LDKPaymentError *obj = (LDKPaymentError*)untag_ptr(ptr);
5543 assert(obj->tag == LDKPaymentError_Routing);
5544 LDKLightningError routing_var = obj->routing;
5545 uint64_t routing_ref = 0;
5546 CHECK_INNER_FIELD_ACCESS_OR_NULL(routing_var);
5547 routing_ref = tag_ptr(routing_var.inner, false);
5550 uint64_t __attribute__((export_name("TS_LDKPaymentError_Sending_get_sending"))) TS_LDKPaymentError_Sending_get_sending(uint64_t ptr) {
5551 LDKPaymentError *obj = (LDKPaymentError*)untag_ptr(ptr);
5552 assert(obj->tag == LDKPaymentError_Sending);
5553 uint64_t sending_ref = tag_ptr(&obj->sending, false);
5556 static inline struct LDKThirtyTwoBytes CResult_PaymentIdPaymentErrorZ_get_ok(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR owner){
5557 CHECK(owner->result_ok);
5558 return ThirtyTwoBytes_clone(&*owner->contents.result);
5560 int8_tArray __attribute__((export_name("TS_CResult_PaymentIdPaymentErrorZ_get_ok"))) TS_CResult_PaymentIdPaymentErrorZ_get_ok(uint64_t owner) {
5561 LDKCResult_PaymentIdPaymentErrorZ* owner_conv = (LDKCResult_PaymentIdPaymentErrorZ*)untag_ptr(owner);
5562 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
5563 memcpy(ret_arr->elems, CResult_PaymentIdPaymentErrorZ_get_ok(owner_conv).data, 32);
5567 static inline struct LDKPaymentError CResult_PaymentIdPaymentErrorZ_get_err(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR owner){
5568 CHECK(!owner->result_ok);
5569 return PaymentError_clone(&*owner->contents.err);
5571 uint64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentErrorZ_get_err"))) TS_CResult_PaymentIdPaymentErrorZ_get_err(uint64_t owner) {
5572 LDKCResult_PaymentIdPaymentErrorZ* owner_conv = (LDKCResult_PaymentIdPaymentErrorZ*)untag_ptr(owner);
5573 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
5574 *ret_copy = CResult_PaymentIdPaymentErrorZ_get_err(owner_conv);
5575 uint64_t ret_ref = tag_ptr(ret_copy, true);
5579 uint32_t __attribute__((export_name("TS_LDKParseError_ty_from_ptr"))) TS_LDKParseError_ty_from_ptr(uint64_t ptr) {
5580 LDKParseError *obj = (LDKParseError*)untag_ptr(ptr);
5582 case LDKParseError_Bech32Error: return 0;
5583 case LDKParseError_ParseAmountError: return 1;
5584 case LDKParseError_MalformedSignature: return 2;
5585 case LDKParseError_BadPrefix: return 3;
5586 case LDKParseError_UnknownCurrency: return 4;
5587 case LDKParseError_UnknownSiPrefix: return 5;
5588 case LDKParseError_MalformedHRP: return 6;
5589 case LDKParseError_TooShortDataPart: return 7;
5590 case LDKParseError_UnexpectedEndOfTaggedFields: return 8;
5591 case LDKParseError_DescriptionDecodeError: return 9;
5592 case LDKParseError_PaddingError: return 10;
5593 case LDKParseError_IntegerOverflowError: return 11;
5594 case LDKParseError_InvalidSegWitProgramLength: return 12;
5595 case LDKParseError_InvalidPubKeyHashLength: return 13;
5596 case LDKParseError_InvalidScriptHashLength: return 14;
5597 case LDKParseError_InvalidRecoveryId: return 15;
5598 case LDKParseError_InvalidSliceLength: return 16;
5599 case LDKParseError_Skip: return 17;
5603 uint64_t __attribute__((export_name("TS_LDKParseError_Bech32Error_get_bech32_error"))) TS_LDKParseError_Bech32Error_get_bech32_error(uint64_t ptr) {
5604 LDKParseError *obj = (LDKParseError*)untag_ptr(ptr);
5605 assert(obj->tag == LDKParseError_Bech32Error);
5606 uint64_t bech32_error_ref = tag_ptr(&obj->bech32_error, false);
5607 return bech32_error_ref;
5609 int32_t __attribute__((export_name("TS_LDKParseError_ParseAmountError_get_parse_amount_error"))) TS_LDKParseError_ParseAmountError_get_parse_amount_error(uint64_t ptr) {
5610 LDKParseError *obj = (LDKParseError*)untag_ptr(ptr);
5611 assert(obj->tag == LDKParseError_ParseAmountError);
5612 /*obj->parse_amount_error*/
5615 uint32_t __attribute__((export_name("TS_LDKParseError_MalformedSignature_get_malformed_signature"))) TS_LDKParseError_MalformedSignature_get_malformed_signature(uint64_t ptr) {
5616 LDKParseError *obj = (LDKParseError*)untag_ptr(ptr);
5617 assert(obj->tag == LDKParseError_MalformedSignature);
5618 uint32_t malformed_signature_conv = LDKSecp256k1Error_to_js(obj->malformed_signature);
5619 return malformed_signature_conv;
5621 int32_t __attribute__((export_name("TS_LDKParseError_DescriptionDecodeError_get_description_decode_error"))) TS_LDKParseError_DescriptionDecodeError_get_description_decode_error(uint64_t ptr) {
5622 LDKParseError *obj = (LDKParseError*)untag_ptr(ptr);
5623 assert(obj->tag == LDKParseError_DescriptionDecodeError);
5624 /*obj->description_decode_error*/
5627 jstring __attribute__((export_name("TS_LDKParseError_InvalidSliceLength_get_invalid_slice_length"))) TS_LDKParseError_InvalidSliceLength_get_invalid_slice_length(uint64_t ptr) {
5628 LDKParseError *obj = (LDKParseError*)untag_ptr(ptr);
5629 assert(obj->tag == LDKParseError_InvalidSliceLength);
5630 LDKStr invalid_slice_length_str = obj->invalid_slice_length;
5631 jstring invalid_slice_length_conv = str_ref_to_ts(invalid_slice_length_str.chars, invalid_slice_length_str.len);
5632 return invalid_slice_length_conv;
5634 static inline enum LDKSiPrefix CResult_SiPrefixParseErrorZ_get_ok(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR owner){
5635 CHECK(owner->result_ok);
5636 return SiPrefix_clone(&*owner->contents.result);
5638 uint32_t __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_get_ok"))) TS_CResult_SiPrefixParseErrorZ_get_ok(uint64_t owner) {
5639 LDKCResult_SiPrefixParseErrorZ* owner_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(owner);
5640 uint32_t ret_conv = LDKSiPrefix_to_js(CResult_SiPrefixParseErrorZ_get_ok(owner_conv));
5644 static inline struct LDKParseError CResult_SiPrefixParseErrorZ_get_err(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR owner){
5645 CHECK(!owner->result_ok);
5646 return ParseError_clone(&*owner->contents.err);
5648 uint64_t __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_get_err"))) TS_CResult_SiPrefixParseErrorZ_get_err(uint64_t owner) {
5649 LDKCResult_SiPrefixParseErrorZ* owner_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(owner);
5650 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
5651 *ret_copy = CResult_SiPrefixParseErrorZ_get_err(owner_conv);
5652 uint64_t ret_ref = tag_ptr(ret_copy, true);
5656 uint32_t __attribute__((export_name("TS_LDKParseOrSemanticError_ty_from_ptr"))) TS_LDKParseOrSemanticError_ty_from_ptr(uint64_t ptr) {
5657 LDKParseOrSemanticError *obj = (LDKParseOrSemanticError*)untag_ptr(ptr);
5659 case LDKParseOrSemanticError_ParseError: return 0;
5660 case LDKParseOrSemanticError_SemanticError: return 1;
5664 uint64_t __attribute__((export_name("TS_LDKParseOrSemanticError_ParseError_get_parse_error"))) TS_LDKParseOrSemanticError_ParseError_get_parse_error(uint64_t ptr) {
5665 LDKParseOrSemanticError *obj = (LDKParseOrSemanticError*)untag_ptr(ptr);
5666 assert(obj->tag == LDKParseOrSemanticError_ParseError);
5667 uint64_t parse_error_ref = tag_ptr(&obj->parse_error, false);
5668 return parse_error_ref;
5670 uint32_t __attribute__((export_name("TS_LDKParseOrSemanticError_SemanticError_get_semantic_error"))) TS_LDKParseOrSemanticError_SemanticError_get_semantic_error(uint64_t ptr) {
5671 LDKParseOrSemanticError *obj = (LDKParseOrSemanticError*)untag_ptr(ptr);
5672 assert(obj->tag == LDKParseOrSemanticError_SemanticError);
5673 uint32_t semantic_error_conv = LDKSemanticError_to_js(obj->semantic_error);
5674 return semantic_error_conv;
5676 static inline struct LDKInvoice CResult_InvoiceParseOrSemanticErrorZ_get_ok(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR owner){
5677 LDKInvoice ret = *owner->contents.result;
5678 ret.is_owned = false;
5681 uint64_t __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_get_ok"))) TS_CResult_InvoiceParseOrSemanticErrorZ_get_ok(uint64_t owner) {
5682 LDKCResult_InvoiceParseOrSemanticErrorZ* owner_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(owner);
5683 LDKInvoice ret_var = CResult_InvoiceParseOrSemanticErrorZ_get_ok(owner_conv);
5684 uint64_t ret_ref = 0;
5685 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5686 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5690 static inline struct LDKParseOrSemanticError CResult_InvoiceParseOrSemanticErrorZ_get_err(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR owner){
5691 CHECK(!owner->result_ok);
5692 return ParseOrSemanticError_clone(&*owner->contents.err);
5694 uint64_t __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_get_err"))) TS_CResult_InvoiceParseOrSemanticErrorZ_get_err(uint64_t owner) {
5695 LDKCResult_InvoiceParseOrSemanticErrorZ* owner_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(owner);
5696 LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError");
5697 *ret_copy = CResult_InvoiceParseOrSemanticErrorZ_get_err(owner_conv);
5698 uint64_t ret_ref = tag_ptr(ret_copy, true);
5702 static inline struct LDKSignedRawInvoice CResult_SignedRawInvoiceParseErrorZ_get_ok(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR owner){
5703 LDKSignedRawInvoice ret = *owner->contents.result;
5704 ret.is_owned = false;
5707 uint64_t __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_get_ok"))) TS_CResult_SignedRawInvoiceParseErrorZ_get_ok(uint64_t owner) {
5708 LDKCResult_SignedRawInvoiceParseErrorZ* owner_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(owner);
5709 LDKSignedRawInvoice ret_var = CResult_SignedRawInvoiceParseErrorZ_get_ok(owner_conv);
5710 uint64_t ret_ref = 0;
5711 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5712 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5716 static inline struct LDKParseError CResult_SignedRawInvoiceParseErrorZ_get_err(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR owner){
5717 CHECK(!owner->result_ok);
5718 return ParseError_clone(&*owner->contents.err);
5720 uint64_t __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_get_err"))) TS_CResult_SignedRawInvoiceParseErrorZ_get_err(uint64_t owner) {
5721 LDKCResult_SignedRawInvoiceParseErrorZ* owner_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(owner);
5722 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
5723 *ret_copy = CResult_SignedRawInvoiceParseErrorZ_get_err(owner_conv);
5724 uint64_t ret_ref = tag_ptr(ret_copy, true);
5728 static inline struct LDKRawInvoice C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner){
5729 LDKRawInvoice ret = owner->a;
5730 ret.is_owned = false;
5733 uint64_t __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(uint64_t owner) {
5734 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* owner_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(owner);
5735 LDKRawInvoice ret_var = C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(owner_conv);
5736 uint64_t ret_ref = 0;
5737 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5738 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5742 static inline struct LDKThirtyTwoBytes C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner){
5743 return ThirtyTwoBytes_clone(&owner->b);
5745 int8_tArray __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(uint64_t owner) {
5746 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* owner_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(owner);
5747 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
5748 memcpy(ret_arr->elems, C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(owner_conv).data, 32);
5752 static inline struct LDKInvoiceSignature C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner){
5753 LDKInvoiceSignature ret = owner->c;
5754 ret.is_owned = false;
5757 uint64_t __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(uint64_t owner) {
5758 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* owner_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(owner);
5759 LDKInvoiceSignature ret_var = C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(owner_conv);
5760 uint64_t ret_ref = 0;
5761 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5762 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5766 static inline struct LDKPayeePubKey CResult_PayeePubKeyErrorZ_get_ok(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR owner){
5767 LDKPayeePubKey ret = *owner->contents.result;
5768 ret.is_owned = false;
5771 uint64_t __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_get_ok"))) TS_CResult_PayeePubKeyErrorZ_get_ok(uint64_t owner) {
5772 LDKCResult_PayeePubKeyErrorZ* owner_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(owner);
5773 LDKPayeePubKey ret_var = CResult_PayeePubKeyErrorZ_get_ok(owner_conv);
5774 uint64_t ret_ref = 0;
5775 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5776 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5780 static inline enum LDKSecp256k1Error CResult_PayeePubKeyErrorZ_get_err(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR owner){
5781 CHECK(!owner->result_ok);
5782 return *owner->contents.err;
5784 uint32_t __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_get_err"))) TS_CResult_PayeePubKeyErrorZ_get_err(uint64_t owner) {
5785 LDKCResult_PayeePubKeyErrorZ* owner_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(owner);
5786 uint32_t ret_conv = LDKSecp256k1Error_to_js(CResult_PayeePubKeyErrorZ_get_err(owner_conv));
5790 static inline LDKCVec_PrivateRouteZ CVec_PrivateRouteZ_clone(const LDKCVec_PrivateRouteZ *orig) {
5791 LDKCVec_PrivateRouteZ ret = { .data = MALLOC(sizeof(LDKPrivateRoute) * orig->datalen, "LDKCVec_PrivateRouteZ clone bytes"), .datalen = orig->datalen };
5792 for (size_t i = 0; i < ret.datalen; i++) {
5793 ret.data[i] = PrivateRoute_clone(&orig->data[i]);
5797 static inline struct LDKPositiveTimestamp CResult_PositiveTimestampCreationErrorZ_get_ok(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR owner){
5798 LDKPositiveTimestamp ret = *owner->contents.result;
5799 ret.is_owned = false;
5802 uint64_t __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_get_ok"))) TS_CResult_PositiveTimestampCreationErrorZ_get_ok(uint64_t owner) {
5803 LDKCResult_PositiveTimestampCreationErrorZ* owner_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(owner);
5804 LDKPositiveTimestamp ret_var = CResult_PositiveTimestampCreationErrorZ_get_ok(owner_conv);
5805 uint64_t ret_ref = 0;
5806 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5807 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5811 static inline enum LDKCreationError CResult_PositiveTimestampCreationErrorZ_get_err(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR owner){
5812 CHECK(!owner->result_ok);
5813 return CreationError_clone(&*owner->contents.err);
5815 uint32_t __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_get_err"))) TS_CResult_PositiveTimestampCreationErrorZ_get_err(uint64_t owner) {
5816 LDKCResult_PositiveTimestampCreationErrorZ* owner_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(owner);
5817 uint32_t ret_conv = LDKCreationError_to_js(CResult_PositiveTimestampCreationErrorZ_get_err(owner_conv));
5821 static inline void CResult_NoneSemanticErrorZ_get_ok(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR owner){
5822 CHECK(owner->result_ok);
5823 return *owner->contents.result;
5825 void __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_get_ok"))) TS_CResult_NoneSemanticErrorZ_get_ok(uint64_t owner) {
5826 LDKCResult_NoneSemanticErrorZ* owner_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(owner);
5827 CResult_NoneSemanticErrorZ_get_ok(owner_conv);
5830 static inline enum LDKSemanticError CResult_NoneSemanticErrorZ_get_err(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR owner){
5831 CHECK(!owner->result_ok);
5832 return SemanticError_clone(&*owner->contents.err);
5834 uint32_t __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_get_err"))) TS_CResult_NoneSemanticErrorZ_get_err(uint64_t owner) {
5835 LDKCResult_NoneSemanticErrorZ* owner_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(owner);
5836 uint32_t ret_conv = LDKSemanticError_to_js(CResult_NoneSemanticErrorZ_get_err(owner_conv));
5840 static inline struct LDKInvoice CResult_InvoiceSemanticErrorZ_get_ok(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR owner){
5841 LDKInvoice ret = *owner->contents.result;
5842 ret.is_owned = false;
5845 uint64_t __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_get_ok"))) TS_CResult_InvoiceSemanticErrorZ_get_ok(uint64_t owner) {
5846 LDKCResult_InvoiceSemanticErrorZ* owner_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(owner);
5847 LDKInvoice ret_var = CResult_InvoiceSemanticErrorZ_get_ok(owner_conv);
5848 uint64_t ret_ref = 0;
5849 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5850 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5854 static inline enum LDKSemanticError CResult_InvoiceSemanticErrorZ_get_err(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR owner){
5855 CHECK(!owner->result_ok);
5856 return SemanticError_clone(&*owner->contents.err);
5858 uint32_t __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_get_err"))) TS_CResult_InvoiceSemanticErrorZ_get_err(uint64_t owner) {
5859 LDKCResult_InvoiceSemanticErrorZ* owner_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(owner);
5860 uint32_t ret_conv = LDKSemanticError_to_js(CResult_InvoiceSemanticErrorZ_get_err(owner_conv));
5864 static inline struct LDKDescription CResult_DescriptionCreationErrorZ_get_ok(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR owner){
5865 LDKDescription ret = *owner->contents.result;
5866 ret.is_owned = false;
5869 uint64_t __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_get_ok"))) TS_CResult_DescriptionCreationErrorZ_get_ok(uint64_t owner) {
5870 LDKCResult_DescriptionCreationErrorZ* owner_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(owner);
5871 LDKDescription ret_var = CResult_DescriptionCreationErrorZ_get_ok(owner_conv);
5872 uint64_t ret_ref = 0;
5873 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5874 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5878 static inline enum LDKCreationError CResult_DescriptionCreationErrorZ_get_err(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR owner){
5879 CHECK(!owner->result_ok);
5880 return CreationError_clone(&*owner->contents.err);
5882 uint32_t __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_get_err"))) TS_CResult_DescriptionCreationErrorZ_get_err(uint64_t owner) {
5883 LDKCResult_DescriptionCreationErrorZ* owner_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(owner);
5884 uint32_t ret_conv = LDKCreationError_to_js(CResult_DescriptionCreationErrorZ_get_err(owner_conv));
5888 static inline struct LDKPrivateRoute CResult_PrivateRouteCreationErrorZ_get_ok(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR owner){
5889 LDKPrivateRoute ret = *owner->contents.result;
5890 ret.is_owned = false;
5893 uint64_t __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_get_ok"))) TS_CResult_PrivateRouteCreationErrorZ_get_ok(uint64_t owner) {
5894 LDKCResult_PrivateRouteCreationErrorZ* owner_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(owner);
5895 LDKPrivateRoute ret_var = CResult_PrivateRouteCreationErrorZ_get_ok(owner_conv);
5896 uint64_t ret_ref = 0;
5897 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5898 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5902 static inline enum LDKCreationError CResult_PrivateRouteCreationErrorZ_get_err(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR owner){
5903 CHECK(!owner->result_ok);
5904 return CreationError_clone(&*owner->contents.err);
5906 uint32_t __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_get_err"))) TS_CResult_PrivateRouteCreationErrorZ_get_err(uint64_t owner) {
5907 LDKCResult_PrivateRouteCreationErrorZ* owner_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(owner);
5908 uint32_t ret_conv = LDKCreationError_to_js(CResult_PrivateRouteCreationErrorZ_get_err(owner_conv));
5912 static inline struct LDKStr CResult_StringErrorZ_get_ok(LDKCResult_StringErrorZ *NONNULL_PTR owner){
5913 CHECK(owner->result_ok);
5914 return *owner->contents.result;
5916 jstring __attribute__((export_name("TS_CResult_StringErrorZ_get_ok"))) TS_CResult_StringErrorZ_get_ok(uint64_t owner) {
5917 LDKCResult_StringErrorZ* owner_conv = (LDKCResult_StringErrorZ*)untag_ptr(owner);
5918 LDKStr ret_str = CResult_StringErrorZ_get_ok(owner_conv);
5919 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
5923 static inline enum LDKSecp256k1Error CResult_StringErrorZ_get_err(LDKCResult_StringErrorZ *NONNULL_PTR owner){
5924 CHECK(!owner->result_ok);
5925 return *owner->contents.err;
5927 uint32_t __attribute__((export_name("TS_CResult_StringErrorZ_get_err"))) TS_CResult_StringErrorZ_get_err(uint64_t owner) {
5928 LDKCResult_StringErrorZ* owner_conv = (LDKCResult_StringErrorZ*)untag_ptr(owner);
5929 uint32_t ret_conv = LDKSecp256k1Error_to_js(CResult_StringErrorZ_get_err(owner_conv));
5933 static inline struct LDKChannelMonitorUpdate CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR owner){
5934 LDKChannelMonitorUpdate ret = *owner->contents.result;
5935 ret.is_owned = false;
5938 uint64_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(uint64_t owner) {
5939 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(owner);
5940 LDKChannelMonitorUpdate ret_var = CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(owner_conv);
5941 uint64_t ret_ref = 0;
5942 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5943 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5947 static inline struct LDKDecodeError CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR owner){
5948 LDKDecodeError ret = *owner->contents.err;
5949 ret.is_owned = false;
5952 uint64_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_get_err"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(uint64_t owner) {
5953 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(owner);
5954 LDKDecodeError ret_var = CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(owner_conv);
5955 uint64_t ret_ref = 0;
5956 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5957 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5961 uint32_t __attribute__((export_name("TS_LDKCOption_MonitorEventZ_ty_from_ptr"))) TS_LDKCOption_MonitorEventZ_ty_from_ptr(uint64_t ptr) {
5962 LDKCOption_MonitorEventZ *obj = (LDKCOption_MonitorEventZ*)untag_ptr(ptr);
5964 case LDKCOption_MonitorEventZ_Some: return 0;
5965 case LDKCOption_MonitorEventZ_None: return 1;
5969 uint64_t __attribute__((export_name("TS_LDKCOption_MonitorEventZ_Some_get_some"))) TS_LDKCOption_MonitorEventZ_Some_get_some(uint64_t ptr) {
5970 LDKCOption_MonitorEventZ *obj = (LDKCOption_MonitorEventZ*)untag_ptr(ptr);
5971 assert(obj->tag == LDKCOption_MonitorEventZ_Some);
5972 uint64_t some_ref = tag_ptr(&obj->some, false);
5975 static inline struct LDKCOption_MonitorEventZ CResult_COption_MonitorEventZDecodeErrorZ_get_ok(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR owner){
5976 CHECK(owner->result_ok);
5977 return COption_MonitorEventZ_clone(&*owner->contents.result);
5979 uint64_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_get_ok"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_get_ok(uint64_t owner) {
5980 LDKCResult_COption_MonitorEventZDecodeErrorZ* owner_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(owner);
5981 LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
5982 *ret_copy = CResult_COption_MonitorEventZDecodeErrorZ_get_ok(owner_conv);
5983 uint64_t ret_ref = tag_ptr(ret_copy, true);
5987 static inline struct LDKDecodeError CResult_COption_MonitorEventZDecodeErrorZ_get_err(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR owner){
5988 LDKDecodeError ret = *owner->contents.err;
5989 ret.is_owned = false;
5992 uint64_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_get_err"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_get_err(uint64_t owner) {
5993 LDKCResult_COption_MonitorEventZDecodeErrorZ* owner_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(owner);
5994 LDKDecodeError ret_var = CResult_COption_MonitorEventZDecodeErrorZ_get_err(owner_conv);
5995 uint64_t ret_ref = 0;
5996 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5997 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6001 static inline struct LDKHTLCUpdate CResult_HTLCUpdateDecodeErrorZ_get_ok(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR owner){
6002 LDKHTLCUpdate ret = *owner->contents.result;
6003 ret.is_owned = false;
6006 uint64_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_get_ok"))) TS_CResult_HTLCUpdateDecodeErrorZ_get_ok(uint64_t owner) {
6007 LDKCResult_HTLCUpdateDecodeErrorZ* owner_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(owner);
6008 LDKHTLCUpdate ret_var = CResult_HTLCUpdateDecodeErrorZ_get_ok(owner_conv);
6009 uint64_t ret_ref = 0;
6010 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6011 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6015 static inline struct LDKDecodeError CResult_HTLCUpdateDecodeErrorZ_get_err(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR owner){
6016 LDKDecodeError ret = *owner->contents.err;
6017 ret.is_owned = false;
6020 uint64_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_get_err"))) TS_CResult_HTLCUpdateDecodeErrorZ_get_err(uint64_t owner) {
6021 LDKCResult_HTLCUpdateDecodeErrorZ* owner_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(owner);
6022 LDKDecodeError ret_var = CResult_HTLCUpdateDecodeErrorZ_get_err(owner_conv);
6023 uint64_t ret_ref = 0;
6024 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6025 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6029 static inline struct LDKOutPoint C2Tuple_OutPointScriptZ_get_a(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR owner){
6030 LDKOutPoint ret = owner->a;
6031 ret.is_owned = false;
6034 uint64_t __attribute__((export_name("TS_C2Tuple_OutPointScriptZ_get_a"))) TS_C2Tuple_OutPointScriptZ_get_a(uint64_t owner) {
6035 LDKC2Tuple_OutPointScriptZ* owner_conv = (LDKC2Tuple_OutPointScriptZ*)untag_ptr(owner);
6036 LDKOutPoint ret_var = C2Tuple_OutPointScriptZ_get_a(owner_conv);
6037 uint64_t ret_ref = 0;
6038 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6039 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6043 static inline struct LDKCVec_u8Z C2Tuple_OutPointScriptZ_get_b(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR owner){
6044 return CVec_u8Z_clone(&owner->b);
6046 int8_tArray __attribute__((export_name("TS_C2Tuple_OutPointScriptZ_get_b"))) TS_C2Tuple_OutPointScriptZ_get_b(uint64_t owner) {
6047 LDKC2Tuple_OutPointScriptZ* owner_conv = (LDKC2Tuple_OutPointScriptZ*)untag_ptr(owner);
6048 LDKCVec_u8Z ret_var = C2Tuple_OutPointScriptZ_get_b(owner_conv);
6049 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
6050 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
6051 CVec_u8Z_free(ret_var);
6055 static inline uint32_t C2Tuple_u32ScriptZ_get_a(LDKC2Tuple_u32ScriptZ *NONNULL_PTR owner){
6058 int32_t __attribute__((export_name("TS_C2Tuple_u32ScriptZ_get_a"))) TS_C2Tuple_u32ScriptZ_get_a(uint64_t owner) {
6059 LDKC2Tuple_u32ScriptZ* owner_conv = (LDKC2Tuple_u32ScriptZ*)untag_ptr(owner);
6060 int32_t ret_conv = C2Tuple_u32ScriptZ_get_a(owner_conv);
6064 static inline struct LDKCVec_u8Z C2Tuple_u32ScriptZ_get_b(LDKC2Tuple_u32ScriptZ *NONNULL_PTR owner){
6065 return CVec_u8Z_clone(&owner->b);
6067 int8_tArray __attribute__((export_name("TS_C2Tuple_u32ScriptZ_get_b"))) TS_C2Tuple_u32ScriptZ_get_b(uint64_t owner) {
6068 LDKC2Tuple_u32ScriptZ* owner_conv = (LDKC2Tuple_u32ScriptZ*)untag_ptr(owner);
6069 LDKCVec_u8Z ret_var = C2Tuple_u32ScriptZ_get_b(owner_conv);
6070 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
6071 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
6072 CVec_u8Z_free(ret_var);
6076 static inline LDKCVec_C2Tuple_u32ScriptZZ CVec_C2Tuple_u32ScriptZZ_clone(const LDKCVec_C2Tuple_u32ScriptZZ *orig) {
6077 LDKCVec_C2Tuple_u32ScriptZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ) * orig->datalen, "LDKCVec_C2Tuple_u32ScriptZZ clone bytes"), .datalen = orig->datalen };
6078 for (size_t i = 0; i < ret.datalen; i++) {
6079 ret.data[i] = C2Tuple_u32ScriptZ_clone(&orig->data[i]);
6083 static inline struct LDKThirtyTwoBytes C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR owner){
6084 return ThirtyTwoBytes_clone(&owner->a);
6086 int8_tArray __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a"))) TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(uint64_t owner) {
6087 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)untag_ptr(owner);
6088 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
6089 memcpy(ret_arr->elems, C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(owner_conv).data, 32);
6093 static inline struct LDKCVec_C2Tuple_u32ScriptZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR owner){
6094 return CVec_C2Tuple_u32ScriptZZ_clone(&owner->b);
6096 uint64_tArray __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b"))) TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(uint64_t owner) {
6097 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)untag_ptr(owner);
6098 LDKCVec_C2Tuple_u32ScriptZZ ret_var = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(owner_conv);
6099 uint64_tArray ret_arr = NULL;
6100 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
6101 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
6102 for (size_t v = 0; v < ret_var.datalen; v++) {
6103 LDKC2Tuple_u32ScriptZ* ret_conv_21_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ");
6104 *ret_conv_21_conv = ret_var.data[v];
6105 ret_arr_ptr[v] = tag_ptr(ret_conv_21_conv, true);
6112 static inline LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_clone(const LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ *orig) {
6113 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 };
6114 for (size_t i = 0; i < ret.datalen; i++) {
6115 ret.data[i] = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(&orig->data[i]);
6119 static inline LDKCVec_EventZ CVec_EventZ_clone(const LDKCVec_EventZ *orig) {
6120 LDKCVec_EventZ ret = { .data = MALLOC(sizeof(LDKEvent) * orig->datalen, "LDKCVec_EventZ clone bytes"), .datalen = orig->datalen };
6121 for (size_t i = 0; i < ret.datalen; i++) {
6122 ret.data[i] = Event_clone(&orig->data[i]);
6126 static inline uint32_t C2Tuple_u32TxOutZ_get_a(LDKC2Tuple_u32TxOutZ *NONNULL_PTR owner){
6129 int32_t __attribute__((export_name("TS_C2Tuple_u32TxOutZ_get_a"))) TS_C2Tuple_u32TxOutZ_get_a(uint64_t owner) {
6130 LDKC2Tuple_u32TxOutZ* owner_conv = (LDKC2Tuple_u32TxOutZ*)untag_ptr(owner);
6131 int32_t ret_conv = C2Tuple_u32TxOutZ_get_a(owner_conv);
6135 static inline struct LDKTxOut C2Tuple_u32TxOutZ_get_b(LDKC2Tuple_u32TxOutZ *NONNULL_PTR owner){
6136 return TxOut_clone(&owner->b);
6138 uint64_t __attribute__((export_name("TS_C2Tuple_u32TxOutZ_get_b"))) TS_C2Tuple_u32TxOutZ_get_b(uint64_t owner) {
6139 LDKC2Tuple_u32TxOutZ* owner_conv = (LDKC2Tuple_u32TxOutZ*)untag_ptr(owner);
6140 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
6141 *ret_ref = C2Tuple_u32TxOutZ_get_b(owner_conv);
6142 return tag_ptr(ret_ref, true);
6145 static inline LDKCVec_C2Tuple_u32TxOutZZ CVec_C2Tuple_u32TxOutZZ_clone(const LDKCVec_C2Tuple_u32TxOutZZ *orig) {
6146 LDKCVec_C2Tuple_u32TxOutZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ) * orig->datalen, "LDKCVec_C2Tuple_u32TxOutZZ clone bytes"), .datalen = orig->datalen };
6147 for (size_t i = 0; i < ret.datalen; i++) {
6148 ret.data[i] = C2Tuple_u32TxOutZ_clone(&orig->data[i]);
6152 static inline struct LDKThirtyTwoBytes C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR owner){
6153 return ThirtyTwoBytes_clone(&owner->a);
6155 int8_tArray __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a"))) TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(uint64_t owner) {
6156 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)untag_ptr(owner);
6157 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
6158 memcpy(ret_arr->elems, C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(owner_conv).data, 32);
6162 static inline struct LDKCVec_C2Tuple_u32TxOutZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR owner){
6163 return CVec_C2Tuple_u32TxOutZZ_clone(&owner->b);
6165 uint64_tArray __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b"))) TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(uint64_t owner) {
6166 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)untag_ptr(owner);
6167 LDKCVec_C2Tuple_u32TxOutZZ ret_var = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(owner_conv);
6168 uint64_tArray ret_arr = NULL;
6169 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
6170 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
6171 for (size_t u = 0; u < ret_var.datalen; u++) {
6172 LDKC2Tuple_u32TxOutZ* ret_conv_20_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
6173 *ret_conv_20_conv = ret_var.data[u];
6174 ret_arr_ptr[u] = tag_ptr(ret_conv_20_conv, true);
6181 static inline LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_clone(const LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ *orig) {
6182 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 };
6183 for (size_t i = 0; i < ret.datalen; i++) {
6184 ret.data[i] = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(&orig->data[i]);
6188 uint32_t __attribute__((export_name("TS_LDKBalance_ty_from_ptr"))) TS_LDKBalance_ty_from_ptr(uint64_t ptr) {
6189 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
6191 case LDKBalance_ClaimableOnChannelClose: return 0;
6192 case LDKBalance_ClaimableAwaitingConfirmations: return 1;
6193 case LDKBalance_ContentiousClaimable: return 2;
6194 case LDKBalance_MaybeClaimableHTLCAwaitingTimeout: return 3;
6198 int64_t __attribute__((export_name("TS_LDKBalance_ClaimableOnChannelClose_get_claimable_amount_satoshis"))) TS_LDKBalance_ClaimableOnChannelClose_get_claimable_amount_satoshis(uint64_t ptr) {
6199 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
6200 assert(obj->tag == LDKBalance_ClaimableOnChannelClose);
6201 int64_t claimable_amount_satoshis_conv = obj->claimable_on_channel_close.claimable_amount_satoshis;
6202 return claimable_amount_satoshis_conv;
6204 int64_t __attribute__((export_name("TS_LDKBalance_ClaimableAwaitingConfirmations_get_claimable_amount_satoshis"))) TS_LDKBalance_ClaimableAwaitingConfirmations_get_claimable_amount_satoshis(uint64_t ptr) {
6205 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
6206 assert(obj->tag == LDKBalance_ClaimableAwaitingConfirmations);
6207 int64_t claimable_amount_satoshis_conv = obj->claimable_awaiting_confirmations.claimable_amount_satoshis;
6208 return claimable_amount_satoshis_conv;
6210 int32_t __attribute__((export_name("TS_LDKBalance_ClaimableAwaitingConfirmations_get_confirmation_height"))) TS_LDKBalance_ClaimableAwaitingConfirmations_get_confirmation_height(uint64_t ptr) {
6211 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
6212 assert(obj->tag == LDKBalance_ClaimableAwaitingConfirmations);
6213 int32_t confirmation_height_conv = obj->claimable_awaiting_confirmations.confirmation_height;
6214 return confirmation_height_conv;
6216 int64_t __attribute__((export_name("TS_LDKBalance_ContentiousClaimable_get_claimable_amount_satoshis"))) TS_LDKBalance_ContentiousClaimable_get_claimable_amount_satoshis(uint64_t ptr) {
6217 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
6218 assert(obj->tag == LDKBalance_ContentiousClaimable);
6219 int64_t claimable_amount_satoshis_conv = obj->contentious_claimable.claimable_amount_satoshis;
6220 return claimable_amount_satoshis_conv;
6222 int32_t __attribute__((export_name("TS_LDKBalance_ContentiousClaimable_get_timeout_height"))) TS_LDKBalance_ContentiousClaimable_get_timeout_height(uint64_t ptr) {
6223 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
6224 assert(obj->tag == LDKBalance_ContentiousClaimable);
6225 int32_t timeout_height_conv = obj->contentious_claimable.timeout_height;
6226 return timeout_height_conv;
6228 int64_t __attribute__((export_name("TS_LDKBalance_MaybeClaimableHTLCAwaitingTimeout_get_claimable_amount_satoshis"))) TS_LDKBalance_MaybeClaimableHTLCAwaitingTimeout_get_claimable_amount_satoshis(uint64_t ptr) {
6229 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
6230 assert(obj->tag == LDKBalance_MaybeClaimableHTLCAwaitingTimeout);
6231 int64_t claimable_amount_satoshis_conv = obj->maybe_claimable_htlc_awaiting_timeout.claimable_amount_satoshis;
6232 return claimable_amount_satoshis_conv;
6234 int32_t __attribute__((export_name("TS_LDKBalance_MaybeClaimableHTLCAwaitingTimeout_get_claimable_height"))) TS_LDKBalance_MaybeClaimableHTLCAwaitingTimeout_get_claimable_height(uint64_t ptr) {
6235 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
6236 assert(obj->tag == LDKBalance_MaybeClaimableHTLCAwaitingTimeout);
6237 int32_t claimable_height_conv = obj->maybe_claimable_htlc_awaiting_timeout.claimable_height;
6238 return claimable_height_conv;
6240 static inline LDKCVec_BalanceZ CVec_BalanceZ_clone(const LDKCVec_BalanceZ *orig) {
6241 LDKCVec_BalanceZ ret = { .data = MALLOC(sizeof(LDKBalance) * orig->datalen, "LDKCVec_BalanceZ clone bytes"), .datalen = orig->datalen };
6242 for (size_t i = 0; i < ret.datalen; i++) {
6243 ret.data[i] = Balance_clone(&orig->data[i]);
6247 static inline struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelMonitorZ_get_a(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR owner){
6248 return ThirtyTwoBytes_clone(&owner->a);
6250 int8_tArray __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_get_a"))) TS_C2Tuple_BlockHashChannelMonitorZ_get_a(uint64_t owner) {
6251 LDKC2Tuple_BlockHashChannelMonitorZ* owner_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(owner);
6252 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
6253 memcpy(ret_arr->elems, C2Tuple_BlockHashChannelMonitorZ_get_a(owner_conv).data, 32);
6257 static inline struct LDKChannelMonitor C2Tuple_BlockHashChannelMonitorZ_get_b(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR owner){
6258 LDKChannelMonitor ret = owner->b;
6259 ret.is_owned = false;
6262 uint64_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_get_b"))) TS_C2Tuple_BlockHashChannelMonitorZ_get_b(uint64_t owner) {
6263 LDKC2Tuple_BlockHashChannelMonitorZ* owner_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(owner);
6264 LDKChannelMonitor ret_var = C2Tuple_BlockHashChannelMonitorZ_get_b(owner_conv);
6265 uint64_t ret_ref = 0;
6266 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6267 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6271 static inline struct LDKC2Tuple_BlockHashChannelMonitorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR owner){
6272 CHECK(owner->result_ok);
6273 return C2Tuple_BlockHashChannelMonitorZ_clone(&*owner->contents.result);
6275 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok(uint64_t owner) {
6276 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(owner);
6277 LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
6278 *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok(owner_conv);
6279 return tag_ptr(ret_conv, true);
6282 static inline struct LDKDecodeError CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR owner){
6283 LDKDecodeError ret = *owner->contents.err;
6284 ret.is_owned = false;
6287 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(uint64_t owner) {
6288 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(owner);
6289 LDKDecodeError ret_var = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(owner_conv);
6290 uint64_t ret_ref = 0;
6291 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6292 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6296 static inline struct LDKPublicKey C2Tuple_PublicKeyTypeZ_get_a(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR owner){
6299 int8_tArray __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_get_a"))) TS_C2Tuple_PublicKeyTypeZ_get_a(uint64_t owner) {
6300 LDKC2Tuple_PublicKeyTypeZ* owner_conv = (LDKC2Tuple_PublicKeyTypeZ*)untag_ptr(owner);
6301 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
6302 memcpy(ret_arr->elems, C2Tuple_PublicKeyTypeZ_get_a(owner_conv).compressed_form, 33);
6306 static inline struct LDKType C2Tuple_PublicKeyTypeZ_get_b(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR owner){
6307 return Type_clone(&owner->b);
6309 uint64_t __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_get_b"))) TS_C2Tuple_PublicKeyTypeZ_get_b(uint64_t owner) {
6310 LDKC2Tuple_PublicKeyTypeZ* owner_conv = (LDKC2Tuple_PublicKeyTypeZ*)untag_ptr(owner);
6311 LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType");
6312 *ret_ret = C2Tuple_PublicKeyTypeZ_get_b(owner_conv);
6313 return tag_ptr(ret_ret, true);
6316 static inline LDKCVec_C2Tuple_PublicKeyTypeZZ CVec_C2Tuple_PublicKeyTypeZZ_clone(const LDKCVec_C2Tuple_PublicKeyTypeZZ *orig) {
6317 LDKCVec_C2Tuple_PublicKeyTypeZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ) * orig->datalen, "LDKCVec_C2Tuple_PublicKeyTypeZZ clone bytes"), .datalen = orig->datalen };
6318 for (size_t i = 0; i < ret.datalen; i++) {
6319 ret.data[i] = C2Tuple_PublicKeyTypeZ_clone(&orig->data[i]);
6323 uint32_t __attribute__((export_name("TS_LDKCOption_NetAddressZ_ty_from_ptr"))) TS_LDKCOption_NetAddressZ_ty_from_ptr(uint64_t ptr) {
6324 LDKCOption_NetAddressZ *obj = (LDKCOption_NetAddressZ*)untag_ptr(ptr);
6326 case LDKCOption_NetAddressZ_Some: return 0;
6327 case LDKCOption_NetAddressZ_None: return 1;
6331 uint64_t __attribute__((export_name("TS_LDKCOption_NetAddressZ_Some_get_some"))) TS_LDKCOption_NetAddressZ_Some_get_some(uint64_t ptr) {
6332 LDKCOption_NetAddressZ *obj = (LDKCOption_NetAddressZ*)untag_ptr(ptr);
6333 assert(obj->tag == LDKCOption_NetAddressZ_Some);
6334 uint64_t some_ref = tag_ptr(&obj->some, false);
6337 static inline struct LDKCVec_u8Z CResult_CVec_u8ZPeerHandleErrorZ_get_ok(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR owner){
6338 CHECK(owner->result_ok);
6339 return CVec_u8Z_clone(&*owner->contents.result);
6341 int8_tArray __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_get_ok"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_get_ok(uint64_t owner) {
6342 LDKCResult_CVec_u8ZPeerHandleErrorZ* owner_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(owner);
6343 LDKCVec_u8Z ret_var = CResult_CVec_u8ZPeerHandleErrorZ_get_ok(owner_conv);
6344 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
6345 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
6346 CVec_u8Z_free(ret_var);
6350 static inline struct LDKPeerHandleError CResult_CVec_u8ZPeerHandleErrorZ_get_err(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR owner){
6351 LDKPeerHandleError ret = *owner->contents.err;
6352 ret.is_owned = false;
6355 uint64_t __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_get_err"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_get_err(uint64_t owner) {
6356 LDKCResult_CVec_u8ZPeerHandleErrorZ* owner_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(owner);
6357 LDKPeerHandleError ret_var = CResult_CVec_u8ZPeerHandleErrorZ_get_err(owner_conv);
6358 uint64_t ret_ref = 0;
6359 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6360 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6364 static inline void CResult_NonePeerHandleErrorZ_get_ok(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR owner){
6365 CHECK(owner->result_ok);
6366 return *owner->contents.result;
6368 void __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_get_ok"))) TS_CResult_NonePeerHandleErrorZ_get_ok(uint64_t owner) {
6369 LDKCResult_NonePeerHandleErrorZ* owner_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(owner);
6370 CResult_NonePeerHandleErrorZ_get_ok(owner_conv);
6373 static inline struct LDKPeerHandleError CResult_NonePeerHandleErrorZ_get_err(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR owner){
6374 LDKPeerHandleError ret = *owner->contents.err;
6375 ret.is_owned = false;
6378 uint64_t __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_get_err"))) TS_CResult_NonePeerHandleErrorZ_get_err(uint64_t owner) {
6379 LDKCResult_NonePeerHandleErrorZ* owner_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(owner);
6380 LDKPeerHandleError ret_var = CResult_NonePeerHandleErrorZ_get_err(owner_conv);
6381 uint64_t ret_ref = 0;
6382 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6383 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6387 static inline bool CResult_boolPeerHandleErrorZ_get_ok(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR owner){
6388 CHECK(owner->result_ok);
6389 return *owner->contents.result;
6391 jboolean __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_get_ok"))) TS_CResult_boolPeerHandleErrorZ_get_ok(uint64_t owner) {
6392 LDKCResult_boolPeerHandleErrorZ* owner_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(owner);
6393 jboolean ret_conv = CResult_boolPeerHandleErrorZ_get_ok(owner_conv);
6397 static inline struct LDKPeerHandleError CResult_boolPeerHandleErrorZ_get_err(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR owner){
6398 LDKPeerHandleError ret = *owner->contents.err;
6399 ret.is_owned = false;
6402 uint64_t __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_get_err"))) TS_CResult_boolPeerHandleErrorZ_get_err(uint64_t owner) {
6403 LDKCResult_boolPeerHandleErrorZ* owner_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(owner);
6404 LDKPeerHandleError ret_var = CResult_boolPeerHandleErrorZ_get_err(owner_conv);
6405 uint64_t ret_ref = 0;
6406 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6407 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6411 static inline void CResult_NoneErrorZ_get_ok(LDKCResult_NoneErrorZ *NONNULL_PTR owner){
6412 CHECK(owner->result_ok);
6413 return *owner->contents.result;
6415 void __attribute__((export_name("TS_CResult_NoneErrorZ_get_ok"))) TS_CResult_NoneErrorZ_get_ok(uint64_t owner) {
6416 LDKCResult_NoneErrorZ* owner_conv = (LDKCResult_NoneErrorZ*)untag_ptr(owner);
6417 CResult_NoneErrorZ_get_ok(owner_conv);
6420 static inline enum LDKIOError CResult_NoneErrorZ_get_err(LDKCResult_NoneErrorZ *NONNULL_PTR owner){
6421 CHECK(!owner->result_ok);
6422 return *owner->contents.err;
6424 uint32_t __attribute__((export_name("TS_CResult_NoneErrorZ_get_err"))) TS_CResult_NoneErrorZ_get_err(uint64_t owner) {
6425 LDKCResult_NoneErrorZ* owner_conv = (LDKCResult_NoneErrorZ*)untag_ptr(owner);
6426 uint32_t ret_conv = LDKIOError_to_js(CResult_NoneErrorZ_get_err(owner_conv));
6430 static inline struct LDKNetAddress CResult_NetAddressDecodeErrorZ_get_ok(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR owner){
6431 CHECK(owner->result_ok);
6432 return NetAddress_clone(&*owner->contents.result);
6434 uint64_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_get_ok"))) TS_CResult_NetAddressDecodeErrorZ_get_ok(uint64_t owner) {
6435 LDKCResult_NetAddressDecodeErrorZ* owner_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(owner);
6436 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
6437 *ret_copy = CResult_NetAddressDecodeErrorZ_get_ok(owner_conv);
6438 uint64_t ret_ref = tag_ptr(ret_copy, true);
6442 static inline struct LDKDecodeError CResult_NetAddressDecodeErrorZ_get_err(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR owner){
6443 LDKDecodeError ret = *owner->contents.err;
6444 ret.is_owned = false;
6447 uint64_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_get_err"))) TS_CResult_NetAddressDecodeErrorZ_get_err(uint64_t owner) {
6448 LDKCResult_NetAddressDecodeErrorZ* owner_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(owner);
6449 LDKDecodeError ret_var = CResult_NetAddressDecodeErrorZ_get_err(owner_conv);
6450 uint64_t ret_ref = 0;
6451 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6452 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6456 static inline LDKCVec_UpdateAddHTLCZ CVec_UpdateAddHTLCZ_clone(const LDKCVec_UpdateAddHTLCZ *orig) {
6457 LDKCVec_UpdateAddHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateAddHTLC) * orig->datalen, "LDKCVec_UpdateAddHTLCZ clone bytes"), .datalen = orig->datalen };
6458 for (size_t i = 0; i < ret.datalen; i++) {
6459 ret.data[i] = UpdateAddHTLC_clone(&orig->data[i]);
6463 static inline LDKCVec_UpdateFulfillHTLCZ CVec_UpdateFulfillHTLCZ_clone(const LDKCVec_UpdateFulfillHTLCZ *orig) {
6464 LDKCVec_UpdateFulfillHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFulfillHTLC) * orig->datalen, "LDKCVec_UpdateFulfillHTLCZ clone bytes"), .datalen = orig->datalen };
6465 for (size_t i = 0; i < ret.datalen; i++) {
6466 ret.data[i] = UpdateFulfillHTLC_clone(&orig->data[i]);
6470 static inline LDKCVec_UpdateFailHTLCZ CVec_UpdateFailHTLCZ_clone(const LDKCVec_UpdateFailHTLCZ *orig) {
6471 LDKCVec_UpdateFailHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFailHTLC) * orig->datalen, "LDKCVec_UpdateFailHTLCZ clone bytes"), .datalen = orig->datalen };
6472 for (size_t i = 0; i < ret.datalen; i++) {
6473 ret.data[i] = UpdateFailHTLC_clone(&orig->data[i]);
6477 static inline LDKCVec_UpdateFailMalformedHTLCZ CVec_UpdateFailMalformedHTLCZ_clone(const LDKCVec_UpdateFailMalformedHTLCZ *orig) {
6478 LDKCVec_UpdateFailMalformedHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFailMalformedHTLC) * orig->datalen, "LDKCVec_UpdateFailMalformedHTLCZ clone bytes"), .datalen = orig->datalen };
6479 for (size_t i = 0; i < ret.datalen; i++) {
6480 ret.data[i] = UpdateFailMalformedHTLC_clone(&orig->data[i]);
6484 static inline struct LDKAcceptChannel CResult_AcceptChannelDecodeErrorZ_get_ok(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR owner){
6485 LDKAcceptChannel ret = *owner->contents.result;
6486 ret.is_owned = false;
6489 uint64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_get_ok"))) TS_CResult_AcceptChannelDecodeErrorZ_get_ok(uint64_t owner) {
6490 LDKCResult_AcceptChannelDecodeErrorZ* owner_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(owner);
6491 LDKAcceptChannel ret_var = CResult_AcceptChannelDecodeErrorZ_get_ok(owner_conv);
6492 uint64_t ret_ref = 0;
6493 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6494 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6498 static inline struct LDKDecodeError CResult_AcceptChannelDecodeErrorZ_get_err(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR owner){
6499 LDKDecodeError ret = *owner->contents.err;
6500 ret.is_owned = false;
6503 uint64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_get_err"))) TS_CResult_AcceptChannelDecodeErrorZ_get_err(uint64_t owner) {
6504 LDKCResult_AcceptChannelDecodeErrorZ* owner_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(owner);
6505 LDKDecodeError ret_var = CResult_AcceptChannelDecodeErrorZ_get_err(owner_conv);
6506 uint64_t ret_ref = 0;
6507 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6508 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6512 static inline struct LDKAnnouncementSignatures CResult_AnnouncementSignaturesDecodeErrorZ_get_ok(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR owner){
6513 LDKAnnouncementSignatures ret = *owner->contents.result;
6514 ret.is_owned = false;
6517 uint64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_get_ok"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_get_ok(uint64_t owner) {
6518 LDKCResult_AnnouncementSignaturesDecodeErrorZ* owner_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(owner);
6519 LDKAnnouncementSignatures ret_var = CResult_AnnouncementSignaturesDecodeErrorZ_get_ok(owner_conv);
6520 uint64_t ret_ref = 0;
6521 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6522 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6526 static inline struct LDKDecodeError CResult_AnnouncementSignaturesDecodeErrorZ_get_err(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR owner){
6527 LDKDecodeError ret = *owner->contents.err;
6528 ret.is_owned = false;
6531 uint64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_get_err"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_get_err(uint64_t owner) {
6532 LDKCResult_AnnouncementSignaturesDecodeErrorZ* owner_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(owner);
6533 LDKDecodeError ret_var = CResult_AnnouncementSignaturesDecodeErrorZ_get_err(owner_conv);
6534 uint64_t ret_ref = 0;
6535 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6536 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6540 static inline struct LDKChannelReestablish CResult_ChannelReestablishDecodeErrorZ_get_ok(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR owner){
6541 LDKChannelReestablish ret = *owner->contents.result;
6542 ret.is_owned = false;
6545 uint64_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_get_ok"))) TS_CResult_ChannelReestablishDecodeErrorZ_get_ok(uint64_t owner) {
6546 LDKCResult_ChannelReestablishDecodeErrorZ* owner_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(owner);
6547 LDKChannelReestablish ret_var = CResult_ChannelReestablishDecodeErrorZ_get_ok(owner_conv);
6548 uint64_t ret_ref = 0;
6549 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6550 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6554 static inline struct LDKDecodeError CResult_ChannelReestablishDecodeErrorZ_get_err(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR owner){
6555 LDKDecodeError ret = *owner->contents.err;
6556 ret.is_owned = false;
6559 uint64_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_get_err"))) TS_CResult_ChannelReestablishDecodeErrorZ_get_err(uint64_t owner) {
6560 LDKCResult_ChannelReestablishDecodeErrorZ* owner_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(owner);
6561 LDKDecodeError ret_var = CResult_ChannelReestablishDecodeErrorZ_get_err(owner_conv);
6562 uint64_t ret_ref = 0;
6563 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6564 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6568 static inline struct LDKClosingSigned CResult_ClosingSignedDecodeErrorZ_get_ok(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR owner){
6569 LDKClosingSigned ret = *owner->contents.result;
6570 ret.is_owned = false;
6573 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_get_ok"))) TS_CResult_ClosingSignedDecodeErrorZ_get_ok(uint64_t owner) {
6574 LDKCResult_ClosingSignedDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(owner);
6575 LDKClosingSigned ret_var = CResult_ClosingSignedDecodeErrorZ_get_ok(owner_conv);
6576 uint64_t ret_ref = 0;
6577 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6578 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6582 static inline struct LDKDecodeError CResult_ClosingSignedDecodeErrorZ_get_err(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR owner){
6583 LDKDecodeError ret = *owner->contents.err;
6584 ret.is_owned = false;
6587 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_get_err"))) TS_CResult_ClosingSignedDecodeErrorZ_get_err(uint64_t owner) {
6588 LDKCResult_ClosingSignedDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(owner);
6589 LDKDecodeError ret_var = CResult_ClosingSignedDecodeErrorZ_get_err(owner_conv);
6590 uint64_t ret_ref = 0;
6591 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6592 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6596 static inline struct LDKClosingSignedFeeRange CResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR owner){
6597 LDKClosingSignedFeeRange ret = *owner->contents.result;
6598 ret.is_owned = false;
6601 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok(uint64_t owner) {
6602 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(owner);
6603 LDKClosingSignedFeeRange ret_var = CResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok(owner_conv);
6604 uint64_t ret_ref = 0;
6605 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6606 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6610 static inline struct LDKDecodeError CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR owner){
6611 LDKDecodeError ret = *owner->contents.err;
6612 ret.is_owned = false;
6615 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(uint64_t owner) {
6616 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(owner);
6617 LDKDecodeError ret_var = CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(owner_conv);
6618 uint64_t ret_ref = 0;
6619 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6620 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6624 static inline struct LDKCommitmentSigned CResult_CommitmentSignedDecodeErrorZ_get_ok(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR owner){
6625 LDKCommitmentSigned ret = *owner->contents.result;
6626 ret.is_owned = false;
6629 uint64_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_get_ok"))) TS_CResult_CommitmentSignedDecodeErrorZ_get_ok(uint64_t owner) {
6630 LDKCResult_CommitmentSignedDecodeErrorZ* owner_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(owner);
6631 LDKCommitmentSigned ret_var = CResult_CommitmentSignedDecodeErrorZ_get_ok(owner_conv);
6632 uint64_t ret_ref = 0;
6633 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6634 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6638 static inline struct LDKDecodeError CResult_CommitmentSignedDecodeErrorZ_get_err(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR owner){
6639 LDKDecodeError ret = *owner->contents.err;
6640 ret.is_owned = false;
6643 uint64_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_get_err"))) TS_CResult_CommitmentSignedDecodeErrorZ_get_err(uint64_t owner) {
6644 LDKCResult_CommitmentSignedDecodeErrorZ* owner_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(owner);
6645 LDKDecodeError ret_var = CResult_CommitmentSignedDecodeErrorZ_get_err(owner_conv);
6646 uint64_t ret_ref = 0;
6647 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6648 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6652 static inline struct LDKFundingCreated CResult_FundingCreatedDecodeErrorZ_get_ok(LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR owner){
6653 LDKFundingCreated ret = *owner->contents.result;
6654 ret.is_owned = false;
6657 uint64_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_get_ok"))) TS_CResult_FundingCreatedDecodeErrorZ_get_ok(uint64_t owner) {
6658 LDKCResult_FundingCreatedDecodeErrorZ* owner_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(owner);
6659 LDKFundingCreated ret_var = CResult_FundingCreatedDecodeErrorZ_get_ok(owner_conv);
6660 uint64_t ret_ref = 0;
6661 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6662 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6666 static inline struct LDKDecodeError CResult_FundingCreatedDecodeErrorZ_get_err(LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR owner){
6667 LDKDecodeError ret = *owner->contents.err;
6668 ret.is_owned = false;
6671 uint64_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_get_err"))) TS_CResult_FundingCreatedDecodeErrorZ_get_err(uint64_t owner) {
6672 LDKCResult_FundingCreatedDecodeErrorZ* owner_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(owner);
6673 LDKDecodeError ret_var = CResult_FundingCreatedDecodeErrorZ_get_err(owner_conv);
6674 uint64_t ret_ref = 0;
6675 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6676 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6680 static inline struct LDKFundingSigned CResult_FundingSignedDecodeErrorZ_get_ok(LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR owner){
6681 LDKFundingSigned ret = *owner->contents.result;
6682 ret.is_owned = false;
6685 uint64_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_get_ok"))) TS_CResult_FundingSignedDecodeErrorZ_get_ok(uint64_t owner) {
6686 LDKCResult_FundingSignedDecodeErrorZ* owner_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(owner);
6687 LDKFundingSigned ret_var = CResult_FundingSignedDecodeErrorZ_get_ok(owner_conv);
6688 uint64_t ret_ref = 0;
6689 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6690 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6694 static inline struct LDKDecodeError CResult_FundingSignedDecodeErrorZ_get_err(LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR owner){
6695 LDKDecodeError ret = *owner->contents.err;
6696 ret.is_owned = false;
6699 uint64_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_get_err"))) TS_CResult_FundingSignedDecodeErrorZ_get_err(uint64_t owner) {
6700 LDKCResult_FundingSignedDecodeErrorZ* owner_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(owner);
6701 LDKDecodeError ret_var = CResult_FundingSignedDecodeErrorZ_get_err(owner_conv);
6702 uint64_t ret_ref = 0;
6703 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6704 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6708 static inline struct LDKChannelReady CResult_ChannelReadyDecodeErrorZ_get_ok(LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR owner){
6709 LDKChannelReady ret = *owner->contents.result;
6710 ret.is_owned = false;
6713 uint64_t __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_get_ok"))) TS_CResult_ChannelReadyDecodeErrorZ_get_ok(uint64_t owner) {
6714 LDKCResult_ChannelReadyDecodeErrorZ* owner_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(owner);
6715 LDKChannelReady ret_var = CResult_ChannelReadyDecodeErrorZ_get_ok(owner_conv);
6716 uint64_t ret_ref = 0;
6717 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6718 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6722 static inline struct LDKDecodeError CResult_ChannelReadyDecodeErrorZ_get_err(LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR owner){
6723 LDKDecodeError ret = *owner->contents.err;
6724 ret.is_owned = false;
6727 uint64_t __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_get_err"))) TS_CResult_ChannelReadyDecodeErrorZ_get_err(uint64_t owner) {
6728 LDKCResult_ChannelReadyDecodeErrorZ* owner_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(owner);
6729 LDKDecodeError ret_var = CResult_ChannelReadyDecodeErrorZ_get_err(owner_conv);
6730 uint64_t ret_ref = 0;
6731 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6732 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6736 static inline struct LDKInit CResult_InitDecodeErrorZ_get_ok(LDKCResult_InitDecodeErrorZ *NONNULL_PTR owner){
6737 LDKInit ret = *owner->contents.result;
6738 ret.is_owned = false;
6741 uint64_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_get_ok"))) TS_CResult_InitDecodeErrorZ_get_ok(uint64_t owner) {
6742 LDKCResult_InitDecodeErrorZ* owner_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(owner);
6743 LDKInit ret_var = CResult_InitDecodeErrorZ_get_ok(owner_conv);
6744 uint64_t ret_ref = 0;
6745 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6746 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6750 static inline struct LDKDecodeError CResult_InitDecodeErrorZ_get_err(LDKCResult_InitDecodeErrorZ *NONNULL_PTR owner){
6751 LDKDecodeError ret = *owner->contents.err;
6752 ret.is_owned = false;
6755 uint64_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_get_err"))) TS_CResult_InitDecodeErrorZ_get_err(uint64_t owner) {
6756 LDKCResult_InitDecodeErrorZ* owner_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(owner);
6757 LDKDecodeError ret_var = CResult_InitDecodeErrorZ_get_err(owner_conv);
6758 uint64_t ret_ref = 0;
6759 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6760 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6764 static inline struct LDKOpenChannel CResult_OpenChannelDecodeErrorZ_get_ok(LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR owner){
6765 LDKOpenChannel ret = *owner->contents.result;
6766 ret.is_owned = false;
6769 uint64_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_get_ok"))) TS_CResult_OpenChannelDecodeErrorZ_get_ok(uint64_t owner) {
6770 LDKCResult_OpenChannelDecodeErrorZ* owner_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(owner);
6771 LDKOpenChannel ret_var = CResult_OpenChannelDecodeErrorZ_get_ok(owner_conv);
6772 uint64_t ret_ref = 0;
6773 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6774 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6778 static inline struct LDKDecodeError CResult_OpenChannelDecodeErrorZ_get_err(LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR owner){
6779 LDKDecodeError ret = *owner->contents.err;
6780 ret.is_owned = false;
6783 uint64_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_get_err"))) TS_CResult_OpenChannelDecodeErrorZ_get_err(uint64_t owner) {
6784 LDKCResult_OpenChannelDecodeErrorZ* owner_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(owner);
6785 LDKDecodeError ret_var = CResult_OpenChannelDecodeErrorZ_get_err(owner_conv);
6786 uint64_t ret_ref = 0;
6787 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6788 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6792 static inline struct LDKRevokeAndACK CResult_RevokeAndACKDecodeErrorZ_get_ok(LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR owner){
6793 LDKRevokeAndACK ret = *owner->contents.result;
6794 ret.is_owned = false;
6797 uint64_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_get_ok"))) TS_CResult_RevokeAndACKDecodeErrorZ_get_ok(uint64_t owner) {
6798 LDKCResult_RevokeAndACKDecodeErrorZ* owner_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(owner);
6799 LDKRevokeAndACK ret_var = CResult_RevokeAndACKDecodeErrorZ_get_ok(owner_conv);
6800 uint64_t ret_ref = 0;
6801 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6802 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6806 static inline struct LDKDecodeError CResult_RevokeAndACKDecodeErrorZ_get_err(LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR owner){
6807 LDKDecodeError ret = *owner->contents.err;
6808 ret.is_owned = false;
6811 uint64_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_get_err"))) TS_CResult_RevokeAndACKDecodeErrorZ_get_err(uint64_t owner) {
6812 LDKCResult_RevokeAndACKDecodeErrorZ* owner_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(owner);
6813 LDKDecodeError ret_var = CResult_RevokeAndACKDecodeErrorZ_get_err(owner_conv);
6814 uint64_t ret_ref = 0;
6815 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6816 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6820 static inline struct LDKShutdown CResult_ShutdownDecodeErrorZ_get_ok(LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR owner){
6821 LDKShutdown ret = *owner->contents.result;
6822 ret.is_owned = false;
6825 uint64_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_get_ok"))) TS_CResult_ShutdownDecodeErrorZ_get_ok(uint64_t owner) {
6826 LDKCResult_ShutdownDecodeErrorZ* owner_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(owner);
6827 LDKShutdown ret_var = CResult_ShutdownDecodeErrorZ_get_ok(owner_conv);
6828 uint64_t ret_ref = 0;
6829 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6830 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6834 static inline struct LDKDecodeError CResult_ShutdownDecodeErrorZ_get_err(LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR owner){
6835 LDKDecodeError ret = *owner->contents.err;
6836 ret.is_owned = false;
6839 uint64_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_get_err"))) TS_CResult_ShutdownDecodeErrorZ_get_err(uint64_t owner) {
6840 LDKCResult_ShutdownDecodeErrorZ* owner_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(owner);
6841 LDKDecodeError ret_var = CResult_ShutdownDecodeErrorZ_get_err(owner_conv);
6842 uint64_t ret_ref = 0;
6843 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6844 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6848 static inline struct LDKUpdateFailHTLC CResult_UpdateFailHTLCDecodeErrorZ_get_ok(LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR owner){
6849 LDKUpdateFailHTLC ret = *owner->contents.result;
6850 ret.is_owned = false;
6853 uint64_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_get_ok"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_get_ok(uint64_t owner) {
6854 LDKCResult_UpdateFailHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(owner);
6855 LDKUpdateFailHTLC ret_var = CResult_UpdateFailHTLCDecodeErrorZ_get_ok(owner_conv);
6856 uint64_t ret_ref = 0;
6857 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6858 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6862 static inline struct LDKDecodeError CResult_UpdateFailHTLCDecodeErrorZ_get_err(LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR owner){
6863 LDKDecodeError ret = *owner->contents.err;
6864 ret.is_owned = false;
6867 uint64_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_get_err"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_get_err(uint64_t owner) {
6868 LDKCResult_UpdateFailHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(owner);
6869 LDKDecodeError ret_var = CResult_UpdateFailHTLCDecodeErrorZ_get_err(owner_conv);
6870 uint64_t ret_ref = 0;
6871 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6872 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6876 static inline struct LDKUpdateFailMalformedHTLC CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_ok(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR owner){
6877 LDKUpdateFailMalformedHTLC ret = *owner->contents.result;
6878 ret.is_owned = false;
6881 uint64_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_ok"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_ok(uint64_t owner) {
6882 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(owner);
6883 LDKUpdateFailMalformedHTLC ret_var = CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_ok(owner_conv);
6884 uint64_t ret_ref = 0;
6885 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6886 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6890 static inline struct LDKDecodeError CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR owner){
6891 LDKDecodeError ret = *owner->contents.err;
6892 ret.is_owned = false;
6895 uint64_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(uint64_t owner) {
6896 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(owner);
6897 LDKDecodeError ret_var = CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(owner_conv);
6898 uint64_t ret_ref = 0;
6899 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6900 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6904 static inline struct LDKUpdateFee CResult_UpdateFeeDecodeErrorZ_get_ok(LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR owner){
6905 LDKUpdateFee ret = *owner->contents.result;
6906 ret.is_owned = false;
6909 uint64_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_get_ok"))) TS_CResult_UpdateFeeDecodeErrorZ_get_ok(uint64_t owner) {
6910 LDKCResult_UpdateFeeDecodeErrorZ* owner_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(owner);
6911 LDKUpdateFee ret_var = CResult_UpdateFeeDecodeErrorZ_get_ok(owner_conv);
6912 uint64_t ret_ref = 0;
6913 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6914 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6918 static inline struct LDKDecodeError CResult_UpdateFeeDecodeErrorZ_get_err(LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR owner){
6919 LDKDecodeError ret = *owner->contents.err;
6920 ret.is_owned = false;
6923 uint64_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_get_err"))) TS_CResult_UpdateFeeDecodeErrorZ_get_err(uint64_t owner) {
6924 LDKCResult_UpdateFeeDecodeErrorZ* owner_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(owner);
6925 LDKDecodeError ret_var = CResult_UpdateFeeDecodeErrorZ_get_err(owner_conv);
6926 uint64_t ret_ref = 0;
6927 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6928 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6932 static inline struct LDKUpdateFulfillHTLC CResult_UpdateFulfillHTLCDecodeErrorZ_get_ok(LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR owner){
6933 LDKUpdateFulfillHTLC ret = *owner->contents.result;
6934 ret.is_owned = false;
6937 uint64_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_get_ok"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_get_ok(uint64_t owner) {
6938 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(owner);
6939 LDKUpdateFulfillHTLC ret_var = CResult_UpdateFulfillHTLCDecodeErrorZ_get_ok(owner_conv);
6940 uint64_t ret_ref = 0;
6941 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6942 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6946 static inline struct LDKDecodeError CResult_UpdateFulfillHTLCDecodeErrorZ_get_err(LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR owner){
6947 LDKDecodeError ret = *owner->contents.err;
6948 ret.is_owned = false;
6951 uint64_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_get_err"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_get_err(uint64_t owner) {
6952 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(owner);
6953 LDKDecodeError ret_var = CResult_UpdateFulfillHTLCDecodeErrorZ_get_err(owner_conv);
6954 uint64_t ret_ref = 0;
6955 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6956 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6960 static inline struct LDKUpdateAddHTLC CResult_UpdateAddHTLCDecodeErrorZ_get_ok(LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR owner){
6961 LDKUpdateAddHTLC ret = *owner->contents.result;
6962 ret.is_owned = false;
6965 uint64_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_get_ok"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_get_ok(uint64_t owner) {
6966 LDKCResult_UpdateAddHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(owner);
6967 LDKUpdateAddHTLC ret_var = CResult_UpdateAddHTLCDecodeErrorZ_get_ok(owner_conv);
6968 uint64_t ret_ref = 0;
6969 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6970 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6974 static inline struct LDKDecodeError CResult_UpdateAddHTLCDecodeErrorZ_get_err(LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR owner){
6975 LDKDecodeError ret = *owner->contents.err;
6976 ret.is_owned = false;
6979 uint64_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_get_err"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_get_err(uint64_t owner) {
6980 LDKCResult_UpdateAddHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(owner);
6981 LDKDecodeError ret_var = CResult_UpdateAddHTLCDecodeErrorZ_get_err(owner_conv);
6982 uint64_t ret_ref = 0;
6983 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6984 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6988 static inline struct LDKPing CResult_PingDecodeErrorZ_get_ok(LDKCResult_PingDecodeErrorZ *NONNULL_PTR owner){
6989 LDKPing ret = *owner->contents.result;
6990 ret.is_owned = false;
6993 uint64_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_get_ok"))) TS_CResult_PingDecodeErrorZ_get_ok(uint64_t owner) {
6994 LDKCResult_PingDecodeErrorZ* owner_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(owner);
6995 LDKPing ret_var = CResult_PingDecodeErrorZ_get_ok(owner_conv);
6996 uint64_t ret_ref = 0;
6997 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6998 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7002 static inline struct LDKDecodeError CResult_PingDecodeErrorZ_get_err(LDKCResult_PingDecodeErrorZ *NONNULL_PTR owner){
7003 LDKDecodeError ret = *owner->contents.err;
7004 ret.is_owned = false;
7007 uint64_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_get_err"))) TS_CResult_PingDecodeErrorZ_get_err(uint64_t owner) {
7008 LDKCResult_PingDecodeErrorZ* owner_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(owner);
7009 LDKDecodeError ret_var = CResult_PingDecodeErrorZ_get_err(owner_conv);
7010 uint64_t ret_ref = 0;
7011 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7012 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7016 static inline struct LDKPong CResult_PongDecodeErrorZ_get_ok(LDKCResult_PongDecodeErrorZ *NONNULL_PTR owner){
7017 LDKPong ret = *owner->contents.result;
7018 ret.is_owned = false;
7021 uint64_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_get_ok"))) TS_CResult_PongDecodeErrorZ_get_ok(uint64_t owner) {
7022 LDKCResult_PongDecodeErrorZ* owner_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(owner);
7023 LDKPong ret_var = CResult_PongDecodeErrorZ_get_ok(owner_conv);
7024 uint64_t ret_ref = 0;
7025 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7026 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7030 static inline struct LDKDecodeError CResult_PongDecodeErrorZ_get_err(LDKCResult_PongDecodeErrorZ *NONNULL_PTR owner){
7031 LDKDecodeError ret = *owner->contents.err;
7032 ret.is_owned = false;
7035 uint64_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_get_err"))) TS_CResult_PongDecodeErrorZ_get_err(uint64_t owner) {
7036 LDKCResult_PongDecodeErrorZ* owner_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(owner);
7037 LDKDecodeError ret_var = CResult_PongDecodeErrorZ_get_err(owner_conv);
7038 uint64_t ret_ref = 0;
7039 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7040 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7044 static inline struct LDKUnsignedChannelAnnouncement CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR owner){
7045 LDKUnsignedChannelAnnouncement ret = *owner->contents.result;
7046 ret.is_owned = false;
7049 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok(uint64_t owner) {
7050 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(owner);
7051 LDKUnsignedChannelAnnouncement ret_var = CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok(owner_conv);
7052 uint64_t ret_ref = 0;
7053 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7054 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7058 static inline struct LDKDecodeError CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR owner){
7059 LDKDecodeError ret = *owner->contents.err;
7060 ret.is_owned = false;
7063 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(uint64_t owner) {
7064 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(owner);
7065 LDKDecodeError ret_var = CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(owner_conv);
7066 uint64_t ret_ref = 0;
7067 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7068 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7072 static inline struct LDKChannelAnnouncement CResult_ChannelAnnouncementDecodeErrorZ_get_ok(LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR owner){
7073 LDKChannelAnnouncement ret = *owner->contents.result;
7074 ret.is_owned = false;
7077 uint64_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_get_ok"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_get_ok(uint64_t owner) {
7078 LDKCResult_ChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(owner);
7079 LDKChannelAnnouncement ret_var = CResult_ChannelAnnouncementDecodeErrorZ_get_ok(owner_conv);
7080 uint64_t ret_ref = 0;
7081 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7082 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7086 static inline struct LDKDecodeError CResult_ChannelAnnouncementDecodeErrorZ_get_err(LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR owner){
7087 LDKDecodeError ret = *owner->contents.err;
7088 ret.is_owned = false;
7091 uint64_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_get_err"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_get_err(uint64_t owner) {
7092 LDKCResult_ChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(owner);
7093 LDKDecodeError ret_var = CResult_ChannelAnnouncementDecodeErrorZ_get_err(owner_conv);
7094 uint64_t ret_ref = 0;
7095 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7096 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7100 static inline struct LDKUnsignedChannelUpdate CResult_UnsignedChannelUpdateDecodeErrorZ_get_ok(LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR owner){
7101 LDKUnsignedChannelUpdate ret = *owner->contents.result;
7102 ret.is_owned = false;
7105 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_get_ok"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_get_ok(uint64_t owner) {
7106 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(owner);
7107 LDKUnsignedChannelUpdate ret_var = CResult_UnsignedChannelUpdateDecodeErrorZ_get_ok(owner_conv);
7108 uint64_t ret_ref = 0;
7109 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7110 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7114 static inline struct LDKDecodeError CResult_UnsignedChannelUpdateDecodeErrorZ_get_err(LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR owner){
7115 LDKDecodeError ret = *owner->contents.err;
7116 ret.is_owned = false;
7119 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_get_err"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_get_err(uint64_t owner) {
7120 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(owner);
7121 LDKDecodeError ret_var = CResult_UnsignedChannelUpdateDecodeErrorZ_get_err(owner_conv);
7122 uint64_t ret_ref = 0;
7123 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7124 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7128 static inline struct LDKChannelUpdate CResult_ChannelUpdateDecodeErrorZ_get_ok(LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR owner){
7129 LDKChannelUpdate ret = *owner->contents.result;
7130 ret.is_owned = false;
7133 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_get_ok"))) TS_CResult_ChannelUpdateDecodeErrorZ_get_ok(uint64_t owner) {
7134 LDKCResult_ChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(owner);
7135 LDKChannelUpdate ret_var = CResult_ChannelUpdateDecodeErrorZ_get_ok(owner_conv);
7136 uint64_t ret_ref = 0;
7137 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7138 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7142 static inline struct LDKDecodeError CResult_ChannelUpdateDecodeErrorZ_get_err(LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR owner){
7143 LDKDecodeError ret = *owner->contents.err;
7144 ret.is_owned = false;
7147 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_get_err"))) TS_CResult_ChannelUpdateDecodeErrorZ_get_err(uint64_t owner) {
7148 LDKCResult_ChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(owner);
7149 LDKDecodeError ret_var = CResult_ChannelUpdateDecodeErrorZ_get_err(owner_conv);
7150 uint64_t ret_ref = 0;
7151 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7152 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7156 static inline struct LDKErrorMessage CResult_ErrorMessageDecodeErrorZ_get_ok(LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR owner){
7157 LDKErrorMessage ret = *owner->contents.result;
7158 ret.is_owned = false;
7161 uint64_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_get_ok"))) TS_CResult_ErrorMessageDecodeErrorZ_get_ok(uint64_t owner) {
7162 LDKCResult_ErrorMessageDecodeErrorZ* owner_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(owner);
7163 LDKErrorMessage ret_var = CResult_ErrorMessageDecodeErrorZ_get_ok(owner_conv);
7164 uint64_t ret_ref = 0;
7165 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7166 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7170 static inline struct LDKDecodeError CResult_ErrorMessageDecodeErrorZ_get_err(LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR owner){
7171 LDKDecodeError ret = *owner->contents.err;
7172 ret.is_owned = false;
7175 uint64_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_get_err"))) TS_CResult_ErrorMessageDecodeErrorZ_get_err(uint64_t owner) {
7176 LDKCResult_ErrorMessageDecodeErrorZ* owner_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(owner);
7177 LDKDecodeError ret_var = CResult_ErrorMessageDecodeErrorZ_get_err(owner_conv);
7178 uint64_t ret_ref = 0;
7179 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7180 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7184 static inline struct LDKWarningMessage CResult_WarningMessageDecodeErrorZ_get_ok(LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR owner){
7185 LDKWarningMessage ret = *owner->contents.result;
7186 ret.is_owned = false;
7189 uint64_t __attribute__((export_name("TS_CResult_WarningMessageDecodeErrorZ_get_ok"))) TS_CResult_WarningMessageDecodeErrorZ_get_ok(uint64_t owner) {
7190 LDKCResult_WarningMessageDecodeErrorZ* owner_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(owner);
7191 LDKWarningMessage ret_var = CResult_WarningMessageDecodeErrorZ_get_ok(owner_conv);
7192 uint64_t ret_ref = 0;
7193 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7194 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7198 static inline struct LDKDecodeError CResult_WarningMessageDecodeErrorZ_get_err(LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR owner){
7199 LDKDecodeError ret = *owner->contents.err;
7200 ret.is_owned = false;
7203 uint64_t __attribute__((export_name("TS_CResult_WarningMessageDecodeErrorZ_get_err"))) TS_CResult_WarningMessageDecodeErrorZ_get_err(uint64_t owner) {
7204 LDKCResult_WarningMessageDecodeErrorZ* owner_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(owner);
7205 LDKDecodeError ret_var = CResult_WarningMessageDecodeErrorZ_get_err(owner_conv);
7206 uint64_t ret_ref = 0;
7207 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7208 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7212 static inline struct LDKUnsignedNodeAnnouncement CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR owner){
7213 LDKUnsignedNodeAnnouncement ret = *owner->contents.result;
7214 ret.is_owned = false;
7217 uint64_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok(uint64_t owner) {
7218 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(owner);
7219 LDKUnsignedNodeAnnouncement ret_var = CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok(owner_conv);
7220 uint64_t ret_ref = 0;
7221 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7222 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7226 static inline struct LDKDecodeError CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR owner){
7227 LDKDecodeError ret = *owner->contents.err;
7228 ret.is_owned = false;
7231 uint64_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(uint64_t owner) {
7232 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(owner);
7233 LDKDecodeError ret_var = CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(owner_conv);
7234 uint64_t ret_ref = 0;
7235 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7236 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7240 static inline struct LDKNodeAnnouncement CResult_NodeAnnouncementDecodeErrorZ_get_ok(LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR owner){
7241 LDKNodeAnnouncement ret = *owner->contents.result;
7242 ret.is_owned = false;
7245 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_get_ok"))) TS_CResult_NodeAnnouncementDecodeErrorZ_get_ok(uint64_t owner) {
7246 LDKCResult_NodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(owner);
7247 LDKNodeAnnouncement ret_var = CResult_NodeAnnouncementDecodeErrorZ_get_ok(owner_conv);
7248 uint64_t ret_ref = 0;
7249 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7250 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7254 static inline struct LDKDecodeError CResult_NodeAnnouncementDecodeErrorZ_get_err(LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR owner){
7255 LDKDecodeError ret = *owner->contents.err;
7256 ret.is_owned = false;
7259 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_get_err"))) TS_CResult_NodeAnnouncementDecodeErrorZ_get_err(uint64_t owner) {
7260 LDKCResult_NodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(owner);
7261 LDKDecodeError ret_var = CResult_NodeAnnouncementDecodeErrorZ_get_err(owner_conv);
7262 uint64_t ret_ref = 0;
7263 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7264 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7268 static inline struct LDKQueryShortChannelIds CResult_QueryShortChannelIdsDecodeErrorZ_get_ok(LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR owner){
7269 LDKQueryShortChannelIds ret = *owner->contents.result;
7270 ret.is_owned = false;
7273 uint64_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_get_ok"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_get_ok(uint64_t owner) {
7274 LDKCResult_QueryShortChannelIdsDecodeErrorZ* owner_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(owner);
7275 LDKQueryShortChannelIds ret_var = CResult_QueryShortChannelIdsDecodeErrorZ_get_ok(owner_conv);
7276 uint64_t ret_ref = 0;
7277 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7278 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7282 static inline struct LDKDecodeError CResult_QueryShortChannelIdsDecodeErrorZ_get_err(LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR owner){
7283 LDKDecodeError ret = *owner->contents.err;
7284 ret.is_owned = false;
7287 uint64_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_get_err"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_get_err(uint64_t owner) {
7288 LDKCResult_QueryShortChannelIdsDecodeErrorZ* owner_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(owner);
7289 LDKDecodeError ret_var = CResult_QueryShortChannelIdsDecodeErrorZ_get_err(owner_conv);
7290 uint64_t ret_ref = 0;
7291 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7292 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7296 static inline struct LDKReplyShortChannelIdsEnd CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR owner){
7297 LDKReplyShortChannelIdsEnd ret = *owner->contents.result;
7298 ret.is_owned = false;
7301 uint64_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok(uint64_t owner) {
7302 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* owner_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(owner);
7303 LDKReplyShortChannelIdsEnd ret_var = CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok(owner_conv);
7304 uint64_t ret_ref = 0;
7305 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7306 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7310 static inline struct LDKDecodeError CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR owner){
7311 LDKDecodeError ret = *owner->contents.err;
7312 ret.is_owned = false;
7315 uint64_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(uint64_t owner) {
7316 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* owner_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(owner);
7317 LDKDecodeError ret_var = CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(owner_conv);
7318 uint64_t ret_ref = 0;
7319 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7320 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7324 static inline struct LDKQueryChannelRange CResult_QueryChannelRangeDecodeErrorZ_get_ok(LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR owner){
7325 LDKQueryChannelRange ret = *owner->contents.result;
7326 ret.is_owned = false;
7329 uint64_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_get_ok"))) TS_CResult_QueryChannelRangeDecodeErrorZ_get_ok(uint64_t owner) {
7330 LDKCResult_QueryChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(owner);
7331 LDKQueryChannelRange ret_var = CResult_QueryChannelRangeDecodeErrorZ_get_ok(owner_conv);
7332 uint64_t ret_ref = 0;
7333 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7334 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7338 static inline struct LDKDecodeError CResult_QueryChannelRangeDecodeErrorZ_get_err(LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR owner){
7339 LDKDecodeError ret = *owner->contents.err;
7340 ret.is_owned = false;
7343 uint64_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_get_err"))) TS_CResult_QueryChannelRangeDecodeErrorZ_get_err(uint64_t owner) {
7344 LDKCResult_QueryChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(owner);
7345 LDKDecodeError ret_var = CResult_QueryChannelRangeDecodeErrorZ_get_err(owner_conv);
7346 uint64_t ret_ref = 0;
7347 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7348 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7352 static inline struct LDKReplyChannelRange CResult_ReplyChannelRangeDecodeErrorZ_get_ok(LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR owner){
7353 LDKReplyChannelRange ret = *owner->contents.result;
7354 ret.is_owned = false;
7357 uint64_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_get_ok"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_get_ok(uint64_t owner) {
7358 LDKCResult_ReplyChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(owner);
7359 LDKReplyChannelRange ret_var = CResult_ReplyChannelRangeDecodeErrorZ_get_ok(owner_conv);
7360 uint64_t ret_ref = 0;
7361 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7362 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7366 static inline struct LDKDecodeError CResult_ReplyChannelRangeDecodeErrorZ_get_err(LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR owner){
7367 LDKDecodeError ret = *owner->contents.err;
7368 ret.is_owned = false;
7371 uint64_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_get_err"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_get_err(uint64_t owner) {
7372 LDKCResult_ReplyChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(owner);
7373 LDKDecodeError ret_var = CResult_ReplyChannelRangeDecodeErrorZ_get_err(owner_conv);
7374 uint64_t ret_ref = 0;
7375 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7376 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7380 static inline struct LDKGossipTimestampFilter CResult_GossipTimestampFilterDecodeErrorZ_get_ok(LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR owner){
7381 LDKGossipTimestampFilter ret = *owner->contents.result;
7382 ret.is_owned = false;
7385 uint64_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_get_ok"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_get_ok(uint64_t owner) {
7386 LDKCResult_GossipTimestampFilterDecodeErrorZ* owner_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(owner);
7387 LDKGossipTimestampFilter ret_var = CResult_GossipTimestampFilterDecodeErrorZ_get_ok(owner_conv);
7388 uint64_t ret_ref = 0;
7389 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7390 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7394 static inline struct LDKDecodeError CResult_GossipTimestampFilterDecodeErrorZ_get_err(LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR owner){
7395 LDKDecodeError ret = *owner->contents.err;
7396 ret.is_owned = false;
7399 uint64_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_get_err"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_get_err(uint64_t owner) {
7400 LDKCResult_GossipTimestampFilterDecodeErrorZ* owner_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(owner);
7401 LDKDecodeError ret_var = CResult_GossipTimestampFilterDecodeErrorZ_get_err(owner_conv);
7402 uint64_t ret_ref = 0;
7403 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7404 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7408 uint32_t __attribute__((export_name("TS_LDKSignOrCreationError_ty_from_ptr"))) TS_LDKSignOrCreationError_ty_from_ptr(uint64_t ptr) {
7409 LDKSignOrCreationError *obj = (LDKSignOrCreationError*)untag_ptr(ptr);
7411 case LDKSignOrCreationError_SignError: return 0;
7412 case LDKSignOrCreationError_CreationError: return 1;
7416 uint32_t __attribute__((export_name("TS_LDKSignOrCreationError_CreationError_get_creation_error"))) TS_LDKSignOrCreationError_CreationError_get_creation_error(uint64_t ptr) {
7417 LDKSignOrCreationError *obj = (LDKSignOrCreationError*)untag_ptr(ptr);
7418 assert(obj->tag == LDKSignOrCreationError_CreationError);
7419 uint32_t creation_error_conv = LDKCreationError_to_js(obj->creation_error);
7420 return creation_error_conv;
7422 static inline struct LDKInvoice CResult_InvoiceSignOrCreationErrorZ_get_ok(LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR owner){
7423 LDKInvoice ret = *owner->contents.result;
7424 ret.is_owned = false;
7427 uint64_t __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_get_ok"))) TS_CResult_InvoiceSignOrCreationErrorZ_get_ok(uint64_t owner) {
7428 LDKCResult_InvoiceSignOrCreationErrorZ* owner_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(owner);
7429 LDKInvoice ret_var = CResult_InvoiceSignOrCreationErrorZ_get_ok(owner_conv);
7430 uint64_t ret_ref = 0;
7431 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7432 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7436 static inline struct LDKSignOrCreationError CResult_InvoiceSignOrCreationErrorZ_get_err(LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR owner){
7437 CHECK(!owner->result_ok);
7438 return SignOrCreationError_clone(&*owner->contents.err);
7440 uint64_t __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_get_err"))) TS_CResult_InvoiceSignOrCreationErrorZ_get_err(uint64_t owner) {
7441 LDKCResult_InvoiceSignOrCreationErrorZ* owner_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(owner);
7442 LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
7443 *ret_copy = CResult_InvoiceSignOrCreationErrorZ_get_err(owner_conv);
7444 uint64_t ret_ref = tag_ptr(ret_copy, true);
7448 typedef struct LDKFilter_JCalls {
7449 atomic_size_t refcnt;
7450 uint32_t instance_ptr;
7452 static void LDKFilter_JCalls_free(void* this_arg) {
7453 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
7454 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
7458 void register_tx_LDKFilter_jcall(const void* this_arg, const uint8_t (* txid)[32], LDKu8slice script_pubkey) {
7459 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
7460 int8_tArray txid_arr = init_int8_tArray(32, __LINE__);
7461 memcpy(txid_arr->elems, *txid, 32);
7462 LDKu8slice script_pubkey_var = script_pubkey;
7463 int8_tArray script_pubkey_arr = init_int8_tArray(script_pubkey_var.datalen, __LINE__);
7464 memcpy(script_pubkey_arr->elems, script_pubkey_var.data, script_pubkey_var.datalen);
7465 js_invoke_function_uuuuuu(j_calls->instance_ptr, 32, (uint32_t)txid_arr, (uint32_t)script_pubkey_arr, 0, 0, 0, 0);
7467 LDKCOption_C2Tuple_usizeTransactionZZ register_output_LDKFilter_jcall(const void* this_arg, LDKWatchedOutput output) {
7468 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
7469 LDKWatchedOutput output_var = output;
7470 uint64_t output_ref = 0;
7471 CHECK_INNER_FIELD_ACCESS_OR_NULL(output_var);
7472 output_ref = tag_ptr(output_var.inner, output_var.is_owned);
7473 uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 33, output_ref, 0, 0, 0, 0, 0);
7474 void* ret_ptr = untag_ptr(ret);
7475 CHECK_ACCESS(ret_ptr);
7476 LDKCOption_C2Tuple_usizeTransactionZZ ret_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(ret_ptr);
7477 FREE(untag_ptr(ret));
7480 static void LDKFilter_JCalls_cloned(LDKFilter* new_obj) {
7481 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) new_obj->this_arg;
7482 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
7484 static inline LDKFilter LDKFilter_init (JSValue o) {
7485 LDKFilter_JCalls *calls = MALLOC(sizeof(LDKFilter_JCalls), "LDKFilter_JCalls");
7486 atomic_init(&calls->refcnt, 1);
7487 calls->instance_ptr = o;
7490 .this_arg = (void*) calls,
7491 .register_tx = register_tx_LDKFilter_jcall,
7492 .register_output = register_output_LDKFilter_jcall,
7493 .free = LDKFilter_JCalls_free,
7497 uint64_t __attribute__((export_name("TS_LDKFilter_new"))) TS_LDKFilter_new(JSValue o) {
7498 LDKFilter *res_ptr = MALLOC(sizeof(LDKFilter), "LDKFilter");
7499 *res_ptr = LDKFilter_init(o);
7500 return tag_ptr(res_ptr, true);
7502 void __attribute__((export_name("TS_Filter_register_tx"))) TS_Filter_register_tx(uint64_t this_arg, int8_tArray txid, int8_tArray script_pubkey) {
7503 void* this_arg_ptr = untag_ptr(this_arg);
7504 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7505 LDKFilter* this_arg_conv = (LDKFilter*)this_arg_ptr;
7506 unsigned char txid_arr[32];
7507 CHECK(txid->arr_len == 32);
7508 memcpy(txid_arr, txid->elems, 32); FREE(txid);
7509 unsigned char (*txid_ref)[32] = &txid_arr;
7510 LDKu8slice script_pubkey_ref;
7511 script_pubkey_ref.datalen = script_pubkey->arr_len;
7512 script_pubkey_ref.data = script_pubkey->elems;
7513 (this_arg_conv->register_tx)(this_arg_conv->this_arg, txid_ref, script_pubkey_ref);
7514 FREE(script_pubkey);
7517 uint64_t __attribute__((export_name("TS_Filter_register_output"))) TS_Filter_register_output(uint64_t this_arg, uint64_t output) {
7518 void* this_arg_ptr = untag_ptr(this_arg);
7519 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7520 LDKFilter* this_arg_conv = (LDKFilter*)this_arg_ptr;
7521 LDKWatchedOutput output_conv;
7522 output_conv.inner = untag_ptr(output);
7523 output_conv.is_owned = ptr_is_owned(output);
7524 CHECK_INNER_FIELD_ACCESS_OR_NULL(output_conv);
7525 output_conv = WatchedOutput_clone(&output_conv);
7526 LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ");
7527 *ret_copy = (this_arg_conv->register_output)(this_arg_conv->this_arg, output_conv);
7528 uint64_t ret_ref = tag_ptr(ret_copy, true);
7532 uint32_t __attribute__((export_name("TS_LDKCOption_FilterZ_ty_from_ptr"))) TS_LDKCOption_FilterZ_ty_from_ptr(uint64_t ptr) {
7533 LDKCOption_FilterZ *obj = (LDKCOption_FilterZ*)untag_ptr(ptr);
7535 case LDKCOption_FilterZ_Some: return 0;
7536 case LDKCOption_FilterZ_None: return 1;
7540 uint64_t __attribute__((export_name("TS_LDKCOption_FilterZ_Some_get_some"))) TS_LDKCOption_FilterZ_Some_get_some(uint64_t ptr) {
7541 LDKCOption_FilterZ *obj = (LDKCOption_FilterZ*)untag_ptr(ptr);
7542 assert(obj->tag == LDKCOption_FilterZ_Some);
7543 LDKFilter* some_ret = MALLOC(sizeof(LDKFilter), "LDKFilter");
7544 *some_ret = obj->some;
7545 // WARNING: We likely need to clone here, but no clone is available, so we just do it for Java instances
7546 if ((*some_ret).free == LDKFilter_JCalls_free) {
7547 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
7548 LDKFilter_JCalls_cloned(&(*some_ret));
7550 return tag_ptr(some_ret, true);
7552 static inline struct LDKLockedChannelMonitor CResult_LockedChannelMonitorNoneZ_get_ok(LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR owner){
7553 LDKLockedChannelMonitor ret = *owner->contents.result;
7554 ret.is_owned = false;
7557 uint64_t __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_get_ok"))) TS_CResult_LockedChannelMonitorNoneZ_get_ok(uint64_t owner) {
7558 LDKCResult_LockedChannelMonitorNoneZ* owner_conv = (LDKCResult_LockedChannelMonitorNoneZ*)untag_ptr(owner);
7559 LDKLockedChannelMonitor ret_var = CResult_LockedChannelMonitorNoneZ_get_ok(owner_conv);
7560 uint64_t ret_ref = 0;
7561 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7562 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7566 static inline void CResult_LockedChannelMonitorNoneZ_get_err(LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR owner){
7567 CHECK(!owner->result_ok);
7568 return *owner->contents.err;
7570 void __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_get_err"))) TS_CResult_LockedChannelMonitorNoneZ_get_err(uint64_t owner) {
7571 LDKCResult_LockedChannelMonitorNoneZ* owner_conv = (LDKCResult_LockedChannelMonitorNoneZ*)untag_ptr(owner);
7572 CResult_LockedChannelMonitorNoneZ_get_err(owner_conv);
7575 static inline LDKCVec_OutPointZ CVec_OutPointZ_clone(const LDKCVec_OutPointZ *orig) {
7576 LDKCVec_OutPointZ ret = { .data = MALLOC(sizeof(LDKOutPoint) * orig->datalen, "LDKCVec_OutPointZ clone bytes"), .datalen = orig->datalen };
7577 for (size_t i = 0; i < ret.datalen; i++) {
7578 ret.data[i] = OutPoint_clone(&orig->data[i]);
7582 typedef struct LDKMessageSendEventsProvider_JCalls {
7583 atomic_size_t refcnt;
7584 uint32_t instance_ptr;
7585 } LDKMessageSendEventsProvider_JCalls;
7586 static void LDKMessageSendEventsProvider_JCalls_free(void* this_arg) {
7587 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
7588 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
7592 LDKCVec_MessageSendEventZ get_and_clear_pending_msg_events_LDKMessageSendEventsProvider_jcall(const void* this_arg) {
7593 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
7594 uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 34, 0, 0, 0, 0, 0, 0);
7595 LDKCVec_MessageSendEventZ ret_constr;
7596 ret_constr.datalen = ret->arr_len;
7597 if (ret_constr.datalen > 0)
7598 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKMessageSendEvent), "LDKCVec_MessageSendEventZ Elements");
7600 ret_constr.data = NULL;
7601 uint64_t* ret_vals = ret->elems;
7602 for (size_t s = 0; s < ret_constr.datalen; s++) {
7603 uint64_t ret_conv_18 = ret_vals[s];
7604 void* ret_conv_18_ptr = untag_ptr(ret_conv_18);
7605 CHECK_ACCESS(ret_conv_18_ptr);
7606 LDKMessageSendEvent ret_conv_18_conv = *(LDKMessageSendEvent*)(ret_conv_18_ptr);
7607 FREE(untag_ptr(ret_conv_18));
7608 ret_constr.data[s] = ret_conv_18_conv;
7613 static void LDKMessageSendEventsProvider_JCalls_cloned(LDKMessageSendEventsProvider* new_obj) {
7614 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) new_obj->this_arg;
7615 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
7617 static inline LDKMessageSendEventsProvider LDKMessageSendEventsProvider_init (JSValue o) {
7618 LDKMessageSendEventsProvider_JCalls *calls = MALLOC(sizeof(LDKMessageSendEventsProvider_JCalls), "LDKMessageSendEventsProvider_JCalls");
7619 atomic_init(&calls->refcnt, 1);
7620 calls->instance_ptr = o;
7622 LDKMessageSendEventsProvider ret = {
7623 .this_arg = (void*) calls,
7624 .get_and_clear_pending_msg_events = get_and_clear_pending_msg_events_LDKMessageSendEventsProvider_jcall,
7625 .free = LDKMessageSendEventsProvider_JCalls_free,
7629 uint64_t __attribute__((export_name("TS_LDKMessageSendEventsProvider_new"))) TS_LDKMessageSendEventsProvider_new(JSValue o) {
7630 LDKMessageSendEventsProvider *res_ptr = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
7631 *res_ptr = LDKMessageSendEventsProvider_init(o);
7632 return tag_ptr(res_ptr, true);
7634 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) {
7635 void* this_arg_ptr = untag_ptr(this_arg);
7636 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7637 LDKMessageSendEventsProvider* this_arg_conv = (LDKMessageSendEventsProvider*)this_arg_ptr;
7638 LDKCVec_MessageSendEventZ ret_var = (this_arg_conv->get_and_clear_pending_msg_events)(this_arg_conv->this_arg);
7639 uint64_tArray ret_arr = NULL;
7640 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
7641 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
7642 for (size_t s = 0; s < ret_var.datalen; s++) {
7643 LDKMessageSendEvent *ret_conv_18_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
7644 *ret_conv_18_copy = ret_var.data[s];
7645 uint64_t ret_conv_18_ref = tag_ptr(ret_conv_18_copy, true);
7646 ret_arr_ptr[s] = ret_conv_18_ref;
7653 typedef struct LDKEventHandler_JCalls {
7654 atomic_size_t refcnt;
7655 uint32_t instance_ptr;
7656 } LDKEventHandler_JCalls;
7657 static void LDKEventHandler_JCalls_free(void* this_arg) {
7658 LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) this_arg;
7659 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
7663 void handle_event_LDKEventHandler_jcall(const void* this_arg, const LDKEvent * event) {
7664 LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) this_arg;
7665 LDKEvent *ret_event = MALLOC(sizeof(LDKEvent), "LDKEvent ret conversion");
7666 *ret_event = Event_clone(event);
7667 uint64_t ref_event = tag_ptr(ret_event, true);
7668 js_invoke_function_buuuuu(j_calls->instance_ptr, 35, ref_event, 0, 0, 0, 0, 0);
7670 static void LDKEventHandler_JCalls_cloned(LDKEventHandler* new_obj) {
7671 LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) new_obj->this_arg;
7672 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
7674 static inline LDKEventHandler LDKEventHandler_init (JSValue o) {
7675 LDKEventHandler_JCalls *calls = MALLOC(sizeof(LDKEventHandler_JCalls), "LDKEventHandler_JCalls");
7676 atomic_init(&calls->refcnt, 1);
7677 calls->instance_ptr = o;
7679 LDKEventHandler ret = {
7680 .this_arg = (void*) calls,
7681 .handle_event = handle_event_LDKEventHandler_jcall,
7682 .free = LDKEventHandler_JCalls_free,
7686 uint64_t __attribute__((export_name("TS_LDKEventHandler_new"))) TS_LDKEventHandler_new(JSValue o) {
7687 LDKEventHandler *res_ptr = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
7688 *res_ptr = LDKEventHandler_init(o);
7689 return tag_ptr(res_ptr, true);
7691 void __attribute__((export_name("TS_EventHandler_handle_event"))) TS_EventHandler_handle_event(uint64_t this_arg, uint64_t event) {
7692 void* this_arg_ptr = untag_ptr(this_arg);
7693 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7694 LDKEventHandler* this_arg_conv = (LDKEventHandler*)this_arg_ptr;
7695 LDKEvent* event_conv = (LDKEvent*)untag_ptr(event);
7696 (this_arg_conv->handle_event)(this_arg_conv->this_arg, event_conv);
7699 typedef struct LDKEventsProvider_JCalls {
7700 atomic_size_t refcnt;
7701 uint32_t instance_ptr;
7702 } LDKEventsProvider_JCalls;
7703 static void LDKEventsProvider_JCalls_free(void* this_arg) {
7704 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
7705 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
7709 void process_pending_events_LDKEventsProvider_jcall(const void* this_arg, LDKEventHandler handler) {
7710 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
7711 LDKEventHandler* handler_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
7712 *handler_ret = handler;
7713 js_invoke_function_buuuuu(j_calls->instance_ptr, 36, tag_ptr(handler_ret, true), 0, 0, 0, 0, 0);
7715 static void LDKEventsProvider_JCalls_cloned(LDKEventsProvider* new_obj) {
7716 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) new_obj->this_arg;
7717 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
7719 static inline LDKEventsProvider LDKEventsProvider_init (JSValue o) {
7720 LDKEventsProvider_JCalls *calls = MALLOC(sizeof(LDKEventsProvider_JCalls), "LDKEventsProvider_JCalls");
7721 atomic_init(&calls->refcnt, 1);
7722 calls->instance_ptr = o;
7724 LDKEventsProvider ret = {
7725 .this_arg = (void*) calls,
7726 .process_pending_events = process_pending_events_LDKEventsProvider_jcall,
7727 .free = LDKEventsProvider_JCalls_free,
7731 uint64_t __attribute__((export_name("TS_LDKEventsProvider_new"))) TS_LDKEventsProvider_new(JSValue o) {
7732 LDKEventsProvider *res_ptr = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
7733 *res_ptr = LDKEventsProvider_init(o);
7734 return tag_ptr(res_ptr, true);
7736 void __attribute__((export_name("TS_EventsProvider_process_pending_events"))) TS_EventsProvider_process_pending_events(uint64_t this_arg, uint64_t handler) {
7737 void* this_arg_ptr = untag_ptr(this_arg);
7738 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7739 LDKEventsProvider* this_arg_conv = (LDKEventsProvider*)this_arg_ptr;
7740 void* handler_ptr = untag_ptr(handler);
7741 CHECK_ACCESS(handler_ptr);
7742 LDKEventHandler handler_conv = *(LDKEventHandler*)(handler_ptr);
7743 if (handler_conv.free == LDKEventHandler_JCalls_free) {
7744 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
7745 LDKEventHandler_JCalls_cloned(&handler_conv);
7747 (this_arg_conv->process_pending_events)(this_arg_conv->this_arg, handler_conv);
7750 typedef struct LDKScore_JCalls {
7751 atomic_size_t refcnt;
7752 uint32_t instance_ptr;
7754 static void LDKScore_JCalls_free(void* this_arg) {
7755 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
7756 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
7760 uint64_t channel_penalty_msat_LDKScore_jcall(const void* this_arg, uint64_t short_channel_id, const LDKNodeId * source, const LDKNodeId * target, LDKChannelUsage usage) {
7761 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
7762 int64_t short_channel_id_conv = short_channel_id;
7763 LDKNodeId source_var = *source;
7764 uint64_t source_ref = 0;
7765 source_var = NodeId_clone(&source_var);
7766 CHECK_INNER_FIELD_ACCESS_OR_NULL(source_var);
7767 source_ref = tag_ptr(source_var.inner, source_var.is_owned);
7768 LDKNodeId target_var = *target;
7769 uint64_t target_ref = 0;
7770 target_var = NodeId_clone(&target_var);
7771 CHECK_INNER_FIELD_ACCESS_OR_NULL(target_var);
7772 target_ref = tag_ptr(target_var.inner, target_var.is_owned);
7773 LDKChannelUsage usage_var = usage;
7774 uint64_t usage_ref = 0;
7775 CHECK_INNER_FIELD_ACCESS_OR_NULL(usage_var);
7776 usage_ref = tag_ptr(usage_var.inner, usage_var.is_owned);
7777 return js_invoke_function_bbbbuu(j_calls->instance_ptr, 37, short_channel_id_conv, source_ref, target_ref, usage_ref, 0, 0);
7779 void payment_path_failed_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path, uint64_t short_channel_id) {
7780 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
7781 LDKCVec_RouteHopZ path_var = path;
7782 uint64_tArray path_arr = NULL;
7783 path_arr = init_uint64_tArray(path_var.datalen, __LINE__);
7784 uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8);
7785 for (size_t k = 0; k < path_var.datalen; k++) {
7786 LDKRouteHop path_conv_10_var = path_var.data[k];
7787 uint64_t path_conv_10_ref = 0;
7788 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
7789 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, path_conv_10_var.is_owned);
7790 path_arr_ptr[k] = path_conv_10_ref;
7793 FREE(path_var.data);
7794 int64_t short_channel_id_conv = short_channel_id;
7795 js_invoke_function_ubuuuu(j_calls->instance_ptr, 38, (uint32_t)path_arr, short_channel_id_conv, 0, 0, 0, 0);
7797 void payment_path_successful_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path) {
7798 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
7799 LDKCVec_RouteHopZ path_var = path;
7800 uint64_tArray path_arr = NULL;
7801 path_arr = init_uint64_tArray(path_var.datalen, __LINE__);
7802 uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8);
7803 for (size_t k = 0; k < path_var.datalen; k++) {
7804 LDKRouteHop path_conv_10_var = path_var.data[k];
7805 uint64_t path_conv_10_ref = 0;
7806 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
7807 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, path_conv_10_var.is_owned);
7808 path_arr_ptr[k] = path_conv_10_ref;
7811 FREE(path_var.data);
7812 js_invoke_function_uuuuuu(j_calls->instance_ptr, 39, (uint32_t)path_arr, 0, 0, 0, 0, 0);
7814 void probe_failed_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path, uint64_t short_channel_id) {
7815 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
7816 LDKCVec_RouteHopZ path_var = path;
7817 uint64_tArray path_arr = NULL;
7818 path_arr = init_uint64_tArray(path_var.datalen, __LINE__);
7819 uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8);
7820 for (size_t k = 0; k < path_var.datalen; k++) {
7821 LDKRouteHop path_conv_10_var = path_var.data[k];
7822 uint64_t path_conv_10_ref = 0;
7823 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
7824 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, path_conv_10_var.is_owned);
7825 path_arr_ptr[k] = path_conv_10_ref;
7828 FREE(path_var.data);
7829 int64_t short_channel_id_conv = short_channel_id;
7830 js_invoke_function_ubuuuu(j_calls->instance_ptr, 40, (uint32_t)path_arr, short_channel_id_conv, 0, 0, 0, 0);
7832 void probe_successful_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path) {
7833 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
7834 LDKCVec_RouteHopZ path_var = path;
7835 uint64_tArray path_arr = NULL;
7836 path_arr = init_uint64_tArray(path_var.datalen, __LINE__);
7837 uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8);
7838 for (size_t k = 0; k < path_var.datalen; k++) {
7839 LDKRouteHop path_conv_10_var = path_var.data[k];
7840 uint64_t path_conv_10_ref = 0;
7841 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
7842 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, path_conv_10_var.is_owned);
7843 path_arr_ptr[k] = path_conv_10_ref;
7846 FREE(path_var.data);
7847 js_invoke_function_uuuuuu(j_calls->instance_ptr, 41, (uint32_t)path_arr, 0, 0, 0, 0, 0);
7849 LDKCVec_u8Z write_LDKScore_jcall(const void* this_arg) {
7850 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
7851 int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 42, 0, 0, 0, 0, 0, 0);
7852 LDKCVec_u8Z ret_ref;
7853 ret_ref.datalen = ret->arr_len;
7854 ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
7855 memcpy(ret_ref.data, ret->elems, ret_ref.datalen); FREE(ret);
7858 static void LDKScore_JCalls_cloned(LDKScore* new_obj) {
7859 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) new_obj->this_arg;
7860 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
7862 static inline LDKScore LDKScore_init (JSValue o) {
7863 LDKScore_JCalls *calls = MALLOC(sizeof(LDKScore_JCalls), "LDKScore_JCalls");
7864 atomic_init(&calls->refcnt, 1);
7865 calls->instance_ptr = o;
7868 .this_arg = (void*) calls,
7869 .channel_penalty_msat = channel_penalty_msat_LDKScore_jcall,
7870 .payment_path_failed = payment_path_failed_LDKScore_jcall,
7871 .payment_path_successful = payment_path_successful_LDKScore_jcall,
7872 .probe_failed = probe_failed_LDKScore_jcall,
7873 .probe_successful = probe_successful_LDKScore_jcall,
7874 .write = write_LDKScore_jcall,
7875 .free = LDKScore_JCalls_free,
7879 uint64_t __attribute__((export_name("TS_LDKScore_new"))) TS_LDKScore_new(JSValue o) {
7880 LDKScore *res_ptr = MALLOC(sizeof(LDKScore), "LDKScore");
7881 *res_ptr = LDKScore_init(o);
7882 return tag_ptr(res_ptr, true);
7884 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) {
7885 void* this_arg_ptr = untag_ptr(this_arg);
7886 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7887 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
7888 LDKNodeId source_conv;
7889 source_conv.inner = untag_ptr(source);
7890 source_conv.is_owned = ptr_is_owned(source);
7891 CHECK_INNER_FIELD_ACCESS_OR_NULL(source_conv);
7892 source_conv.is_owned = false;
7893 LDKNodeId target_conv;
7894 target_conv.inner = untag_ptr(target);
7895 target_conv.is_owned = ptr_is_owned(target);
7896 CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv);
7897 target_conv.is_owned = false;
7898 LDKChannelUsage usage_conv;
7899 usage_conv.inner = untag_ptr(usage);
7900 usage_conv.is_owned = ptr_is_owned(usage);
7901 CHECK_INNER_FIELD_ACCESS_OR_NULL(usage_conv);
7902 usage_conv = ChannelUsage_clone(&usage_conv);
7903 int64_t ret_conv = (this_arg_conv->channel_penalty_msat)(this_arg_conv->this_arg, short_channel_id, &source_conv, &target_conv, usage_conv);
7907 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) {
7908 void* this_arg_ptr = untag_ptr(this_arg);
7909 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7910 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
7911 LDKCVec_RouteHopZ path_constr;
7912 path_constr.datalen = path->arr_len;
7913 if (path_constr.datalen > 0)
7914 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
7916 path_constr.data = NULL;
7917 uint64_t* path_vals = path->elems;
7918 for (size_t k = 0; k < path_constr.datalen; k++) {
7919 uint64_t path_conv_10 = path_vals[k];
7920 LDKRouteHop path_conv_10_conv;
7921 path_conv_10_conv.inner = untag_ptr(path_conv_10);
7922 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
7923 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
7924 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
7925 path_constr.data[k] = path_conv_10_conv;
7928 (this_arg_conv->payment_path_failed)(this_arg_conv->this_arg, path_constr, short_channel_id);
7931 void __attribute__((export_name("TS_Score_payment_path_successful"))) TS_Score_payment_path_successful(uint64_t this_arg, uint64_tArray path) {
7932 void* this_arg_ptr = untag_ptr(this_arg);
7933 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7934 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
7935 LDKCVec_RouteHopZ path_constr;
7936 path_constr.datalen = path->arr_len;
7937 if (path_constr.datalen > 0)
7938 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
7940 path_constr.data = NULL;
7941 uint64_t* path_vals = path->elems;
7942 for (size_t k = 0; k < path_constr.datalen; k++) {
7943 uint64_t path_conv_10 = path_vals[k];
7944 LDKRouteHop path_conv_10_conv;
7945 path_conv_10_conv.inner = untag_ptr(path_conv_10);
7946 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
7947 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
7948 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
7949 path_constr.data[k] = path_conv_10_conv;
7952 (this_arg_conv->payment_path_successful)(this_arg_conv->this_arg, path_constr);
7955 void __attribute__((export_name("TS_Score_probe_failed"))) TS_Score_probe_failed(uint64_t this_arg, uint64_tArray path, int64_t short_channel_id) {
7956 void* this_arg_ptr = untag_ptr(this_arg);
7957 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7958 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
7959 LDKCVec_RouteHopZ path_constr;
7960 path_constr.datalen = path->arr_len;
7961 if (path_constr.datalen > 0)
7962 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
7964 path_constr.data = NULL;
7965 uint64_t* path_vals = path->elems;
7966 for (size_t k = 0; k < path_constr.datalen; k++) {
7967 uint64_t path_conv_10 = path_vals[k];
7968 LDKRouteHop path_conv_10_conv;
7969 path_conv_10_conv.inner = untag_ptr(path_conv_10);
7970 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
7971 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
7972 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
7973 path_constr.data[k] = path_conv_10_conv;
7976 (this_arg_conv->probe_failed)(this_arg_conv->this_arg, path_constr, short_channel_id);
7979 void __attribute__((export_name("TS_Score_probe_successful"))) TS_Score_probe_successful(uint64_t this_arg, uint64_tArray path) {
7980 void* this_arg_ptr = untag_ptr(this_arg);
7981 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7982 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
7983 LDKCVec_RouteHopZ path_constr;
7984 path_constr.datalen = path->arr_len;
7985 if (path_constr.datalen > 0)
7986 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
7988 path_constr.data = NULL;
7989 uint64_t* path_vals = path->elems;
7990 for (size_t k = 0; k < path_constr.datalen; k++) {
7991 uint64_t path_conv_10 = path_vals[k];
7992 LDKRouteHop path_conv_10_conv;
7993 path_conv_10_conv.inner = untag_ptr(path_conv_10);
7994 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
7995 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
7996 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
7997 path_constr.data[k] = path_conv_10_conv;
8000 (this_arg_conv->probe_successful)(this_arg_conv->this_arg, path_constr);
8003 int8_tArray __attribute__((export_name("TS_Score_write"))) TS_Score_write(uint64_t this_arg) {
8004 void* this_arg_ptr = untag_ptr(this_arg);
8005 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8006 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
8007 LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
8008 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
8009 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
8010 CVec_u8Z_free(ret_var);
8014 typedef struct LDKPersister_JCalls {
8015 atomic_size_t refcnt;
8016 uint32_t instance_ptr;
8017 } LDKPersister_JCalls;
8018 static void LDKPersister_JCalls_free(void* this_arg) {
8019 LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg;
8020 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
8024 LDKCResult_NoneErrorZ persist_manager_LDKPersister_jcall(const void* this_arg, const LDKChannelManager * channel_manager) {
8025 LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg;
8026 LDKChannelManager channel_manager_var = *channel_manager;
8027 uint64_t channel_manager_ref = 0;
8028 // WARNING: we may need a move here but no clone is available for LDKChannelManager
8029 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_var);
8030 channel_manager_ref = tag_ptr(channel_manager_var.inner, channel_manager_var.is_owned);
8031 uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 43, channel_manager_ref, 0, 0, 0, 0, 0);
8032 void* ret_ptr = untag_ptr(ret);
8033 CHECK_ACCESS(ret_ptr);
8034 LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr);
8035 FREE(untag_ptr(ret));
8038 LDKCResult_NoneErrorZ persist_graph_LDKPersister_jcall(const void* this_arg, const LDKNetworkGraph * network_graph) {
8039 LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg;
8040 LDKNetworkGraph network_graph_var = *network_graph;
8041 uint64_t network_graph_ref = 0;
8042 // WARNING: we may need a move here but no clone is available for LDKNetworkGraph
8043 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_var);
8044 network_graph_ref = tag_ptr(network_graph_var.inner, network_graph_var.is_owned);
8045 uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 44, network_graph_ref, 0, 0, 0, 0, 0);
8046 void* ret_ptr = untag_ptr(ret);
8047 CHECK_ACCESS(ret_ptr);
8048 LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr);
8049 FREE(untag_ptr(ret));
8052 LDKCResult_NoneErrorZ persist_scorer_LDKPersister_jcall(const void* this_arg, const LDKMultiThreadedLockableScore * scorer) {
8053 LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg;
8054 LDKMultiThreadedLockableScore scorer_var = *scorer;
8055 uint64_t scorer_ref = 0;
8056 // WARNING: we may need a move here but no clone is available for LDKMultiThreadedLockableScore
8057 CHECK_INNER_FIELD_ACCESS_OR_NULL(scorer_var);
8058 scorer_ref = tag_ptr(scorer_var.inner, scorer_var.is_owned);
8059 uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 45, scorer_ref, 0, 0, 0, 0, 0);
8060 void* ret_ptr = untag_ptr(ret);
8061 CHECK_ACCESS(ret_ptr);
8062 LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr);
8063 FREE(untag_ptr(ret));
8066 static void LDKPersister_JCalls_cloned(LDKPersister* new_obj) {
8067 LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) new_obj->this_arg;
8068 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
8070 static inline LDKPersister LDKPersister_init (JSValue o) {
8071 LDKPersister_JCalls *calls = MALLOC(sizeof(LDKPersister_JCalls), "LDKPersister_JCalls");
8072 atomic_init(&calls->refcnt, 1);
8073 calls->instance_ptr = o;
8075 LDKPersister ret = {
8076 .this_arg = (void*) calls,
8077 .persist_manager = persist_manager_LDKPersister_jcall,
8078 .persist_graph = persist_graph_LDKPersister_jcall,
8079 .persist_scorer = persist_scorer_LDKPersister_jcall,
8080 .free = LDKPersister_JCalls_free,
8084 uint64_t __attribute__((export_name("TS_LDKPersister_new"))) TS_LDKPersister_new(JSValue o) {
8085 LDKPersister *res_ptr = MALLOC(sizeof(LDKPersister), "LDKPersister");
8086 *res_ptr = LDKPersister_init(o);
8087 return tag_ptr(res_ptr, true);
8089 uint64_t __attribute__((export_name("TS_Persister_persist_manager"))) TS_Persister_persist_manager(uint64_t this_arg, uint64_t channel_manager) {
8090 void* this_arg_ptr = untag_ptr(this_arg);
8091 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8092 LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr;
8093 LDKChannelManager channel_manager_conv;
8094 channel_manager_conv.inner = untag_ptr(channel_manager);
8095 channel_manager_conv.is_owned = ptr_is_owned(channel_manager);
8096 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_conv);
8097 channel_manager_conv.is_owned = false;
8098 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
8099 *ret_conv = (this_arg_conv->persist_manager)(this_arg_conv->this_arg, &channel_manager_conv);
8100 return tag_ptr(ret_conv, true);
8103 uint64_t __attribute__((export_name("TS_Persister_persist_graph"))) TS_Persister_persist_graph(uint64_t this_arg, uint64_t network_graph) {
8104 void* this_arg_ptr = untag_ptr(this_arg);
8105 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8106 LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr;
8107 LDKNetworkGraph network_graph_conv;
8108 network_graph_conv.inner = untag_ptr(network_graph);
8109 network_graph_conv.is_owned = ptr_is_owned(network_graph);
8110 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
8111 network_graph_conv.is_owned = false;
8112 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
8113 *ret_conv = (this_arg_conv->persist_graph)(this_arg_conv->this_arg, &network_graph_conv);
8114 return tag_ptr(ret_conv, true);
8117 uint64_t __attribute__((export_name("TS_Persister_persist_scorer"))) TS_Persister_persist_scorer(uint64_t this_arg, uint64_t scorer) {
8118 void* this_arg_ptr = untag_ptr(this_arg);
8119 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8120 LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr;
8121 LDKMultiThreadedLockableScore scorer_conv;
8122 scorer_conv.inner = untag_ptr(scorer);
8123 scorer_conv.is_owned = ptr_is_owned(scorer);
8124 CHECK_INNER_FIELD_ACCESS_OR_NULL(scorer_conv);
8125 scorer_conv.is_owned = false;
8126 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
8127 *ret_conv = (this_arg_conv->persist_scorer)(this_arg_conv->this_arg, &scorer_conv);
8128 return tag_ptr(ret_conv, true);
8131 typedef struct LDKListen_JCalls {
8132 atomic_size_t refcnt;
8133 uint32_t instance_ptr;
8135 static void LDKListen_JCalls_free(void* this_arg) {
8136 LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
8137 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
8141 void filtered_block_connected_LDKListen_jcall(const void* this_arg, const uint8_t (* header)[80], LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height) {
8142 LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
8143 int8_tArray header_arr = init_int8_tArray(80, __LINE__);
8144 memcpy(header_arr->elems, *header, 80);
8145 LDKCVec_C2Tuple_usizeTransactionZZ txdata_var = txdata;
8146 uint64_tArray txdata_arr = NULL;
8147 txdata_arr = init_uint64_tArray(txdata_var.datalen, __LINE__);
8148 uint64_t *txdata_arr_ptr = (uint64_t*)(((uint8_t*)txdata_arr) + 8);
8149 for (size_t c = 0; c < txdata_var.datalen; c++) {
8150 LDKC2Tuple_usizeTransactionZ* txdata_conv_28_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
8151 *txdata_conv_28_conv = txdata_var.data[c];
8152 txdata_arr_ptr[c] = tag_ptr(txdata_conv_28_conv, true);
8155 FREE(txdata_var.data);
8156 int32_t height_conv = height;
8157 js_invoke_function_uuuuuu(j_calls->instance_ptr, 46, (uint32_t)header_arr, (uint32_t)txdata_arr, height_conv, 0, 0, 0);
8159 void block_connected_LDKListen_jcall(const void* this_arg, LDKu8slice block, uint32_t height) {
8160 LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
8161 LDKu8slice block_var = block;
8162 int8_tArray block_arr = init_int8_tArray(block_var.datalen, __LINE__);
8163 memcpy(block_arr->elems, block_var.data, block_var.datalen);
8164 int32_t height_conv = height;
8165 js_invoke_function_uuuuuu(j_calls->instance_ptr, 47, (uint32_t)block_arr, height_conv, 0, 0, 0, 0);
8167 void block_disconnected_LDKListen_jcall(const void* this_arg, const uint8_t (* header)[80], uint32_t height) {
8168 LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
8169 int8_tArray header_arr = init_int8_tArray(80, __LINE__);
8170 memcpy(header_arr->elems, *header, 80);
8171 int32_t height_conv = height;
8172 js_invoke_function_uuuuuu(j_calls->instance_ptr, 48, (uint32_t)header_arr, height_conv, 0, 0, 0, 0);
8174 static void LDKListen_JCalls_cloned(LDKListen* new_obj) {
8175 LDKListen_JCalls *j_calls = (LDKListen_JCalls*) new_obj->this_arg;
8176 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
8178 static inline LDKListen LDKListen_init (JSValue o) {
8179 LDKListen_JCalls *calls = MALLOC(sizeof(LDKListen_JCalls), "LDKListen_JCalls");
8180 atomic_init(&calls->refcnt, 1);
8181 calls->instance_ptr = o;
8184 .this_arg = (void*) calls,
8185 .filtered_block_connected = filtered_block_connected_LDKListen_jcall,
8186 .block_connected = block_connected_LDKListen_jcall,
8187 .block_disconnected = block_disconnected_LDKListen_jcall,
8188 .free = LDKListen_JCalls_free,
8192 uint64_t __attribute__((export_name("TS_LDKListen_new"))) TS_LDKListen_new(JSValue o) {
8193 LDKListen *res_ptr = MALLOC(sizeof(LDKListen), "LDKListen");
8194 *res_ptr = LDKListen_init(o);
8195 return tag_ptr(res_ptr, true);
8197 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) {
8198 void* this_arg_ptr = untag_ptr(this_arg);
8199 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8200 LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr;
8201 unsigned char header_arr[80];
8202 CHECK(header->arr_len == 80);
8203 memcpy(header_arr, header->elems, 80); FREE(header);
8204 unsigned char (*header_ref)[80] = &header_arr;
8205 LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr;
8206 txdata_constr.datalen = txdata->arr_len;
8207 if (txdata_constr.datalen > 0)
8208 txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
8210 txdata_constr.data = NULL;
8211 uint64_t* txdata_vals = txdata->elems;
8212 for (size_t c = 0; c < txdata_constr.datalen; c++) {
8213 uint64_t txdata_conv_28 = txdata_vals[c];
8214 void* txdata_conv_28_ptr = untag_ptr(txdata_conv_28);
8215 CHECK_ACCESS(txdata_conv_28_ptr);
8216 LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr);
8217 txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(txdata_conv_28));
8218 txdata_constr.data[c] = txdata_conv_28_conv;
8221 (this_arg_conv->filtered_block_connected)(this_arg_conv->this_arg, header_ref, txdata_constr, height);
8224 void __attribute__((export_name("TS_Listen_block_connected"))) TS_Listen_block_connected(uint64_t this_arg, int8_tArray block, int32_t height) {
8225 void* this_arg_ptr = untag_ptr(this_arg);
8226 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8227 LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr;
8228 LDKu8slice block_ref;
8229 block_ref.datalen = block->arr_len;
8230 block_ref.data = block->elems;
8231 (this_arg_conv->block_connected)(this_arg_conv->this_arg, block_ref, height);
8235 void __attribute__((export_name("TS_Listen_block_disconnected"))) TS_Listen_block_disconnected(uint64_t this_arg, int8_tArray header, int32_t height) {
8236 void* this_arg_ptr = untag_ptr(this_arg);
8237 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8238 LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr;
8239 unsigned char header_arr[80];
8240 CHECK(header->arr_len == 80);
8241 memcpy(header_arr, header->elems, 80); FREE(header);
8242 unsigned char (*header_ref)[80] = &header_arr;
8243 (this_arg_conv->block_disconnected)(this_arg_conv->this_arg, header_ref, height);
8246 typedef struct LDKConfirm_JCalls {
8247 atomic_size_t refcnt;
8248 uint32_t instance_ptr;
8249 } LDKConfirm_JCalls;
8250 static void LDKConfirm_JCalls_free(void* this_arg) {
8251 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
8252 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
8256 void transactions_confirmed_LDKConfirm_jcall(const void* this_arg, const uint8_t (* header)[80], LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height) {
8257 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
8258 int8_tArray header_arr = init_int8_tArray(80, __LINE__);
8259 memcpy(header_arr->elems, *header, 80);
8260 LDKCVec_C2Tuple_usizeTransactionZZ txdata_var = txdata;
8261 uint64_tArray txdata_arr = NULL;
8262 txdata_arr = init_uint64_tArray(txdata_var.datalen, __LINE__);
8263 uint64_t *txdata_arr_ptr = (uint64_t*)(((uint8_t*)txdata_arr) + 8);
8264 for (size_t c = 0; c < txdata_var.datalen; c++) {
8265 LDKC2Tuple_usizeTransactionZ* txdata_conv_28_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
8266 *txdata_conv_28_conv = txdata_var.data[c];
8267 txdata_arr_ptr[c] = tag_ptr(txdata_conv_28_conv, true);
8270 FREE(txdata_var.data);
8271 int32_t height_conv = height;
8272 js_invoke_function_uuuuuu(j_calls->instance_ptr, 49, (uint32_t)header_arr, (uint32_t)txdata_arr, height_conv, 0, 0, 0);
8274 void transaction_unconfirmed_LDKConfirm_jcall(const void* this_arg, const uint8_t (* txid)[32]) {
8275 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
8276 int8_tArray txid_arr = init_int8_tArray(32, __LINE__);
8277 memcpy(txid_arr->elems, *txid, 32);
8278 js_invoke_function_uuuuuu(j_calls->instance_ptr, 50, (uint32_t)txid_arr, 0, 0, 0, 0, 0);
8280 void best_block_updated_LDKConfirm_jcall(const void* this_arg, const uint8_t (* header)[80], uint32_t height) {
8281 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
8282 int8_tArray header_arr = init_int8_tArray(80, __LINE__);
8283 memcpy(header_arr->elems, *header, 80);
8284 int32_t height_conv = height;
8285 js_invoke_function_uuuuuu(j_calls->instance_ptr, 51, (uint32_t)header_arr, height_conv, 0, 0, 0, 0);
8287 LDKCVec_TxidZ get_relevant_txids_LDKConfirm_jcall(const void* this_arg) {
8288 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
8289 ptrArray ret = (ptrArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 52, 0, 0, 0, 0, 0, 0);
8290 LDKCVec_TxidZ ret_constr;
8291 ret_constr.datalen = ret->arr_len;
8292 if (ret_constr.datalen > 0)
8293 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_TxidZ Elements");
8295 ret_constr.data = NULL;
8296 int8_tArray* ret_vals = (void*) ret->elems;
8297 for (size_t m = 0; m < ret_constr.datalen; m++) {
8298 int8_tArray ret_conv_12 = ret_vals[m];
8299 LDKThirtyTwoBytes ret_conv_12_ref;
8300 CHECK(ret_conv_12->arr_len == 32);
8301 memcpy(ret_conv_12_ref.data, ret_conv_12->elems, 32); FREE(ret_conv_12);
8302 ret_constr.data[m] = ret_conv_12_ref;
8307 static void LDKConfirm_JCalls_cloned(LDKConfirm* new_obj) {
8308 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) new_obj->this_arg;
8309 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
8311 static inline LDKConfirm LDKConfirm_init (JSValue o) {
8312 LDKConfirm_JCalls *calls = MALLOC(sizeof(LDKConfirm_JCalls), "LDKConfirm_JCalls");
8313 atomic_init(&calls->refcnt, 1);
8314 calls->instance_ptr = o;
8317 .this_arg = (void*) calls,
8318 .transactions_confirmed = transactions_confirmed_LDKConfirm_jcall,
8319 .transaction_unconfirmed = transaction_unconfirmed_LDKConfirm_jcall,
8320 .best_block_updated = best_block_updated_LDKConfirm_jcall,
8321 .get_relevant_txids = get_relevant_txids_LDKConfirm_jcall,
8322 .free = LDKConfirm_JCalls_free,
8326 uint64_t __attribute__((export_name("TS_LDKConfirm_new"))) TS_LDKConfirm_new(JSValue o) {
8327 LDKConfirm *res_ptr = MALLOC(sizeof(LDKConfirm), "LDKConfirm");
8328 *res_ptr = LDKConfirm_init(o);
8329 return tag_ptr(res_ptr, true);
8331 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) {
8332 void* this_arg_ptr = untag_ptr(this_arg);
8333 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8334 LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
8335 unsigned char header_arr[80];
8336 CHECK(header->arr_len == 80);
8337 memcpy(header_arr, header->elems, 80); FREE(header);
8338 unsigned char (*header_ref)[80] = &header_arr;
8339 LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr;
8340 txdata_constr.datalen = txdata->arr_len;
8341 if (txdata_constr.datalen > 0)
8342 txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
8344 txdata_constr.data = NULL;
8345 uint64_t* txdata_vals = txdata->elems;
8346 for (size_t c = 0; c < txdata_constr.datalen; c++) {
8347 uint64_t txdata_conv_28 = txdata_vals[c];
8348 void* txdata_conv_28_ptr = untag_ptr(txdata_conv_28);
8349 CHECK_ACCESS(txdata_conv_28_ptr);
8350 LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr);
8351 txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(txdata_conv_28));
8352 txdata_constr.data[c] = txdata_conv_28_conv;
8355 (this_arg_conv->transactions_confirmed)(this_arg_conv->this_arg, header_ref, txdata_constr, height);
8358 void __attribute__((export_name("TS_Confirm_transaction_unconfirmed"))) TS_Confirm_transaction_unconfirmed(uint64_t this_arg, int8_tArray txid) {
8359 void* this_arg_ptr = untag_ptr(this_arg);
8360 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8361 LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
8362 unsigned char txid_arr[32];
8363 CHECK(txid->arr_len == 32);
8364 memcpy(txid_arr, txid->elems, 32); FREE(txid);
8365 unsigned char (*txid_ref)[32] = &txid_arr;
8366 (this_arg_conv->transaction_unconfirmed)(this_arg_conv->this_arg, txid_ref);
8369 void __attribute__((export_name("TS_Confirm_best_block_updated"))) TS_Confirm_best_block_updated(uint64_t this_arg, int8_tArray header, int32_t height) {
8370 void* this_arg_ptr = untag_ptr(this_arg);
8371 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8372 LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
8373 unsigned char header_arr[80];
8374 CHECK(header->arr_len == 80);
8375 memcpy(header_arr, header->elems, 80); FREE(header);
8376 unsigned char (*header_ref)[80] = &header_arr;
8377 (this_arg_conv->best_block_updated)(this_arg_conv->this_arg, header_ref, height);
8380 ptrArray __attribute__((export_name("TS_Confirm_get_relevant_txids"))) TS_Confirm_get_relevant_txids(uint64_t this_arg) {
8381 void* this_arg_ptr = untag_ptr(this_arg);
8382 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8383 LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
8384 LDKCVec_TxidZ ret_var = (this_arg_conv->get_relevant_txids)(this_arg_conv->this_arg);
8385 ptrArray ret_arr = NULL;
8386 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
8387 int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8);
8388 for (size_t m = 0; m < ret_var.datalen; m++) {
8389 int8_tArray ret_conv_12_arr = init_int8_tArray(32, __LINE__);
8390 memcpy(ret_conv_12_arr->elems, ret_var.data[m].data, 32);
8391 ret_arr_ptr[m] = ret_conv_12_arr;
8398 typedef struct LDKPersist_JCalls {
8399 atomic_size_t refcnt;
8400 uint32_t instance_ptr;
8401 } LDKPersist_JCalls;
8402 static void LDKPersist_JCalls_free(void* this_arg) {
8403 LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg;
8404 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
8408 LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) {
8409 LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg;
8410 LDKOutPoint channel_id_var = channel_id;
8411 uint64_t channel_id_ref = 0;
8412 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var);
8413 channel_id_ref = tag_ptr(channel_id_var.inner, channel_id_var.is_owned);
8414 LDKChannelMonitor data_var = *data;
8415 uint64_t data_ref = 0;
8416 data_var = ChannelMonitor_clone(&data_var);
8417 CHECK_INNER_FIELD_ACCESS_OR_NULL(data_var);
8418 data_ref = tag_ptr(data_var.inner, data_var.is_owned);
8419 LDKMonitorUpdateId update_id_var = update_id;
8420 uint64_t update_id_ref = 0;
8421 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_var);
8422 update_id_ref = tag_ptr(update_id_var.inner, update_id_var.is_owned);
8423 uint32_t ret = js_invoke_function_bbbuuu(j_calls->instance_ptr, 53, channel_id_ref, data_ref, update_id_ref, 0, 0, 0);
8424 void* ret_ptr = untag_ptr(ret);
8425 CHECK_ACCESS(ret_ptr);
8426 LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
8427 FREE(untag_ptr(ret));
8430 LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitorUpdate * update, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) {
8431 LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg;
8432 LDKOutPoint channel_id_var = channel_id;
8433 uint64_t channel_id_ref = 0;
8434 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var);
8435 channel_id_ref = tag_ptr(channel_id_var.inner, channel_id_var.is_owned);
8436 LDKChannelMonitorUpdate update_var = *update;
8437 uint64_t update_ref = 0;
8438 update_var = ChannelMonitorUpdate_clone(&update_var);
8439 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_var);
8440 update_ref = tag_ptr(update_var.inner, update_var.is_owned);
8441 LDKChannelMonitor data_var = *data;
8442 uint64_t data_ref = 0;
8443 data_var = ChannelMonitor_clone(&data_var);
8444 CHECK_INNER_FIELD_ACCESS_OR_NULL(data_var);
8445 data_ref = tag_ptr(data_var.inner, data_var.is_owned);
8446 LDKMonitorUpdateId update_id_var = update_id;
8447 uint64_t update_id_ref = 0;
8448 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_var);
8449 update_id_ref = tag_ptr(update_id_var.inner, update_id_var.is_owned);
8450 uint32_t ret = js_invoke_function_bbbbuu(j_calls->instance_ptr, 54, channel_id_ref, update_ref, data_ref, update_id_ref, 0, 0);
8451 void* ret_ptr = untag_ptr(ret);
8452 CHECK_ACCESS(ret_ptr);
8453 LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
8454 FREE(untag_ptr(ret));
8457 static void LDKPersist_JCalls_cloned(LDKPersist* new_obj) {
8458 LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) new_obj->this_arg;
8459 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
8461 static inline LDKPersist LDKPersist_init (JSValue o) {
8462 LDKPersist_JCalls *calls = MALLOC(sizeof(LDKPersist_JCalls), "LDKPersist_JCalls");
8463 atomic_init(&calls->refcnt, 1);
8464 calls->instance_ptr = o;
8467 .this_arg = (void*) calls,
8468 .persist_new_channel = persist_new_channel_LDKPersist_jcall,
8469 .update_persisted_channel = update_persisted_channel_LDKPersist_jcall,
8470 .free = LDKPersist_JCalls_free,
8474 uint64_t __attribute__((export_name("TS_LDKPersist_new"))) TS_LDKPersist_new(JSValue o) {
8475 LDKPersist *res_ptr = MALLOC(sizeof(LDKPersist), "LDKPersist");
8476 *res_ptr = LDKPersist_init(o);
8477 return tag_ptr(res_ptr, true);
8479 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) {
8480 void* this_arg_ptr = untag_ptr(this_arg);
8481 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8482 LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr;
8483 LDKOutPoint channel_id_conv;
8484 channel_id_conv.inner = untag_ptr(channel_id);
8485 channel_id_conv.is_owned = ptr_is_owned(channel_id);
8486 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv);
8487 channel_id_conv = OutPoint_clone(&channel_id_conv);
8488 LDKChannelMonitor data_conv;
8489 data_conv.inner = untag_ptr(data);
8490 data_conv.is_owned = ptr_is_owned(data);
8491 CHECK_INNER_FIELD_ACCESS_OR_NULL(data_conv);
8492 data_conv.is_owned = false;
8493 LDKMonitorUpdateId update_id_conv;
8494 update_id_conv.inner = untag_ptr(update_id);
8495 update_id_conv.is_owned = ptr_is_owned(update_id);
8496 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_conv);
8497 update_id_conv = MonitorUpdateId_clone(&update_id_conv);
8498 LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
8499 *ret_conv = (this_arg_conv->persist_new_channel)(this_arg_conv->this_arg, channel_id_conv, &data_conv, update_id_conv);
8500 return tag_ptr(ret_conv, true);
8503 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) {
8504 void* this_arg_ptr = untag_ptr(this_arg);
8505 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8506 LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr;
8507 LDKOutPoint channel_id_conv;
8508 channel_id_conv.inner = untag_ptr(channel_id);
8509 channel_id_conv.is_owned = ptr_is_owned(channel_id);
8510 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv);
8511 channel_id_conv = OutPoint_clone(&channel_id_conv);
8512 LDKChannelMonitorUpdate update_conv;
8513 update_conv.inner = untag_ptr(update);
8514 update_conv.is_owned = ptr_is_owned(update);
8515 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv);
8516 update_conv.is_owned = false;
8517 LDKChannelMonitor data_conv;
8518 data_conv.inner = untag_ptr(data);
8519 data_conv.is_owned = ptr_is_owned(data);
8520 CHECK_INNER_FIELD_ACCESS_OR_NULL(data_conv);
8521 data_conv.is_owned = false;
8522 LDKMonitorUpdateId update_id_conv;
8523 update_id_conv.inner = untag_ptr(update_id);
8524 update_id_conv.is_owned = ptr_is_owned(update_id);
8525 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_conv);
8526 update_id_conv = MonitorUpdateId_clone(&update_id_conv);
8527 LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
8528 *ret_conv = (this_arg_conv->update_persisted_channel)(this_arg_conv->this_arg, channel_id_conv, &update_conv, &data_conv, update_id_conv);
8529 return tag_ptr(ret_conv, true);
8532 typedef struct LDKChannelMessageHandler_JCalls {
8533 atomic_size_t refcnt;
8534 uint32_t instance_ptr;
8535 LDKMessageSendEventsProvider_JCalls* MessageSendEventsProvider;
8536 } LDKChannelMessageHandler_JCalls;
8537 static void LDKChannelMessageHandler_JCalls_free(void* this_arg) {
8538 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8539 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
8543 void handle_open_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKOpenChannel * msg) {
8544 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8545 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8546 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8547 LDKInitFeatures their_features_var = their_features;
8548 uint64_t their_features_ref = 0;
8549 CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_var);
8550 their_features_ref = tag_ptr(their_features_var.inner, their_features_var.is_owned);
8551 LDKOpenChannel msg_var = *msg;
8552 uint64_t msg_ref = 0;
8553 msg_var = OpenChannel_clone(&msg_var);
8554 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8555 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8556 js_invoke_function_ubbuuu(j_calls->instance_ptr, 55, (uint32_t)their_node_id_arr, their_features_ref, msg_ref, 0, 0, 0);
8558 void handle_accept_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKAcceptChannel * msg) {
8559 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8560 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8561 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8562 LDKInitFeatures their_features_var = their_features;
8563 uint64_t their_features_ref = 0;
8564 CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_var);
8565 their_features_ref = tag_ptr(their_features_var.inner, their_features_var.is_owned);
8566 LDKAcceptChannel msg_var = *msg;
8567 uint64_t msg_ref = 0;
8568 msg_var = AcceptChannel_clone(&msg_var);
8569 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8570 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8571 js_invoke_function_ubbuuu(j_calls->instance_ptr, 56, (uint32_t)their_node_id_arr, their_features_ref, msg_ref, 0, 0, 0);
8573 void handle_funding_created_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingCreated * msg) {
8574 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8575 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8576 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8577 LDKFundingCreated msg_var = *msg;
8578 uint64_t msg_ref = 0;
8579 msg_var = FundingCreated_clone(&msg_var);
8580 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8581 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8582 js_invoke_function_ubuuuu(j_calls->instance_ptr, 57, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
8584 void handle_funding_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingSigned * msg) {
8585 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8586 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8587 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8588 LDKFundingSigned msg_var = *msg;
8589 uint64_t msg_ref = 0;
8590 msg_var = FundingSigned_clone(&msg_var);
8591 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8592 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8593 js_invoke_function_ubuuuu(j_calls->instance_ptr, 58, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
8595 void handle_channel_ready_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReady * msg) {
8596 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8597 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8598 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8599 LDKChannelReady msg_var = *msg;
8600 uint64_t msg_ref = 0;
8601 msg_var = ChannelReady_clone(&msg_var);
8602 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8603 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8604 js_invoke_function_ubuuuu(j_calls->instance_ptr, 59, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
8606 void handle_shutdown_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInitFeatures * their_features, const LDKShutdown * msg) {
8607 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8608 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8609 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8610 LDKInitFeatures their_features_var = *their_features;
8611 uint64_t their_features_ref = 0;
8612 their_features_var = InitFeatures_clone(&their_features_var);
8613 CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_var);
8614 their_features_ref = tag_ptr(their_features_var.inner, their_features_var.is_owned);
8615 LDKShutdown msg_var = *msg;
8616 uint64_t msg_ref = 0;
8617 msg_var = Shutdown_clone(&msg_var);
8618 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8619 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8620 js_invoke_function_ubbuuu(j_calls->instance_ptr, 60, (uint32_t)their_node_id_arr, their_features_ref, msg_ref, 0, 0, 0);
8622 void handle_closing_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKClosingSigned * msg) {
8623 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8624 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8625 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8626 LDKClosingSigned msg_var = *msg;
8627 uint64_t msg_ref = 0;
8628 msg_var = ClosingSigned_clone(&msg_var);
8629 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8630 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8631 js_invoke_function_ubuuuu(j_calls->instance_ptr, 61, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
8633 void handle_update_add_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateAddHTLC * msg) {
8634 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8635 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8636 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8637 LDKUpdateAddHTLC msg_var = *msg;
8638 uint64_t msg_ref = 0;
8639 msg_var = UpdateAddHTLC_clone(&msg_var);
8640 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8641 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8642 js_invoke_function_ubuuuu(j_calls->instance_ptr, 62, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
8644 void handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFulfillHTLC * msg) {
8645 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8646 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8647 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8648 LDKUpdateFulfillHTLC msg_var = *msg;
8649 uint64_t msg_ref = 0;
8650 msg_var = UpdateFulfillHTLC_clone(&msg_var);
8651 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8652 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8653 js_invoke_function_ubuuuu(j_calls->instance_ptr, 63, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
8655 void handle_update_fail_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailHTLC * msg) {
8656 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8657 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8658 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8659 LDKUpdateFailHTLC msg_var = *msg;
8660 uint64_t msg_ref = 0;
8661 msg_var = UpdateFailHTLC_clone(&msg_var);
8662 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8663 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8664 js_invoke_function_ubuuuu(j_calls->instance_ptr, 64, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
8666 void handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailMalformedHTLC * msg) {
8667 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8668 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8669 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8670 LDKUpdateFailMalformedHTLC msg_var = *msg;
8671 uint64_t msg_ref = 0;
8672 msg_var = UpdateFailMalformedHTLC_clone(&msg_var);
8673 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8674 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8675 js_invoke_function_ubuuuu(j_calls->instance_ptr, 65, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
8677 void handle_commitment_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKCommitmentSigned * msg) {
8678 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8679 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8680 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8681 LDKCommitmentSigned msg_var = *msg;
8682 uint64_t msg_ref = 0;
8683 msg_var = CommitmentSigned_clone(&msg_var);
8684 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8685 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8686 js_invoke_function_ubuuuu(j_calls->instance_ptr, 66, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
8688 void handle_revoke_and_ack_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKRevokeAndACK * msg) {
8689 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8690 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8691 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8692 LDKRevokeAndACK msg_var = *msg;
8693 uint64_t msg_ref = 0;
8694 msg_var = RevokeAndACK_clone(&msg_var);
8695 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8696 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8697 js_invoke_function_ubuuuu(j_calls->instance_ptr, 67, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
8699 void handle_update_fee_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFee * msg) {
8700 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8701 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8702 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8703 LDKUpdateFee msg_var = *msg;
8704 uint64_t msg_ref = 0;
8705 msg_var = UpdateFee_clone(&msg_var);
8706 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8707 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8708 js_invoke_function_ubuuuu(j_calls->instance_ptr, 68, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
8710 void handle_announcement_signatures_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKAnnouncementSignatures * msg) {
8711 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8712 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8713 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8714 LDKAnnouncementSignatures msg_var = *msg;
8715 uint64_t msg_ref = 0;
8716 msg_var = AnnouncementSignatures_clone(&msg_var);
8717 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8718 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8719 js_invoke_function_ubuuuu(j_calls->instance_ptr, 69, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
8721 void peer_disconnected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, bool no_connection_possible) {
8722 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8723 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8724 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8725 jboolean no_connection_possible_conv = no_connection_possible;
8726 js_invoke_function_uuuuuu(j_calls->instance_ptr, 70, (uint32_t)their_node_id_arr, no_connection_possible_conv, 0, 0, 0, 0);
8728 void peer_connected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * msg) {
8729 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8730 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8731 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8732 LDKInit msg_var = *msg;
8733 uint64_t msg_ref = 0;
8734 msg_var = Init_clone(&msg_var);
8735 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8736 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8737 js_invoke_function_ubuuuu(j_calls->instance_ptr, 71, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
8739 void handle_channel_reestablish_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReestablish * msg) {
8740 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8741 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8742 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8743 LDKChannelReestablish msg_var = *msg;
8744 uint64_t msg_ref = 0;
8745 msg_var = ChannelReestablish_clone(&msg_var);
8746 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8747 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8748 js_invoke_function_ubuuuu(j_calls->instance_ptr, 72, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
8750 void handle_channel_update_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelUpdate * msg) {
8751 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8752 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8753 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8754 LDKChannelUpdate msg_var = *msg;
8755 uint64_t msg_ref = 0;
8756 msg_var = ChannelUpdate_clone(&msg_var);
8757 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8758 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8759 js_invoke_function_ubuuuu(j_calls->instance_ptr, 73, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
8761 void handle_error_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKErrorMessage * msg) {
8762 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8763 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8764 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8765 LDKErrorMessage msg_var = *msg;
8766 uint64_t msg_ref = 0;
8767 msg_var = ErrorMessage_clone(&msg_var);
8768 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8769 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8770 js_invoke_function_ubuuuu(j_calls->instance_ptr, 74, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
8772 static void LDKChannelMessageHandler_JCalls_cloned(LDKChannelMessageHandler* new_obj) {
8773 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) new_obj->this_arg;
8774 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
8775 atomic_fetch_add_explicit(&j_calls->MessageSendEventsProvider->refcnt, 1, memory_order_release);
8777 static inline LDKChannelMessageHandler LDKChannelMessageHandler_init (JSValue o, JSValue MessageSendEventsProvider) {
8778 LDKChannelMessageHandler_JCalls *calls = MALLOC(sizeof(LDKChannelMessageHandler_JCalls), "LDKChannelMessageHandler_JCalls");
8779 atomic_init(&calls->refcnt, 1);
8780 calls->instance_ptr = o;
8782 LDKChannelMessageHandler ret = {
8783 .this_arg = (void*) calls,
8784 .handle_open_channel = handle_open_channel_LDKChannelMessageHandler_jcall,
8785 .handle_accept_channel = handle_accept_channel_LDKChannelMessageHandler_jcall,
8786 .handle_funding_created = handle_funding_created_LDKChannelMessageHandler_jcall,
8787 .handle_funding_signed = handle_funding_signed_LDKChannelMessageHandler_jcall,
8788 .handle_channel_ready = handle_channel_ready_LDKChannelMessageHandler_jcall,
8789 .handle_shutdown = handle_shutdown_LDKChannelMessageHandler_jcall,
8790 .handle_closing_signed = handle_closing_signed_LDKChannelMessageHandler_jcall,
8791 .handle_update_add_htlc = handle_update_add_htlc_LDKChannelMessageHandler_jcall,
8792 .handle_update_fulfill_htlc = handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall,
8793 .handle_update_fail_htlc = handle_update_fail_htlc_LDKChannelMessageHandler_jcall,
8794 .handle_update_fail_malformed_htlc = handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall,
8795 .handle_commitment_signed = handle_commitment_signed_LDKChannelMessageHandler_jcall,
8796 .handle_revoke_and_ack = handle_revoke_and_ack_LDKChannelMessageHandler_jcall,
8797 .handle_update_fee = handle_update_fee_LDKChannelMessageHandler_jcall,
8798 .handle_announcement_signatures = handle_announcement_signatures_LDKChannelMessageHandler_jcall,
8799 .peer_disconnected = peer_disconnected_LDKChannelMessageHandler_jcall,
8800 .peer_connected = peer_connected_LDKChannelMessageHandler_jcall,
8801 .handle_channel_reestablish = handle_channel_reestablish_LDKChannelMessageHandler_jcall,
8802 .handle_channel_update = handle_channel_update_LDKChannelMessageHandler_jcall,
8803 .handle_error = handle_error_LDKChannelMessageHandler_jcall,
8804 .free = LDKChannelMessageHandler_JCalls_free,
8805 .MessageSendEventsProvider = LDKMessageSendEventsProvider_init(MessageSendEventsProvider),
8807 calls->MessageSendEventsProvider = ret.MessageSendEventsProvider.this_arg;
8810 uint64_t __attribute__((export_name("TS_LDKChannelMessageHandler_new"))) TS_LDKChannelMessageHandler_new(JSValue o, JSValue MessageSendEventsProvider) {
8811 LDKChannelMessageHandler *res_ptr = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
8812 *res_ptr = LDKChannelMessageHandler_init(o, MessageSendEventsProvider);
8813 return tag_ptr(res_ptr, true);
8815 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) {
8816 void* this_arg_ptr = untag_ptr(this_arg);
8817 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8818 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
8819 LDKPublicKey their_node_id_ref;
8820 CHECK(their_node_id->arr_len == 33);
8821 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
8822 LDKInitFeatures their_features_conv;
8823 their_features_conv.inner = untag_ptr(their_features);
8824 their_features_conv.is_owned = ptr_is_owned(their_features);
8825 CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_conv);
8826 their_features_conv = InitFeatures_clone(&their_features_conv);
8827 LDKOpenChannel msg_conv;
8828 msg_conv.inner = untag_ptr(msg);
8829 msg_conv.is_owned = ptr_is_owned(msg);
8830 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
8831 msg_conv.is_owned = false;
8832 (this_arg_conv->handle_open_channel)(this_arg_conv->this_arg, their_node_id_ref, their_features_conv, &msg_conv);
8835 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) {
8836 void* this_arg_ptr = untag_ptr(this_arg);
8837 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8838 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
8839 LDKPublicKey their_node_id_ref;
8840 CHECK(their_node_id->arr_len == 33);
8841 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
8842 LDKInitFeatures their_features_conv;
8843 their_features_conv.inner = untag_ptr(their_features);
8844 their_features_conv.is_owned = ptr_is_owned(their_features);
8845 CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_conv);
8846 their_features_conv = InitFeatures_clone(&their_features_conv);
8847 LDKAcceptChannel msg_conv;
8848 msg_conv.inner = untag_ptr(msg);
8849 msg_conv.is_owned = ptr_is_owned(msg);
8850 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
8851 msg_conv.is_owned = false;
8852 (this_arg_conv->handle_accept_channel)(this_arg_conv->this_arg, their_node_id_ref, their_features_conv, &msg_conv);
8855 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) {
8856 void* this_arg_ptr = untag_ptr(this_arg);
8857 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8858 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
8859 LDKPublicKey their_node_id_ref;
8860 CHECK(their_node_id->arr_len == 33);
8861 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
8862 LDKFundingCreated msg_conv;
8863 msg_conv.inner = untag_ptr(msg);
8864 msg_conv.is_owned = ptr_is_owned(msg);
8865 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
8866 msg_conv.is_owned = false;
8867 (this_arg_conv->handle_funding_created)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
8870 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) {
8871 void* this_arg_ptr = untag_ptr(this_arg);
8872 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8873 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
8874 LDKPublicKey their_node_id_ref;
8875 CHECK(their_node_id->arr_len == 33);
8876 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
8877 LDKFundingSigned msg_conv;
8878 msg_conv.inner = untag_ptr(msg);
8879 msg_conv.is_owned = ptr_is_owned(msg);
8880 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
8881 msg_conv.is_owned = false;
8882 (this_arg_conv->handle_funding_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
8885 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) {
8886 void* this_arg_ptr = untag_ptr(this_arg);
8887 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8888 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
8889 LDKPublicKey their_node_id_ref;
8890 CHECK(their_node_id->arr_len == 33);
8891 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
8892 LDKChannelReady msg_conv;
8893 msg_conv.inner = untag_ptr(msg);
8894 msg_conv.is_owned = ptr_is_owned(msg);
8895 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
8896 msg_conv.is_owned = false;
8897 (this_arg_conv->handle_channel_ready)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
8900 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) {
8901 void* this_arg_ptr = untag_ptr(this_arg);
8902 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8903 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
8904 LDKPublicKey their_node_id_ref;
8905 CHECK(their_node_id->arr_len == 33);
8906 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
8907 LDKInitFeatures their_features_conv;
8908 their_features_conv.inner = untag_ptr(their_features);
8909 their_features_conv.is_owned = ptr_is_owned(their_features);
8910 CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_conv);
8911 their_features_conv.is_owned = false;
8912 LDKShutdown msg_conv;
8913 msg_conv.inner = untag_ptr(msg);
8914 msg_conv.is_owned = ptr_is_owned(msg);
8915 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
8916 msg_conv.is_owned = false;
8917 (this_arg_conv->handle_shutdown)(this_arg_conv->this_arg, their_node_id_ref, &their_features_conv, &msg_conv);
8920 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) {
8921 void* this_arg_ptr = untag_ptr(this_arg);
8922 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8923 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
8924 LDKPublicKey their_node_id_ref;
8925 CHECK(their_node_id->arr_len == 33);
8926 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
8927 LDKClosingSigned msg_conv;
8928 msg_conv.inner = untag_ptr(msg);
8929 msg_conv.is_owned = ptr_is_owned(msg);
8930 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
8931 msg_conv.is_owned = false;
8932 (this_arg_conv->handle_closing_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
8935 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) {
8936 void* this_arg_ptr = untag_ptr(this_arg);
8937 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8938 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
8939 LDKPublicKey their_node_id_ref;
8940 CHECK(their_node_id->arr_len == 33);
8941 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
8942 LDKUpdateAddHTLC msg_conv;
8943 msg_conv.inner = untag_ptr(msg);
8944 msg_conv.is_owned = ptr_is_owned(msg);
8945 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
8946 msg_conv.is_owned = false;
8947 (this_arg_conv->handle_update_add_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
8950 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) {
8951 void* this_arg_ptr = untag_ptr(this_arg);
8952 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8953 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
8954 LDKPublicKey their_node_id_ref;
8955 CHECK(their_node_id->arr_len == 33);
8956 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
8957 LDKUpdateFulfillHTLC msg_conv;
8958 msg_conv.inner = untag_ptr(msg);
8959 msg_conv.is_owned = ptr_is_owned(msg);
8960 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
8961 msg_conv.is_owned = false;
8962 (this_arg_conv->handle_update_fulfill_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
8965 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) {
8966 void* this_arg_ptr = untag_ptr(this_arg);
8967 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8968 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
8969 LDKPublicKey their_node_id_ref;
8970 CHECK(their_node_id->arr_len == 33);
8971 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
8972 LDKUpdateFailHTLC msg_conv;
8973 msg_conv.inner = untag_ptr(msg);
8974 msg_conv.is_owned = ptr_is_owned(msg);
8975 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
8976 msg_conv.is_owned = false;
8977 (this_arg_conv->handle_update_fail_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
8980 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) {
8981 void* this_arg_ptr = untag_ptr(this_arg);
8982 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8983 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
8984 LDKPublicKey their_node_id_ref;
8985 CHECK(their_node_id->arr_len == 33);
8986 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
8987 LDKUpdateFailMalformedHTLC msg_conv;
8988 msg_conv.inner = untag_ptr(msg);
8989 msg_conv.is_owned = ptr_is_owned(msg);
8990 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
8991 msg_conv.is_owned = false;
8992 (this_arg_conv->handle_update_fail_malformed_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
8995 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) {
8996 void* this_arg_ptr = untag_ptr(this_arg);
8997 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8998 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
8999 LDKPublicKey their_node_id_ref;
9000 CHECK(their_node_id->arr_len == 33);
9001 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9002 LDKCommitmentSigned msg_conv;
9003 msg_conv.inner = untag_ptr(msg);
9004 msg_conv.is_owned = ptr_is_owned(msg);
9005 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9006 msg_conv.is_owned = false;
9007 (this_arg_conv->handle_commitment_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
9010 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) {
9011 void* this_arg_ptr = untag_ptr(this_arg);
9012 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9013 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9014 LDKPublicKey their_node_id_ref;
9015 CHECK(their_node_id->arr_len == 33);
9016 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9017 LDKRevokeAndACK msg_conv;
9018 msg_conv.inner = untag_ptr(msg);
9019 msg_conv.is_owned = ptr_is_owned(msg);
9020 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9021 msg_conv.is_owned = false;
9022 (this_arg_conv->handle_revoke_and_ack)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
9025 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) {
9026 void* this_arg_ptr = untag_ptr(this_arg);
9027 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9028 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9029 LDKPublicKey their_node_id_ref;
9030 CHECK(their_node_id->arr_len == 33);
9031 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9032 LDKUpdateFee msg_conv;
9033 msg_conv.inner = untag_ptr(msg);
9034 msg_conv.is_owned = ptr_is_owned(msg);
9035 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9036 msg_conv.is_owned = false;
9037 (this_arg_conv->handle_update_fee)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
9040 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) {
9041 void* this_arg_ptr = untag_ptr(this_arg);
9042 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9043 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9044 LDKPublicKey their_node_id_ref;
9045 CHECK(their_node_id->arr_len == 33);
9046 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9047 LDKAnnouncementSignatures msg_conv;
9048 msg_conv.inner = untag_ptr(msg);
9049 msg_conv.is_owned = ptr_is_owned(msg);
9050 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9051 msg_conv.is_owned = false;
9052 (this_arg_conv->handle_announcement_signatures)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
9055 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) {
9056 void* this_arg_ptr = untag_ptr(this_arg);
9057 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9058 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9059 LDKPublicKey their_node_id_ref;
9060 CHECK(their_node_id->arr_len == 33);
9061 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9062 (this_arg_conv->peer_disconnected)(this_arg_conv->this_arg, their_node_id_ref, no_connection_possible);
9065 void __attribute__((export_name("TS_ChannelMessageHandler_peer_connected"))) TS_ChannelMessageHandler_peer_connected(uint64_t this_arg, int8_tArray their_node_id, uint64_t msg) {
9066 void* this_arg_ptr = untag_ptr(this_arg);
9067 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9068 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9069 LDKPublicKey their_node_id_ref;
9070 CHECK(their_node_id->arr_len == 33);
9071 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9073 msg_conv.inner = untag_ptr(msg);
9074 msg_conv.is_owned = ptr_is_owned(msg);
9075 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9076 msg_conv.is_owned = false;
9077 (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
9080 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) {
9081 void* this_arg_ptr = untag_ptr(this_arg);
9082 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9083 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9084 LDKPublicKey their_node_id_ref;
9085 CHECK(their_node_id->arr_len == 33);
9086 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9087 LDKChannelReestablish msg_conv;
9088 msg_conv.inner = untag_ptr(msg);
9089 msg_conv.is_owned = ptr_is_owned(msg);
9090 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9091 msg_conv.is_owned = false;
9092 (this_arg_conv->handle_channel_reestablish)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
9095 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) {
9096 void* this_arg_ptr = untag_ptr(this_arg);
9097 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9098 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9099 LDKPublicKey their_node_id_ref;
9100 CHECK(their_node_id->arr_len == 33);
9101 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9102 LDKChannelUpdate msg_conv;
9103 msg_conv.inner = untag_ptr(msg);
9104 msg_conv.is_owned = ptr_is_owned(msg);
9105 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9106 msg_conv.is_owned = false;
9107 (this_arg_conv->handle_channel_update)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
9110 void __attribute__((export_name("TS_ChannelMessageHandler_handle_error"))) TS_ChannelMessageHandler_handle_error(uint64_t this_arg, int8_tArray their_node_id, uint64_t msg) {
9111 void* this_arg_ptr = untag_ptr(this_arg);
9112 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9113 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
9114 LDKPublicKey their_node_id_ref;
9115 CHECK(their_node_id->arr_len == 33);
9116 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9117 LDKErrorMessage msg_conv;
9118 msg_conv.inner = untag_ptr(msg);
9119 msg_conv.is_owned = ptr_is_owned(msg);
9120 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9121 msg_conv.is_owned = false;
9122 (this_arg_conv->handle_error)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
9125 typedef struct LDKRoutingMessageHandler_JCalls {
9126 atomic_size_t refcnt;
9127 uint32_t instance_ptr;
9128 LDKMessageSendEventsProvider_JCalls* MessageSendEventsProvider;
9129 } LDKRoutingMessageHandler_JCalls;
9130 static void LDKRoutingMessageHandler_JCalls_free(void* this_arg) {
9131 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9132 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
9136 LDKCResult_boolLightningErrorZ handle_node_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKNodeAnnouncement * msg) {
9137 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9138 LDKNodeAnnouncement msg_var = *msg;
9139 uint64_t msg_ref = 0;
9140 msg_var = NodeAnnouncement_clone(&msg_var);
9141 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9142 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9143 uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 75, msg_ref, 0, 0, 0, 0, 0);
9144 void* ret_ptr = untag_ptr(ret);
9145 CHECK_ACCESS(ret_ptr);
9146 LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
9147 FREE(untag_ptr(ret));
9150 LDKCResult_boolLightningErrorZ handle_channel_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKChannelAnnouncement * msg) {
9151 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9152 LDKChannelAnnouncement msg_var = *msg;
9153 uint64_t msg_ref = 0;
9154 msg_var = ChannelAnnouncement_clone(&msg_var);
9155 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9156 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9157 uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 76, msg_ref, 0, 0, 0, 0, 0);
9158 void* ret_ptr = untag_ptr(ret);
9159 CHECK_ACCESS(ret_ptr);
9160 LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
9161 FREE(untag_ptr(ret));
9164 LDKCResult_boolLightningErrorZ handle_channel_update_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKChannelUpdate * msg) {
9165 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9166 LDKChannelUpdate msg_var = *msg;
9167 uint64_t msg_ref = 0;
9168 msg_var = ChannelUpdate_clone(&msg_var);
9169 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9170 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9171 uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 77, msg_ref, 0, 0, 0, 0, 0);
9172 void* ret_ptr = untag_ptr(ret);
9173 CHECK_ACCESS(ret_ptr);
9174 LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
9175 FREE(untag_ptr(ret));
9178 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel_announcements_LDKRoutingMessageHandler_jcall(const void* this_arg, uint64_t starting_point, uint8_t batch_amount) {
9179 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9180 int64_t starting_point_conv = starting_point;
9181 int8_t batch_amount_conv = batch_amount;
9182 uint64_tArray ret = (uint64_tArray)js_invoke_function_buuuuu(j_calls->instance_ptr, 78, starting_point_conv, batch_amount_conv, 0, 0, 0, 0);
9183 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret_constr;
9184 ret_constr.datalen = ret->arr_len;
9185 if (ret_constr.datalen > 0)
9186 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ Elements");
9188 ret_constr.data = NULL;
9189 uint64_t* ret_vals = ret->elems;
9190 for (size_t h = 0; h < ret_constr.datalen; h++) {
9191 uint64_t ret_conv_59 = ret_vals[h];
9192 void* ret_conv_59_ptr = untag_ptr(ret_conv_59);
9193 CHECK_ACCESS(ret_conv_59_ptr);
9194 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ ret_conv_59_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(ret_conv_59_ptr);
9195 FREE(untag_ptr(ret_conv_59));
9196 ret_constr.data[h] = ret_conv_59_conv;
9201 LDKCVec_NodeAnnouncementZ get_next_node_announcements_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey starting_point, uint8_t batch_amount) {
9202 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9203 int8_tArray starting_point_arr = init_int8_tArray(33, __LINE__);
9204 memcpy(starting_point_arr->elems, starting_point.compressed_form, 33);
9205 int8_t batch_amount_conv = batch_amount;
9206 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);
9207 LDKCVec_NodeAnnouncementZ ret_constr;
9208 ret_constr.datalen = ret->arr_len;
9209 if (ret_constr.datalen > 0)
9210 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKNodeAnnouncement), "LDKCVec_NodeAnnouncementZ Elements");
9212 ret_constr.data = NULL;
9213 uint64_t* ret_vals = ret->elems;
9214 for (size_t s = 0; s < ret_constr.datalen; s++) {
9215 uint64_t ret_conv_18 = ret_vals[s];
9216 LDKNodeAnnouncement ret_conv_18_conv;
9217 ret_conv_18_conv.inner = untag_ptr(ret_conv_18);
9218 ret_conv_18_conv.is_owned = ptr_is_owned(ret_conv_18);
9219 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_18_conv);
9220 ret_constr.data[s] = ret_conv_18_conv;
9225 void peer_connected_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * init) {
9226 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9227 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9228 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9229 LDKInit init_var = *init;
9230 uint64_t init_ref = 0;
9231 init_var = Init_clone(&init_var);
9232 CHECK_INNER_FIELD_ACCESS_OR_NULL(init_var);
9233 init_ref = tag_ptr(init_var.inner, init_var.is_owned);
9234 js_invoke_function_ubuuuu(j_calls->instance_ptr, 80, (uint32_t)their_node_id_arr, init_ref, 0, 0, 0, 0);
9236 LDKCResult_NoneLightningErrorZ handle_reply_channel_range_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKReplyChannelRange msg) {
9237 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9238 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9239 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9240 LDKReplyChannelRange msg_var = msg;
9241 uint64_t msg_ref = 0;
9242 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9243 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9244 uint32_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 81, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9245 void* ret_ptr = untag_ptr(ret);
9246 CHECK_ACCESS(ret_ptr);
9247 LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
9248 FREE(untag_ptr(ret));
9251 LDKCResult_NoneLightningErrorZ handle_reply_short_channel_ids_end_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKReplyShortChannelIdsEnd msg) {
9252 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9253 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9254 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9255 LDKReplyShortChannelIdsEnd msg_var = msg;
9256 uint64_t msg_ref = 0;
9257 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9258 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9259 uint32_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 82, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9260 void* ret_ptr = untag_ptr(ret);
9261 CHECK_ACCESS(ret_ptr);
9262 LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
9263 FREE(untag_ptr(ret));
9266 LDKCResult_NoneLightningErrorZ handle_query_channel_range_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKQueryChannelRange msg) {
9267 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9268 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9269 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9270 LDKQueryChannelRange msg_var = msg;
9271 uint64_t msg_ref = 0;
9272 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9273 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9274 uint32_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 83, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9275 void* ret_ptr = untag_ptr(ret);
9276 CHECK_ACCESS(ret_ptr);
9277 LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
9278 FREE(untag_ptr(ret));
9281 LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKQueryShortChannelIds msg) {
9282 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9283 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9284 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9285 LDKQueryShortChannelIds msg_var = msg;
9286 uint64_t msg_ref = 0;
9287 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9288 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9289 uint32_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 84, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9290 void* ret_ptr = untag_ptr(ret);
9291 CHECK_ACCESS(ret_ptr);
9292 LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
9293 FREE(untag_ptr(ret));
9296 static void LDKRoutingMessageHandler_JCalls_cloned(LDKRoutingMessageHandler* new_obj) {
9297 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) new_obj->this_arg;
9298 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
9299 atomic_fetch_add_explicit(&j_calls->MessageSendEventsProvider->refcnt, 1, memory_order_release);
9301 static inline LDKRoutingMessageHandler LDKRoutingMessageHandler_init (JSValue o, JSValue MessageSendEventsProvider) {
9302 LDKRoutingMessageHandler_JCalls *calls = MALLOC(sizeof(LDKRoutingMessageHandler_JCalls), "LDKRoutingMessageHandler_JCalls");
9303 atomic_init(&calls->refcnt, 1);
9304 calls->instance_ptr = o;
9306 LDKRoutingMessageHandler ret = {
9307 .this_arg = (void*) calls,
9308 .handle_node_announcement = handle_node_announcement_LDKRoutingMessageHandler_jcall,
9309 .handle_channel_announcement = handle_channel_announcement_LDKRoutingMessageHandler_jcall,
9310 .handle_channel_update = handle_channel_update_LDKRoutingMessageHandler_jcall,
9311 .get_next_channel_announcements = get_next_channel_announcements_LDKRoutingMessageHandler_jcall,
9312 .get_next_node_announcements = get_next_node_announcements_LDKRoutingMessageHandler_jcall,
9313 .peer_connected = peer_connected_LDKRoutingMessageHandler_jcall,
9314 .handle_reply_channel_range = handle_reply_channel_range_LDKRoutingMessageHandler_jcall,
9315 .handle_reply_short_channel_ids_end = handle_reply_short_channel_ids_end_LDKRoutingMessageHandler_jcall,
9316 .handle_query_channel_range = handle_query_channel_range_LDKRoutingMessageHandler_jcall,
9317 .handle_query_short_channel_ids = handle_query_short_channel_ids_LDKRoutingMessageHandler_jcall,
9318 .free = LDKRoutingMessageHandler_JCalls_free,
9319 .MessageSendEventsProvider = LDKMessageSendEventsProvider_init(MessageSendEventsProvider),
9321 calls->MessageSendEventsProvider = ret.MessageSendEventsProvider.this_arg;
9324 uint64_t __attribute__((export_name("TS_LDKRoutingMessageHandler_new"))) TS_LDKRoutingMessageHandler_new(JSValue o, JSValue MessageSendEventsProvider) {
9325 LDKRoutingMessageHandler *res_ptr = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
9326 *res_ptr = LDKRoutingMessageHandler_init(o, MessageSendEventsProvider);
9327 return tag_ptr(res_ptr, true);
9329 uint64_t __attribute__((export_name("TS_RoutingMessageHandler_handle_node_announcement"))) TS_RoutingMessageHandler_handle_node_announcement(uint64_t this_arg, uint64_t msg) {
9330 void* this_arg_ptr = untag_ptr(this_arg);
9331 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9332 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
9333 LDKNodeAnnouncement msg_conv;
9334 msg_conv.inner = untag_ptr(msg);
9335 msg_conv.is_owned = ptr_is_owned(msg);
9336 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9337 msg_conv.is_owned = false;
9338 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
9339 *ret_conv = (this_arg_conv->handle_node_announcement)(this_arg_conv->this_arg, &msg_conv);
9340 return tag_ptr(ret_conv, true);
9343 uint64_t __attribute__((export_name("TS_RoutingMessageHandler_handle_channel_announcement"))) TS_RoutingMessageHandler_handle_channel_announcement(uint64_t this_arg, uint64_t msg) {
9344 void* this_arg_ptr = untag_ptr(this_arg);
9345 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9346 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
9347 LDKChannelAnnouncement msg_conv;
9348 msg_conv.inner = untag_ptr(msg);
9349 msg_conv.is_owned = ptr_is_owned(msg);
9350 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9351 msg_conv.is_owned = false;
9352 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
9353 *ret_conv = (this_arg_conv->handle_channel_announcement)(this_arg_conv->this_arg, &msg_conv);
9354 return tag_ptr(ret_conv, true);
9357 uint64_t __attribute__((export_name("TS_RoutingMessageHandler_handle_channel_update"))) TS_RoutingMessageHandler_handle_channel_update(uint64_t this_arg, uint64_t msg) {
9358 void* this_arg_ptr = untag_ptr(this_arg);
9359 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9360 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
9361 LDKChannelUpdate msg_conv;
9362 msg_conv.inner = untag_ptr(msg);
9363 msg_conv.is_owned = ptr_is_owned(msg);
9364 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9365 msg_conv.is_owned = false;
9366 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
9367 *ret_conv = (this_arg_conv->handle_channel_update)(this_arg_conv->this_arg, &msg_conv);
9368 return tag_ptr(ret_conv, true);
9371 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) {
9372 void* this_arg_ptr = untag_ptr(this_arg);
9373 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9374 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
9375 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret_var = (this_arg_conv->get_next_channel_announcements)(this_arg_conv->this_arg, starting_point, batch_amount);
9376 uint64_tArray ret_arr = NULL;
9377 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
9378 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
9379 for (size_t h = 0; h < ret_var.datalen; h++) {
9380 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv_59_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
9381 *ret_conv_59_conv = ret_var.data[h];
9382 ret_arr_ptr[h] = tag_ptr(ret_conv_59_conv, true);
9389 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) {
9390 void* this_arg_ptr = untag_ptr(this_arg);
9391 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9392 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
9393 LDKPublicKey starting_point_ref;
9394 CHECK(starting_point->arr_len == 33);
9395 memcpy(starting_point_ref.compressed_form, starting_point->elems, 33); FREE(starting_point);
9396 LDKCVec_NodeAnnouncementZ ret_var = (this_arg_conv->get_next_node_announcements)(this_arg_conv->this_arg, starting_point_ref, batch_amount);
9397 uint64_tArray ret_arr = NULL;
9398 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
9399 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
9400 for (size_t s = 0; s < ret_var.datalen; s++) {
9401 LDKNodeAnnouncement ret_conv_18_var = ret_var.data[s];
9402 uint64_t ret_conv_18_ref = 0;
9403 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_18_var);
9404 ret_conv_18_ref = tag_ptr(ret_conv_18_var.inner, ret_conv_18_var.is_owned);
9405 ret_arr_ptr[s] = ret_conv_18_ref;
9412 void __attribute__((export_name("TS_RoutingMessageHandler_peer_connected"))) TS_RoutingMessageHandler_peer_connected(uint64_t this_arg, int8_tArray their_node_id, uint64_t init) {
9413 void* this_arg_ptr = untag_ptr(this_arg);
9414 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9415 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
9416 LDKPublicKey their_node_id_ref;
9417 CHECK(their_node_id->arr_len == 33);
9418 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9420 init_conv.inner = untag_ptr(init);
9421 init_conv.is_owned = ptr_is_owned(init);
9422 CHECK_INNER_FIELD_ACCESS_OR_NULL(init_conv);
9423 init_conv.is_owned = false;
9424 (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &init_conv);
9427 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) {
9428 void* this_arg_ptr = untag_ptr(this_arg);
9429 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9430 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
9431 LDKPublicKey their_node_id_ref;
9432 CHECK(their_node_id->arr_len == 33);
9433 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9434 LDKReplyChannelRange msg_conv;
9435 msg_conv.inner = untag_ptr(msg);
9436 msg_conv.is_owned = ptr_is_owned(msg);
9437 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9438 msg_conv = ReplyChannelRange_clone(&msg_conv);
9439 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
9440 *ret_conv = (this_arg_conv->handle_reply_channel_range)(this_arg_conv->this_arg, their_node_id_ref, msg_conv);
9441 return tag_ptr(ret_conv, true);
9444 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) {
9445 void* this_arg_ptr = untag_ptr(this_arg);
9446 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9447 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
9448 LDKPublicKey their_node_id_ref;
9449 CHECK(their_node_id->arr_len == 33);
9450 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9451 LDKReplyShortChannelIdsEnd msg_conv;
9452 msg_conv.inner = untag_ptr(msg);
9453 msg_conv.is_owned = ptr_is_owned(msg);
9454 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9455 msg_conv = ReplyShortChannelIdsEnd_clone(&msg_conv);
9456 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
9457 *ret_conv = (this_arg_conv->handle_reply_short_channel_ids_end)(this_arg_conv->this_arg, their_node_id_ref, msg_conv);
9458 return tag_ptr(ret_conv, true);
9461 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) {
9462 void* this_arg_ptr = untag_ptr(this_arg);
9463 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9464 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
9465 LDKPublicKey their_node_id_ref;
9466 CHECK(their_node_id->arr_len == 33);
9467 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9468 LDKQueryChannelRange msg_conv;
9469 msg_conv.inner = untag_ptr(msg);
9470 msg_conv.is_owned = ptr_is_owned(msg);
9471 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9472 msg_conv = QueryChannelRange_clone(&msg_conv);
9473 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
9474 *ret_conv = (this_arg_conv->handle_query_channel_range)(this_arg_conv->this_arg, their_node_id_ref, msg_conv);
9475 return tag_ptr(ret_conv, true);
9478 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) {
9479 void* this_arg_ptr = untag_ptr(this_arg);
9480 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9481 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
9482 LDKPublicKey their_node_id_ref;
9483 CHECK(their_node_id->arr_len == 33);
9484 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9485 LDKQueryShortChannelIds msg_conv;
9486 msg_conv.inner = untag_ptr(msg);
9487 msg_conv.is_owned = ptr_is_owned(msg);
9488 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9489 msg_conv = QueryShortChannelIds_clone(&msg_conv);
9490 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
9491 *ret_conv = (this_arg_conv->handle_query_short_channel_ids)(this_arg_conv->this_arg, their_node_id_ref, msg_conv);
9492 return tag_ptr(ret_conv, true);
9495 typedef struct LDKCustomMessageReader_JCalls {
9496 atomic_size_t refcnt;
9497 uint32_t instance_ptr;
9498 } LDKCustomMessageReader_JCalls;
9499 static void LDKCustomMessageReader_JCalls_free(void* this_arg) {
9500 LDKCustomMessageReader_JCalls *j_calls = (LDKCustomMessageReader_JCalls*) this_arg;
9501 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
9505 LDKCResult_COption_TypeZDecodeErrorZ read_LDKCustomMessageReader_jcall(const void* this_arg, uint16_t message_type, LDKu8slice buffer) {
9506 LDKCustomMessageReader_JCalls *j_calls = (LDKCustomMessageReader_JCalls*) this_arg;
9507 int16_t message_type_conv = message_type;
9508 LDKu8slice buffer_var = buffer;
9509 int8_tArray buffer_arr = init_int8_tArray(buffer_var.datalen, __LINE__);
9510 memcpy(buffer_arr->elems, buffer_var.data, buffer_var.datalen);
9511 uint32_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 85, message_type_conv, (uint32_t)buffer_arr, 0, 0, 0, 0);
9512 void* ret_ptr = untag_ptr(ret);
9513 CHECK_ACCESS(ret_ptr);
9514 LDKCResult_COption_TypeZDecodeErrorZ ret_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(ret_ptr);
9515 FREE(untag_ptr(ret));
9518 static void LDKCustomMessageReader_JCalls_cloned(LDKCustomMessageReader* new_obj) {
9519 LDKCustomMessageReader_JCalls *j_calls = (LDKCustomMessageReader_JCalls*) new_obj->this_arg;
9520 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
9522 static inline LDKCustomMessageReader LDKCustomMessageReader_init (JSValue o) {
9523 LDKCustomMessageReader_JCalls *calls = MALLOC(sizeof(LDKCustomMessageReader_JCalls), "LDKCustomMessageReader_JCalls");
9524 atomic_init(&calls->refcnt, 1);
9525 calls->instance_ptr = o;
9527 LDKCustomMessageReader ret = {
9528 .this_arg = (void*) calls,
9529 .read = read_LDKCustomMessageReader_jcall,
9530 .free = LDKCustomMessageReader_JCalls_free,
9534 uint64_t __attribute__((export_name("TS_LDKCustomMessageReader_new"))) TS_LDKCustomMessageReader_new(JSValue o) {
9535 LDKCustomMessageReader *res_ptr = MALLOC(sizeof(LDKCustomMessageReader), "LDKCustomMessageReader");
9536 *res_ptr = LDKCustomMessageReader_init(o);
9537 return tag_ptr(res_ptr, true);
9539 uint64_t __attribute__((export_name("TS_CustomMessageReader_read"))) TS_CustomMessageReader_read(uint64_t this_arg, int16_t message_type, int8_tArray buffer) {
9540 void* this_arg_ptr = untag_ptr(this_arg);
9541 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9542 LDKCustomMessageReader* this_arg_conv = (LDKCustomMessageReader*)this_arg_ptr;
9543 LDKu8slice buffer_ref;
9544 buffer_ref.datalen = buffer->arr_len;
9545 buffer_ref.data = buffer->elems;
9546 LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
9547 *ret_conv = (this_arg_conv->read)(this_arg_conv->this_arg, message_type, buffer_ref);
9549 return tag_ptr(ret_conv, true);
9552 typedef struct LDKCustomMessageHandler_JCalls {
9553 atomic_size_t refcnt;
9554 uint32_t instance_ptr;
9555 LDKCustomMessageReader_JCalls* CustomMessageReader;
9556 } LDKCustomMessageHandler_JCalls;
9557 static void LDKCustomMessageHandler_JCalls_free(void* this_arg) {
9558 LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) this_arg;
9559 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
9563 LDKCResult_NoneLightningErrorZ handle_custom_message_LDKCustomMessageHandler_jcall(const void* this_arg, LDKType msg, LDKPublicKey sender_node_id) {
9564 LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) this_arg;
9565 LDKType* msg_ret = MALLOC(sizeof(LDKType), "LDKType");
9567 int8_tArray sender_node_id_arr = init_int8_tArray(33, __LINE__);
9568 memcpy(sender_node_id_arr->elems, sender_node_id.compressed_form, 33);
9569 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);
9570 void* ret_ptr = untag_ptr(ret);
9571 CHECK_ACCESS(ret_ptr);
9572 LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
9573 FREE(untag_ptr(ret));
9576 LDKCVec_C2Tuple_PublicKeyTypeZZ get_and_clear_pending_msg_LDKCustomMessageHandler_jcall(const void* this_arg) {
9577 LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) this_arg;
9578 uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 87, 0, 0, 0, 0, 0, 0);
9579 LDKCVec_C2Tuple_PublicKeyTypeZZ ret_constr;
9580 ret_constr.datalen = ret->arr_len;
9581 if (ret_constr.datalen > 0)
9582 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKCVec_C2Tuple_PublicKeyTypeZZ Elements");
9584 ret_constr.data = NULL;
9585 uint64_t* ret_vals = ret->elems;
9586 for (size_t z = 0; z < ret_constr.datalen; z++) {
9587 uint64_t ret_conv_25 = ret_vals[z];
9588 void* ret_conv_25_ptr = untag_ptr(ret_conv_25);
9589 CHECK_ACCESS(ret_conv_25_ptr);
9590 LDKC2Tuple_PublicKeyTypeZ ret_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(ret_conv_25_ptr);
9591 FREE(untag_ptr(ret_conv_25));
9592 ret_constr.data[z] = ret_conv_25_conv;
9597 static void LDKCustomMessageHandler_JCalls_cloned(LDKCustomMessageHandler* new_obj) {
9598 LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) new_obj->this_arg;
9599 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
9600 atomic_fetch_add_explicit(&j_calls->CustomMessageReader->refcnt, 1, memory_order_release);
9602 static inline LDKCustomMessageHandler LDKCustomMessageHandler_init (JSValue o, JSValue CustomMessageReader) {
9603 LDKCustomMessageHandler_JCalls *calls = MALLOC(sizeof(LDKCustomMessageHandler_JCalls), "LDKCustomMessageHandler_JCalls");
9604 atomic_init(&calls->refcnt, 1);
9605 calls->instance_ptr = o;
9607 LDKCustomMessageHandler ret = {
9608 .this_arg = (void*) calls,
9609 .handle_custom_message = handle_custom_message_LDKCustomMessageHandler_jcall,
9610 .get_and_clear_pending_msg = get_and_clear_pending_msg_LDKCustomMessageHandler_jcall,
9611 .free = LDKCustomMessageHandler_JCalls_free,
9612 .CustomMessageReader = LDKCustomMessageReader_init(CustomMessageReader),
9614 calls->CustomMessageReader = ret.CustomMessageReader.this_arg;
9617 uint64_t __attribute__((export_name("TS_LDKCustomMessageHandler_new"))) TS_LDKCustomMessageHandler_new(JSValue o, JSValue CustomMessageReader) {
9618 LDKCustomMessageHandler *res_ptr = MALLOC(sizeof(LDKCustomMessageHandler), "LDKCustomMessageHandler");
9619 *res_ptr = LDKCustomMessageHandler_init(o, CustomMessageReader);
9620 return tag_ptr(res_ptr, true);
9622 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) {
9623 void* this_arg_ptr = untag_ptr(this_arg);
9624 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9625 LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)this_arg_ptr;
9626 void* msg_ptr = untag_ptr(msg);
9627 CHECK_ACCESS(msg_ptr);
9628 LDKType msg_conv = *(LDKType*)(msg_ptr);
9629 if (msg_conv.free == LDKType_JCalls_free) {
9630 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
9631 LDKType_JCalls_cloned(&msg_conv);
9633 LDKPublicKey sender_node_id_ref;
9634 CHECK(sender_node_id->arr_len == 33);
9635 memcpy(sender_node_id_ref.compressed_form, sender_node_id->elems, 33); FREE(sender_node_id);
9636 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
9637 *ret_conv = (this_arg_conv->handle_custom_message)(this_arg_conv->this_arg, msg_conv, sender_node_id_ref);
9638 return tag_ptr(ret_conv, true);
9641 uint64_tArray __attribute__((export_name("TS_CustomMessageHandler_get_and_clear_pending_msg"))) TS_CustomMessageHandler_get_and_clear_pending_msg(uint64_t this_arg) {
9642 void* this_arg_ptr = untag_ptr(this_arg);
9643 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9644 LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)this_arg_ptr;
9645 LDKCVec_C2Tuple_PublicKeyTypeZZ ret_var = (this_arg_conv->get_and_clear_pending_msg)(this_arg_conv->this_arg);
9646 uint64_tArray ret_arr = NULL;
9647 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
9648 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
9649 for (size_t z = 0; z < ret_var.datalen; z++) {
9650 LDKC2Tuple_PublicKeyTypeZ* ret_conv_25_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
9651 *ret_conv_25_conv = ret_var.data[z];
9652 ret_arr_ptr[z] = tag_ptr(ret_conv_25_conv, true);
9659 typedef struct LDKSocketDescriptor_JCalls {
9660 atomic_size_t refcnt;
9661 uint32_t instance_ptr;
9662 } LDKSocketDescriptor_JCalls;
9663 static void LDKSocketDescriptor_JCalls_free(void* this_arg) {
9664 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
9665 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
9669 uintptr_t send_data_LDKSocketDescriptor_jcall(void* this_arg, LDKu8slice data, bool resume_read) {
9670 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
9671 LDKu8slice data_var = data;
9672 int8_tArray data_arr = init_int8_tArray(data_var.datalen, __LINE__);
9673 memcpy(data_arr->elems, data_var.data, data_var.datalen);
9674 jboolean resume_read_conv = resume_read;
9675 return js_invoke_function_uuuuuu(j_calls->instance_ptr, 88, (uint32_t)data_arr, resume_read_conv, 0, 0, 0, 0);
9677 void disconnect_socket_LDKSocketDescriptor_jcall(void* this_arg) {
9678 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
9679 js_invoke_function_uuuuuu(j_calls->instance_ptr, 89, 0, 0, 0, 0, 0, 0);
9681 bool eq_LDKSocketDescriptor_jcall(const void* this_arg, const LDKSocketDescriptor * other_arg) {
9682 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
9683 LDKSocketDescriptor *other_arg_clone = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
9684 *other_arg_clone = SocketDescriptor_clone(other_arg);
9685 return js_invoke_function_buuuuu(j_calls->instance_ptr, 90, tag_ptr(other_arg_clone, true), 0, 0, 0, 0, 0);
9687 uint64_t hash_LDKSocketDescriptor_jcall(const void* this_arg) {
9688 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
9689 return js_invoke_function_uuuuuu(j_calls->instance_ptr, 91, 0, 0, 0, 0, 0, 0);
9691 static void LDKSocketDescriptor_JCalls_cloned(LDKSocketDescriptor* new_obj) {
9692 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) new_obj->this_arg;
9693 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
9695 static inline LDKSocketDescriptor LDKSocketDescriptor_init (JSValue o) {
9696 LDKSocketDescriptor_JCalls *calls = MALLOC(sizeof(LDKSocketDescriptor_JCalls), "LDKSocketDescriptor_JCalls");
9697 atomic_init(&calls->refcnt, 1);
9698 calls->instance_ptr = o;
9700 LDKSocketDescriptor ret = {
9701 .this_arg = (void*) calls,
9702 .send_data = send_data_LDKSocketDescriptor_jcall,
9703 .disconnect_socket = disconnect_socket_LDKSocketDescriptor_jcall,
9704 .eq = eq_LDKSocketDescriptor_jcall,
9705 .hash = hash_LDKSocketDescriptor_jcall,
9706 .cloned = LDKSocketDescriptor_JCalls_cloned,
9707 .free = LDKSocketDescriptor_JCalls_free,
9711 uint64_t __attribute__((export_name("TS_LDKSocketDescriptor_new"))) TS_LDKSocketDescriptor_new(JSValue o) {
9712 LDKSocketDescriptor *res_ptr = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
9713 *res_ptr = LDKSocketDescriptor_init(o);
9714 return tag_ptr(res_ptr, true);
9716 uint32_t __attribute__((export_name("TS_SocketDescriptor_send_data"))) TS_SocketDescriptor_send_data(uint64_t this_arg, int8_tArray data, jboolean resume_read) {
9717 void* this_arg_ptr = untag_ptr(this_arg);
9718 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9719 LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg_ptr;
9720 LDKu8slice data_ref;
9721 data_ref.datalen = data->arr_len;
9722 data_ref.data = data->elems;
9723 uint32_t ret_conv = (this_arg_conv->send_data)(this_arg_conv->this_arg, data_ref, resume_read);
9728 void __attribute__((export_name("TS_SocketDescriptor_disconnect_socket"))) TS_SocketDescriptor_disconnect_socket(uint64_t this_arg) {
9729 void* this_arg_ptr = untag_ptr(this_arg);
9730 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9731 LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg_ptr;
9732 (this_arg_conv->disconnect_socket)(this_arg_conv->this_arg);
9735 int64_t __attribute__((export_name("TS_SocketDescriptor_hash"))) TS_SocketDescriptor_hash(uint64_t this_arg) {
9736 void* this_arg_ptr = untag_ptr(this_arg);
9737 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9738 LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg_ptr;
9739 int64_t ret_conv = (this_arg_conv->hash)(this_arg_conv->this_arg);
9743 uint32_t __attribute__((export_name("TS_LDKEffectiveCapacity_ty_from_ptr"))) TS_LDKEffectiveCapacity_ty_from_ptr(uint64_t ptr) {
9744 LDKEffectiveCapacity *obj = (LDKEffectiveCapacity*)untag_ptr(ptr);
9746 case LDKEffectiveCapacity_ExactLiquidity: return 0;
9747 case LDKEffectiveCapacity_MaximumHTLC: return 1;
9748 case LDKEffectiveCapacity_Total: return 2;
9749 case LDKEffectiveCapacity_Infinite: return 3;
9750 case LDKEffectiveCapacity_Unknown: return 4;
9754 int64_t __attribute__((export_name("TS_LDKEffectiveCapacity_ExactLiquidity_get_liquidity_msat"))) TS_LDKEffectiveCapacity_ExactLiquidity_get_liquidity_msat(uint64_t ptr) {
9755 LDKEffectiveCapacity *obj = (LDKEffectiveCapacity*)untag_ptr(ptr);
9756 assert(obj->tag == LDKEffectiveCapacity_ExactLiquidity);
9757 int64_t liquidity_msat_conv = obj->exact_liquidity.liquidity_msat;
9758 return liquidity_msat_conv;
9760 int64_t __attribute__((export_name("TS_LDKEffectiveCapacity_MaximumHTLC_get_amount_msat"))) TS_LDKEffectiveCapacity_MaximumHTLC_get_amount_msat(uint64_t ptr) {
9761 LDKEffectiveCapacity *obj = (LDKEffectiveCapacity*)untag_ptr(ptr);
9762 assert(obj->tag == LDKEffectiveCapacity_MaximumHTLC);
9763 int64_t amount_msat_conv = obj->maximum_htlc.amount_msat;
9764 return amount_msat_conv;
9766 int64_t __attribute__((export_name("TS_LDKEffectiveCapacity_Total_get_capacity_msat"))) TS_LDKEffectiveCapacity_Total_get_capacity_msat(uint64_t ptr) {
9767 LDKEffectiveCapacity *obj = (LDKEffectiveCapacity*)untag_ptr(ptr);
9768 assert(obj->tag == LDKEffectiveCapacity_Total);
9769 int64_t capacity_msat_conv = obj->total.capacity_msat;
9770 return capacity_msat_conv;
9772 uint64_t __attribute__((export_name("TS_LDKEffectiveCapacity_Total_get_htlc_maximum_msat"))) TS_LDKEffectiveCapacity_Total_get_htlc_maximum_msat(uint64_t ptr) {
9773 LDKEffectiveCapacity *obj = (LDKEffectiveCapacity*)untag_ptr(ptr);
9774 assert(obj->tag == LDKEffectiveCapacity_Total);
9775 uint64_t htlc_maximum_msat_ref = tag_ptr(&obj->total.htlc_maximum_msat, false);
9776 return htlc_maximum_msat_ref;
9778 typedef struct LDKLockableScore_JCalls {
9779 atomic_size_t refcnt;
9780 uint32_t instance_ptr;
9781 } LDKLockableScore_JCalls;
9782 static void LDKLockableScore_JCalls_free(void* this_arg) {
9783 LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) this_arg;
9784 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
9788 LDKScore lock_LDKLockableScore_jcall(const void* this_arg) {
9789 LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) this_arg;
9790 uint32_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 92, 0, 0, 0, 0, 0, 0);
9791 void* ret_ptr = untag_ptr(ret);
9792 CHECK_ACCESS(ret_ptr);
9793 LDKScore ret_conv = *(LDKScore*)(ret_ptr);
9794 if (ret_conv.free == LDKScore_JCalls_free) {
9795 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
9796 LDKScore_JCalls_cloned(&ret_conv);
9797 }// WARNING: we may need a move here but no clone is available for LDKScore
9801 static void LDKLockableScore_JCalls_cloned(LDKLockableScore* new_obj) {
9802 LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) new_obj->this_arg;
9803 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
9805 static inline LDKLockableScore LDKLockableScore_init (JSValue o) {
9806 LDKLockableScore_JCalls *calls = MALLOC(sizeof(LDKLockableScore_JCalls), "LDKLockableScore_JCalls");
9807 atomic_init(&calls->refcnt, 1);
9808 calls->instance_ptr = o;
9810 LDKLockableScore ret = {
9811 .this_arg = (void*) calls,
9812 .lock = lock_LDKLockableScore_jcall,
9813 .free = LDKLockableScore_JCalls_free,
9817 uint64_t __attribute__((export_name("TS_LDKLockableScore_new"))) TS_LDKLockableScore_new(JSValue o) {
9818 LDKLockableScore *res_ptr = MALLOC(sizeof(LDKLockableScore), "LDKLockableScore");
9819 *res_ptr = LDKLockableScore_init(o);
9820 return tag_ptr(res_ptr, true);
9822 uint64_t __attribute__((export_name("TS_LockableScore_lock"))) TS_LockableScore_lock(uint64_t this_arg) {
9823 void* this_arg_ptr = untag_ptr(this_arg);
9824 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9825 LDKLockableScore* this_arg_conv = (LDKLockableScore*)this_arg_ptr;
9826 LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore");
9827 *ret_ret = (this_arg_conv->lock)(this_arg_conv->this_arg);
9828 return tag_ptr(ret_ret, true);
9831 uint32_t __attribute__((export_name("TS_LDKFallback_ty_from_ptr"))) TS_LDKFallback_ty_from_ptr(uint64_t ptr) {
9832 LDKFallback *obj = (LDKFallback*)untag_ptr(ptr);
9834 case LDKFallback_SegWitProgram: return 0;
9835 case LDKFallback_PubKeyHash: return 1;
9836 case LDKFallback_ScriptHash: return 2;
9840 int8_t __attribute__((export_name("TS_LDKFallback_SegWitProgram_get_version"))) TS_LDKFallback_SegWitProgram_get_version(uint64_t ptr) {
9841 LDKFallback *obj = (LDKFallback*)untag_ptr(ptr);
9842 assert(obj->tag == LDKFallback_SegWitProgram);
9843 uint8_t version_val = obj->seg_wit_program.version._0;
9846 int8_tArray __attribute__((export_name("TS_LDKFallback_SegWitProgram_get_program"))) TS_LDKFallback_SegWitProgram_get_program(uint64_t ptr) {
9847 LDKFallback *obj = (LDKFallback*)untag_ptr(ptr);
9848 assert(obj->tag == LDKFallback_SegWitProgram);
9849 LDKCVec_u8Z program_var = obj->seg_wit_program.program;
9850 int8_tArray program_arr = init_int8_tArray(program_var.datalen, __LINE__);
9851 memcpy(program_arr->elems, program_var.data, program_var.datalen);
9854 int8_tArray __attribute__((export_name("TS_LDKFallback_PubKeyHash_get_pub_key_hash"))) TS_LDKFallback_PubKeyHash_get_pub_key_hash(uint64_t ptr) {
9855 LDKFallback *obj = (LDKFallback*)untag_ptr(ptr);
9856 assert(obj->tag == LDKFallback_PubKeyHash);
9857 int8_tArray pub_key_hash_arr = init_int8_tArray(20, __LINE__);
9858 memcpy(pub_key_hash_arr->elems, obj->pub_key_hash.data, 20);
9859 return pub_key_hash_arr;
9861 int8_tArray __attribute__((export_name("TS_LDKFallback_ScriptHash_get_script_hash"))) TS_LDKFallback_ScriptHash_get_script_hash(uint64_t ptr) {
9862 LDKFallback *obj = (LDKFallback*)untag_ptr(ptr);
9863 assert(obj->tag == LDKFallback_ScriptHash);
9864 int8_tArray script_hash_arr = init_int8_tArray(20, __LINE__);
9865 memcpy(script_hash_arr->elems, obj->script_hash.data, 20);
9866 return script_hash_arr;
9868 typedef struct LDKPayer_JCalls {
9869 atomic_size_t refcnt;
9870 uint32_t instance_ptr;
9872 static void LDKPayer_JCalls_free(void* this_arg) {
9873 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
9874 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
9878 LDKPublicKey node_id_LDKPayer_jcall(const void* this_arg) {
9879 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
9880 int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 93, 0, 0, 0, 0, 0, 0);
9881 LDKPublicKey ret_ref;
9882 CHECK(ret->arr_len == 33);
9883 memcpy(ret_ref.compressed_form, ret->elems, 33); FREE(ret);
9886 LDKCVec_ChannelDetailsZ first_hops_LDKPayer_jcall(const void* this_arg) {
9887 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
9888 uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 94, 0, 0, 0, 0, 0, 0);
9889 LDKCVec_ChannelDetailsZ ret_constr;
9890 ret_constr.datalen = ret->arr_len;
9891 if (ret_constr.datalen > 0)
9892 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
9894 ret_constr.data = NULL;
9895 uint64_t* ret_vals = ret->elems;
9896 for (size_t q = 0; q < ret_constr.datalen; q++) {
9897 uint64_t ret_conv_16 = ret_vals[q];
9898 LDKChannelDetails ret_conv_16_conv;
9899 ret_conv_16_conv.inner = untag_ptr(ret_conv_16);
9900 ret_conv_16_conv.is_owned = ptr_is_owned(ret_conv_16);
9901 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_conv);
9902 ret_constr.data[q] = ret_conv_16_conv;
9907 LDKCResult_PaymentIdPaymentSendFailureZ send_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_hash, LDKThirtyTwoBytes payment_secret) {
9908 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
9909 LDKRoute route_var = *route;
9910 uint64_t route_ref = 0;
9911 route_var = Route_clone(&route_var);
9912 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var);
9913 route_ref = tag_ptr(route_var.inner, route_var.is_owned);
9914 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
9915 memcpy(payment_hash_arr->elems, payment_hash.data, 32);
9916 int8_tArray payment_secret_arr = init_int8_tArray(32, __LINE__);
9917 memcpy(payment_secret_arr->elems, payment_secret.data, 32);
9918 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);
9919 void* ret_ptr = untag_ptr(ret);
9920 CHECK_ACCESS(ret_ptr);
9921 LDKCResult_PaymentIdPaymentSendFailureZ ret_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(ret_ptr);
9922 FREE(untag_ptr(ret));
9925 LDKCResult_PaymentIdPaymentSendFailureZ send_spontaneous_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_preimage) {
9926 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
9927 LDKRoute route_var = *route;
9928 uint64_t route_ref = 0;
9929 route_var = Route_clone(&route_var);
9930 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var);
9931 route_ref = tag_ptr(route_var.inner, route_var.is_owned);
9932 int8_tArray payment_preimage_arr = init_int8_tArray(32, __LINE__);
9933 memcpy(payment_preimage_arr->elems, payment_preimage.data, 32);
9934 uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 96, route_ref, (uint32_t)payment_preimage_arr, 0, 0, 0, 0);
9935 void* ret_ptr = untag_ptr(ret);
9936 CHECK_ACCESS(ret_ptr);
9937 LDKCResult_PaymentIdPaymentSendFailureZ ret_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(ret_ptr);
9938 FREE(untag_ptr(ret));
9941 LDKCResult_NonePaymentSendFailureZ retry_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_id) {
9942 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
9943 LDKRoute route_var = *route;
9944 uint64_t route_ref = 0;
9945 route_var = Route_clone(&route_var);
9946 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var);
9947 route_ref = tag_ptr(route_var.inner, route_var.is_owned);
9948 int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
9949 memcpy(payment_id_arr->elems, payment_id.data, 32);
9950 uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 97, route_ref, (uint32_t)payment_id_arr, 0, 0, 0, 0);
9951 void* ret_ptr = untag_ptr(ret);
9952 CHECK_ACCESS(ret_ptr);
9953 LDKCResult_NonePaymentSendFailureZ ret_conv = *(LDKCResult_NonePaymentSendFailureZ*)(ret_ptr);
9954 FREE(untag_ptr(ret));
9957 void abandon_payment_LDKPayer_jcall(const void* this_arg, LDKThirtyTwoBytes payment_id) {
9958 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
9959 int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
9960 memcpy(payment_id_arr->elems, payment_id.data, 32);
9961 js_invoke_function_uuuuuu(j_calls->instance_ptr, 98, (uint32_t)payment_id_arr, 0, 0, 0, 0, 0);
9963 static void LDKPayer_JCalls_cloned(LDKPayer* new_obj) {
9964 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) new_obj->this_arg;
9965 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
9967 static inline LDKPayer LDKPayer_init (JSValue o) {
9968 LDKPayer_JCalls *calls = MALLOC(sizeof(LDKPayer_JCalls), "LDKPayer_JCalls");
9969 atomic_init(&calls->refcnt, 1);
9970 calls->instance_ptr = o;
9973 .this_arg = (void*) calls,
9974 .node_id = node_id_LDKPayer_jcall,
9975 .first_hops = first_hops_LDKPayer_jcall,
9976 .send_payment = send_payment_LDKPayer_jcall,
9977 .send_spontaneous_payment = send_spontaneous_payment_LDKPayer_jcall,
9978 .retry_payment = retry_payment_LDKPayer_jcall,
9979 .abandon_payment = abandon_payment_LDKPayer_jcall,
9980 .free = LDKPayer_JCalls_free,
9984 uint64_t __attribute__((export_name("TS_LDKPayer_new"))) TS_LDKPayer_new(JSValue o) {
9985 LDKPayer *res_ptr = MALLOC(sizeof(LDKPayer), "LDKPayer");
9986 *res_ptr = LDKPayer_init(o);
9987 return tag_ptr(res_ptr, true);
9989 int8_tArray __attribute__((export_name("TS_Payer_node_id"))) TS_Payer_node_id(uint64_t this_arg) {
9990 void* this_arg_ptr = untag_ptr(this_arg);
9991 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9992 LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
9993 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
9994 memcpy(ret_arr->elems, (this_arg_conv->node_id)(this_arg_conv->this_arg).compressed_form, 33);
9998 uint64_tArray __attribute__((export_name("TS_Payer_first_hops"))) TS_Payer_first_hops(uint64_t this_arg) {
9999 void* this_arg_ptr = untag_ptr(this_arg);
10000 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10001 LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
10002 LDKCVec_ChannelDetailsZ ret_var = (this_arg_conv->first_hops)(this_arg_conv->this_arg);
10003 uint64_tArray ret_arr = NULL;
10004 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
10005 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
10006 for (size_t q = 0; q < ret_var.datalen; q++) {
10007 LDKChannelDetails ret_conv_16_var = ret_var.data[q];
10008 uint64_t ret_conv_16_ref = 0;
10009 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
10010 ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned);
10011 ret_arr_ptr[q] = ret_conv_16_ref;
10014 FREE(ret_var.data);
10018 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) {
10019 void* this_arg_ptr = untag_ptr(this_arg);
10020 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10021 LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
10022 LDKRoute route_conv;
10023 route_conv.inner = untag_ptr(route);
10024 route_conv.is_owned = ptr_is_owned(route);
10025 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
10026 route_conv.is_owned = false;
10027 LDKThirtyTwoBytes payment_hash_ref;
10028 CHECK(payment_hash->arr_len == 32);
10029 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
10030 LDKThirtyTwoBytes payment_secret_ref;
10031 CHECK(payment_secret->arr_len == 32);
10032 memcpy(payment_secret_ref.data, payment_secret->elems, 32); FREE(payment_secret);
10033 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
10034 *ret_conv = (this_arg_conv->send_payment)(this_arg_conv->this_arg, &route_conv, payment_hash_ref, payment_secret_ref);
10035 return tag_ptr(ret_conv, true);
10038 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) {
10039 void* this_arg_ptr = untag_ptr(this_arg);
10040 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10041 LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
10042 LDKRoute route_conv;
10043 route_conv.inner = untag_ptr(route);
10044 route_conv.is_owned = ptr_is_owned(route);
10045 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
10046 route_conv.is_owned = false;
10047 LDKThirtyTwoBytes payment_preimage_ref;
10048 CHECK(payment_preimage->arr_len == 32);
10049 memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage);
10050 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
10051 *ret_conv = (this_arg_conv->send_spontaneous_payment)(this_arg_conv->this_arg, &route_conv, payment_preimage_ref);
10052 return tag_ptr(ret_conv, true);
10055 uint64_t __attribute__((export_name("TS_Payer_retry_payment"))) TS_Payer_retry_payment(uint64_t this_arg, uint64_t route, int8_tArray payment_id) {
10056 void* this_arg_ptr = untag_ptr(this_arg);
10057 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10058 LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
10059 LDKRoute route_conv;
10060 route_conv.inner = untag_ptr(route);
10061 route_conv.is_owned = ptr_is_owned(route);
10062 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
10063 route_conv.is_owned = false;
10064 LDKThirtyTwoBytes payment_id_ref;
10065 CHECK(payment_id->arr_len == 32);
10066 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
10067 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
10068 *ret_conv = (this_arg_conv->retry_payment)(this_arg_conv->this_arg, &route_conv, payment_id_ref);
10069 return tag_ptr(ret_conv, true);
10072 void __attribute__((export_name("TS_Payer_abandon_payment"))) TS_Payer_abandon_payment(uint64_t this_arg, int8_tArray payment_id) {
10073 void* this_arg_ptr = untag_ptr(this_arg);
10074 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10075 LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
10076 LDKThirtyTwoBytes payment_id_ref;
10077 CHECK(payment_id->arr_len == 32);
10078 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
10079 (this_arg_conv->abandon_payment)(this_arg_conv->this_arg, payment_id_ref);
10082 typedef struct LDKRouter_JCalls {
10083 atomic_size_t refcnt;
10084 uint32_t instance_ptr;
10085 } LDKRouter_JCalls;
10086 static void LDKRouter_JCalls_free(void* this_arg) {
10087 LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg;
10088 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
10092 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) {
10093 LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg;
10094 int8_tArray payer_arr = init_int8_tArray(33, __LINE__);
10095 memcpy(payer_arr->elems, payer.compressed_form, 33);
10096 LDKRouteParameters route_params_var = *route_params;
10097 uint64_t route_params_ref = 0;
10098 route_params_var = RouteParameters_clone(&route_params_var);
10099 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_var);
10100 route_params_ref = tag_ptr(route_params_var.inner, route_params_var.is_owned);
10101 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
10102 memcpy(payment_hash_arr->elems, *payment_hash, 32);
10103 LDKCVec_ChannelDetailsZ *first_hops_var_ptr = first_hops;
10104 uint64_tArray first_hops_arr = NULL;
10105 if (first_hops != NULL) {
10106 LDKCVec_ChannelDetailsZ first_hops_var = *first_hops_var_ptr;
10107 first_hops_arr = init_uint64_tArray(first_hops_var.datalen, __LINE__);
10108 uint64_t *first_hops_arr_ptr = (uint64_t*)(((uint8_t*)first_hops_arr) + 8);
10109 for (size_t q = 0; q < first_hops_var.datalen; q++) {
10110 LDKChannelDetails first_hops_conv_16_var = first_hops_var.data[q];
10111 uint64_t first_hops_conv_16_ref = 0;
10112 CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_var);
10113 first_hops_conv_16_ref = tag_ptr(first_hops_conv_16_var.inner, first_hops_conv_16_var.is_owned);
10114 first_hops_arr_ptr[q] = first_hops_conv_16_ref;
10118 // WARNING: This object doesn't live past this scope, needs clone!
10119 uint64_t ret_scorer = tag_ptr(scorer, false);
10120 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);
10121 void* ret_ptr = untag_ptr(ret);
10122 CHECK_ACCESS(ret_ptr);
10123 LDKCResult_RouteLightningErrorZ ret_conv = *(LDKCResult_RouteLightningErrorZ*)(ret_ptr);
10124 FREE(untag_ptr(ret));
10127 static void LDKRouter_JCalls_cloned(LDKRouter* new_obj) {
10128 LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) new_obj->this_arg;
10129 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
10131 static inline LDKRouter LDKRouter_init (JSValue o) {
10132 LDKRouter_JCalls *calls = MALLOC(sizeof(LDKRouter_JCalls), "LDKRouter_JCalls");
10133 atomic_init(&calls->refcnt, 1);
10134 calls->instance_ptr = o;
10137 .this_arg = (void*) calls,
10138 .find_route = find_route_LDKRouter_jcall,
10139 .free = LDKRouter_JCalls_free,
10143 uint64_t __attribute__((export_name("TS_LDKRouter_new"))) TS_LDKRouter_new(JSValue o) {
10144 LDKRouter *res_ptr = MALLOC(sizeof(LDKRouter), "LDKRouter");
10145 *res_ptr = LDKRouter_init(o);
10146 return tag_ptr(res_ptr, true);
10148 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) {
10149 void* this_arg_ptr = untag_ptr(this_arg);
10150 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
10151 LDKRouter* this_arg_conv = (LDKRouter*)this_arg_ptr;
10152 LDKPublicKey payer_ref;
10153 CHECK(payer->arr_len == 33);
10154 memcpy(payer_ref.compressed_form, payer->elems, 33); FREE(payer);
10155 LDKRouteParameters route_params_conv;
10156 route_params_conv.inner = untag_ptr(route_params);
10157 route_params_conv.is_owned = ptr_is_owned(route_params);
10158 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv);
10159 route_params_conv.is_owned = false;
10160 unsigned char payment_hash_arr[32];
10161 CHECK(payment_hash->arr_len == 32);
10162 memcpy(payment_hash_arr, payment_hash->elems, 32); FREE(payment_hash);
10163 unsigned char (*payment_hash_ref)[32] = &payment_hash_arr;
10164 LDKCVec_ChannelDetailsZ first_hops_constr;
10165 LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL;
10166 if (first_hops != 0) {
10167 first_hops_constr.datalen = first_hops->arr_len;
10168 if (first_hops_constr.datalen > 0)
10169 first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
10171 first_hops_constr.data = NULL;
10172 uint64_t* first_hops_vals = first_hops->elems;
10173 for (size_t q = 0; q < first_hops_constr.datalen; q++) {
10174 uint64_t first_hops_conv_16 = first_hops_vals[q];
10175 LDKChannelDetails first_hops_conv_16_conv;
10176 first_hops_conv_16_conv.inner = untag_ptr(first_hops_conv_16);
10177 first_hops_conv_16_conv.is_owned = ptr_is_owned(first_hops_conv_16);
10178 CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv);
10179 first_hops_conv_16_conv.is_owned = false;
10180 first_hops_constr.data[q] = first_hops_conv_16_conv;
10183 first_hops_ptr = &first_hops_constr;
10185 void* scorer_ptr = untag_ptr(scorer);
10186 if (ptr_is_owned(scorer)) { CHECK_ACCESS(scorer_ptr); }
10187 LDKScore* scorer_conv = (LDKScore*)scorer_ptr;
10188 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
10189 *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);
10190 if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
10191 return tag_ptr(ret_conv, true);
10194 uint32_t __attribute__((export_name("TS_LDKRetry_ty_from_ptr"))) TS_LDKRetry_ty_from_ptr(uint64_t ptr) {
10195 LDKRetry *obj = (LDKRetry*)untag_ptr(ptr);
10197 case LDKRetry_Attempts: return 0;
10201 uint32_t __attribute__((export_name("TS_LDKRetry_Attempts_get_attempts"))) TS_LDKRetry_Attempts_get_attempts(uint64_t ptr) {
10202 LDKRetry *obj = (LDKRetry*)untag_ptr(ptr);
10203 assert(obj->tag == LDKRetry_Attempts);
10204 uint32_t attempts_conv = obj->attempts;
10205 return attempts_conv;
10207 jstring __attribute__((export_name("TS__ldk_get_compiled_version"))) TS__ldk_get_compiled_version() {
10208 LDKStr ret_str = _ldk_get_compiled_version();
10209 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
10214 jstring __attribute__((export_name("TS__ldk_c_bindings_get_compiled_version"))) TS__ldk_c_bindings_get_compiled_version() {
10215 LDKStr ret_str = _ldk_c_bindings_get_compiled_version();
10216 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
10221 static inline uint64_t Bech32Error_clone_ptr(LDKBech32Error *NONNULL_PTR arg) {
10222 LDKBech32Error *ret_copy = MALLOC(sizeof(LDKBech32Error), "LDKBech32Error");
10223 *ret_copy = Bech32Error_clone(arg);
10224 uint64_t ret_ref = tag_ptr(ret_copy, true);
10227 int64_t __attribute__((export_name("TS_Bech32Error_clone_ptr"))) TS_Bech32Error_clone_ptr(uint64_t arg) {
10228 LDKBech32Error* arg_conv = (LDKBech32Error*)untag_ptr(arg);
10229 int64_t ret_conv = Bech32Error_clone_ptr(arg_conv);
10233 uint64_t __attribute__((export_name("TS_Bech32Error_clone"))) TS_Bech32Error_clone(uint64_t orig) {
10234 LDKBech32Error* orig_conv = (LDKBech32Error*)untag_ptr(orig);
10235 LDKBech32Error *ret_copy = MALLOC(sizeof(LDKBech32Error), "LDKBech32Error");
10236 *ret_copy = Bech32Error_clone(orig_conv);
10237 uint64_t ret_ref = tag_ptr(ret_copy, true);
10241 void __attribute__((export_name("TS_Bech32Error_free"))) TS_Bech32Error_free(uint64_t o) {
10242 if (!ptr_is_owned(o)) return;
10243 void* o_ptr = untag_ptr(o);
10244 CHECK_ACCESS(o_ptr);
10245 LDKBech32Error o_conv = *(LDKBech32Error*)(o_ptr);
10246 FREE(untag_ptr(o));
10247 Bech32Error_free(o_conv);
10250 void __attribute__((export_name("TS_Transaction_free"))) TS_Transaction_free(int8_tArray _res) {
10251 LDKTransaction _res_ref;
10252 _res_ref.datalen = _res->arr_len;
10253 _res_ref.data = MALLOC(_res_ref.datalen, "LDKTransaction Bytes");
10254 memcpy(_res_ref.data, _res->elems, _res_ref.datalen); FREE(_res);
10255 _res_ref.data_is_owned = true;
10256 Transaction_free(_res_ref);
10259 uint64_t __attribute__((export_name("TS_TxOut_new"))) TS_TxOut_new(int8_tArray script_pubkey, int64_t value) {
10260 LDKCVec_u8Z script_pubkey_ref;
10261 script_pubkey_ref.datalen = script_pubkey->arr_len;
10262 script_pubkey_ref.data = MALLOC(script_pubkey_ref.datalen, "LDKCVec_u8Z Bytes");
10263 memcpy(script_pubkey_ref.data, script_pubkey->elems, script_pubkey_ref.datalen); FREE(script_pubkey);
10264 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
10265 *ret_ref = TxOut_new(script_pubkey_ref, value);
10266 return tag_ptr(ret_ref, true);
10269 void __attribute__((export_name("TS_TxOut_free"))) TS_TxOut_free(uint64_t _res) {
10270 if (!ptr_is_owned(_res)) return;
10271 void* _res_ptr = untag_ptr(_res);
10272 CHECK_ACCESS(_res_ptr);
10273 LDKTxOut _res_conv = *(LDKTxOut*)(_res_ptr);
10274 FREE(untag_ptr(_res));
10275 TxOut_free(_res_conv);
10278 static inline uint64_t TxOut_clone_ptr(LDKTxOut *NONNULL_PTR arg) {
10279 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
10280 *ret_ref = TxOut_clone(arg);
10281 return tag_ptr(ret_ref, true);
10283 int64_t __attribute__((export_name("TS_TxOut_clone_ptr"))) TS_TxOut_clone_ptr(uint64_t arg) {
10284 LDKTxOut* arg_conv = (LDKTxOut*)untag_ptr(arg);
10285 int64_t ret_conv = TxOut_clone_ptr(arg_conv);
10289 uint64_t __attribute__((export_name("TS_TxOut_clone"))) TS_TxOut_clone(uint64_t orig) {
10290 LDKTxOut* orig_conv = (LDKTxOut*)untag_ptr(orig);
10291 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
10292 *ret_ref = TxOut_clone(orig_conv);
10293 return tag_ptr(ret_ref, true);
10296 void __attribute__((export_name("TS_Str_free"))) TS_Str_free(jstring _res) {
10297 LDKStr dummy = { .chars = NULL, .len = 0, .chars_is_owned = false };
10301 uint64_t __attribute__((export_name("TS_CResult_NoneNoneZ_ok"))) TS_CResult_NoneNoneZ_ok() {
10302 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
10303 *ret_conv = CResult_NoneNoneZ_ok();
10304 return tag_ptr(ret_conv, true);
10307 uint64_t __attribute__((export_name("TS_CResult_NoneNoneZ_err"))) TS_CResult_NoneNoneZ_err() {
10308 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
10309 *ret_conv = CResult_NoneNoneZ_err();
10310 return tag_ptr(ret_conv, true);
10313 jboolean __attribute__((export_name("TS_CResult_NoneNoneZ_is_ok"))) TS_CResult_NoneNoneZ_is_ok(uint64_t o) {
10314 LDKCResult_NoneNoneZ* o_conv = (LDKCResult_NoneNoneZ*)untag_ptr(o);
10315 jboolean ret_conv = CResult_NoneNoneZ_is_ok(o_conv);
10319 void __attribute__((export_name("TS_CResult_NoneNoneZ_free"))) TS_CResult_NoneNoneZ_free(uint64_t _res) {
10320 if (!ptr_is_owned(_res)) return;
10321 void* _res_ptr = untag_ptr(_res);
10322 CHECK_ACCESS(_res_ptr);
10323 LDKCResult_NoneNoneZ _res_conv = *(LDKCResult_NoneNoneZ*)(_res_ptr);
10324 FREE(untag_ptr(_res));
10325 CResult_NoneNoneZ_free(_res_conv);
10328 static inline uint64_t CResult_NoneNoneZ_clone_ptr(LDKCResult_NoneNoneZ *NONNULL_PTR arg) {
10329 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
10330 *ret_conv = CResult_NoneNoneZ_clone(arg);
10331 return tag_ptr(ret_conv, true);
10333 int64_t __attribute__((export_name("TS_CResult_NoneNoneZ_clone_ptr"))) TS_CResult_NoneNoneZ_clone_ptr(uint64_t arg) {
10334 LDKCResult_NoneNoneZ* arg_conv = (LDKCResult_NoneNoneZ*)untag_ptr(arg);
10335 int64_t ret_conv = CResult_NoneNoneZ_clone_ptr(arg_conv);
10339 uint64_t __attribute__((export_name("TS_CResult_NoneNoneZ_clone"))) TS_CResult_NoneNoneZ_clone(uint64_t orig) {
10340 LDKCResult_NoneNoneZ* orig_conv = (LDKCResult_NoneNoneZ*)untag_ptr(orig);
10341 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
10342 *ret_conv = CResult_NoneNoneZ_clone(orig_conv);
10343 return tag_ptr(ret_conv, true);
10346 uint64_t __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(uint64_t o) {
10347 LDKCounterpartyCommitmentSecrets o_conv;
10348 o_conv.inner = untag_ptr(o);
10349 o_conv.is_owned = ptr_is_owned(o);
10350 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
10351 o_conv = CounterpartyCommitmentSecrets_clone(&o_conv);
10352 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
10353 *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(o_conv);
10354 return tag_ptr(ret_conv, true);
10357 uint64_t __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(uint64_t e) {
10358 LDKDecodeError e_conv;
10359 e_conv.inner = untag_ptr(e);
10360 e_conv.is_owned = ptr_is_owned(e);
10361 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
10362 e_conv = DecodeError_clone(&e_conv);
10363 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
10364 *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(e_conv);
10365 return tag_ptr(ret_conv, true);
10368 jboolean __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(uint64_t o) {
10369 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* o_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(o);
10370 jboolean ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(o_conv);
10374 void __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(uint64_t _res) {
10375 if (!ptr_is_owned(_res)) return;
10376 void* _res_ptr = untag_ptr(_res);
10377 CHECK_ACCESS(_res_ptr);
10378 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)(_res_ptr);
10379 FREE(untag_ptr(_res));
10380 CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(_res_conv);
10383 static inline uint64_t CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR arg) {
10384 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
10385 *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(arg);
10386 return tag_ptr(ret_conv, true);
10388 int64_t __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr(uint64_t arg) {
10389 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(arg);
10390 int64_t ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr(arg_conv);
10394 uint64_t __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(uint64_t orig) {
10395 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(orig);
10396 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
10397 *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(orig_conv);
10398 return tag_ptr(ret_conv, true);
10401 uint64_t __attribute__((export_name("TS_CResult_SecretKeyErrorZ_ok"))) TS_CResult_SecretKeyErrorZ_ok(int8_tArray o) {
10402 LDKSecretKey o_ref;
10403 CHECK(o->arr_len == 32);
10404 memcpy(o_ref.bytes, o->elems, 32); FREE(o);
10405 LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
10406 *ret_conv = CResult_SecretKeyErrorZ_ok(o_ref);
10407 return tag_ptr(ret_conv, true);
10410 uint64_t __attribute__((export_name("TS_CResult_SecretKeyErrorZ_err"))) TS_CResult_SecretKeyErrorZ_err(uint32_t e) {
10411 LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_js(e);
10412 LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
10413 *ret_conv = CResult_SecretKeyErrorZ_err(e_conv);
10414 return tag_ptr(ret_conv, true);
10417 jboolean __attribute__((export_name("TS_CResult_SecretKeyErrorZ_is_ok"))) TS_CResult_SecretKeyErrorZ_is_ok(uint64_t o) {
10418 LDKCResult_SecretKeyErrorZ* o_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(o);
10419 jboolean ret_conv = CResult_SecretKeyErrorZ_is_ok(o_conv);
10423 void __attribute__((export_name("TS_CResult_SecretKeyErrorZ_free"))) TS_CResult_SecretKeyErrorZ_free(uint64_t _res) {
10424 if (!ptr_is_owned(_res)) return;
10425 void* _res_ptr = untag_ptr(_res);
10426 CHECK_ACCESS(_res_ptr);
10427 LDKCResult_SecretKeyErrorZ _res_conv = *(LDKCResult_SecretKeyErrorZ*)(_res_ptr);
10428 FREE(untag_ptr(_res));
10429 CResult_SecretKeyErrorZ_free(_res_conv);
10432 static inline uint64_t CResult_SecretKeyErrorZ_clone_ptr(LDKCResult_SecretKeyErrorZ *NONNULL_PTR arg) {
10433 LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
10434 *ret_conv = CResult_SecretKeyErrorZ_clone(arg);
10435 return tag_ptr(ret_conv, true);
10437 int64_t __attribute__((export_name("TS_CResult_SecretKeyErrorZ_clone_ptr"))) TS_CResult_SecretKeyErrorZ_clone_ptr(uint64_t arg) {
10438 LDKCResult_SecretKeyErrorZ* arg_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(arg);
10439 int64_t ret_conv = CResult_SecretKeyErrorZ_clone_ptr(arg_conv);
10443 uint64_t __attribute__((export_name("TS_CResult_SecretKeyErrorZ_clone"))) TS_CResult_SecretKeyErrorZ_clone(uint64_t orig) {
10444 LDKCResult_SecretKeyErrorZ* orig_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(orig);
10445 LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
10446 *ret_conv = CResult_SecretKeyErrorZ_clone(orig_conv);
10447 return tag_ptr(ret_conv, true);
10450 uint64_t __attribute__((export_name("TS_CResult_PublicKeyErrorZ_ok"))) TS_CResult_PublicKeyErrorZ_ok(int8_tArray o) {
10451 LDKPublicKey o_ref;
10452 CHECK(o->arr_len == 33);
10453 memcpy(o_ref.compressed_form, o->elems, 33); FREE(o);
10454 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
10455 *ret_conv = CResult_PublicKeyErrorZ_ok(o_ref);
10456 return tag_ptr(ret_conv, true);
10459 uint64_t __attribute__((export_name("TS_CResult_PublicKeyErrorZ_err"))) TS_CResult_PublicKeyErrorZ_err(uint32_t e) {
10460 LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_js(e);
10461 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
10462 *ret_conv = CResult_PublicKeyErrorZ_err(e_conv);
10463 return tag_ptr(ret_conv, true);
10466 jboolean __attribute__((export_name("TS_CResult_PublicKeyErrorZ_is_ok"))) TS_CResult_PublicKeyErrorZ_is_ok(uint64_t o) {
10467 LDKCResult_PublicKeyErrorZ* o_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(o);
10468 jboolean ret_conv = CResult_PublicKeyErrorZ_is_ok(o_conv);
10472 void __attribute__((export_name("TS_CResult_PublicKeyErrorZ_free"))) TS_CResult_PublicKeyErrorZ_free(uint64_t _res) {
10473 if (!ptr_is_owned(_res)) return;
10474 void* _res_ptr = untag_ptr(_res);
10475 CHECK_ACCESS(_res_ptr);
10476 LDKCResult_PublicKeyErrorZ _res_conv = *(LDKCResult_PublicKeyErrorZ*)(_res_ptr);
10477 FREE(untag_ptr(_res));
10478 CResult_PublicKeyErrorZ_free(_res_conv);
10481 static inline uint64_t CResult_PublicKeyErrorZ_clone_ptr(LDKCResult_PublicKeyErrorZ *NONNULL_PTR arg) {
10482 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
10483 *ret_conv = CResult_PublicKeyErrorZ_clone(arg);
10484 return tag_ptr(ret_conv, true);
10486 int64_t __attribute__((export_name("TS_CResult_PublicKeyErrorZ_clone_ptr"))) TS_CResult_PublicKeyErrorZ_clone_ptr(uint64_t arg) {
10487 LDKCResult_PublicKeyErrorZ* arg_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(arg);
10488 int64_t ret_conv = CResult_PublicKeyErrorZ_clone_ptr(arg_conv);
10492 uint64_t __attribute__((export_name("TS_CResult_PublicKeyErrorZ_clone"))) TS_CResult_PublicKeyErrorZ_clone(uint64_t orig) {
10493 LDKCResult_PublicKeyErrorZ* orig_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(orig);
10494 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
10495 *ret_conv = CResult_PublicKeyErrorZ_clone(orig_conv);
10496 return tag_ptr(ret_conv, true);
10499 uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_ok"))) TS_CResult_TxCreationKeysDecodeErrorZ_ok(uint64_t o) {
10500 LDKTxCreationKeys o_conv;
10501 o_conv.inner = untag_ptr(o);
10502 o_conv.is_owned = ptr_is_owned(o);
10503 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
10504 o_conv = TxCreationKeys_clone(&o_conv);
10505 LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
10506 *ret_conv = CResult_TxCreationKeysDecodeErrorZ_ok(o_conv);
10507 return tag_ptr(ret_conv, true);
10510 uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_err"))) TS_CResult_TxCreationKeysDecodeErrorZ_err(uint64_t e) {
10511 LDKDecodeError e_conv;
10512 e_conv.inner = untag_ptr(e);
10513 e_conv.is_owned = ptr_is_owned(e);
10514 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
10515 e_conv = DecodeError_clone(&e_conv);
10516 LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
10517 *ret_conv = CResult_TxCreationKeysDecodeErrorZ_err(e_conv);
10518 return tag_ptr(ret_conv, true);
10521 jboolean __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_is_ok"))) TS_CResult_TxCreationKeysDecodeErrorZ_is_ok(uint64_t o) {
10522 LDKCResult_TxCreationKeysDecodeErrorZ* o_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(o);
10523 jboolean ret_conv = CResult_TxCreationKeysDecodeErrorZ_is_ok(o_conv);
10527 void __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_free"))) TS_CResult_TxCreationKeysDecodeErrorZ_free(uint64_t _res) {
10528 if (!ptr_is_owned(_res)) return;
10529 void* _res_ptr = untag_ptr(_res);
10530 CHECK_ACCESS(_res_ptr);
10531 LDKCResult_TxCreationKeysDecodeErrorZ _res_conv = *(LDKCResult_TxCreationKeysDecodeErrorZ*)(_res_ptr);
10532 FREE(untag_ptr(_res));
10533 CResult_TxCreationKeysDecodeErrorZ_free(_res_conv);
10536 static inline uint64_t CResult_TxCreationKeysDecodeErrorZ_clone_ptr(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR arg) {
10537 LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
10538 *ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone(arg);
10539 return tag_ptr(ret_conv, true);
10541 int64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_clone_ptr"))) TS_CResult_TxCreationKeysDecodeErrorZ_clone_ptr(uint64_t arg) {
10542 LDKCResult_TxCreationKeysDecodeErrorZ* arg_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(arg);
10543 int64_t ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone_ptr(arg_conv);
10547 uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_clone"))) TS_CResult_TxCreationKeysDecodeErrorZ_clone(uint64_t orig) {
10548 LDKCResult_TxCreationKeysDecodeErrorZ* orig_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(orig);
10549 LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
10550 *ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone(orig_conv);
10551 return tag_ptr(ret_conv, true);
10554 uint64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_ok"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_ok(uint64_t o) {
10555 LDKChannelPublicKeys o_conv;
10556 o_conv.inner = untag_ptr(o);
10557 o_conv.is_owned = ptr_is_owned(o);
10558 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
10559 o_conv = ChannelPublicKeys_clone(&o_conv);
10560 LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
10561 *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_ok(o_conv);
10562 return tag_ptr(ret_conv, true);
10565 uint64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_err"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_err(uint64_t e) {
10566 LDKDecodeError e_conv;
10567 e_conv.inner = untag_ptr(e);
10568 e_conv.is_owned = ptr_is_owned(e);
10569 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
10570 e_conv = DecodeError_clone(&e_conv);
10571 LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
10572 *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_err(e_conv);
10573 return tag_ptr(ret_conv, true);
10576 jboolean __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_is_ok"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_is_ok(uint64_t o) {
10577 LDKCResult_ChannelPublicKeysDecodeErrorZ* o_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(o);
10578 jboolean ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_is_ok(o_conv);
10582 void __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_free"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_free(uint64_t _res) {
10583 if (!ptr_is_owned(_res)) return;
10584 void* _res_ptr = untag_ptr(_res);
10585 CHECK_ACCESS(_res_ptr);
10586 LDKCResult_ChannelPublicKeysDecodeErrorZ _res_conv = *(LDKCResult_ChannelPublicKeysDecodeErrorZ*)(_res_ptr);
10587 FREE(untag_ptr(_res));
10588 CResult_ChannelPublicKeysDecodeErrorZ_free(_res_conv);
10591 static inline uint64_t CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR arg) {
10592 LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
10593 *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone(arg);
10594 return tag_ptr(ret_conv, true);
10596 int64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(uint64_t arg) {
10597 LDKCResult_ChannelPublicKeysDecodeErrorZ* arg_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(arg);
10598 int64_t ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(arg_conv);
10602 uint64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_clone"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_clone(uint64_t orig) {
10603 LDKCResult_ChannelPublicKeysDecodeErrorZ* orig_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(orig);
10604 LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
10605 *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone(orig_conv);
10606 return tag_ptr(ret_conv, true);
10609 uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_ok"))) TS_CResult_TxCreationKeysErrorZ_ok(uint64_t o) {
10610 LDKTxCreationKeys o_conv;
10611 o_conv.inner = untag_ptr(o);
10612 o_conv.is_owned = ptr_is_owned(o);
10613 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
10614 o_conv = TxCreationKeys_clone(&o_conv);
10615 LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
10616 *ret_conv = CResult_TxCreationKeysErrorZ_ok(o_conv);
10617 return tag_ptr(ret_conv, true);
10620 uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_err"))) TS_CResult_TxCreationKeysErrorZ_err(uint32_t e) {
10621 LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_js(e);
10622 LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
10623 *ret_conv = CResult_TxCreationKeysErrorZ_err(e_conv);
10624 return tag_ptr(ret_conv, true);
10627 jboolean __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_is_ok"))) TS_CResult_TxCreationKeysErrorZ_is_ok(uint64_t o) {
10628 LDKCResult_TxCreationKeysErrorZ* o_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(o);
10629 jboolean ret_conv = CResult_TxCreationKeysErrorZ_is_ok(o_conv);
10633 void __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_free"))) TS_CResult_TxCreationKeysErrorZ_free(uint64_t _res) {
10634 if (!ptr_is_owned(_res)) return;
10635 void* _res_ptr = untag_ptr(_res);
10636 CHECK_ACCESS(_res_ptr);
10637 LDKCResult_TxCreationKeysErrorZ _res_conv = *(LDKCResult_TxCreationKeysErrorZ*)(_res_ptr);
10638 FREE(untag_ptr(_res));
10639 CResult_TxCreationKeysErrorZ_free(_res_conv);
10642 static inline uint64_t CResult_TxCreationKeysErrorZ_clone_ptr(LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR arg) {
10643 LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
10644 *ret_conv = CResult_TxCreationKeysErrorZ_clone(arg);
10645 return tag_ptr(ret_conv, true);
10647 int64_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_clone_ptr"))) TS_CResult_TxCreationKeysErrorZ_clone_ptr(uint64_t arg) {
10648 LDKCResult_TxCreationKeysErrorZ* arg_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(arg);
10649 int64_t ret_conv = CResult_TxCreationKeysErrorZ_clone_ptr(arg_conv);
10653 uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_clone"))) TS_CResult_TxCreationKeysErrorZ_clone(uint64_t orig) {
10654 LDKCResult_TxCreationKeysErrorZ* orig_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(orig);
10655 LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
10656 *ret_conv = CResult_TxCreationKeysErrorZ_clone(orig_conv);
10657 return tag_ptr(ret_conv, true);
10660 uint64_t __attribute__((export_name("TS_COption_u32Z_some"))) TS_COption_u32Z_some(int32_t o) {
10661 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
10662 *ret_copy = COption_u32Z_some(o);
10663 uint64_t ret_ref = tag_ptr(ret_copy, true);
10667 uint64_t __attribute__((export_name("TS_COption_u32Z_none"))) TS_COption_u32Z_none() {
10668 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
10669 *ret_copy = COption_u32Z_none();
10670 uint64_t ret_ref = tag_ptr(ret_copy, true);
10674 void __attribute__((export_name("TS_COption_u32Z_free"))) TS_COption_u32Z_free(uint64_t _res) {
10675 if (!ptr_is_owned(_res)) return;
10676 void* _res_ptr = untag_ptr(_res);
10677 CHECK_ACCESS(_res_ptr);
10678 LDKCOption_u32Z _res_conv = *(LDKCOption_u32Z*)(_res_ptr);
10679 FREE(untag_ptr(_res));
10680 COption_u32Z_free(_res_conv);
10683 static inline uint64_t COption_u32Z_clone_ptr(LDKCOption_u32Z *NONNULL_PTR arg) {
10684 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
10685 *ret_copy = COption_u32Z_clone(arg);
10686 uint64_t ret_ref = tag_ptr(ret_copy, true);
10689 int64_t __attribute__((export_name("TS_COption_u32Z_clone_ptr"))) TS_COption_u32Z_clone_ptr(uint64_t arg) {
10690 LDKCOption_u32Z* arg_conv = (LDKCOption_u32Z*)untag_ptr(arg);
10691 int64_t ret_conv = COption_u32Z_clone_ptr(arg_conv);
10695 uint64_t __attribute__((export_name("TS_COption_u32Z_clone"))) TS_COption_u32Z_clone(uint64_t orig) {
10696 LDKCOption_u32Z* orig_conv = (LDKCOption_u32Z*)untag_ptr(orig);
10697 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
10698 *ret_copy = COption_u32Z_clone(orig_conv);
10699 uint64_t ret_ref = tag_ptr(ret_copy, true);
10703 uint64_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_ok"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(uint64_t o) {
10704 LDKHTLCOutputInCommitment o_conv;
10705 o_conv.inner = untag_ptr(o);
10706 o_conv.is_owned = ptr_is_owned(o);
10707 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
10708 o_conv = HTLCOutputInCommitment_clone(&o_conv);
10709 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
10710 *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(o_conv);
10711 return tag_ptr(ret_conv, true);
10714 uint64_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_err"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_err(uint64_t e) {
10715 LDKDecodeError e_conv;
10716 e_conv.inner = untag_ptr(e);
10717 e_conv.is_owned = ptr_is_owned(e);
10718 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
10719 e_conv = DecodeError_clone(&e_conv);
10720 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
10721 *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_err(e_conv);
10722 return tag_ptr(ret_conv, true);
10725 jboolean __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(uint64_t o) {
10726 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* o_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(o);
10727 jboolean ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(o_conv);
10731 void __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_free"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_free(uint64_t _res) {
10732 if (!ptr_is_owned(_res)) return;
10733 void* _res_ptr = untag_ptr(_res);
10734 CHECK_ACCESS(_res_ptr);
10735 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res_conv = *(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(_res_ptr);
10736 FREE(untag_ptr(_res));
10737 CResult_HTLCOutputInCommitmentDecodeErrorZ_free(_res_conv);
10740 static inline uint64_t CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR arg) {
10741 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
10742 *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(arg);
10743 return tag_ptr(ret_conv, true);
10745 int64_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(uint64_t arg) {
10746 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* arg_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(arg);
10747 int64_t ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(arg_conv);
10751 uint64_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(uint64_t orig) {
10752 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* orig_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(orig);
10753 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
10754 *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(orig_conv);
10755 return tag_ptr(ret_conv, true);
10758 uint32_t __attribute__((export_name("TS_COption_NoneZ_some"))) TS_COption_NoneZ_some() {
10759 uint32_t ret_conv = LDKCOption_NoneZ_to_js(COption_NoneZ_some());
10763 uint32_t __attribute__((export_name("TS_COption_NoneZ_none"))) TS_COption_NoneZ_none() {
10764 uint32_t ret_conv = LDKCOption_NoneZ_to_js(COption_NoneZ_none());
10768 void __attribute__((export_name("TS_COption_NoneZ_free"))) TS_COption_NoneZ_free(uint32_t _res) {
10769 LDKCOption_NoneZ _res_conv = LDKCOption_NoneZ_from_js(_res);
10770 COption_NoneZ_free(_res_conv);
10773 uint64_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(uint64_t o) {
10774 LDKCounterpartyChannelTransactionParameters o_conv;
10775 o_conv.inner = untag_ptr(o);
10776 o_conv.is_owned = ptr_is_owned(o);
10777 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
10778 o_conv = CounterpartyChannelTransactionParameters_clone(&o_conv);
10779 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
10780 *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(o_conv);
10781 return tag_ptr(ret_conv, true);
10784 uint64_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(uint64_t e) {
10785 LDKDecodeError e_conv;
10786 e_conv.inner = untag_ptr(e);
10787 e_conv.is_owned = ptr_is_owned(e);
10788 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
10789 e_conv = DecodeError_clone(&e_conv);
10790 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
10791 *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(e_conv);
10792 return tag_ptr(ret_conv, true);
10795 jboolean __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(uint64_t o) {
10796 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* o_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(o);
10797 jboolean ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(o_conv);
10801 void __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(uint64_t _res) {
10802 if (!ptr_is_owned(_res)) return;
10803 void* _res_ptr = untag_ptr(_res);
10804 CHECK_ACCESS(_res_ptr);
10805 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(_res_ptr);
10806 FREE(untag_ptr(_res));
10807 CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(_res_conv);
10810 static inline uint64_t CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg) {
10811 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
10812 *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(arg);
10813 return tag_ptr(ret_conv, true);
10815 int64_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(uint64_t arg) {
10816 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(arg);
10817 int64_t ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv);
10821 uint64_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(uint64_t orig) {
10822 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(orig);
10823 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
10824 *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(orig_conv);
10825 return tag_ptr(ret_conv, true);
10828 uint64_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_ok"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_ok(uint64_t o) {
10829 LDKChannelTransactionParameters o_conv;
10830 o_conv.inner = untag_ptr(o);
10831 o_conv.is_owned = ptr_is_owned(o);
10832 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
10833 o_conv = ChannelTransactionParameters_clone(&o_conv);
10834 LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
10835 *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_ok(o_conv);
10836 return tag_ptr(ret_conv, true);
10839 uint64_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_err"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_err(uint64_t e) {
10840 LDKDecodeError e_conv;
10841 e_conv.inner = untag_ptr(e);
10842 e_conv.is_owned = ptr_is_owned(e);
10843 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
10844 e_conv = DecodeError_clone(&e_conv);
10845 LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
10846 *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_err(e_conv);
10847 return tag_ptr(ret_conv, true);
10850 jboolean __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_is_ok"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(uint64_t o) {
10851 LDKCResult_ChannelTransactionParametersDecodeErrorZ* o_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(o);
10852 jboolean ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(o_conv);
10856 void __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_free"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_free(uint64_t _res) {
10857 if (!ptr_is_owned(_res)) return;
10858 void* _res_ptr = untag_ptr(_res);
10859 CHECK_ACCESS(_res_ptr);
10860 LDKCResult_ChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(_res_ptr);
10861 FREE(untag_ptr(_res));
10862 CResult_ChannelTransactionParametersDecodeErrorZ_free(_res_conv);
10865 static inline uint64_t CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg) {
10866 LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
10867 *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone(arg);
10868 return tag_ptr(ret_conv, true);
10870 int64_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(uint64_t arg) {
10871 LDKCResult_ChannelTransactionParametersDecodeErrorZ* arg_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(arg);
10872 int64_t ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv);
10876 uint64_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_clone"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_clone(uint64_t orig) {
10877 LDKCResult_ChannelTransactionParametersDecodeErrorZ* orig_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(orig);
10878 LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
10879 *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone(orig_conv);
10880 return tag_ptr(ret_conv, true);
10883 void __attribute__((export_name("TS_CVec_SignatureZ_free"))) TS_CVec_SignatureZ_free(ptrArray _res) {
10884 LDKCVec_SignatureZ _res_constr;
10885 _res_constr.datalen = _res->arr_len;
10886 if (_res_constr.datalen > 0)
10887 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
10889 _res_constr.data = NULL;
10890 int8_tArray* _res_vals = (void*) _res->elems;
10891 for (size_t m = 0; m < _res_constr.datalen; m++) {
10892 int8_tArray _res_conv_12 = _res_vals[m];
10893 LDKSignature _res_conv_12_ref;
10894 CHECK(_res_conv_12->arr_len == 64);
10895 memcpy(_res_conv_12_ref.compact_form, _res_conv_12->elems, 64); FREE(_res_conv_12);
10896 _res_constr.data[m] = _res_conv_12_ref;
10899 CVec_SignatureZ_free(_res_constr);
10902 uint64_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_ok"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_ok(uint64_t o) {
10903 LDKHolderCommitmentTransaction o_conv;
10904 o_conv.inner = untag_ptr(o);
10905 o_conv.is_owned = ptr_is_owned(o);
10906 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
10907 o_conv = HolderCommitmentTransaction_clone(&o_conv);
10908 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
10909 *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_ok(o_conv);
10910 return tag_ptr(ret_conv, true);
10913 uint64_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_err"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_err(uint64_t e) {
10914 LDKDecodeError e_conv;
10915 e_conv.inner = untag_ptr(e);
10916 e_conv.is_owned = ptr_is_owned(e);
10917 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
10918 e_conv = DecodeError_clone(&e_conv);
10919 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
10920 *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_err(e_conv);
10921 return tag_ptr(ret_conv, true);
10924 jboolean __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(uint64_t o) {
10925 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(o);
10926 jboolean ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(o_conv);
10930 void __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_free"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_free(uint64_t _res) {
10931 if (!ptr_is_owned(_res)) return;
10932 void* _res_ptr = untag_ptr(_res);
10933 CHECK_ACCESS(_res_ptr);
10934 LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(_res_ptr);
10935 FREE(untag_ptr(_res));
10936 CResult_HolderCommitmentTransactionDecodeErrorZ_free(_res_conv);
10939 static inline uint64_t CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) {
10940 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
10941 *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone(arg);
10942 return tag_ptr(ret_conv, true);
10944 int64_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(uint64_t arg) {
10945 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(arg);
10946 int64_t ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv);
10950 uint64_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_clone"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_clone(uint64_t orig) {
10951 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(orig);
10952 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
10953 *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone(orig_conv);
10954 return tag_ptr(ret_conv, true);
10957 uint64_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_ok"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(uint64_t o) {
10958 LDKBuiltCommitmentTransaction o_conv;
10959 o_conv.inner = untag_ptr(o);
10960 o_conv.is_owned = ptr_is_owned(o);
10961 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
10962 o_conv = BuiltCommitmentTransaction_clone(&o_conv);
10963 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
10964 *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(o_conv);
10965 return tag_ptr(ret_conv, true);
10968 uint64_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_err"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_err(uint64_t e) {
10969 LDKDecodeError e_conv;
10970 e_conv.inner = untag_ptr(e);
10971 e_conv.is_owned = ptr_is_owned(e);
10972 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
10973 e_conv = DecodeError_clone(&e_conv);
10974 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
10975 *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_err(e_conv);
10976 return tag_ptr(ret_conv, true);
10979 jboolean __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(uint64_t o) {
10980 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(o);
10981 jboolean ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(o_conv);
10985 void __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_free"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_free(uint64_t _res) {
10986 if (!ptr_is_owned(_res)) return;
10987 void* _res_ptr = untag_ptr(_res);
10988 CHECK_ACCESS(_res_ptr);
10989 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(_res_ptr);
10990 FREE(untag_ptr(_res));
10991 CResult_BuiltCommitmentTransactionDecodeErrorZ_free(_res_conv);
10994 static inline uint64_t CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) {
10995 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
10996 *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(arg);
10997 return tag_ptr(ret_conv, true);
10999 int64_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(uint64_t arg) {
11000 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(arg);
11001 int64_t ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv);
11005 uint64_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(uint64_t orig) {
11006 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(orig);
11007 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
11008 *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(orig_conv);
11009 return tag_ptr(ret_conv, true);
11012 uint64_t __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_ok"))) TS_CResult_TrustedClosingTransactionNoneZ_ok(uint64_t o) {
11013 LDKTrustedClosingTransaction o_conv;
11014 o_conv.inner = untag_ptr(o);
11015 o_conv.is_owned = ptr_is_owned(o);
11016 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11017 // WARNING: we need a move here but no clone is available for LDKTrustedClosingTransaction
11019 LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ");
11020 *ret_conv = CResult_TrustedClosingTransactionNoneZ_ok(o_conv);
11021 return tag_ptr(ret_conv, true);
11024 uint64_t __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_err"))) TS_CResult_TrustedClosingTransactionNoneZ_err() {
11025 LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ");
11026 *ret_conv = CResult_TrustedClosingTransactionNoneZ_err();
11027 return tag_ptr(ret_conv, true);
11030 jboolean __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_is_ok"))) TS_CResult_TrustedClosingTransactionNoneZ_is_ok(uint64_t o) {
11031 LDKCResult_TrustedClosingTransactionNoneZ* o_conv = (LDKCResult_TrustedClosingTransactionNoneZ*)untag_ptr(o);
11032 jboolean ret_conv = CResult_TrustedClosingTransactionNoneZ_is_ok(o_conv);
11036 void __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_free"))) TS_CResult_TrustedClosingTransactionNoneZ_free(uint64_t _res) {
11037 if (!ptr_is_owned(_res)) return;
11038 void* _res_ptr = untag_ptr(_res);
11039 CHECK_ACCESS(_res_ptr);
11040 LDKCResult_TrustedClosingTransactionNoneZ _res_conv = *(LDKCResult_TrustedClosingTransactionNoneZ*)(_res_ptr);
11041 FREE(untag_ptr(_res));
11042 CResult_TrustedClosingTransactionNoneZ_free(_res_conv);
11045 uint64_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_ok"))) TS_CResult_CommitmentTransactionDecodeErrorZ_ok(uint64_t o) {
11046 LDKCommitmentTransaction o_conv;
11047 o_conv.inner = untag_ptr(o);
11048 o_conv.is_owned = ptr_is_owned(o);
11049 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11050 o_conv = CommitmentTransaction_clone(&o_conv);
11051 LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
11052 *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_ok(o_conv);
11053 return tag_ptr(ret_conv, true);
11056 uint64_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_err"))) TS_CResult_CommitmentTransactionDecodeErrorZ_err(uint64_t e) {
11057 LDKDecodeError e_conv;
11058 e_conv.inner = untag_ptr(e);
11059 e_conv.is_owned = ptr_is_owned(e);
11060 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
11061 e_conv = DecodeError_clone(&e_conv);
11062 LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
11063 *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_err(e_conv);
11064 return tag_ptr(ret_conv, true);
11067 jboolean __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_is_ok"))) TS_CResult_CommitmentTransactionDecodeErrorZ_is_ok(uint64_t o) {
11068 LDKCResult_CommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(o);
11069 jboolean ret_conv = CResult_CommitmentTransactionDecodeErrorZ_is_ok(o_conv);
11073 void __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_free"))) TS_CResult_CommitmentTransactionDecodeErrorZ_free(uint64_t _res) {
11074 if (!ptr_is_owned(_res)) return;
11075 void* _res_ptr = untag_ptr(_res);
11076 CHECK_ACCESS(_res_ptr);
11077 LDKCResult_CommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_CommitmentTransactionDecodeErrorZ*)(_res_ptr);
11078 FREE(untag_ptr(_res));
11079 CResult_CommitmentTransactionDecodeErrorZ_free(_res_conv);
11082 static inline uint64_t CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) {
11083 LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
11084 *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone(arg);
11085 return tag_ptr(ret_conv, true);
11087 int64_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_clone_ptr"))) TS_CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(uint64_t arg) {
11088 LDKCResult_CommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(arg);
11089 int64_t ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv);
11093 uint64_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_clone"))) TS_CResult_CommitmentTransactionDecodeErrorZ_clone(uint64_t orig) {
11094 LDKCResult_CommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(orig);
11095 LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
11096 *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone(orig_conv);
11097 return tag_ptr(ret_conv, true);
11100 uint64_t __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNoneZ_ok"))) TS_CResult_TrustedCommitmentTransactionNoneZ_ok(uint64_t o) {
11101 LDKTrustedCommitmentTransaction o_conv;
11102 o_conv.inner = untag_ptr(o);
11103 o_conv.is_owned = ptr_is_owned(o);
11104 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11105 // WARNING: we need a move here but no clone is available for LDKTrustedCommitmentTransaction
11107 LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ");
11108 *ret_conv = CResult_TrustedCommitmentTransactionNoneZ_ok(o_conv);
11109 return tag_ptr(ret_conv, true);
11112 uint64_t __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNoneZ_err"))) TS_CResult_TrustedCommitmentTransactionNoneZ_err() {
11113 LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ");
11114 *ret_conv = CResult_TrustedCommitmentTransactionNoneZ_err();
11115 return tag_ptr(ret_conv, true);
11118 jboolean __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNoneZ_is_ok"))) TS_CResult_TrustedCommitmentTransactionNoneZ_is_ok(uint64_t o) {
11119 LDKCResult_TrustedCommitmentTransactionNoneZ* o_conv = (LDKCResult_TrustedCommitmentTransactionNoneZ*)untag_ptr(o);
11120 jboolean ret_conv = CResult_TrustedCommitmentTransactionNoneZ_is_ok(o_conv);
11124 void __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNoneZ_free"))) TS_CResult_TrustedCommitmentTransactionNoneZ_free(uint64_t _res) {
11125 if (!ptr_is_owned(_res)) return;
11126 void* _res_ptr = untag_ptr(_res);
11127 CHECK_ACCESS(_res_ptr);
11128 LDKCResult_TrustedCommitmentTransactionNoneZ _res_conv = *(LDKCResult_TrustedCommitmentTransactionNoneZ*)(_res_ptr);
11129 FREE(untag_ptr(_res));
11130 CResult_TrustedCommitmentTransactionNoneZ_free(_res_conv);
11133 uint64_t __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_ok"))) TS_CResult_CVec_SignatureZNoneZ_ok(ptrArray o) {
11134 LDKCVec_SignatureZ o_constr;
11135 o_constr.datalen = o->arr_len;
11136 if (o_constr.datalen > 0)
11137 o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
11139 o_constr.data = NULL;
11140 int8_tArray* o_vals = (void*) o->elems;
11141 for (size_t m = 0; m < o_constr.datalen; m++) {
11142 int8_tArray o_conv_12 = o_vals[m];
11143 LDKSignature o_conv_12_ref;
11144 CHECK(o_conv_12->arr_len == 64);
11145 memcpy(o_conv_12_ref.compact_form, o_conv_12->elems, 64); FREE(o_conv_12);
11146 o_constr.data[m] = o_conv_12_ref;
11149 LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
11150 *ret_conv = CResult_CVec_SignatureZNoneZ_ok(o_constr);
11151 return tag_ptr(ret_conv, true);
11154 uint64_t __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_err"))) TS_CResult_CVec_SignatureZNoneZ_err() {
11155 LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
11156 *ret_conv = CResult_CVec_SignatureZNoneZ_err();
11157 return tag_ptr(ret_conv, true);
11160 jboolean __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_is_ok"))) TS_CResult_CVec_SignatureZNoneZ_is_ok(uint64_t o) {
11161 LDKCResult_CVec_SignatureZNoneZ* o_conv = (LDKCResult_CVec_SignatureZNoneZ*)untag_ptr(o);
11162 jboolean ret_conv = CResult_CVec_SignatureZNoneZ_is_ok(o_conv);
11166 void __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_free"))) TS_CResult_CVec_SignatureZNoneZ_free(uint64_t _res) {
11167 if (!ptr_is_owned(_res)) return;
11168 void* _res_ptr = untag_ptr(_res);
11169 CHECK_ACCESS(_res_ptr);
11170 LDKCResult_CVec_SignatureZNoneZ _res_conv = *(LDKCResult_CVec_SignatureZNoneZ*)(_res_ptr);
11171 FREE(untag_ptr(_res));
11172 CResult_CVec_SignatureZNoneZ_free(_res_conv);
11175 static inline uint64_t CResult_CVec_SignatureZNoneZ_clone_ptr(LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR arg) {
11176 LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
11177 *ret_conv = CResult_CVec_SignatureZNoneZ_clone(arg);
11178 return tag_ptr(ret_conv, true);
11180 int64_t __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_clone_ptr"))) TS_CResult_CVec_SignatureZNoneZ_clone_ptr(uint64_t arg) {
11181 LDKCResult_CVec_SignatureZNoneZ* arg_conv = (LDKCResult_CVec_SignatureZNoneZ*)untag_ptr(arg);
11182 int64_t ret_conv = CResult_CVec_SignatureZNoneZ_clone_ptr(arg_conv);
11186 uint64_t __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_clone"))) TS_CResult_CVec_SignatureZNoneZ_clone(uint64_t orig) {
11187 LDKCResult_CVec_SignatureZNoneZ* orig_conv = (LDKCResult_CVec_SignatureZNoneZ*)untag_ptr(orig);
11188 LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
11189 *ret_conv = CResult_CVec_SignatureZNoneZ_clone(orig_conv);
11190 return tag_ptr(ret_conv, true);
11193 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_ok"))) TS_CResult_ShutdownScriptDecodeErrorZ_ok(uint64_t o) {
11194 LDKShutdownScript o_conv;
11195 o_conv.inner = untag_ptr(o);
11196 o_conv.is_owned = ptr_is_owned(o);
11197 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11198 o_conv = ShutdownScript_clone(&o_conv);
11199 LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
11200 *ret_conv = CResult_ShutdownScriptDecodeErrorZ_ok(o_conv);
11201 return tag_ptr(ret_conv, true);
11204 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_err"))) TS_CResult_ShutdownScriptDecodeErrorZ_err(uint64_t e) {
11205 LDKDecodeError e_conv;
11206 e_conv.inner = untag_ptr(e);
11207 e_conv.is_owned = ptr_is_owned(e);
11208 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
11209 e_conv = DecodeError_clone(&e_conv);
11210 LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
11211 *ret_conv = CResult_ShutdownScriptDecodeErrorZ_err(e_conv);
11212 return tag_ptr(ret_conv, true);
11215 jboolean __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_is_ok"))) TS_CResult_ShutdownScriptDecodeErrorZ_is_ok(uint64_t o) {
11216 LDKCResult_ShutdownScriptDecodeErrorZ* o_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(o);
11217 jboolean ret_conv = CResult_ShutdownScriptDecodeErrorZ_is_ok(o_conv);
11221 void __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_free"))) TS_CResult_ShutdownScriptDecodeErrorZ_free(uint64_t _res) {
11222 if (!ptr_is_owned(_res)) return;
11223 void* _res_ptr = untag_ptr(_res);
11224 CHECK_ACCESS(_res_ptr);
11225 LDKCResult_ShutdownScriptDecodeErrorZ _res_conv = *(LDKCResult_ShutdownScriptDecodeErrorZ*)(_res_ptr);
11226 FREE(untag_ptr(_res));
11227 CResult_ShutdownScriptDecodeErrorZ_free(_res_conv);
11230 static inline uint64_t CResult_ShutdownScriptDecodeErrorZ_clone_ptr(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR arg) {
11231 LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
11232 *ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone(arg);
11233 return tag_ptr(ret_conv, true);
11235 int64_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_clone_ptr"))) TS_CResult_ShutdownScriptDecodeErrorZ_clone_ptr(uint64_t arg) {
11236 LDKCResult_ShutdownScriptDecodeErrorZ* arg_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(arg);
11237 int64_t ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone_ptr(arg_conv);
11241 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_clone"))) TS_CResult_ShutdownScriptDecodeErrorZ_clone(uint64_t orig) {
11242 LDKCResult_ShutdownScriptDecodeErrorZ* orig_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(orig);
11243 LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
11244 *ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone(orig_conv);
11245 return tag_ptr(ret_conv, true);
11248 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_ok"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_ok(uint64_t o) {
11249 LDKShutdownScript o_conv;
11250 o_conv.inner = untag_ptr(o);
11251 o_conv.is_owned = ptr_is_owned(o);
11252 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11253 o_conv = ShutdownScript_clone(&o_conv);
11254 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
11255 *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_ok(o_conv);
11256 return tag_ptr(ret_conv, true);
11259 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_err"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_err(uint64_t e) {
11260 LDKInvalidShutdownScript e_conv;
11261 e_conv.inner = untag_ptr(e);
11262 e_conv.is_owned = ptr_is_owned(e);
11263 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
11264 e_conv = InvalidShutdownScript_clone(&e_conv);
11265 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
11266 *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_err(e_conv);
11267 return tag_ptr(ret_conv, true);
11270 jboolean __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(uint64_t o) {
11271 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* o_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(o);
11272 jboolean ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(o_conv);
11276 void __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_free"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_free(uint64_t _res) {
11277 if (!ptr_is_owned(_res)) return;
11278 void* _res_ptr = untag_ptr(_res);
11279 CHECK_ACCESS(_res_ptr);
11280 LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res_conv = *(LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(_res_ptr);
11281 FREE(untag_ptr(_res));
11282 CResult_ShutdownScriptInvalidShutdownScriptZ_free(_res_conv);
11285 static inline uint64_t CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR arg) {
11286 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
11287 *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone(arg);
11288 return tag_ptr(ret_conv, true);
11290 int64_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(uint64_t arg) {
11291 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* arg_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(arg);
11292 int64_t ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(arg_conv);
11296 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_clone"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_clone(uint64_t orig) {
11297 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* orig_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(orig);
11298 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
11299 *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone(orig_conv);
11300 return tag_ptr(ret_conv, true);
11303 uint64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_ok"))) TS_CResult_RouteHopDecodeErrorZ_ok(uint64_t o) {
11304 LDKRouteHop o_conv;
11305 o_conv.inner = untag_ptr(o);
11306 o_conv.is_owned = ptr_is_owned(o);
11307 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11308 o_conv = RouteHop_clone(&o_conv);
11309 LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
11310 *ret_conv = CResult_RouteHopDecodeErrorZ_ok(o_conv);
11311 return tag_ptr(ret_conv, true);
11314 uint64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_err"))) TS_CResult_RouteHopDecodeErrorZ_err(uint64_t e) {
11315 LDKDecodeError e_conv;
11316 e_conv.inner = untag_ptr(e);
11317 e_conv.is_owned = ptr_is_owned(e);
11318 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
11319 e_conv = DecodeError_clone(&e_conv);
11320 LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
11321 *ret_conv = CResult_RouteHopDecodeErrorZ_err(e_conv);
11322 return tag_ptr(ret_conv, true);
11325 jboolean __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_is_ok"))) TS_CResult_RouteHopDecodeErrorZ_is_ok(uint64_t o) {
11326 LDKCResult_RouteHopDecodeErrorZ* o_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(o);
11327 jboolean ret_conv = CResult_RouteHopDecodeErrorZ_is_ok(o_conv);
11331 void __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_free"))) TS_CResult_RouteHopDecodeErrorZ_free(uint64_t _res) {
11332 if (!ptr_is_owned(_res)) return;
11333 void* _res_ptr = untag_ptr(_res);
11334 CHECK_ACCESS(_res_ptr);
11335 LDKCResult_RouteHopDecodeErrorZ _res_conv = *(LDKCResult_RouteHopDecodeErrorZ*)(_res_ptr);
11336 FREE(untag_ptr(_res));
11337 CResult_RouteHopDecodeErrorZ_free(_res_conv);
11340 static inline uint64_t CResult_RouteHopDecodeErrorZ_clone_ptr(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR arg) {
11341 LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
11342 *ret_conv = CResult_RouteHopDecodeErrorZ_clone(arg);
11343 return tag_ptr(ret_conv, true);
11345 int64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_clone_ptr"))) TS_CResult_RouteHopDecodeErrorZ_clone_ptr(uint64_t arg) {
11346 LDKCResult_RouteHopDecodeErrorZ* arg_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(arg);
11347 int64_t ret_conv = CResult_RouteHopDecodeErrorZ_clone_ptr(arg_conv);
11351 uint64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_clone"))) TS_CResult_RouteHopDecodeErrorZ_clone(uint64_t orig) {
11352 LDKCResult_RouteHopDecodeErrorZ* orig_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(orig);
11353 LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
11354 *ret_conv = CResult_RouteHopDecodeErrorZ_clone(orig_conv);
11355 return tag_ptr(ret_conv, true);
11358 void __attribute__((export_name("TS_CVec_RouteHopZ_free"))) TS_CVec_RouteHopZ_free(uint64_tArray _res) {
11359 LDKCVec_RouteHopZ _res_constr;
11360 _res_constr.datalen = _res->arr_len;
11361 if (_res_constr.datalen > 0)
11362 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
11364 _res_constr.data = NULL;
11365 uint64_t* _res_vals = _res->elems;
11366 for (size_t k = 0; k < _res_constr.datalen; k++) {
11367 uint64_t _res_conv_10 = _res_vals[k];
11368 LDKRouteHop _res_conv_10_conv;
11369 _res_conv_10_conv.inner = untag_ptr(_res_conv_10);
11370 _res_conv_10_conv.is_owned = ptr_is_owned(_res_conv_10);
11371 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_10_conv);
11372 _res_constr.data[k] = _res_conv_10_conv;
11375 CVec_RouteHopZ_free(_res_constr);
11378 void __attribute__((export_name("TS_CVec_CVec_RouteHopZZ_free"))) TS_CVec_CVec_RouteHopZZ_free(ptrArray _res) {
11379 LDKCVec_CVec_RouteHopZZ _res_constr;
11380 _res_constr.datalen = _res->arr_len;
11381 if (_res_constr.datalen > 0)
11382 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCVec_RouteHopZ), "LDKCVec_CVec_RouteHopZZ Elements");
11384 _res_constr.data = NULL;
11385 uint64_tArray* _res_vals = (void*) _res->elems;
11386 for (size_t m = 0; m < _res_constr.datalen; m++) {
11387 uint64_tArray _res_conv_12 = _res_vals[m];
11388 LDKCVec_RouteHopZ _res_conv_12_constr;
11389 _res_conv_12_constr.datalen = _res_conv_12->arr_len;
11390 if (_res_conv_12_constr.datalen > 0)
11391 _res_conv_12_constr.data = MALLOC(_res_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
11393 _res_conv_12_constr.data = NULL;
11394 uint64_t* _res_conv_12_vals = _res_conv_12->elems;
11395 for (size_t k = 0; k < _res_conv_12_constr.datalen; k++) {
11396 uint64_t _res_conv_12_conv_10 = _res_conv_12_vals[k];
11397 LDKRouteHop _res_conv_12_conv_10_conv;
11398 _res_conv_12_conv_10_conv.inner = untag_ptr(_res_conv_12_conv_10);
11399 _res_conv_12_conv_10_conv.is_owned = ptr_is_owned(_res_conv_12_conv_10);
11400 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_12_conv_10_conv);
11401 _res_conv_12_constr.data[k] = _res_conv_12_conv_10_conv;
11403 FREE(_res_conv_12);
11404 _res_constr.data[m] = _res_conv_12_constr;
11407 CVec_CVec_RouteHopZZ_free(_res_constr);
11410 uint64_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_ok"))) TS_CResult_RouteDecodeErrorZ_ok(uint64_t o) {
11412 o_conv.inner = untag_ptr(o);
11413 o_conv.is_owned = ptr_is_owned(o);
11414 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11415 o_conv = Route_clone(&o_conv);
11416 LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
11417 *ret_conv = CResult_RouteDecodeErrorZ_ok(o_conv);
11418 return tag_ptr(ret_conv, true);
11421 uint64_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_err"))) TS_CResult_RouteDecodeErrorZ_err(uint64_t e) {
11422 LDKDecodeError e_conv;
11423 e_conv.inner = untag_ptr(e);
11424 e_conv.is_owned = ptr_is_owned(e);
11425 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
11426 e_conv = DecodeError_clone(&e_conv);
11427 LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
11428 *ret_conv = CResult_RouteDecodeErrorZ_err(e_conv);
11429 return tag_ptr(ret_conv, true);
11432 jboolean __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_is_ok"))) TS_CResult_RouteDecodeErrorZ_is_ok(uint64_t o) {
11433 LDKCResult_RouteDecodeErrorZ* o_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(o);
11434 jboolean ret_conv = CResult_RouteDecodeErrorZ_is_ok(o_conv);
11438 void __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_free"))) TS_CResult_RouteDecodeErrorZ_free(uint64_t _res) {
11439 if (!ptr_is_owned(_res)) return;
11440 void* _res_ptr = untag_ptr(_res);
11441 CHECK_ACCESS(_res_ptr);
11442 LDKCResult_RouteDecodeErrorZ _res_conv = *(LDKCResult_RouteDecodeErrorZ*)(_res_ptr);
11443 FREE(untag_ptr(_res));
11444 CResult_RouteDecodeErrorZ_free(_res_conv);
11447 static inline uint64_t CResult_RouteDecodeErrorZ_clone_ptr(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR arg) {
11448 LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
11449 *ret_conv = CResult_RouteDecodeErrorZ_clone(arg);
11450 return tag_ptr(ret_conv, true);
11452 int64_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_clone_ptr"))) TS_CResult_RouteDecodeErrorZ_clone_ptr(uint64_t arg) {
11453 LDKCResult_RouteDecodeErrorZ* arg_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(arg);
11454 int64_t ret_conv = CResult_RouteDecodeErrorZ_clone_ptr(arg_conv);
11458 uint64_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_clone"))) TS_CResult_RouteDecodeErrorZ_clone(uint64_t orig) {
11459 LDKCResult_RouteDecodeErrorZ* orig_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(orig);
11460 LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
11461 *ret_conv = CResult_RouteDecodeErrorZ_clone(orig_conv);
11462 return tag_ptr(ret_conv, true);
11465 uint64_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_ok"))) TS_CResult_RouteParametersDecodeErrorZ_ok(uint64_t o) {
11466 LDKRouteParameters o_conv;
11467 o_conv.inner = untag_ptr(o);
11468 o_conv.is_owned = ptr_is_owned(o);
11469 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11470 o_conv = RouteParameters_clone(&o_conv);
11471 LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
11472 *ret_conv = CResult_RouteParametersDecodeErrorZ_ok(o_conv);
11473 return tag_ptr(ret_conv, true);
11476 uint64_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_err"))) TS_CResult_RouteParametersDecodeErrorZ_err(uint64_t e) {
11477 LDKDecodeError e_conv;
11478 e_conv.inner = untag_ptr(e);
11479 e_conv.is_owned = ptr_is_owned(e);
11480 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
11481 e_conv = DecodeError_clone(&e_conv);
11482 LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
11483 *ret_conv = CResult_RouteParametersDecodeErrorZ_err(e_conv);
11484 return tag_ptr(ret_conv, true);
11487 jboolean __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_is_ok"))) TS_CResult_RouteParametersDecodeErrorZ_is_ok(uint64_t o) {
11488 LDKCResult_RouteParametersDecodeErrorZ* o_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(o);
11489 jboolean ret_conv = CResult_RouteParametersDecodeErrorZ_is_ok(o_conv);
11493 void __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_free"))) TS_CResult_RouteParametersDecodeErrorZ_free(uint64_t _res) {
11494 if (!ptr_is_owned(_res)) return;
11495 void* _res_ptr = untag_ptr(_res);
11496 CHECK_ACCESS(_res_ptr);
11497 LDKCResult_RouteParametersDecodeErrorZ _res_conv = *(LDKCResult_RouteParametersDecodeErrorZ*)(_res_ptr);
11498 FREE(untag_ptr(_res));
11499 CResult_RouteParametersDecodeErrorZ_free(_res_conv);
11502 static inline uint64_t CResult_RouteParametersDecodeErrorZ_clone_ptr(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR arg) {
11503 LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
11504 *ret_conv = CResult_RouteParametersDecodeErrorZ_clone(arg);
11505 return tag_ptr(ret_conv, true);
11507 int64_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_clone_ptr"))) TS_CResult_RouteParametersDecodeErrorZ_clone_ptr(uint64_t arg) {
11508 LDKCResult_RouteParametersDecodeErrorZ* arg_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(arg);
11509 int64_t ret_conv = CResult_RouteParametersDecodeErrorZ_clone_ptr(arg_conv);
11513 uint64_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_clone"))) TS_CResult_RouteParametersDecodeErrorZ_clone(uint64_t orig) {
11514 LDKCResult_RouteParametersDecodeErrorZ* orig_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(orig);
11515 LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
11516 *ret_conv = CResult_RouteParametersDecodeErrorZ_clone(orig_conv);
11517 return tag_ptr(ret_conv, true);
11520 void __attribute__((export_name("TS_CVec_RouteHintZ_free"))) TS_CVec_RouteHintZ_free(uint64_tArray _res) {
11521 LDKCVec_RouteHintZ _res_constr;
11522 _res_constr.datalen = _res->arr_len;
11523 if (_res_constr.datalen > 0)
11524 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
11526 _res_constr.data = NULL;
11527 uint64_t* _res_vals = _res->elems;
11528 for (size_t l = 0; l < _res_constr.datalen; l++) {
11529 uint64_t _res_conv_11 = _res_vals[l];
11530 LDKRouteHint _res_conv_11_conv;
11531 _res_conv_11_conv.inner = untag_ptr(_res_conv_11);
11532 _res_conv_11_conv.is_owned = ptr_is_owned(_res_conv_11);
11533 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_11_conv);
11534 _res_constr.data[l] = _res_conv_11_conv;
11537 CVec_RouteHintZ_free(_res_constr);
11540 uint64_t __attribute__((export_name("TS_COption_u64Z_some"))) TS_COption_u64Z_some(int64_t o) {
11541 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
11542 *ret_copy = COption_u64Z_some(o);
11543 uint64_t ret_ref = tag_ptr(ret_copy, true);
11547 uint64_t __attribute__((export_name("TS_COption_u64Z_none"))) TS_COption_u64Z_none() {
11548 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
11549 *ret_copy = COption_u64Z_none();
11550 uint64_t ret_ref = tag_ptr(ret_copy, true);
11554 void __attribute__((export_name("TS_COption_u64Z_free"))) TS_COption_u64Z_free(uint64_t _res) {
11555 if (!ptr_is_owned(_res)) return;
11556 void* _res_ptr = untag_ptr(_res);
11557 CHECK_ACCESS(_res_ptr);
11558 LDKCOption_u64Z _res_conv = *(LDKCOption_u64Z*)(_res_ptr);
11559 FREE(untag_ptr(_res));
11560 COption_u64Z_free(_res_conv);
11563 static inline uint64_t COption_u64Z_clone_ptr(LDKCOption_u64Z *NONNULL_PTR arg) {
11564 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
11565 *ret_copy = COption_u64Z_clone(arg);
11566 uint64_t ret_ref = tag_ptr(ret_copy, true);
11569 int64_t __attribute__((export_name("TS_COption_u64Z_clone_ptr"))) TS_COption_u64Z_clone_ptr(uint64_t arg) {
11570 LDKCOption_u64Z* arg_conv = (LDKCOption_u64Z*)untag_ptr(arg);
11571 int64_t ret_conv = COption_u64Z_clone_ptr(arg_conv);
11575 uint64_t __attribute__((export_name("TS_COption_u64Z_clone"))) TS_COption_u64Z_clone(uint64_t orig) {
11576 LDKCOption_u64Z* orig_conv = (LDKCOption_u64Z*)untag_ptr(orig);
11577 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
11578 *ret_copy = COption_u64Z_clone(orig_conv);
11579 uint64_t ret_ref = tag_ptr(ret_copy, true);
11583 void __attribute__((export_name("TS_CVec_u64Z_free"))) TS_CVec_u64Z_free(int64_tArray _res) {
11584 LDKCVec_u64Z _res_constr;
11585 _res_constr.datalen = _res->arr_len;
11586 if (_res_constr.datalen > 0)
11587 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
11589 _res_constr.data = NULL;
11590 int64_t* _res_vals = _res->elems;
11591 for (size_t i = 0; i < _res_constr.datalen; i++) {
11592 int64_t _res_conv_8 = _res_vals[i];
11593 _res_constr.data[i] = _res_conv_8;
11596 CVec_u64Z_free(_res_constr);
11599 uint64_t __attribute__((export_name("TS_CResult_PaymentParametersDecodeErrorZ_ok"))) TS_CResult_PaymentParametersDecodeErrorZ_ok(uint64_t o) {
11600 LDKPaymentParameters o_conv;
11601 o_conv.inner = untag_ptr(o);
11602 o_conv.is_owned = ptr_is_owned(o);
11603 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11604 o_conv = PaymentParameters_clone(&o_conv);
11605 LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
11606 *ret_conv = CResult_PaymentParametersDecodeErrorZ_ok(o_conv);
11607 return tag_ptr(ret_conv, true);
11610 uint64_t __attribute__((export_name("TS_CResult_PaymentParametersDecodeErrorZ_err"))) TS_CResult_PaymentParametersDecodeErrorZ_err(uint64_t e) {
11611 LDKDecodeError e_conv;
11612 e_conv.inner = untag_ptr(e);
11613 e_conv.is_owned = ptr_is_owned(e);
11614 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
11615 e_conv = DecodeError_clone(&e_conv);
11616 LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
11617 *ret_conv = CResult_PaymentParametersDecodeErrorZ_err(e_conv);
11618 return tag_ptr(ret_conv, true);
11621 jboolean __attribute__((export_name("TS_CResult_PaymentParametersDecodeErrorZ_is_ok"))) TS_CResult_PaymentParametersDecodeErrorZ_is_ok(uint64_t o) {
11622 LDKCResult_PaymentParametersDecodeErrorZ* o_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(o);
11623 jboolean ret_conv = CResult_PaymentParametersDecodeErrorZ_is_ok(o_conv);
11627 void __attribute__((export_name("TS_CResult_PaymentParametersDecodeErrorZ_free"))) TS_CResult_PaymentParametersDecodeErrorZ_free(uint64_t _res) {
11628 if (!ptr_is_owned(_res)) return;
11629 void* _res_ptr = untag_ptr(_res);
11630 CHECK_ACCESS(_res_ptr);
11631 LDKCResult_PaymentParametersDecodeErrorZ _res_conv = *(LDKCResult_PaymentParametersDecodeErrorZ*)(_res_ptr);
11632 FREE(untag_ptr(_res));
11633 CResult_PaymentParametersDecodeErrorZ_free(_res_conv);
11636 static inline uint64_t CResult_PaymentParametersDecodeErrorZ_clone_ptr(LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR arg) {
11637 LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
11638 *ret_conv = CResult_PaymentParametersDecodeErrorZ_clone(arg);
11639 return tag_ptr(ret_conv, true);
11641 int64_t __attribute__((export_name("TS_CResult_PaymentParametersDecodeErrorZ_clone_ptr"))) TS_CResult_PaymentParametersDecodeErrorZ_clone_ptr(uint64_t arg) {
11642 LDKCResult_PaymentParametersDecodeErrorZ* arg_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(arg);
11643 int64_t ret_conv = CResult_PaymentParametersDecodeErrorZ_clone_ptr(arg_conv);
11647 uint64_t __attribute__((export_name("TS_CResult_PaymentParametersDecodeErrorZ_clone"))) TS_CResult_PaymentParametersDecodeErrorZ_clone(uint64_t orig) {
11648 LDKCResult_PaymentParametersDecodeErrorZ* orig_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(orig);
11649 LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
11650 *ret_conv = CResult_PaymentParametersDecodeErrorZ_clone(orig_conv);
11651 return tag_ptr(ret_conv, true);
11654 void __attribute__((export_name("TS_CVec_RouteHintHopZ_free"))) TS_CVec_RouteHintHopZ_free(uint64_tArray _res) {
11655 LDKCVec_RouteHintHopZ _res_constr;
11656 _res_constr.datalen = _res->arr_len;
11657 if (_res_constr.datalen > 0)
11658 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements");
11660 _res_constr.data = NULL;
11661 uint64_t* _res_vals = _res->elems;
11662 for (size_t o = 0; o < _res_constr.datalen; o++) {
11663 uint64_t _res_conv_14 = _res_vals[o];
11664 LDKRouteHintHop _res_conv_14_conv;
11665 _res_conv_14_conv.inner = untag_ptr(_res_conv_14);
11666 _res_conv_14_conv.is_owned = ptr_is_owned(_res_conv_14);
11667 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv);
11668 _res_constr.data[o] = _res_conv_14_conv;
11671 CVec_RouteHintHopZ_free(_res_constr);
11674 uint64_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_ok"))) TS_CResult_RouteHintDecodeErrorZ_ok(uint64_t o) {
11675 LDKRouteHint o_conv;
11676 o_conv.inner = untag_ptr(o);
11677 o_conv.is_owned = ptr_is_owned(o);
11678 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11679 o_conv = RouteHint_clone(&o_conv);
11680 LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
11681 *ret_conv = CResult_RouteHintDecodeErrorZ_ok(o_conv);
11682 return tag_ptr(ret_conv, true);
11685 uint64_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_err"))) TS_CResult_RouteHintDecodeErrorZ_err(uint64_t e) {
11686 LDKDecodeError e_conv;
11687 e_conv.inner = untag_ptr(e);
11688 e_conv.is_owned = ptr_is_owned(e);
11689 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
11690 e_conv = DecodeError_clone(&e_conv);
11691 LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
11692 *ret_conv = CResult_RouteHintDecodeErrorZ_err(e_conv);
11693 return tag_ptr(ret_conv, true);
11696 jboolean __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_is_ok"))) TS_CResult_RouteHintDecodeErrorZ_is_ok(uint64_t o) {
11697 LDKCResult_RouteHintDecodeErrorZ* o_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(o);
11698 jboolean ret_conv = CResult_RouteHintDecodeErrorZ_is_ok(o_conv);
11702 void __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_free"))) TS_CResult_RouteHintDecodeErrorZ_free(uint64_t _res) {
11703 if (!ptr_is_owned(_res)) return;
11704 void* _res_ptr = untag_ptr(_res);
11705 CHECK_ACCESS(_res_ptr);
11706 LDKCResult_RouteHintDecodeErrorZ _res_conv = *(LDKCResult_RouteHintDecodeErrorZ*)(_res_ptr);
11707 FREE(untag_ptr(_res));
11708 CResult_RouteHintDecodeErrorZ_free(_res_conv);
11711 static inline uint64_t CResult_RouteHintDecodeErrorZ_clone_ptr(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR arg) {
11712 LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
11713 *ret_conv = CResult_RouteHintDecodeErrorZ_clone(arg);
11714 return tag_ptr(ret_conv, true);
11716 int64_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_clone_ptr"))) TS_CResult_RouteHintDecodeErrorZ_clone_ptr(uint64_t arg) {
11717 LDKCResult_RouteHintDecodeErrorZ* arg_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(arg);
11718 int64_t ret_conv = CResult_RouteHintDecodeErrorZ_clone_ptr(arg_conv);
11722 uint64_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_clone"))) TS_CResult_RouteHintDecodeErrorZ_clone(uint64_t orig) {
11723 LDKCResult_RouteHintDecodeErrorZ* orig_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(orig);
11724 LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
11725 *ret_conv = CResult_RouteHintDecodeErrorZ_clone(orig_conv);
11726 return tag_ptr(ret_conv, true);
11729 uint64_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_ok"))) TS_CResult_RouteHintHopDecodeErrorZ_ok(uint64_t o) {
11730 LDKRouteHintHop o_conv;
11731 o_conv.inner = untag_ptr(o);
11732 o_conv.is_owned = ptr_is_owned(o);
11733 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11734 o_conv = RouteHintHop_clone(&o_conv);
11735 LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
11736 *ret_conv = CResult_RouteHintHopDecodeErrorZ_ok(o_conv);
11737 return tag_ptr(ret_conv, true);
11740 uint64_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_err"))) TS_CResult_RouteHintHopDecodeErrorZ_err(uint64_t e) {
11741 LDKDecodeError e_conv;
11742 e_conv.inner = untag_ptr(e);
11743 e_conv.is_owned = ptr_is_owned(e);
11744 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
11745 e_conv = DecodeError_clone(&e_conv);
11746 LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
11747 *ret_conv = CResult_RouteHintHopDecodeErrorZ_err(e_conv);
11748 return tag_ptr(ret_conv, true);
11751 jboolean __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_is_ok"))) TS_CResult_RouteHintHopDecodeErrorZ_is_ok(uint64_t o) {
11752 LDKCResult_RouteHintHopDecodeErrorZ* o_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(o);
11753 jboolean ret_conv = CResult_RouteHintHopDecodeErrorZ_is_ok(o_conv);
11757 void __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_free"))) TS_CResult_RouteHintHopDecodeErrorZ_free(uint64_t _res) {
11758 if (!ptr_is_owned(_res)) return;
11759 void* _res_ptr = untag_ptr(_res);
11760 CHECK_ACCESS(_res_ptr);
11761 LDKCResult_RouteHintHopDecodeErrorZ _res_conv = *(LDKCResult_RouteHintHopDecodeErrorZ*)(_res_ptr);
11762 FREE(untag_ptr(_res));
11763 CResult_RouteHintHopDecodeErrorZ_free(_res_conv);
11766 static inline uint64_t CResult_RouteHintHopDecodeErrorZ_clone_ptr(LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR arg) {
11767 LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
11768 *ret_conv = CResult_RouteHintHopDecodeErrorZ_clone(arg);
11769 return tag_ptr(ret_conv, true);
11771 int64_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_clone_ptr"))) TS_CResult_RouteHintHopDecodeErrorZ_clone_ptr(uint64_t arg) {
11772 LDKCResult_RouteHintHopDecodeErrorZ* arg_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(arg);
11773 int64_t ret_conv = CResult_RouteHintHopDecodeErrorZ_clone_ptr(arg_conv);
11777 uint64_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_clone"))) TS_CResult_RouteHintHopDecodeErrorZ_clone(uint64_t orig) {
11778 LDKCResult_RouteHintHopDecodeErrorZ* orig_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(orig);
11779 LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
11780 *ret_conv = CResult_RouteHintHopDecodeErrorZ_clone(orig_conv);
11781 return tag_ptr(ret_conv, true);
11784 void __attribute__((export_name("TS_CVec_ChannelDetailsZ_free"))) TS_CVec_ChannelDetailsZ_free(uint64_tArray _res) {
11785 LDKCVec_ChannelDetailsZ _res_constr;
11786 _res_constr.datalen = _res->arr_len;
11787 if (_res_constr.datalen > 0)
11788 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
11790 _res_constr.data = NULL;
11791 uint64_t* _res_vals = _res->elems;
11792 for (size_t q = 0; q < _res_constr.datalen; q++) {
11793 uint64_t _res_conv_16 = _res_vals[q];
11794 LDKChannelDetails _res_conv_16_conv;
11795 _res_conv_16_conv.inner = untag_ptr(_res_conv_16);
11796 _res_conv_16_conv.is_owned = ptr_is_owned(_res_conv_16);
11797 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv);
11798 _res_constr.data[q] = _res_conv_16_conv;
11801 CVec_ChannelDetailsZ_free(_res_constr);
11804 uint64_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_ok"))) TS_CResult_RouteLightningErrorZ_ok(uint64_t o) {
11806 o_conv.inner = untag_ptr(o);
11807 o_conv.is_owned = ptr_is_owned(o);
11808 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11809 o_conv = Route_clone(&o_conv);
11810 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
11811 *ret_conv = CResult_RouteLightningErrorZ_ok(o_conv);
11812 return tag_ptr(ret_conv, true);
11815 uint64_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_err"))) TS_CResult_RouteLightningErrorZ_err(uint64_t e) {
11816 LDKLightningError e_conv;
11817 e_conv.inner = untag_ptr(e);
11818 e_conv.is_owned = ptr_is_owned(e);
11819 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
11820 e_conv = LightningError_clone(&e_conv);
11821 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
11822 *ret_conv = CResult_RouteLightningErrorZ_err(e_conv);
11823 return tag_ptr(ret_conv, true);
11826 jboolean __attribute__((export_name("TS_CResult_RouteLightningErrorZ_is_ok"))) TS_CResult_RouteLightningErrorZ_is_ok(uint64_t o) {
11827 LDKCResult_RouteLightningErrorZ* o_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(o);
11828 jboolean ret_conv = CResult_RouteLightningErrorZ_is_ok(o_conv);
11832 void __attribute__((export_name("TS_CResult_RouteLightningErrorZ_free"))) TS_CResult_RouteLightningErrorZ_free(uint64_t _res) {
11833 if (!ptr_is_owned(_res)) return;
11834 void* _res_ptr = untag_ptr(_res);
11835 CHECK_ACCESS(_res_ptr);
11836 LDKCResult_RouteLightningErrorZ _res_conv = *(LDKCResult_RouteLightningErrorZ*)(_res_ptr);
11837 FREE(untag_ptr(_res));
11838 CResult_RouteLightningErrorZ_free(_res_conv);
11841 static inline uint64_t CResult_RouteLightningErrorZ_clone_ptr(LDKCResult_RouteLightningErrorZ *NONNULL_PTR arg) {
11842 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
11843 *ret_conv = CResult_RouteLightningErrorZ_clone(arg);
11844 return tag_ptr(ret_conv, true);
11846 int64_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_clone_ptr"))) TS_CResult_RouteLightningErrorZ_clone_ptr(uint64_t arg) {
11847 LDKCResult_RouteLightningErrorZ* arg_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(arg);
11848 int64_t ret_conv = CResult_RouteLightningErrorZ_clone_ptr(arg_conv);
11852 uint64_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_clone"))) TS_CResult_RouteLightningErrorZ_clone(uint64_t orig) {
11853 LDKCResult_RouteLightningErrorZ* orig_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(orig);
11854 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
11855 *ret_conv = CResult_RouteLightningErrorZ_clone(orig_conv);
11856 return tag_ptr(ret_conv, true);
11859 void __attribute__((export_name("TS_CVec_PublicKeyZ_free"))) TS_CVec_PublicKeyZ_free(ptrArray _res) {
11860 LDKCVec_PublicKeyZ _res_constr;
11861 _res_constr.datalen = _res->arr_len;
11862 if (_res_constr.datalen > 0)
11863 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements");
11865 _res_constr.data = NULL;
11866 int8_tArray* _res_vals = (void*) _res->elems;
11867 for (size_t m = 0; m < _res_constr.datalen; m++) {
11868 int8_tArray _res_conv_12 = _res_vals[m];
11869 LDKPublicKey _res_conv_12_ref;
11870 CHECK(_res_conv_12->arr_len == 33);
11871 memcpy(_res_conv_12_ref.compressed_form, _res_conv_12->elems, 33); FREE(_res_conv_12);
11872 _res_constr.data[m] = _res_conv_12_ref;
11875 CVec_PublicKeyZ_free(_res_constr);
11878 uint64_t __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_ok"))) TS_CResult_PaymentPurposeDecodeErrorZ_ok(uint64_t o) {
11879 void* o_ptr = untag_ptr(o);
11880 CHECK_ACCESS(o_ptr);
11881 LDKPaymentPurpose o_conv = *(LDKPaymentPurpose*)(o_ptr);
11882 o_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(o));
11883 LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
11884 *ret_conv = CResult_PaymentPurposeDecodeErrorZ_ok(o_conv);
11885 return tag_ptr(ret_conv, true);
11888 uint64_t __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_err"))) TS_CResult_PaymentPurposeDecodeErrorZ_err(uint64_t e) {
11889 LDKDecodeError e_conv;
11890 e_conv.inner = untag_ptr(e);
11891 e_conv.is_owned = ptr_is_owned(e);
11892 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
11893 e_conv = DecodeError_clone(&e_conv);
11894 LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
11895 *ret_conv = CResult_PaymentPurposeDecodeErrorZ_err(e_conv);
11896 return tag_ptr(ret_conv, true);
11899 jboolean __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_is_ok"))) TS_CResult_PaymentPurposeDecodeErrorZ_is_ok(uint64_t o) {
11900 LDKCResult_PaymentPurposeDecodeErrorZ* o_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(o);
11901 jboolean ret_conv = CResult_PaymentPurposeDecodeErrorZ_is_ok(o_conv);
11905 void __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_free"))) TS_CResult_PaymentPurposeDecodeErrorZ_free(uint64_t _res) {
11906 if (!ptr_is_owned(_res)) return;
11907 void* _res_ptr = untag_ptr(_res);
11908 CHECK_ACCESS(_res_ptr);
11909 LDKCResult_PaymentPurposeDecodeErrorZ _res_conv = *(LDKCResult_PaymentPurposeDecodeErrorZ*)(_res_ptr);
11910 FREE(untag_ptr(_res));
11911 CResult_PaymentPurposeDecodeErrorZ_free(_res_conv);
11914 static inline uint64_t CResult_PaymentPurposeDecodeErrorZ_clone_ptr(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR arg) {
11915 LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
11916 *ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone(arg);
11917 return tag_ptr(ret_conv, true);
11919 int64_t __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_clone_ptr"))) TS_CResult_PaymentPurposeDecodeErrorZ_clone_ptr(uint64_t arg) {
11920 LDKCResult_PaymentPurposeDecodeErrorZ* arg_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(arg);
11921 int64_t ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone_ptr(arg_conv);
11925 uint64_t __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_clone"))) TS_CResult_PaymentPurposeDecodeErrorZ_clone(uint64_t orig) {
11926 LDKCResult_PaymentPurposeDecodeErrorZ* orig_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(orig);
11927 LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
11928 *ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone(orig_conv);
11929 return tag_ptr(ret_conv, true);
11932 uint64_t __attribute__((export_name("TS_COption_ClosureReasonZ_some"))) TS_COption_ClosureReasonZ_some(uint64_t o) {
11933 void* o_ptr = untag_ptr(o);
11934 CHECK_ACCESS(o_ptr);
11935 LDKClosureReason o_conv = *(LDKClosureReason*)(o_ptr);
11936 o_conv = ClosureReason_clone((LDKClosureReason*)untag_ptr(o));
11937 LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
11938 *ret_copy = COption_ClosureReasonZ_some(o_conv);
11939 uint64_t ret_ref = tag_ptr(ret_copy, true);
11943 uint64_t __attribute__((export_name("TS_COption_ClosureReasonZ_none"))) TS_COption_ClosureReasonZ_none() {
11944 LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
11945 *ret_copy = COption_ClosureReasonZ_none();
11946 uint64_t ret_ref = tag_ptr(ret_copy, true);
11950 void __attribute__((export_name("TS_COption_ClosureReasonZ_free"))) TS_COption_ClosureReasonZ_free(uint64_t _res) {
11951 if (!ptr_is_owned(_res)) return;
11952 void* _res_ptr = untag_ptr(_res);
11953 CHECK_ACCESS(_res_ptr);
11954 LDKCOption_ClosureReasonZ _res_conv = *(LDKCOption_ClosureReasonZ*)(_res_ptr);
11955 FREE(untag_ptr(_res));
11956 COption_ClosureReasonZ_free(_res_conv);
11959 static inline uint64_t COption_ClosureReasonZ_clone_ptr(LDKCOption_ClosureReasonZ *NONNULL_PTR arg) {
11960 LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
11961 *ret_copy = COption_ClosureReasonZ_clone(arg);
11962 uint64_t ret_ref = tag_ptr(ret_copy, true);
11965 int64_t __attribute__((export_name("TS_COption_ClosureReasonZ_clone_ptr"))) TS_COption_ClosureReasonZ_clone_ptr(uint64_t arg) {
11966 LDKCOption_ClosureReasonZ* arg_conv = (LDKCOption_ClosureReasonZ*)untag_ptr(arg);
11967 int64_t ret_conv = COption_ClosureReasonZ_clone_ptr(arg_conv);
11971 uint64_t __attribute__((export_name("TS_COption_ClosureReasonZ_clone"))) TS_COption_ClosureReasonZ_clone(uint64_t orig) {
11972 LDKCOption_ClosureReasonZ* orig_conv = (LDKCOption_ClosureReasonZ*)untag_ptr(orig);
11973 LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
11974 *ret_copy = COption_ClosureReasonZ_clone(orig_conv);
11975 uint64_t ret_ref = tag_ptr(ret_copy, true);
11979 uint64_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_ok"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_ok(uint64_t o) {
11980 void* o_ptr = untag_ptr(o);
11981 CHECK_ACCESS(o_ptr);
11982 LDKCOption_ClosureReasonZ o_conv = *(LDKCOption_ClosureReasonZ*)(o_ptr);
11983 o_conv = COption_ClosureReasonZ_clone((LDKCOption_ClosureReasonZ*)untag_ptr(o));
11984 LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
11985 *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_ok(o_conv);
11986 return tag_ptr(ret_conv, true);
11989 uint64_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_err"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_err(uint64_t e) {
11990 LDKDecodeError e_conv;
11991 e_conv.inner = untag_ptr(e);
11992 e_conv.is_owned = ptr_is_owned(e);
11993 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
11994 e_conv = DecodeError_clone(&e_conv);
11995 LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
11996 *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_err(e_conv);
11997 return tag_ptr(ret_conv, true);
12000 jboolean __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_is_ok"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(uint64_t o) {
12001 LDKCResult_COption_ClosureReasonZDecodeErrorZ* o_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(o);
12002 jboolean ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(o_conv);
12006 void __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_free"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_free(uint64_t _res) {
12007 if (!ptr_is_owned(_res)) return;
12008 void* _res_ptr = untag_ptr(_res);
12009 CHECK_ACCESS(_res_ptr);
12010 LDKCResult_COption_ClosureReasonZDecodeErrorZ _res_conv = *(LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(_res_ptr);
12011 FREE(untag_ptr(_res));
12012 CResult_COption_ClosureReasonZDecodeErrorZ_free(_res_conv);
12015 static inline uint64_t CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR arg) {
12016 LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
12017 *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone(arg);
12018 return tag_ptr(ret_conv, true);
12020 int64_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(uint64_t arg) {
12021 LDKCResult_COption_ClosureReasonZDecodeErrorZ* arg_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(arg);
12022 int64_t ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(arg_conv);
12026 uint64_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_clone"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_clone(uint64_t orig) {
12027 LDKCResult_COption_ClosureReasonZDecodeErrorZ* orig_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(orig);
12028 LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
12029 *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone(orig_conv);
12030 return tag_ptr(ret_conv, true);
12033 uint64_t __attribute__((export_name("TS_COption_HTLCDestinationZ_some"))) TS_COption_HTLCDestinationZ_some(uint64_t o) {
12034 void* o_ptr = untag_ptr(o);
12035 CHECK_ACCESS(o_ptr);
12036 LDKHTLCDestination o_conv = *(LDKHTLCDestination*)(o_ptr);
12037 o_conv = HTLCDestination_clone((LDKHTLCDestination*)untag_ptr(o));
12038 LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ");
12039 *ret_copy = COption_HTLCDestinationZ_some(o_conv);
12040 uint64_t ret_ref = tag_ptr(ret_copy, true);
12044 uint64_t __attribute__((export_name("TS_COption_HTLCDestinationZ_none"))) TS_COption_HTLCDestinationZ_none() {
12045 LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ");
12046 *ret_copy = COption_HTLCDestinationZ_none();
12047 uint64_t ret_ref = tag_ptr(ret_copy, true);
12051 void __attribute__((export_name("TS_COption_HTLCDestinationZ_free"))) TS_COption_HTLCDestinationZ_free(uint64_t _res) {
12052 if (!ptr_is_owned(_res)) return;
12053 void* _res_ptr = untag_ptr(_res);
12054 CHECK_ACCESS(_res_ptr);
12055 LDKCOption_HTLCDestinationZ _res_conv = *(LDKCOption_HTLCDestinationZ*)(_res_ptr);
12056 FREE(untag_ptr(_res));
12057 COption_HTLCDestinationZ_free(_res_conv);
12060 static inline uint64_t COption_HTLCDestinationZ_clone_ptr(LDKCOption_HTLCDestinationZ *NONNULL_PTR arg) {
12061 LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ");
12062 *ret_copy = COption_HTLCDestinationZ_clone(arg);
12063 uint64_t ret_ref = tag_ptr(ret_copy, true);
12066 int64_t __attribute__((export_name("TS_COption_HTLCDestinationZ_clone_ptr"))) TS_COption_HTLCDestinationZ_clone_ptr(uint64_t arg) {
12067 LDKCOption_HTLCDestinationZ* arg_conv = (LDKCOption_HTLCDestinationZ*)untag_ptr(arg);
12068 int64_t ret_conv = COption_HTLCDestinationZ_clone_ptr(arg_conv);
12072 uint64_t __attribute__((export_name("TS_COption_HTLCDestinationZ_clone"))) TS_COption_HTLCDestinationZ_clone(uint64_t orig) {
12073 LDKCOption_HTLCDestinationZ* orig_conv = (LDKCOption_HTLCDestinationZ*)untag_ptr(orig);
12074 LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ");
12075 *ret_copy = COption_HTLCDestinationZ_clone(orig_conv);
12076 uint64_t ret_ref = tag_ptr(ret_copy, true);
12080 uint64_t __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_ok"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_ok(uint64_t o) {
12081 void* o_ptr = untag_ptr(o);
12082 CHECK_ACCESS(o_ptr);
12083 LDKCOption_HTLCDestinationZ o_conv = *(LDKCOption_HTLCDestinationZ*)(o_ptr);
12084 o_conv = COption_HTLCDestinationZ_clone((LDKCOption_HTLCDestinationZ*)untag_ptr(o));
12085 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ");
12086 *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_ok(o_conv);
12087 return tag_ptr(ret_conv, true);
12090 uint64_t __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_err"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_err(uint64_t e) {
12091 LDKDecodeError e_conv;
12092 e_conv.inner = untag_ptr(e);
12093 e_conv.is_owned = ptr_is_owned(e);
12094 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
12095 e_conv = DecodeError_clone(&e_conv);
12096 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ");
12097 *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_err(e_conv);
12098 return tag_ptr(ret_conv, true);
12101 jboolean __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(uint64_t o) {
12102 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* o_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(o);
12103 jboolean ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(o_conv);
12107 void __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_free"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_free(uint64_t _res) {
12108 if (!ptr_is_owned(_res)) return;
12109 void* _res_ptr = untag_ptr(_res);
12110 CHECK_ACCESS(_res_ptr);
12111 LDKCResult_COption_HTLCDestinationZDecodeErrorZ _res_conv = *(LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)(_res_ptr);
12112 FREE(untag_ptr(_res));
12113 CResult_COption_HTLCDestinationZDecodeErrorZ_free(_res_conv);
12116 static inline uint64_t CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr(LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR arg) {
12117 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ");
12118 *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_clone(arg);
12119 return tag_ptr(ret_conv, true);
12121 int64_t __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr(uint64_t arg) {
12122 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* arg_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(arg);
12123 int64_t ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr(arg_conv);
12127 uint64_t __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_clone"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_clone(uint64_t orig) {
12128 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* orig_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(orig);
12129 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ");
12130 *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_clone(orig_conv);
12131 return tag_ptr(ret_conv, true);
12134 uint64_t __attribute__((export_name("TS_COption_NetworkUpdateZ_some"))) TS_COption_NetworkUpdateZ_some(uint64_t o) {
12135 void* o_ptr = untag_ptr(o);
12136 CHECK_ACCESS(o_ptr);
12137 LDKNetworkUpdate o_conv = *(LDKNetworkUpdate*)(o_ptr);
12138 o_conv = NetworkUpdate_clone((LDKNetworkUpdate*)untag_ptr(o));
12139 LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
12140 *ret_copy = COption_NetworkUpdateZ_some(o_conv);
12141 uint64_t ret_ref = tag_ptr(ret_copy, true);
12145 uint64_t __attribute__((export_name("TS_COption_NetworkUpdateZ_none"))) TS_COption_NetworkUpdateZ_none() {
12146 LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
12147 *ret_copy = COption_NetworkUpdateZ_none();
12148 uint64_t ret_ref = tag_ptr(ret_copy, true);
12152 void __attribute__((export_name("TS_COption_NetworkUpdateZ_free"))) TS_COption_NetworkUpdateZ_free(uint64_t _res) {
12153 if (!ptr_is_owned(_res)) return;
12154 void* _res_ptr = untag_ptr(_res);
12155 CHECK_ACCESS(_res_ptr);
12156 LDKCOption_NetworkUpdateZ _res_conv = *(LDKCOption_NetworkUpdateZ*)(_res_ptr);
12157 FREE(untag_ptr(_res));
12158 COption_NetworkUpdateZ_free(_res_conv);
12161 static inline uint64_t COption_NetworkUpdateZ_clone_ptr(LDKCOption_NetworkUpdateZ *NONNULL_PTR arg) {
12162 LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
12163 *ret_copy = COption_NetworkUpdateZ_clone(arg);
12164 uint64_t ret_ref = tag_ptr(ret_copy, true);
12167 int64_t __attribute__((export_name("TS_COption_NetworkUpdateZ_clone_ptr"))) TS_COption_NetworkUpdateZ_clone_ptr(uint64_t arg) {
12168 LDKCOption_NetworkUpdateZ* arg_conv = (LDKCOption_NetworkUpdateZ*)untag_ptr(arg);
12169 int64_t ret_conv = COption_NetworkUpdateZ_clone_ptr(arg_conv);
12173 uint64_t __attribute__((export_name("TS_COption_NetworkUpdateZ_clone"))) TS_COption_NetworkUpdateZ_clone(uint64_t orig) {
12174 LDKCOption_NetworkUpdateZ* orig_conv = (LDKCOption_NetworkUpdateZ*)untag_ptr(orig);
12175 LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
12176 *ret_copy = COption_NetworkUpdateZ_clone(orig_conv);
12177 uint64_t ret_ref = tag_ptr(ret_copy, true);
12181 void __attribute__((export_name("TS_CVec_SpendableOutputDescriptorZ_free"))) TS_CVec_SpendableOutputDescriptorZ_free(uint64_tArray _res) {
12182 LDKCVec_SpendableOutputDescriptorZ _res_constr;
12183 _res_constr.datalen = _res->arr_len;
12184 if (_res_constr.datalen > 0)
12185 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
12187 _res_constr.data = NULL;
12188 uint64_t* _res_vals = _res->elems;
12189 for (size_t b = 0; b < _res_constr.datalen; b++) {
12190 uint64_t _res_conv_27 = _res_vals[b];
12191 void* _res_conv_27_ptr = untag_ptr(_res_conv_27);
12192 CHECK_ACCESS(_res_conv_27_ptr);
12193 LDKSpendableOutputDescriptor _res_conv_27_conv = *(LDKSpendableOutputDescriptor*)(_res_conv_27_ptr);
12194 FREE(untag_ptr(_res_conv_27));
12195 _res_constr.data[b] = _res_conv_27_conv;
12198 CVec_SpendableOutputDescriptorZ_free(_res_constr);
12201 uint64_t __attribute__((export_name("TS_COption_EventZ_some"))) TS_COption_EventZ_some(uint64_t o) {
12202 void* o_ptr = untag_ptr(o);
12203 CHECK_ACCESS(o_ptr);
12204 LDKEvent o_conv = *(LDKEvent*)(o_ptr);
12205 o_conv = Event_clone((LDKEvent*)untag_ptr(o));
12206 LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
12207 *ret_copy = COption_EventZ_some(o_conv);
12208 uint64_t ret_ref = tag_ptr(ret_copy, true);
12212 uint64_t __attribute__((export_name("TS_COption_EventZ_none"))) TS_COption_EventZ_none() {
12213 LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
12214 *ret_copy = COption_EventZ_none();
12215 uint64_t ret_ref = tag_ptr(ret_copy, true);
12219 void __attribute__((export_name("TS_COption_EventZ_free"))) TS_COption_EventZ_free(uint64_t _res) {
12220 if (!ptr_is_owned(_res)) return;
12221 void* _res_ptr = untag_ptr(_res);
12222 CHECK_ACCESS(_res_ptr);
12223 LDKCOption_EventZ _res_conv = *(LDKCOption_EventZ*)(_res_ptr);
12224 FREE(untag_ptr(_res));
12225 COption_EventZ_free(_res_conv);
12228 static inline uint64_t COption_EventZ_clone_ptr(LDKCOption_EventZ *NONNULL_PTR arg) {
12229 LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
12230 *ret_copy = COption_EventZ_clone(arg);
12231 uint64_t ret_ref = tag_ptr(ret_copy, true);
12234 int64_t __attribute__((export_name("TS_COption_EventZ_clone_ptr"))) TS_COption_EventZ_clone_ptr(uint64_t arg) {
12235 LDKCOption_EventZ* arg_conv = (LDKCOption_EventZ*)untag_ptr(arg);
12236 int64_t ret_conv = COption_EventZ_clone_ptr(arg_conv);
12240 uint64_t __attribute__((export_name("TS_COption_EventZ_clone"))) TS_COption_EventZ_clone(uint64_t orig) {
12241 LDKCOption_EventZ* orig_conv = (LDKCOption_EventZ*)untag_ptr(orig);
12242 LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
12243 *ret_copy = COption_EventZ_clone(orig_conv);
12244 uint64_t ret_ref = tag_ptr(ret_copy, true);
12248 uint64_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_ok"))) TS_CResult_COption_EventZDecodeErrorZ_ok(uint64_t o) {
12249 void* o_ptr = untag_ptr(o);
12250 CHECK_ACCESS(o_ptr);
12251 LDKCOption_EventZ o_conv = *(LDKCOption_EventZ*)(o_ptr);
12252 o_conv = COption_EventZ_clone((LDKCOption_EventZ*)untag_ptr(o));
12253 LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
12254 *ret_conv = CResult_COption_EventZDecodeErrorZ_ok(o_conv);
12255 return tag_ptr(ret_conv, true);
12258 uint64_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_err"))) TS_CResult_COption_EventZDecodeErrorZ_err(uint64_t e) {
12259 LDKDecodeError e_conv;
12260 e_conv.inner = untag_ptr(e);
12261 e_conv.is_owned = ptr_is_owned(e);
12262 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
12263 e_conv = DecodeError_clone(&e_conv);
12264 LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
12265 *ret_conv = CResult_COption_EventZDecodeErrorZ_err(e_conv);
12266 return tag_ptr(ret_conv, true);
12269 jboolean __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_is_ok"))) TS_CResult_COption_EventZDecodeErrorZ_is_ok(uint64_t o) {
12270 LDKCResult_COption_EventZDecodeErrorZ* o_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(o);
12271 jboolean ret_conv = CResult_COption_EventZDecodeErrorZ_is_ok(o_conv);
12275 void __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_free"))) TS_CResult_COption_EventZDecodeErrorZ_free(uint64_t _res) {
12276 if (!ptr_is_owned(_res)) return;
12277 void* _res_ptr = untag_ptr(_res);
12278 CHECK_ACCESS(_res_ptr);
12279 LDKCResult_COption_EventZDecodeErrorZ _res_conv = *(LDKCResult_COption_EventZDecodeErrorZ*)(_res_ptr);
12280 FREE(untag_ptr(_res));
12281 CResult_COption_EventZDecodeErrorZ_free(_res_conv);
12284 static inline uint64_t CResult_COption_EventZDecodeErrorZ_clone_ptr(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR arg) {
12285 LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
12286 *ret_conv = CResult_COption_EventZDecodeErrorZ_clone(arg);
12287 return tag_ptr(ret_conv, true);
12289 int64_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_EventZDecodeErrorZ_clone_ptr(uint64_t arg) {
12290 LDKCResult_COption_EventZDecodeErrorZ* arg_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(arg);
12291 int64_t ret_conv = CResult_COption_EventZDecodeErrorZ_clone_ptr(arg_conv);
12295 uint64_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_clone"))) TS_CResult_COption_EventZDecodeErrorZ_clone(uint64_t orig) {
12296 LDKCResult_COption_EventZDecodeErrorZ* orig_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(orig);
12297 LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
12298 *ret_conv = CResult_COption_EventZDecodeErrorZ_clone(orig_conv);
12299 return tag_ptr(ret_conv, true);
12302 void __attribute__((export_name("TS_CVec_MessageSendEventZ_free"))) TS_CVec_MessageSendEventZ_free(uint64_tArray _res) {
12303 LDKCVec_MessageSendEventZ _res_constr;
12304 _res_constr.datalen = _res->arr_len;
12305 if (_res_constr.datalen > 0)
12306 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMessageSendEvent), "LDKCVec_MessageSendEventZ Elements");
12308 _res_constr.data = NULL;
12309 uint64_t* _res_vals = _res->elems;
12310 for (size_t s = 0; s < _res_constr.datalen; s++) {
12311 uint64_t _res_conv_18 = _res_vals[s];
12312 void* _res_conv_18_ptr = untag_ptr(_res_conv_18);
12313 CHECK_ACCESS(_res_conv_18_ptr);
12314 LDKMessageSendEvent _res_conv_18_conv = *(LDKMessageSendEvent*)(_res_conv_18_ptr);
12315 FREE(untag_ptr(_res_conv_18));
12316 _res_constr.data[s] = _res_conv_18_conv;
12319 CVec_MessageSendEventZ_free(_res_constr);
12322 uint64_t __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_ok"))) TS_CResult_TxOutAccessErrorZ_ok(uint64_t o) {
12323 void* o_ptr = untag_ptr(o);
12324 CHECK_ACCESS(o_ptr);
12325 LDKTxOut o_conv = *(LDKTxOut*)(o_ptr);
12326 o_conv = TxOut_clone((LDKTxOut*)untag_ptr(o));
12327 LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
12328 *ret_conv = CResult_TxOutAccessErrorZ_ok(o_conv);
12329 return tag_ptr(ret_conv, true);
12332 uint64_t __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_err"))) TS_CResult_TxOutAccessErrorZ_err(uint32_t e) {
12333 LDKAccessError e_conv = LDKAccessError_from_js(e);
12334 LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
12335 *ret_conv = CResult_TxOutAccessErrorZ_err(e_conv);
12336 return tag_ptr(ret_conv, true);
12339 jboolean __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_is_ok"))) TS_CResult_TxOutAccessErrorZ_is_ok(uint64_t o) {
12340 LDKCResult_TxOutAccessErrorZ* o_conv = (LDKCResult_TxOutAccessErrorZ*)untag_ptr(o);
12341 jboolean ret_conv = CResult_TxOutAccessErrorZ_is_ok(o_conv);
12345 void __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_free"))) TS_CResult_TxOutAccessErrorZ_free(uint64_t _res) {
12346 if (!ptr_is_owned(_res)) return;
12347 void* _res_ptr = untag_ptr(_res);
12348 CHECK_ACCESS(_res_ptr);
12349 LDKCResult_TxOutAccessErrorZ _res_conv = *(LDKCResult_TxOutAccessErrorZ*)(_res_ptr);
12350 FREE(untag_ptr(_res));
12351 CResult_TxOutAccessErrorZ_free(_res_conv);
12354 static inline uint64_t CResult_TxOutAccessErrorZ_clone_ptr(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR arg) {
12355 LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
12356 *ret_conv = CResult_TxOutAccessErrorZ_clone(arg);
12357 return tag_ptr(ret_conv, true);
12359 int64_t __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_clone_ptr"))) TS_CResult_TxOutAccessErrorZ_clone_ptr(uint64_t arg) {
12360 LDKCResult_TxOutAccessErrorZ* arg_conv = (LDKCResult_TxOutAccessErrorZ*)untag_ptr(arg);
12361 int64_t ret_conv = CResult_TxOutAccessErrorZ_clone_ptr(arg_conv);
12365 uint64_t __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_clone"))) TS_CResult_TxOutAccessErrorZ_clone(uint64_t orig) {
12366 LDKCResult_TxOutAccessErrorZ* orig_conv = (LDKCResult_TxOutAccessErrorZ*)untag_ptr(orig);
12367 LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
12368 *ret_conv = CResult_TxOutAccessErrorZ_clone(orig_conv);
12369 return tag_ptr(ret_conv, true);
12372 static inline uint64_t C2Tuple_usizeTransactionZ_clone_ptr(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR arg) {
12373 LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
12374 *ret_conv = C2Tuple_usizeTransactionZ_clone(arg);
12375 return tag_ptr(ret_conv, true);
12377 int64_t __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_clone_ptr"))) TS_C2Tuple_usizeTransactionZ_clone_ptr(uint64_t arg) {
12378 LDKC2Tuple_usizeTransactionZ* arg_conv = (LDKC2Tuple_usizeTransactionZ*)untag_ptr(arg);
12379 int64_t ret_conv = C2Tuple_usizeTransactionZ_clone_ptr(arg_conv);
12383 uint64_t __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_clone"))) TS_C2Tuple_usizeTransactionZ_clone(uint64_t orig) {
12384 LDKC2Tuple_usizeTransactionZ* orig_conv = (LDKC2Tuple_usizeTransactionZ*)untag_ptr(orig);
12385 LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
12386 *ret_conv = C2Tuple_usizeTransactionZ_clone(orig_conv);
12387 return tag_ptr(ret_conv, true);
12390 uint64_t __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_new"))) TS_C2Tuple_usizeTransactionZ_new(uint32_t a, int8_tArray b) {
12391 LDKTransaction b_ref;
12392 b_ref.datalen = b->arr_len;
12393 b_ref.data = MALLOC(b_ref.datalen, "LDKTransaction Bytes");
12394 memcpy(b_ref.data, b->elems, b_ref.datalen); FREE(b);
12395 b_ref.data_is_owned = true;
12396 LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
12397 *ret_conv = C2Tuple_usizeTransactionZ_new(a, b_ref);
12398 return tag_ptr(ret_conv, true);
12401 void __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_free"))) TS_C2Tuple_usizeTransactionZ_free(uint64_t _res) {
12402 if (!ptr_is_owned(_res)) return;
12403 void* _res_ptr = untag_ptr(_res);
12404 CHECK_ACCESS(_res_ptr);
12405 LDKC2Tuple_usizeTransactionZ _res_conv = *(LDKC2Tuple_usizeTransactionZ*)(_res_ptr);
12406 FREE(untag_ptr(_res));
12407 C2Tuple_usizeTransactionZ_free(_res_conv);
12410 void __attribute__((export_name("TS_CVec_C2Tuple_usizeTransactionZZ_free"))) TS_CVec_C2Tuple_usizeTransactionZZ_free(uint64_tArray _res) {
12411 LDKCVec_C2Tuple_usizeTransactionZZ _res_constr;
12412 _res_constr.datalen = _res->arr_len;
12413 if (_res_constr.datalen > 0)
12414 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
12416 _res_constr.data = NULL;
12417 uint64_t* _res_vals = _res->elems;
12418 for (size_t c = 0; c < _res_constr.datalen; c++) {
12419 uint64_t _res_conv_28 = _res_vals[c];
12420 void* _res_conv_28_ptr = untag_ptr(_res_conv_28);
12421 CHECK_ACCESS(_res_conv_28_ptr);
12422 LDKC2Tuple_usizeTransactionZ _res_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(_res_conv_28_ptr);
12423 FREE(untag_ptr(_res_conv_28));
12424 _res_constr.data[c] = _res_conv_28_conv;
12427 CVec_C2Tuple_usizeTransactionZZ_free(_res_constr);
12430 void __attribute__((export_name("TS_CVec_TxidZ_free"))) TS_CVec_TxidZ_free(ptrArray _res) {
12431 LDKCVec_TxidZ _res_constr;
12432 _res_constr.datalen = _res->arr_len;
12433 if (_res_constr.datalen > 0)
12434 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_TxidZ Elements");
12436 _res_constr.data = NULL;
12437 int8_tArray* _res_vals = (void*) _res->elems;
12438 for (size_t m = 0; m < _res_constr.datalen; m++) {
12439 int8_tArray _res_conv_12 = _res_vals[m];
12440 LDKThirtyTwoBytes _res_conv_12_ref;
12441 CHECK(_res_conv_12->arr_len == 32);
12442 memcpy(_res_conv_12_ref.data, _res_conv_12->elems, 32); FREE(_res_conv_12);
12443 _res_constr.data[m] = _res_conv_12_ref;
12446 CVec_TxidZ_free(_res_constr);
12449 uint64_t __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_ok"))) TS_CResult_NoneChannelMonitorUpdateErrZ_ok() {
12450 LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
12451 *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_ok();
12452 return tag_ptr(ret_conv, true);
12455 uint64_t __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_err"))) TS_CResult_NoneChannelMonitorUpdateErrZ_err(uint32_t e) {
12456 LDKChannelMonitorUpdateErr e_conv = LDKChannelMonitorUpdateErr_from_js(e);
12457 LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
12458 *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_err(e_conv);
12459 return tag_ptr(ret_conv, true);
12462 jboolean __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_is_ok"))) TS_CResult_NoneChannelMonitorUpdateErrZ_is_ok(uint64_t o) {
12463 LDKCResult_NoneChannelMonitorUpdateErrZ* o_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)untag_ptr(o);
12464 jboolean ret_conv = CResult_NoneChannelMonitorUpdateErrZ_is_ok(o_conv);
12468 void __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_free"))) TS_CResult_NoneChannelMonitorUpdateErrZ_free(uint64_t _res) {
12469 if (!ptr_is_owned(_res)) return;
12470 void* _res_ptr = untag_ptr(_res);
12471 CHECK_ACCESS(_res_ptr);
12472 LDKCResult_NoneChannelMonitorUpdateErrZ _res_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(_res_ptr);
12473 FREE(untag_ptr(_res));
12474 CResult_NoneChannelMonitorUpdateErrZ_free(_res_conv);
12477 static inline uint64_t CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR arg) {
12478 LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
12479 *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone(arg);
12480 return tag_ptr(ret_conv, true);
12482 int64_t __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_clone_ptr"))) TS_CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(uint64_t arg) {
12483 LDKCResult_NoneChannelMonitorUpdateErrZ* arg_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)untag_ptr(arg);
12484 int64_t ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(arg_conv);
12488 uint64_t __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_clone"))) TS_CResult_NoneChannelMonitorUpdateErrZ_clone(uint64_t orig) {
12489 LDKCResult_NoneChannelMonitorUpdateErrZ* orig_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)untag_ptr(orig);
12490 LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
12491 *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone(orig_conv);
12492 return tag_ptr(ret_conv, true);
12495 void __attribute__((export_name("TS_CVec_MonitorEventZ_free"))) TS_CVec_MonitorEventZ_free(uint64_tArray _res) {
12496 LDKCVec_MonitorEventZ _res_constr;
12497 _res_constr.datalen = _res->arr_len;
12498 if (_res_constr.datalen > 0)
12499 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ Elements");
12501 _res_constr.data = NULL;
12502 uint64_t* _res_vals = _res->elems;
12503 for (size_t o = 0; o < _res_constr.datalen; o++) {
12504 uint64_t _res_conv_14 = _res_vals[o];
12505 void* _res_conv_14_ptr = untag_ptr(_res_conv_14);
12506 CHECK_ACCESS(_res_conv_14_ptr);
12507 LDKMonitorEvent _res_conv_14_conv = *(LDKMonitorEvent*)(_res_conv_14_ptr);
12508 FREE(untag_ptr(_res_conv_14));
12509 _res_constr.data[o] = _res_conv_14_conv;
12512 CVec_MonitorEventZ_free(_res_constr);
12515 static inline uint64_t C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR arg) {
12516 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ");
12517 *ret_conv = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(arg);
12518 return tag_ptr(ret_conv, true);
12520 int64_t __attribute__((export_name("TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr(uint64_t arg) {
12521 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* arg_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(arg);
12522 int64_t ret_conv = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr(arg_conv);
12526 uint64_t __attribute__((export_name("TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(uint64_t orig) {
12527 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* orig_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(orig);
12528 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ");
12529 *ret_conv = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(orig_conv);
12530 return tag_ptr(ret_conv, true);
12533 uint64_t __attribute__((export_name("TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new(uint64_t a, uint64_tArray b, int8_tArray c) {
12534 LDKOutPoint a_conv;
12535 a_conv.inner = untag_ptr(a);
12536 a_conv.is_owned = ptr_is_owned(a);
12537 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
12538 a_conv = OutPoint_clone(&a_conv);
12539 LDKCVec_MonitorEventZ b_constr;
12540 b_constr.datalen = b->arr_len;
12541 if (b_constr.datalen > 0)
12542 b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ Elements");
12544 b_constr.data = NULL;
12545 uint64_t* b_vals = b->elems;
12546 for (size_t o = 0; o < b_constr.datalen; o++) {
12547 uint64_t b_conv_14 = b_vals[o];
12548 void* b_conv_14_ptr = untag_ptr(b_conv_14);
12549 CHECK_ACCESS(b_conv_14_ptr);
12550 LDKMonitorEvent b_conv_14_conv = *(LDKMonitorEvent*)(b_conv_14_ptr);
12551 b_conv_14_conv = MonitorEvent_clone((LDKMonitorEvent*)untag_ptr(b_conv_14));
12552 b_constr.data[o] = b_conv_14_conv;
12555 LDKPublicKey c_ref;
12556 CHECK(c->arr_len == 33);
12557 memcpy(c_ref.compressed_form, c->elems, 33); FREE(c);
12558 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ");
12559 *ret_conv = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new(a_conv, b_constr, c_ref);
12560 return tag_ptr(ret_conv, true);
12563 void __attribute__((export_name("TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free(uint64_t _res) {
12564 if (!ptr_is_owned(_res)) return;
12565 void* _res_ptr = untag_ptr(_res);
12566 CHECK_ACCESS(_res_ptr);
12567 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ _res_conv = *(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)(_res_ptr);
12568 FREE(untag_ptr(_res));
12569 C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free(_res_conv);
12572 void __attribute__((export_name("TS_CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free"))) TS_CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free(uint64_tArray _res) {
12573 LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ _res_constr;
12574 _res_constr.datalen = _res->arr_len;
12575 if (_res_constr.datalen > 0)
12576 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ Elements");
12578 _res_constr.data = NULL;
12579 uint64_t* _res_vals = _res->elems;
12580 for (size_t x = 0; x < _res_constr.datalen; x++) {
12581 uint64_t _res_conv_49 = _res_vals[x];
12582 void* _res_conv_49_ptr = untag_ptr(_res_conv_49);
12583 CHECK_ACCESS(_res_conv_49_ptr);
12584 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ _res_conv_49_conv = *(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)(_res_conv_49_ptr);
12585 FREE(untag_ptr(_res_conv_49));
12586 _res_constr.data[x] = _res_conv_49_conv;
12589 CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free(_res_constr);
12592 uint64_t __attribute__((export_name("TS_COption_C2Tuple_usizeTransactionZZ_some"))) TS_COption_C2Tuple_usizeTransactionZZ_some(uint64_t o) {
12593 void* o_ptr = untag_ptr(o);
12594 CHECK_ACCESS(o_ptr);
12595 LDKC2Tuple_usizeTransactionZ o_conv = *(LDKC2Tuple_usizeTransactionZ*)(o_ptr);
12596 o_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(o));
12597 LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ");
12598 *ret_copy = COption_C2Tuple_usizeTransactionZZ_some(o_conv);
12599 uint64_t ret_ref = tag_ptr(ret_copy, true);
12603 uint64_t __attribute__((export_name("TS_COption_C2Tuple_usizeTransactionZZ_none"))) TS_COption_C2Tuple_usizeTransactionZZ_none() {
12604 LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ");
12605 *ret_copy = COption_C2Tuple_usizeTransactionZZ_none();
12606 uint64_t ret_ref = tag_ptr(ret_copy, true);
12610 void __attribute__((export_name("TS_COption_C2Tuple_usizeTransactionZZ_free"))) TS_COption_C2Tuple_usizeTransactionZZ_free(uint64_t _res) {
12611 if (!ptr_is_owned(_res)) return;
12612 void* _res_ptr = untag_ptr(_res);
12613 CHECK_ACCESS(_res_ptr);
12614 LDKCOption_C2Tuple_usizeTransactionZZ _res_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(_res_ptr);
12615 FREE(untag_ptr(_res));
12616 COption_C2Tuple_usizeTransactionZZ_free(_res_conv);
12619 static inline uint64_t COption_C2Tuple_usizeTransactionZZ_clone_ptr(LDKCOption_C2Tuple_usizeTransactionZZ *NONNULL_PTR arg) {
12620 LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ");
12621 *ret_copy = COption_C2Tuple_usizeTransactionZZ_clone(arg);
12622 uint64_t ret_ref = tag_ptr(ret_copy, true);
12625 int64_t __attribute__((export_name("TS_COption_C2Tuple_usizeTransactionZZ_clone_ptr"))) TS_COption_C2Tuple_usizeTransactionZZ_clone_ptr(uint64_t arg) {
12626 LDKCOption_C2Tuple_usizeTransactionZZ* arg_conv = (LDKCOption_C2Tuple_usizeTransactionZZ*)untag_ptr(arg);
12627 int64_t ret_conv = COption_C2Tuple_usizeTransactionZZ_clone_ptr(arg_conv);
12631 uint64_t __attribute__((export_name("TS_COption_C2Tuple_usizeTransactionZZ_clone"))) TS_COption_C2Tuple_usizeTransactionZZ_clone(uint64_t orig) {
12632 LDKCOption_C2Tuple_usizeTransactionZZ* orig_conv = (LDKCOption_C2Tuple_usizeTransactionZZ*)untag_ptr(orig);
12633 LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ");
12634 *ret_copy = COption_C2Tuple_usizeTransactionZZ_clone(orig_conv);
12635 uint64_t ret_ref = tag_ptr(ret_copy, true);
12639 uint64_t __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_ok"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_ok(uint64_t o) {
12640 LDKFixedPenaltyScorer o_conv;
12641 o_conv.inner = untag_ptr(o);
12642 o_conv.is_owned = ptr_is_owned(o);
12643 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
12644 o_conv = FixedPenaltyScorer_clone(&o_conv);
12645 LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
12646 *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_ok(o_conv);
12647 return tag_ptr(ret_conv, true);
12650 uint64_t __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_err"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_err(uint64_t e) {
12651 LDKDecodeError e_conv;
12652 e_conv.inner = untag_ptr(e);
12653 e_conv.is_owned = ptr_is_owned(e);
12654 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
12655 e_conv = DecodeError_clone(&e_conv);
12656 LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
12657 *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_err(e_conv);
12658 return tag_ptr(ret_conv, true);
12661 jboolean __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_is_ok"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(uint64_t o) {
12662 LDKCResult_FixedPenaltyScorerDecodeErrorZ* o_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(o);
12663 jboolean ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(o_conv);
12667 void __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_free"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_free(uint64_t _res) {
12668 if (!ptr_is_owned(_res)) return;
12669 void* _res_ptr = untag_ptr(_res);
12670 CHECK_ACCESS(_res_ptr);
12671 LDKCResult_FixedPenaltyScorerDecodeErrorZ _res_conv = *(LDKCResult_FixedPenaltyScorerDecodeErrorZ*)(_res_ptr);
12672 FREE(untag_ptr(_res));
12673 CResult_FixedPenaltyScorerDecodeErrorZ_free(_res_conv);
12676 static inline uint64_t CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR arg) {
12677 LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
12678 *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_clone(arg);
12679 return tag_ptr(ret_conv, true);
12681 int64_t __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr(uint64_t arg) {
12682 LDKCResult_FixedPenaltyScorerDecodeErrorZ* arg_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(arg);
12683 int64_t ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr(arg_conv);
12687 uint64_t __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_clone"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_clone(uint64_t orig) {
12688 LDKCResult_FixedPenaltyScorerDecodeErrorZ* orig_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(orig);
12689 LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
12690 *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_clone(orig_conv);
12691 return tag_ptr(ret_conv, true);
12694 static inline uint64_t C2Tuple_u64u64Z_clone_ptr(LDKC2Tuple_u64u64Z *NONNULL_PTR arg) {
12695 LDKC2Tuple_u64u64Z* ret_conv = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
12696 *ret_conv = C2Tuple_u64u64Z_clone(arg);
12697 return tag_ptr(ret_conv, true);
12699 int64_t __attribute__((export_name("TS_C2Tuple_u64u64Z_clone_ptr"))) TS_C2Tuple_u64u64Z_clone_ptr(uint64_t arg) {
12700 LDKC2Tuple_u64u64Z* arg_conv = (LDKC2Tuple_u64u64Z*)untag_ptr(arg);
12701 int64_t ret_conv = C2Tuple_u64u64Z_clone_ptr(arg_conv);
12705 uint64_t __attribute__((export_name("TS_C2Tuple_u64u64Z_clone"))) TS_C2Tuple_u64u64Z_clone(uint64_t orig) {
12706 LDKC2Tuple_u64u64Z* orig_conv = (LDKC2Tuple_u64u64Z*)untag_ptr(orig);
12707 LDKC2Tuple_u64u64Z* ret_conv = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
12708 *ret_conv = C2Tuple_u64u64Z_clone(orig_conv);
12709 return tag_ptr(ret_conv, true);
12712 uint64_t __attribute__((export_name("TS_C2Tuple_u64u64Z_new"))) TS_C2Tuple_u64u64Z_new(int64_t a, int64_t b) {
12713 LDKC2Tuple_u64u64Z* ret_conv = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
12714 *ret_conv = C2Tuple_u64u64Z_new(a, b);
12715 return tag_ptr(ret_conv, true);
12718 void __attribute__((export_name("TS_C2Tuple_u64u64Z_free"))) TS_C2Tuple_u64u64Z_free(uint64_t _res) {
12719 if (!ptr_is_owned(_res)) return;
12720 void* _res_ptr = untag_ptr(_res);
12721 CHECK_ACCESS(_res_ptr);
12722 LDKC2Tuple_u64u64Z _res_conv = *(LDKC2Tuple_u64u64Z*)(_res_ptr);
12723 FREE(untag_ptr(_res));
12724 C2Tuple_u64u64Z_free(_res_conv);
12727 uint64_t __attribute__((export_name("TS_COption_C2Tuple_u64u64ZZ_some"))) TS_COption_C2Tuple_u64u64ZZ_some(uint64_t o) {
12728 void* o_ptr = untag_ptr(o);
12729 CHECK_ACCESS(o_ptr);
12730 LDKC2Tuple_u64u64Z o_conv = *(LDKC2Tuple_u64u64Z*)(o_ptr);
12731 o_conv = C2Tuple_u64u64Z_clone((LDKC2Tuple_u64u64Z*)untag_ptr(o));
12732 LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ");
12733 *ret_copy = COption_C2Tuple_u64u64ZZ_some(o_conv);
12734 uint64_t ret_ref = tag_ptr(ret_copy, true);
12738 uint64_t __attribute__((export_name("TS_COption_C2Tuple_u64u64ZZ_none"))) TS_COption_C2Tuple_u64u64ZZ_none() {
12739 LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ");
12740 *ret_copy = COption_C2Tuple_u64u64ZZ_none();
12741 uint64_t ret_ref = tag_ptr(ret_copy, true);
12745 void __attribute__((export_name("TS_COption_C2Tuple_u64u64ZZ_free"))) TS_COption_C2Tuple_u64u64ZZ_free(uint64_t _res) {
12746 if (!ptr_is_owned(_res)) return;
12747 void* _res_ptr = untag_ptr(_res);
12748 CHECK_ACCESS(_res_ptr);
12749 LDKCOption_C2Tuple_u64u64ZZ _res_conv = *(LDKCOption_C2Tuple_u64u64ZZ*)(_res_ptr);
12750 FREE(untag_ptr(_res));
12751 COption_C2Tuple_u64u64ZZ_free(_res_conv);
12754 static inline uint64_t COption_C2Tuple_u64u64ZZ_clone_ptr(LDKCOption_C2Tuple_u64u64ZZ *NONNULL_PTR arg) {
12755 LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ");
12756 *ret_copy = COption_C2Tuple_u64u64ZZ_clone(arg);
12757 uint64_t ret_ref = tag_ptr(ret_copy, true);
12760 int64_t __attribute__((export_name("TS_COption_C2Tuple_u64u64ZZ_clone_ptr"))) TS_COption_C2Tuple_u64u64ZZ_clone_ptr(uint64_t arg) {
12761 LDKCOption_C2Tuple_u64u64ZZ* arg_conv = (LDKCOption_C2Tuple_u64u64ZZ*)untag_ptr(arg);
12762 int64_t ret_conv = COption_C2Tuple_u64u64ZZ_clone_ptr(arg_conv);
12766 uint64_t __attribute__((export_name("TS_COption_C2Tuple_u64u64ZZ_clone"))) TS_COption_C2Tuple_u64u64ZZ_clone(uint64_t orig) {
12767 LDKCOption_C2Tuple_u64u64ZZ* orig_conv = (LDKCOption_C2Tuple_u64u64ZZ*)untag_ptr(orig);
12768 LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ");
12769 *ret_copy = COption_C2Tuple_u64u64ZZ_clone(orig_conv);
12770 uint64_t ret_ref = tag_ptr(ret_copy, true);
12774 void __attribute__((export_name("TS_CVec_NodeIdZ_free"))) TS_CVec_NodeIdZ_free(uint64_tArray _res) {
12775 LDKCVec_NodeIdZ _res_constr;
12776 _res_constr.datalen = _res->arr_len;
12777 if (_res_constr.datalen > 0)
12778 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKNodeId), "LDKCVec_NodeIdZ Elements");
12780 _res_constr.data = NULL;
12781 uint64_t* _res_vals = _res->elems;
12782 for (size_t i = 0; i < _res_constr.datalen; i++) {
12783 uint64_t _res_conv_8 = _res_vals[i];
12784 LDKNodeId _res_conv_8_conv;
12785 _res_conv_8_conv.inner = untag_ptr(_res_conv_8);
12786 _res_conv_8_conv.is_owned = ptr_is_owned(_res_conv_8);
12787 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_8_conv);
12788 _res_constr.data[i] = _res_conv_8_conv;
12791 CVec_NodeIdZ_free(_res_constr);
12794 uint64_t __attribute__((export_name("TS_CResult_ProbabilisticScorerDecodeErrorZ_ok"))) TS_CResult_ProbabilisticScorerDecodeErrorZ_ok(uint64_t o) {
12795 LDKProbabilisticScorer o_conv;
12796 o_conv.inner = untag_ptr(o);
12797 o_conv.is_owned = ptr_is_owned(o);
12798 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
12799 // WARNING: we need a move here but no clone is available for LDKProbabilisticScorer
12801 LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ");
12802 *ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_ok(o_conv);
12803 return tag_ptr(ret_conv, true);
12806 uint64_t __attribute__((export_name("TS_CResult_ProbabilisticScorerDecodeErrorZ_err"))) TS_CResult_ProbabilisticScorerDecodeErrorZ_err(uint64_t e) {
12807 LDKDecodeError e_conv;
12808 e_conv.inner = untag_ptr(e);
12809 e_conv.is_owned = ptr_is_owned(e);
12810 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
12811 e_conv = DecodeError_clone(&e_conv);
12812 LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ");
12813 *ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_err(e_conv);
12814 return tag_ptr(ret_conv, true);
12817 jboolean __attribute__((export_name("TS_CResult_ProbabilisticScorerDecodeErrorZ_is_ok"))) TS_CResult_ProbabilisticScorerDecodeErrorZ_is_ok(uint64_t o) {
12818 LDKCResult_ProbabilisticScorerDecodeErrorZ* o_conv = (LDKCResult_ProbabilisticScorerDecodeErrorZ*)untag_ptr(o);
12819 jboolean ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_is_ok(o_conv);
12823 void __attribute__((export_name("TS_CResult_ProbabilisticScorerDecodeErrorZ_free"))) TS_CResult_ProbabilisticScorerDecodeErrorZ_free(uint64_t _res) {
12824 if (!ptr_is_owned(_res)) return;
12825 void* _res_ptr = untag_ptr(_res);
12826 CHECK_ACCESS(_res_ptr);
12827 LDKCResult_ProbabilisticScorerDecodeErrorZ _res_conv = *(LDKCResult_ProbabilisticScorerDecodeErrorZ*)(_res_ptr);
12828 FREE(untag_ptr(_res));
12829 CResult_ProbabilisticScorerDecodeErrorZ_free(_res_conv);
12832 uint64_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_ok"))) TS_CResult_InitFeaturesDecodeErrorZ_ok(uint64_t o) {
12833 LDKInitFeatures o_conv;
12834 o_conv.inner = untag_ptr(o);
12835 o_conv.is_owned = ptr_is_owned(o);
12836 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
12837 o_conv = InitFeatures_clone(&o_conv);
12838 LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
12839 *ret_conv = CResult_InitFeaturesDecodeErrorZ_ok(o_conv);
12840 return tag_ptr(ret_conv, true);
12843 uint64_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_err"))) TS_CResult_InitFeaturesDecodeErrorZ_err(uint64_t e) {
12844 LDKDecodeError e_conv;
12845 e_conv.inner = untag_ptr(e);
12846 e_conv.is_owned = ptr_is_owned(e);
12847 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
12848 e_conv = DecodeError_clone(&e_conv);
12849 LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
12850 *ret_conv = CResult_InitFeaturesDecodeErrorZ_err(e_conv);
12851 return tag_ptr(ret_conv, true);
12854 jboolean __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_is_ok"))) TS_CResult_InitFeaturesDecodeErrorZ_is_ok(uint64_t o) {
12855 LDKCResult_InitFeaturesDecodeErrorZ* o_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(o);
12856 jboolean ret_conv = CResult_InitFeaturesDecodeErrorZ_is_ok(o_conv);
12860 void __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_free"))) TS_CResult_InitFeaturesDecodeErrorZ_free(uint64_t _res) {
12861 if (!ptr_is_owned(_res)) return;
12862 void* _res_ptr = untag_ptr(_res);
12863 CHECK_ACCESS(_res_ptr);
12864 LDKCResult_InitFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InitFeaturesDecodeErrorZ*)(_res_ptr);
12865 FREE(untag_ptr(_res));
12866 CResult_InitFeaturesDecodeErrorZ_free(_res_conv);
12869 static inline uint64_t CResult_InitFeaturesDecodeErrorZ_clone_ptr(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR arg) {
12870 LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
12871 *ret_conv = CResult_InitFeaturesDecodeErrorZ_clone(arg);
12872 return tag_ptr(ret_conv, true);
12874 int64_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_clone_ptr"))) TS_CResult_InitFeaturesDecodeErrorZ_clone_ptr(uint64_t arg) {
12875 LDKCResult_InitFeaturesDecodeErrorZ* arg_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(arg);
12876 int64_t ret_conv = CResult_InitFeaturesDecodeErrorZ_clone_ptr(arg_conv);
12880 uint64_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_clone"))) TS_CResult_InitFeaturesDecodeErrorZ_clone(uint64_t orig) {
12881 LDKCResult_InitFeaturesDecodeErrorZ* orig_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(orig);
12882 LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
12883 *ret_conv = CResult_InitFeaturesDecodeErrorZ_clone(orig_conv);
12884 return tag_ptr(ret_conv, true);
12887 uint64_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_ok"))) TS_CResult_ChannelFeaturesDecodeErrorZ_ok(uint64_t o) {
12888 LDKChannelFeatures o_conv;
12889 o_conv.inner = untag_ptr(o);
12890 o_conv.is_owned = ptr_is_owned(o);
12891 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
12892 o_conv = ChannelFeatures_clone(&o_conv);
12893 LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
12894 *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_ok(o_conv);
12895 return tag_ptr(ret_conv, true);
12898 uint64_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_err"))) TS_CResult_ChannelFeaturesDecodeErrorZ_err(uint64_t e) {
12899 LDKDecodeError e_conv;
12900 e_conv.inner = untag_ptr(e);
12901 e_conv.is_owned = ptr_is_owned(e);
12902 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
12903 e_conv = DecodeError_clone(&e_conv);
12904 LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
12905 *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_err(e_conv);
12906 return tag_ptr(ret_conv, true);
12909 jboolean __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_is_ok"))) TS_CResult_ChannelFeaturesDecodeErrorZ_is_ok(uint64_t o) {
12910 LDKCResult_ChannelFeaturesDecodeErrorZ* o_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(o);
12911 jboolean ret_conv = CResult_ChannelFeaturesDecodeErrorZ_is_ok(o_conv);
12915 void __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_free"))) TS_CResult_ChannelFeaturesDecodeErrorZ_free(uint64_t _res) {
12916 if (!ptr_is_owned(_res)) return;
12917 void* _res_ptr = untag_ptr(_res);
12918 CHECK_ACCESS(_res_ptr);
12919 LDKCResult_ChannelFeaturesDecodeErrorZ _res_conv = *(LDKCResult_ChannelFeaturesDecodeErrorZ*)(_res_ptr);
12920 FREE(untag_ptr(_res));
12921 CResult_ChannelFeaturesDecodeErrorZ_free(_res_conv);
12924 static inline uint64_t CResult_ChannelFeaturesDecodeErrorZ_clone_ptr(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR arg) {
12925 LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
12926 *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_clone(arg);
12927 return tag_ptr(ret_conv, true);
12929 int64_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelFeaturesDecodeErrorZ_clone_ptr(uint64_t arg) {
12930 LDKCResult_ChannelFeaturesDecodeErrorZ* arg_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(arg);
12931 int64_t ret_conv = CResult_ChannelFeaturesDecodeErrorZ_clone_ptr(arg_conv);
12935 uint64_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_clone"))) TS_CResult_ChannelFeaturesDecodeErrorZ_clone(uint64_t orig) {
12936 LDKCResult_ChannelFeaturesDecodeErrorZ* orig_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(orig);
12937 LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
12938 *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_clone(orig_conv);
12939 return tag_ptr(ret_conv, true);
12942 uint64_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_ok"))) TS_CResult_NodeFeaturesDecodeErrorZ_ok(uint64_t o) {
12943 LDKNodeFeatures o_conv;
12944 o_conv.inner = untag_ptr(o);
12945 o_conv.is_owned = ptr_is_owned(o);
12946 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
12947 o_conv = NodeFeatures_clone(&o_conv);
12948 LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
12949 *ret_conv = CResult_NodeFeaturesDecodeErrorZ_ok(o_conv);
12950 return tag_ptr(ret_conv, true);
12953 uint64_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_err"))) TS_CResult_NodeFeaturesDecodeErrorZ_err(uint64_t e) {
12954 LDKDecodeError e_conv;
12955 e_conv.inner = untag_ptr(e);
12956 e_conv.is_owned = ptr_is_owned(e);
12957 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
12958 e_conv = DecodeError_clone(&e_conv);
12959 LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
12960 *ret_conv = CResult_NodeFeaturesDecodeErrorZ_err(e_conv);
12961 return tag_ptr(ret_conv, true);
12964 jboolean __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_is_ok"))) TS_CResult_NodeFeaturesDecodeErrorZ_is_ok(uint64_t o) {
12965 LDKCResult_NodeFeaturesDecodeErrorZ* o_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(o);
12966 jboolean ret_conv = CResult_NodeFeaturesDecodeErrorZ_is_ok(o_conv);
12970 void __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_free"))) TS_CResult_NodeFeaturesDecodeErrorZ_free(uint64_t _res) {
12971 if (!ptr_is_owned(_res)) return;
12972 void* _res_ptr = untag_ptr(_res);
12973 CHECK_ACCESS(_res_ptr);
12974 LDKCResult_NodeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_NodeFeaturesDecodeErrorZ*)(_res_ptr);
12975 FREE(untag_ptr(_res));
12976 CResult_NodeFeaturesDecodeErrorZ_free(_res_conv);
12979 static inline uint64_t CResult_NodeFeaturesDecodeErrorZ_clone_ptr(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR arg) {
12980 LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
12981 *ret_conv = CResult_NodeFeaturesDecodeErrorZ_clone(arg);
12982 return tag_ptr(ret_conv, true);
12984 int64_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_clone_ptr"))) TS_CResult_NodeFeaturesDecodeErrorZ_clone_ptr(uint64_t arg) {
12985 LDKCResult_NodeFeaturesDecodeErrorZ* arg_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(arg);
12986 int64_t ret_conv = CResult_NodeFeaturesDecodeErrorZ_clone_ptr(arg_conv);
12990 uint64_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_clone"))) TS_CResult_NodeFeaturesDecodeErrorZ_clone(uint64_t orig) {
12991 LDKCResult_NodeFeaturesDecodeErrorZ* orig_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(orig);
12992 LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
12993 *ret_conv = CResult_NodeFeaturesDecodeErrorZ_clone(orig_conv);
12994 return tag_ptr(ret_conv, true);
12997 uint64_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_ok"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_ok(uint64_t o) {
12998 LDKInvoiceFeatures o_conv;
12999 o_conv.inner = untag_ptr(o);
13000 o_conv.is_owned = ptr_is_owned(o);
13001 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
13002 o_conv = InvoiceFeatures_clone(&o_conv);
13003 LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
13004 *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_ok(o_conv);
13005 return tag_ptr(ret_conv, true);
13008 uint64_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_err"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_err(uint64_t e) {
13009 LDKDecodeError e_conv;
13010 e_conv.inner = untag_ptr(e);
13011 e_conv.is_owned = ptr_is_owned(e);
13012 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13013 e_conv = DecodeError_clone(&e_conv);
13014 LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
13015 *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_err(e_conv);
13016 return tag_ptr(ret_conv, true);
13019 jboolean __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_is_ok"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_is_ok(uint64_t o) {
13020 LDKCResult_InvoiceFeaturesDecodeErrorZ* o_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(o);
13021 jboolean ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_is_ok(o_conv);
13025 void __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_free"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_free(uint64_t _res) {
13026 if (!ptr_is_owned(_res)) return;
13027 void* _res_ptr = untag_ptr(_res);
13028 CHECK_ACCESS(_res_ptr);
13029 LDKCResult_InvoiceFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InvoiceFeaturesDecodeErrorZ*)(_res_ptr);
13030 FREE(untag_ptr(_res));
13031 CResult_InvoiceFeaturesDecodeErrorZ_free(_res_conv);
13034 static inline uint64_t CResult_InvoiceFeaturesDecodeErrorZ_clone_ptr(LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR arg) {
13035 LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
13036 *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_clone(arg);
13037 return tag_ptr(ret_conv, true);
13039 int64_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_clone_ptr"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_clone_ptr(uint64_t arg) {
13040 LDKCResult_InvoiceFeaturesDecodeErrorZ* arg_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(arg);
13041 int64_t ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_clone_ptr(arg_conv);
13045 uint64_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_clone"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_clone(uint64_t orig) {
13046 LDKCResult_InvoiceFeaturesDecodeErrorZ* orig_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(orig);
13047 LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
13048 *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_clone(orig_conv);
13049 return tag_ptr(ret_conv, true);
13052 uint64_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_ok"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_ok(uint64_t o) {
13053 LDKChannelTypeFeatures o_conv;
13054 o_conv.inner = untag_ptr(o);
13055 o_conv.is_owned = ptr_is_owned(o);
13056 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
13057 o_conv = ChannelTypeFeatures_clone(&o_conv);
13058 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
13059 *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_ok(o_conv);
13060 return tag_ptr(ret_conv, true);
13063 uint64_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_err"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_err(uint64_t e) {
13064 LDKDecodeError e_conv;
13065 e_conv.inner = untag_ptr(e);
13066 e_conv.is_owned = ptr_is_owned(e);
13067 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13068 e_conv = DecodeError_clone(&e_conv);
13069 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
13070 *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_err(e_conv);
13071 return tag_ptr(ret_conv, true);
13074 jboolean __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(uint64_t o) {
13075 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* o_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(o);
13076 jboolean ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(o_conv);
13080 void __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_free"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_free(uint64_t _res) {
13081 if (!ptr_is_owned(_res)) return;
13082 void* _res_ptr = untag_ptr(_res);
13083 CHECK_ACCESS(_res_ptr);
13084 LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)(_res_ptr);
13085 FREE(untag_ptr(_res));
13086 CResult_ChannelTypeFeaturesDecodeErrorZ_free(_res_conv);
13089 static inline uint64_t CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR arg) {
13090 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
13091 *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone(arg);
13092 return tag_ptr(ret_conv, true);
13094 int64_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(uint64_t arg) {
13095 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* arg_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(arg);
13096 int64_t ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(arg_conv);
13100 uint64_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_clone"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_clone(uint64_t orig) {
13101 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* orig_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(orig);
13102 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
13103 *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone(orig_conv);
13104 return tag_ptr(ret_conv, true);
13107 uint64_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_ok"))) TS_CResult_NodeIdDecodeErrorZ_ok(uint64_t o) {
13109 o_conv.inner = untag_ptr(o);
13110 o_conv.is_owned = ptr_is_owned(o);
13111 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
13112 o_conv = NodeId_clone(&o_conv);
13113 LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
13114 *ret_conv = CResult_NodeIdDecodeErrorZ_ok(o_conv);
13115 return tag_ptr(ret_conv, true);
13118 uint64_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_err"))) TS_CResult_NodeIdDecodeErrorZ_err(uint64_t e) {
13119 LDKDecodeError e_conv;
13120 e_conv.inner = untag_ptr(e);
13121 e_conv.is_owned = ptr_is_owned(e);
13122 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13123 e_conv = DecodeError_clone(&e_conv);
13124 LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
13125 *ret_conv = CResult_NodeIdDecodeErrorZ_err(e_conv);
13126 return tag_ptr(ret_conv, true);
13129 jboolean __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_is_ok"))) TS_CResult_NodeIdDecodeErrorZ_is_ok(uint64_t o) {
13130 LDKCResult_NodeIdDecodeErrorZ* o_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(o);
13131 jboolean ret_conv = CResult_NodeIdDecodeErrorZ_is_ok(o_conv);
13135 void __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_free"))) TS_CResult_NodeIdDecodeErrorZ_free(uint64_t _res) {
13136 if (!ptr_is_owned(_res)) return;
13137 void* _res_ptr = untag_ptr(_res);
13138 CHECK_ACCESS(_res_ptr);
13139 LDKCResult_NodeIdDecodeErrorZ _res_conv = *(LDKCResult_NodeIdDecodeErrorZ*)(_res_ptr);
13140 FREE(untag_ptr(_res));
13141 CResult_NodeIdDecodeErrorZ_free(_res_conv);
13144 static inline uint64_t CResult_NodeIdDecodeErrorZ_clone_ptr(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR arg) {
13145 LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
13146 *ret_conv = CResult_NodeIdDecodeErrorZ_clone(arg);
13147 return tag_ptr(ret_conv, true);
13149 int64_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_clone_ptr"))) TS_CResult_NodeIdDecodeErrorZ_clone_ptr(uint64_t arg) {
13150 LDKCResult_NodeIdDecodeErrorZ* arg_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(arg);
13151 int64_t ret_conv = CResult_NodeIdDecodeErrorZ_clone_ptr(arg_conv);
13155 uint64_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_clone"))) TS_CResult_NodeIdDecodeErrorZ_clone(uint64_t orig) {
13156 LDKCResult_NodeIdDecodeErrorZ* orig_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(orig);
13157 LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
13158 *ret_conv = CResult_NodeIdDecodeErrorZ_clone(orig_conv);
13159 return tag_ptr(ret_conv, true);
13162 uint64_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_ok"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_ok(uint64_t o) {
13163 void* o_ptr = untag_ptr(o);
13164 CHECK_ACCESS(o_ptr);
13165 LDKCOption_NetworkUpdateZ o_conv = *(LDKCOption_NetworkUpdateZ*)(o_ptr);
13166 o_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)untag_ptr(o));
13167 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
13168 *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_ok(o_conv);
13169 return tag_ptr(ret_conv, true);
13172 uint64_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_err"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_err(uint64_t e) {
13173 LDKDecodeError e_conv;
13174 e_conv.inner = untag_ptr(e);
13175 e_conv.is_owned = ptr_is_owned(e);
13176 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13177 e_conv = DecodeError_clone(&e_conv);
13178 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
13179 *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_err(e_conv);
13180 return tag_ptr(ret_conv, true);
13183 jboolean __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(uint64_t o) {
13184 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* o_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(o);
13185 jboolean ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(o_conv);
13189 void __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_free"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_free(uint64_t _res) {
13190 if (!ptr_is_owned(_res)) return;
13191 void* _res_ptr = untag_ptr(_res);
13192 CHECK_ACCESS(_res_ptr);
13193 LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res_conv = *(LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(_res_ptr);
13194 FREE(untag_ptr(_res));
13195 CResult_COption_NetworkUpdateZDecodeErrorZ_free(_res_conv);
13198 static inline uint64_t CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR arg) {
13199 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
13200 *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone(arg);
13201 return tag_ptr(ret_conv, true);
13203 int64_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(uint64_t arg) {
13204 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* arg_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(arg);
13205 int64_t ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(arg_conv);
13209 uint64_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_clone"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_clone(uint64_t orig) {
13210 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* orig_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(orig);
13211 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
13212 *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone(orig_conv);
13213 return tag_ptr(ret_conv, true);
13216 uint64_t __attribute__((export_name("TS_COption_AccessZ_some"))) TS_COption_AccessZ_some(uint64_t o) {
13217 void* o_ptr = untag_ptr(o);
13218 CHECK_ACCESS(o_ptr);
13219 LDKAccess o_conv = *(LDKAccess*)(o_ptr);
13220 if (o_conv.free == LDKAccess_JCalls_free) {
13221 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
13222 LDKAccess_JCalls_cloned(&o_conv);
13224 LDKCOption_AccessZ *ret_copy = MALLOC(sizeof(LDKCOption_AccessZ), "LDKCOption_AccessZ");
13225 *ret_copy = COption_AccessZ_some(o_conv);
13226 uint64_t ret_ref = tag_ptr(ret_copy, true);
13230 uint64_t __attribute__((export_name("TS_COption_AccessZ_none"))) TS_COption_AccessZ_none() {
13231 LDKCOption_AccessZ *ret_copy = MALLOC(sizeof(LDKCOption_AccessZ), "LDKCOption_AccessZ");
13232 *ret_copy = COption_AccessZ_none();
13233 uint64_t ret_ref = tag_ptr(ret_copy, true);
13237 void __attribute__((export_name("TS_COption_AccessZ_free"))) TS_COption_AccessZ_free(uint64_t _res) {
13238 if (!ptr_is_owned(_res)) return;
13239 void* _res_ptr = untag_ptr(_res);
13240 CHECK_ACCESS(_res_ptr);
13241 LDKCOption_AccessZ _res_conv = *(LDKCOption_AccessZ*)(_res_ptr);
13242 FREE(untag_ptr(_res));
13243 COption_AccessZ_free(_res_conv);
13246 uint64_t __attribute__((export_name("TS_CResult_boolLightningErrorZ_ok"))) TS_CResult_boolLightningErrorZ_ok(jboolean o) {
13247 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
13248 *ret_conv = CResult_boolLightningErrorZ_ok(o);
13249 return tag_ptr(ret_conv, true);
13252 uint64_t __attribute__((export_name("TS_CResult_boolLightningErrorZ_err"))) TS_CResult_boolLightningErrorZ_err(uint64_t e) {
13253 LDKLightningError e_conv;
13254 e_conv.inner = untag_ptr(e);
13255 e_conv.is_owned = ptr_is_owned(e);
13256 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13257 e_conv = LightningError_clone(&e_conv);
13258 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
13259 *ret_conv = CResult_boolLightningErrorZ_err(e_conv);
13260 return tag_ptr(ret_conv, true);
13263 jboolean __attribute__((export_name("TS_CResult_boolLightningErrorZ_is_ok"))) TS_CResult_boolLightningErrorZ_is_ok(uint64_t o) {
13264 LDKCResult_boolLightningErrorZ* o_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(o);
13265 jboolean ret_conv = CResult_boolLightningErrorZ_is_ok(o_conv);
13269 void __attribute__((export_name("TS_CResult_boolLightningErrorZ_free"))) TS_CResult_boolLightningErrorZ_free(uint64_t _res) {
13270 if (!ptr_is_owned(_res)) return;
13271 void* _res_ptr = untag_ptr(_res);
13272 CHECK_ACCESS(_res_ptr);
13273 LDKCResult_boolLightningErrorZ _res_conv = *(LDKCResult_boolLightningErrorZ*)(_res_ptr);
13274 FREE(untag_ptr(_res));
13275 CResult_boolLightningErrorZ_free(_res_conv);
13278 static inline uint64_t CResult_boolLightningErrorZ_clone_ptr(LDKCResult_boolLightningErrorZ *NONNULL_PTR arg) {
13279 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
13280 *ret_conv = CResult_boolLightningErrorZ_clone(arg);
13281 return tag_ptr(ret_conv, true);
13283 int64_t __attribute__((export_name("TS_CResult_boolLightningErrorZ_clone_ptr"))) TS_CResult_boolLightningErrorZ_clone_ptr(uint64_t arg) {
13284 LDKCResult_boolLightningErrorZ* arg_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(arg);
13285 int64_t ret_conv = CResult_boolLightningErrorZ_clone_ptr(arg_conv);
13289 uint64_t __attribute__((export_name("TS_CResult_boolLightningErrorZ_clone"))) TS_CResult_boolLightningErrorZ_clone(uint64_t orig) {
13290 LDKCResult_boolLightningErrorZ* orig_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(orig);
13291 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
13292 *ret_conv = CResult_boolLightningErrorZ_clone(orig_conv);
13293 return tag_ptr(ret_conv, true);
13296 static inline uint64_t C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR arg) {
13297 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
13298 *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(arg);
13299 return tag_ptr(ret_conv, true);
13301 int64_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(uint64_t arg) {
13302 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* arg_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(arg);
13303 int64_t ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(arg_conv);
13307 uint64_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(uint64_t orig) {
13308 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* orig_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(orig);
13309 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
13310 *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(orig_conv);
13311 return tag_ptr(ret_conv, true);
13314 uint64_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(uint64_t a, uint64_t b, uint64_t c) {
13315 LDKChannelAnnouncement a_conv;
13316 a_conv.inner = untag_ptr(a);
13317 a_conv.is_owned = ptr_is_owned(a);
13318 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
13319 a_conv = ChannelAnnouncement_clone(&a_conv);
13320 LDKChannelUpdate b_conv;
13321 b_conv.inner = untag_ptr(b);
13322 b_conv.is_owned = ptr_is_owned(b);
13323 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
13324 b_conv = ChannelUpdate_clone(&b_conv);
13325 LDKChannelUpdate c_conv;
13326 c_conv.inner = untag_ptr(c);
13327 c_conv.is_owned = ptr_is_owned(c);
13328 CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv);
13329 c_conv = ChannelUpdate_clone(&c_conv);
13330 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
13331 *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a_conv, b_conv, c_conv);
13332 return tag_ptr(ret_conv, true);
13335 void __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(uint64_t _res) {
13336 if (!ptr_is_owned(_res)) return;
13337 void* _res_ptr = untag_ptr(_res);
13338 CHECK_ACCESS(_res_ptr);
13339 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(_res_ptr);
13340 FREE(untag_ptr(_res));
13341 C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(_res_conv);
13344 void __attribute__((export_name("TS_CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free"))) TS_CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(uint64_tArray _res) {
13345 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res_constr;
13346 _res_constr.datalen = _res->arr_len;
13347 if (_res_constr.datalen > 0)
13348 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ Elements");
13350 _res_constr.data = NULL;
13351 uint64_t* _res_vals = _res->elems;
13352 for (size_t h = 0; h < _res_constr.datalen; h++) {
13353 uint64_t _res_conv_59 = _res_vals[h];
13354 void* _res_conv_59_ptr = untag_ptr(_res_conv_59);
13355 CHECK_ACCESS(_res_conv_59_ptr);
13356 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res_conv_59_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(_res_conv_59_ptr);
13357 FREE(untag_ptr(_res_conv_59));
13358 _res_constr.data[h] = _res_conv_59_conv;
13361 CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(_res_constr);
13364 void __attribute__((export_name("TS_CVec_NodeAnnouncementZ_free"))) TS_CVec_NodeAnnouncementZ_free(uint64_tArray _res) {
13365 LDKCVec_NodeAnnouncementZ _res_constr;
13366 _res_constr.datalen = _res->arr_len;
13367 if (_res_constr.datalen > 0)
13368 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKNodeAnnouncement), "LDKCVec_NodeAnnouncementZ Elements");
13370 _res_constr.data = NULL;
13371 uint64_t* _res_vals = _res->elems;
13372 for (size_t s = 0; s < _res_constr.datalen; s++) {
13373 uint64_t _res_conv_18 = _res_vals[s];
13374 LDKNodeAnnouncement _res_conv_18_conv;
13375 _res_conv_18_conv.inner = untag_ptr(_res_conv_18);
13376 _res_conv_18_conv.is_owned = ptr_is_owned(_res_conv_18);
13377 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_18_conv);
13378 _res_constr.data[s] = _res_conv_18_conv;
13381 CVec_NodeAnnouncementZ_free(_res_constr);
13384 uint64_t __attribute__((export_name("TS_CResult_NoneLightningErrorZ_ok"))) TS_CResult_NoneLightningErrorZ_ok() {
13385 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
13386 *ret_conv = CResult_NoneLightningErrorZ_ok();
13387 return tag_ptr(ret_conv, true);
13390 uint64_t __attribute__((export_name("TS_CResult_NoneLightningErrorZ_err"))) TS_CResult_NoneLightningErrorZ_err(uint64_t e) {
13391 LDKLightningError e_conv;
13392 e_conv.inner = untag_ptr(e);
13393 e_conv.is_owned = ptr_is_owned(e);
13394 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13395 e_conv = LightningError_clone(&e_conv);
13396 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
13397 *ret_conv = CResult_NoneLightningErrorZ_err(e_conv);
13398 return tag_ptr(ret_conv, true);
13401 jboolean __attribute__((export_name("TS_CResult_NoneLightningErrorZ_is_ok"))) TS_CResult_NoneLightningErrorZ_is_ok(uint64_t o) {
13402 LDKCResult_NoneLightningErrorZ* o_conv = (LDKCResult_NoneLightningErrorZ*)untag_ptr(o);
13403 jboolean ret_conv = CResult_NoneLightningErrorZ_is_ok(o_conv);
13407 void __attribute__((export_name("TS_CResult_NoneLightningErrorZ_free"))) TS_CResult_NoneLightningErrorZ_free(uint64_t _res) {
13408 if (!ptr_is_owned(_res)) return;
13409 void* _res_ptr = untag_ptr(_res);
13410 CHECK_ACCESS(_res_ptr);
13411 LDKCResult_NoneLightningErrorZ _res_conv = *(LDKCResult_NoneLightningErrorZ*)(_res_ptr);
13412 FREE(untag_ptr(_res));
13413 CResult_NoneLightningErrorZ_free(_res_conv);
13416 static inline uint64_t CResult_NoneLightningErrorZ_clone_ptr(LDKCResult_NoneLightningErrorZ *NONNULL_PTR arg) {
13417 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
13418 *ret_conv = CResult_NoneLightningErrorZ_clone(arg);
13419 return tag_ptr(ret_conv, true);
13421 int64_t __attribute__((export_name("TS_CResult_NoneLightningErrorZ_clone_ptr"))) TS_CResult_NoneLightningErrorZ_clone_ptr(uint64_t arg) {
13422 LDKCResult_NoneLightningErrorZ* arg_conv = (LDKCResult_NoneLightningErrorZ*)untag_ptr(arg);
13423 int64_t ret_conv = CResult_NoneLightningErrorZ_clone_ptr(arg_conv);
13427 uint64_t __attribute__((export_name("TS_CResult_NoneLightningErrorZ_clone"))) TS_CResult_NoneLightningErrorZ_clone(uint64_t orig) {
13428 LDKCResult_NoneLightningErrorZ* orig_conv = (LDKCResult_NoneLightningErrorZ*)untag_ptr(orig);
13429 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
13430 *ret_conv = CResult_NoneLightningErrorZ_clone(orig_conv);
13431 return tag_ptr(ret_conv, true);
13434 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateInfoDecodeErrorZ_ok"))) TS_CResult_ChannelUpdateInfoDecodeErrorZ_ok(uint64_t o) {
13435 LDKChannelUpdateInfo o_conv;
13436 o_conv.inner = untag_ptr(o);
13437 o_conv.is_owned = ptr_is_owned(o);
13438 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
13439 o_conv = ChannelUpdateInfo_clone(&o_conv);
13440 LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
13441 *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_ok(o_conv);
13442 return tag_ptr(ret_conv, true);
13445 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateInfoDecodeErrorZ_err"))) TS_CResult_ChannelUpdateInfoDecodeErrorZ_err(uint64_t e) {
13446 LDKDecodeError e_conv;
13447 e_conv.inner = untag_ptr(e);
13448 e_conv.is_owned = ptr_is_owned(e);
13449 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13450 e_conv = DecodeError_clone(&e_conv);
13451 LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
13452 *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_err(e_conv);
13453 return tag_ptr(ret_conv, true);
13456 jboolean __attribute__((export_name("TS_CResult_ChannelUpdateInfoDecodeErrorZ_is_ok"))) TS_CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(uint64_t o) {
13457 LDKCResult_ChannelUpdateInfoDecodeErrorZ* o_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(o);
13458 jboolean ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(o_conv);
13462 void __attribute__((export_name("TS_CResult_ChannelUpdateInfoDecodeErrorZ_free"))) TS_CResult_ChannelUpdateInfoDecodeErrorZ_free(uint64_t _res) {
13463 if (!ptr_is_owned(_res)) return;
13464 void* _res_ptr = untag_ptr(_res);
13465 CHECK_ACCESS(_res_ptr);
13466 LDKCResult_ChannelUpdateInfoDecodeErrorZ _res_conv = *(LDKCResult_ChannelUpdateInfoDecodeErrorZ*)(_res_ptr);
13467 FREE(untag_ptr(_res));
13468 CResult_ChannelUpdateInfoDecodeErrorZ_free(_res_conv);
13471 static inline uint64_t CResult_ChannelUpdateInfoDecodeErrorZ_clone_ptr(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR arg) {
13472 LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
13473 *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_clone(arg);
13474 return tag_ptr(ret_conv, true);
13476 int64_t __attribute__((export_name("TS_CResult_ChannelUpdateInfoDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelUpdateInfoDecodeErrorZ_clone_ptr(uint64_t arg) {
13477 LDKCResult_ChannelUpdateInfoDecodeErrorZ* arg_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(arg);
13478 int64_t ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_clone_ptr(arg_conv);
13482 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateInfoDecodeErrorZ_clone"))) TS_CResult_ChannelUpdateInfoDecodeErrorZ_clone(uint64_t orig) {
13483 LDKCResult_ChannelUpdateInfoDecodeErrorZ* orig_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(orig);
13484 LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
13485 *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_clone(orig_conv);
13486 return tag_ptr(ret_conv, true);
13489 uint64_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_ok"))) TS_CResult_ChannelInfoDecodeErrorZ_ok(uint64_t o) {
13490 LDKChannelInfo o_conv;
13491 o_conv.inner = untag_ptr(o);
13492 o_conv.is_owned = ptr_is_owned(o);
13493 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
13494 o_conv = ChannelInfo_clone(&o_conv);
13495 LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
13496 *ret_conv = CResult_ChannelInfoDecodeErrorZ_ok(o_conv);
13497 return tag_ptr(ret_conv, true);
13500 uint64_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_err"))) TS_CResult_ChannelInfoDecodeErrorZ_err(uint64_t e) {
13501 LDKDecodeError e_conv;
13502 e_conv.inner = untag_ptr(e);
13503 e_conv.is_owned = ptr_is_owned(e);
13504 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13505 e_conv = DecodeError_clone(&e_conv);
13506 LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
13507 *ret_conv = CResult_ChannelInfoDecodeErrorZ_err(e_conv);
13508 return tag_ptr(ret_conv, true);
13511 jboolean __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_is_ok"))) TS_CResult_ChannelInfoDecodeErrorZ_is_ok(uint64_t o) {
13512 LDKCResult_ChannelInfoDecodeErrorZ* o_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(o);
13513 jboolean ret_conv = CResult_ChannelInfoDecodeErrorZ_is_ok(o_conv);
13517 void __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_free"))) TS_CResult_ChannelInfoDecodeErrorZ_free(uint64_t _res) {
13518 if (!ptr_is_owned(_res)) return;
13519 void* _res_ptr = untag_ptr(_res);
13520 CHECK_ACCESS(_res_ptr);
13521 LDKCResult_ChannelInfoDecodeErrorZ _res_conv = *(LDKCResult_ChannelInfoDecodeErrorZ*)(_res_ptr);
13522 FREE(untag_ptr(_res));
13523 CResult_ChannelInfoDecodeErrorZ_free(_res_conv);
13526 static inline uint64_t CResult_ChannelInfoDecodeErrorZ_clone_ptr(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR arg) {
13527 LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
13528 *ret_conv = CResult_ChannelInfoDecodeErrorZ_clone(arg);
13529 return tag_ptr(ret_conv, true);
13531 int64_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelInfoDecodeErrorZ_clone_ptr(uint64_t arg) {
13532 LDKCResult_ChannelInfoDecodeErrorZ* arg_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(arg);
13533 int64_t ret_conv = CResult_ChannelInfoDecodeErrorZ_clone_ptr(arg_conv);
13537 uint64_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_clone"))) TS_CResult_ChannelInfoDecodeErrorZ_clone(uint64_t orig) {
13538 LDKCResult_ChannelInfoDecodeErrorZ* orig_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(orig);
13539 LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
13540 *ret_conv = CResult_ChannelInfoDecodeErrorZ_clone(orig_conv);
13541 return tag_ptr(ret_conv, true);
13544 uint64_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_ok"))) TS_CResult_RoutingFeesDecodeErrorZ_ok(uint64_t o) {
13545 LDKRoutingFees o_conv;
13546 o_conv.inner = untag_ptr(o);
13547 o_conv.is_owned = ptr_is_owned(o);
13548 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
13549 o_conv = RoutingFees_clone(&o_conv);
13550 LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
13551 *ret_conv = CResult_RoutingFeesDecodeErrorZ_ok(o_conv);
13552 return tag_ptr(ret_conv, true);
13555 uint64_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_err"))) TS_CResult_RoutingFeesDecodeErrorZ_err(uint64_t e) {
13556 LDKDecodeError e_conv;
13557 e_conv.inner = untag_ptr(e);
13558 e_conv.is_owned = ptr_is_owned(e);
13559 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13560 e_conv = DecodeError_clone(&e_conv);
13561 LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
13562 *ret_conv = CResult_RoutingFeesDecodeErrorZ_err(e_conv);
13563 return tag_ptr(ret_conv, true);
13566 jboolean __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_is_ok"))) TS_CResult_RoutingFeesDecodeErrorZ_is_ok(uint64_t o) {
13567 LDKCResult_RoutingFeesDecodeErrorZ* o_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(o);
13568 jboolean ret_conv = CResult_RoutingFeesDecodeErrorZ_is_ok(o_conv);
13572 void __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_free"))) TS_CResult_RoutingFeesDecodeErrorZ_free(uint64_t _res) {
13573 if (!ptr_is_owned(_res)) return;
13574 void* _res_ptr = untag_ptr(_res);
13575 CHECK_ACCESS(_res_ptr);
13576 LDKCResult_RoutingFeesDecodeErrorZ _res_conv = *(LDKCResult_RoutingFeesDecodeErrorZ*)(_res_ptr);
13577 FREE(untag_ptr(_res));
13578 CResult_RoutingFeesDecodeErrorZ_free(_res_conv);
13581 static inline uint64_t CResult_RoutingFeesDecodeErrorZ_clone_ptr(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR arg) {
13582 LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
13583 *ret_conv = CResult_RoutingFeesDecodeErrorZ_clone(arg);
13584 return tag_ptr(ret_conv, true);
13586 int64_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_clone_ptr"))) TS_CResult_RoutingFeesDecodeErrorZ_clone_ptr(uint64_t arg) {
13587 LDKCResult_RoutingFeesDecodeErrorZ* arg_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(arg);
13588 int64_t ret_conv = CResult_RoutingFeesDecodeErrorZ_clone_ptr(arg_conv);
13592 uint64_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_clone"))) TS_CResult_RoutingFeesDecodeErrorZ_clone(uint64_t orig) {
13593 LDKCResult_RoutingFeesDecodeErrorZ* orig_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(orig);
13594 LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
13595 *ret_conv = CResult_RoutingFeesDecodeErrorZ_clone(orig_conv);
13596 return tag_ptr(ret_conv, true);
13599 void __attribute__((export_name("TS_CVec_NetAddressZ_free"))) TS_CVec_NetAddressZ_free(uint64_tArray _res) {
13600 LDKCVec_NetAddressZ _res_constr;
13601 _res_constr.datalen = _res->arr_len;
13602 if (_res_constr.datalen > 0)
13603 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
13605 _res_constr.data = NULL;
13606 uint64_t* _res_vals = _res->elems;
13607 for (size_t m = 0; m < _res_constr.datalen; m++) {
13608 uint64_t _res_conv_12 = _res_vals[m];
13609 void* _res_conv_12_ptr = untag_ptr(_res_conv_12);
13610 CHECK_ACCESS(_res_conv_12_ptr);
13611 LDKNetAddress _res_conv_12_conv = *(LDKNetAddress*)(_res_conv_12_ptr);
13612 FREE(untag_ptr(_res_conv_12));
13613 _res_constr.data[m] = _res_conv_12_conv;
13616 CVec_NetAddressZ_free(_res_constr);
13619 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_ok"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_ok(uint64_t o) {
13620 LDKNodeAnnouncementInfo o_conv;
13621 o_conv.inner = untag_ptr(o);
13622 o_conv.is_owned = ptr_is_owned(o);
13623 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
13624 o_conv = NodeAnnouncementInfo_clone(&o_conv);
13625 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
13626 *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_ok(o_conv);
13627 return tag_ptr(ret_conv, true);
13630 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_err"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_err(uint64_t e) {
13631 LDKDecodeError e_conv;
13632 e_conv.inner = untag_ptr(e);
13633 e_conv.is_owned = ptr_is_owned(e);
13634 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13635 e_conv = DecodeError_clone(&e_conv);
13636 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
13637 *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_err(e_conv);
13638 return tag_ptr(ret_conv, true);
13641 jboolean __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(uint64_t o) {
13642 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* o_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(o);
13643 jboolean ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(o_conv);
13647 void __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_free"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_free(uint64_t _res) {
13648 if (!ptr_is_owned(_res)) return;
13649 void* _res_ptr = untag_ptr(_res);
13650 CHECK_ACCESS(_res_ptr);
13651 LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res_conv = *(LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(_res_ptr);
13652 FREE(untag_ptr(_res));
13653 CResult_NodeAnnouncementInfoDecodeErrorZ_free(_res_conv);
13656 static inline uint64_t CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR arg) {
13657 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
13658 *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone(arg);
13659 return tag_ptr(ret_conv, true);
13661 int64_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(uint64_t arg) {
13662 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* arg_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(arg);
13663 int64_t ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(arg_conv);
13667 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_clone"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_clone(uint64_t orig) {
13668 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* orig_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(orig);
13669 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
13670 *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone(orig_conv);
13671 return tag_ptr(ret_conv, true);
13674 uint64_t __attribute__((export_name("TS_CResult_NodeAliasDecodeErrorZ_ok"))) TS_CResult_NodeAliasDecodeErrorZ_ok(uint64_t o) {
13675 LDKNodeAlias o_conv;
13676 o_conv.inner = untag_ptr(o);
13677 o_conv.is_owned = ptr_is_owned(o);
13678 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
13679 o_conv = NodeAlias_clone(&o_conv);
13680 LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ");
13681 *ret_conv = CResult_NodeAliasDecodeErrorZ_ok(o_conv);
13682 return tag_ptr(ret_conv, true);
13685 uint64_t __attribute__((export_name("TS_CResult_NodeAliasDecodeErrorZ_err"))) TS_CResult_NodeAliasDecodeErrorZ_err(uint64_t e) {
13686 LDKDecodeError e_conv;
13687 e_conv.inner = untag_ptr(e);
13688 e_conv.is_owned = ptr_is_owned(e);
13689 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13690 e_conv = DecodeError_clone(&e_conv);
13691 LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ");
13692 *ret_conv = CResult_NodeAliasDecodeErrorZ_err(e_conv);
13693 return tag_ptr(ret_conv, true);
13696 jboolean __attribute__((export_name("TS_CResult_NodeAliasDecodeErrorZ_is_ok"))) TS_CResult_NodeAliasDecodeErrorZ_is_ok(uint64_t o) {
13697 LDKCResult_NodeAliasDecodeErrorZ* o_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(o);
13698 jboolean ret_conv = CResult_NodeAliasDecodeErrorZ_is_ok(o_conv);
13702 void __attribute__((export_name("TS_CResult_NodeAliasDecodeErrorZ_free"))) TS_CResult_NodeAliasDecodeErrorZ_free(uint64_t _res) {
13703 if (!ptr_is_owned(_res)) return;
13704 void* _res_ptr = untag_ptr(_res);
13705 CHECK_ACCESS(_res_ptr);
13706 LDKCResult_NodeAliasDecodeErrorZ _res_conv = *(LDKCResult_NodeAliasDecodeErrorZ*)(_res_ptr);
13707 FREE(untag_ptr(_res));
13708 CResult_NodeAliasDecodeErrorZ_free(_res_conv);
13711 static inline uint64_t CResult_NodeAliasDecodeErrorZ_clone_ptr(LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR arg) {
13712 LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ");
13713 *ret_conv = CResult_NodeAliasDecodeErrorZ_clone(arg);
13714 return tag_ptr(ret_conv, true);
13716 int64_t __attribute__((export_name("TS_CResult_NodeAliasDecodeErrorZ_clone_ptr"))) TS_CResult_NodeAliasDecodeErrorZ_clone_ptr(uint64_t arg) {
13717 LDKCResult_NodeAliasDecodeErrorZ* arg_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(arg);
13718 int64_t ret_conv = CResult_NodeAliasDecodeErrorZ_clone_ptr(arg_conv);
13722 uint64_t __attribute__((export_name("TS_CResult_NodeAliasDecodeErrorZ_clone"))) TS_CResult_NodeAliasDecodeErrorZ_clone(uint64_t orig) {
13723 LDKCResult_NodeAliasDecodeErrorZ* orig_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(orig);
13724 LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ");
13725 *ret_conv = CResult_NodeAliasDecodeErrorZ_clone(orig_conv);
13726 return tag_ptr(ret_conv, true);
13729 uint64_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_ok"))) TS_CResult_NodeInfoDecodeErrorZ_ok(uint64_t o) {
13730 LDKNodeInfo o_conv;
13731 o_conv.inner = untag_ptr(o);
13732 o_conv.is_owned = ptr_is_owned(o);
13733 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
13734 o_conv = NodeInfo_clone(&o_conv);
13735 LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
13736 *ret_conv = CResult_NodeInfoDecodeErrorZ_ok(o_conv);
13737 return tag_ptr(ret_conv, true);
13740 uint64_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_err"))) TS_CResult_NodeInfoDecodeErrorZ_err(uint64_t e) {
13741 LDKDecodeError e_conv;
13742 e_conv.inner = untag_ptr(e);
13743 e_conv.is_owned = ptr_is_owned(e);
13744 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13745 e_conv = DecodeError_clone(&e_conv);
13746 LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
13747 *ret_conv = CResult_NodeInfoDecodeErrorZ_err(e_conv);
13748 return tag_ptr(ret_conv, true);
13751 jboolean __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_is_ok"))) TS_CResult_NodeInfoDecodeErrorZ_is_ok(uint64_t o) {
13752 LDKCResult_NodeInfoDecodeErrorZ* o_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(o);
13753 jboolean ret_conv = CResult_NodeInfoDecodeErrorZ_is_ok(o_conv);
13757 void __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_free"))) TS_CResult_NodeInfoDecodeErrorZ_free(uint64_t _res) {
13758 if (!ptr_is_owned(_res)) return;
13759 void* _res_ptr = untag_ptr(_res);
13760 CHECK_ACCESS(_res_ptr);
13761 LDKCResult_NodeInfoDecodeErrorZ _res_conv = *(LDKCResult_NodeInfoDecodeErrorZ*)(_res_ptr);
13762 FREE(untag_ptr(_res));
13763 CResult_NodeInfoDecodeErrorZ_free(_res_conv);
13766 static inline uint64_t CResult_NodeInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR arg) {
13767 LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
13768 *ret_conv = CResult_NodeInfoDecodeErrorZ_clone(arg);
13769 return tag_ptr(ret_conv, true);
13771 int64_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_clone_ptr"))) TS_CResult_NodeInfoDecodeErrorZ_clone_ptr(uint64_t arg) {
13772 LDKCResult_NodeInfoDecodeErrorZ* arg_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(arg);
13773 int64_t ret_conv = CResult_NodeInfoDecodeErrorZ_clone_ptr(arg_conv);
13777 uint64_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_clone"))) TS_CResult_NodeInfoDecodeErrorZ_clone(uint64_t orig) {
13778 LDKCResult_NodeInfoDecodeErrorZ* orig_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(orig);
13779 LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
13780 *ret_conv = CResult_NodeInfoDecodeErrorZ_clone(orig_conv);
13781 return tag_ptr(ret_conv, true);
13784 uint64_t __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_ok"))) TS_CResult_NetworkGraphDecodeErrorZ_ok(uint64_t o) {
13785 LDKNetworkGraph o_conv;
13786 o_conv.inner = untag_ptr(o);
13787 o_conv.is_owned = ptr_is_owned(o);
13788 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
13789 // WARNING: we need a move here but no clone is available for LDKNetworkGraph
13791 LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ");
13792 *ret_conv = CResult_NetworkGraphDecodeErrorZ_ok(o_conv);
13793 return tag_ptr(ret_conv, true);
13796 uint64_t __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_err"))) TS_CResult_NetworkGraphDecodeErrorZ_err(uint64_t e) {
13797 LDKDecodeError e_conv;
13798 e_conv.inner = untag_ptr(e);
13799 e_conv.is_owned = ptr_is_owned(e);
13800 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13801 e_conv = DecodeError_clone(&e_conv);
13802 LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ");
13803 *ret_conv = CResult_NetworkGraphDecodeErrorZ_err(e_conv);
13804 return tag_ptr(ret_conv, true);
13807 jboolean __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_is_ok"))) TS_CResult_NetworkGraphDecodeErrorZ_is_ok(uint64_t o) {
13808 LDKCResult_NetworkGraphDecodeErrorZ* o_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)untag_ptr(o);
13809 jboolean ret_conv = CResult_NetworkGraphDecodeErrorZ_is_ok(o_conv);
13813 void __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_free"))) TS_CResult_NetworkGraphDecodeErrorZ_free(uint64_t _res) {
13814 if (!ptr_is_owned(_res)) return;
13815 void* _res_ptr = untag_ptr(_res);
13816 CHECK_ACCESS(_res_ptr);
13817 LDKCResult_NetworkGraphDecodeErrorZ _res_conv = *(LDKCResult_NetworkGraphDecodeErrorZ*)(_res_ptr);
13818 FREE(untag_ptr(_res));
13819 CResult_NetworkGraphDecodeErrorZ_free(_res_conv);
13822 uint64_t __attribute__((export_name("TS_COption_CVec_NetAddressZZ_some"))) TS_COption_CVec_NetAddressZZ_some(uint64_tArray o) {
13823 LDKCVec_NetAddressZ o_constr;
13824 o_constr.datalen = o->arr_len;
13825 if (o_constr.datalen > 0)
13826 o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
13828 o_constr.data = NULL;
13829 uint64_t* o_vals = o->elems;
13830 for (size_t m = 0; m < o_constr.datalen; m++) {
13831 uint64_t o_conv_12 = o_vals[m];
13832 void* o_conv_12_ptr = untag_ptr(o_conv_12);
13833 CHECK_ACCESS(o_conv_12_ptr);
13834 LDKNetAddress o_conv_12_conv = *(LDKNetAddress*)(o_conv_12_ptr);
13835 o_conv_12_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(o_conv_12));
13836 o_constr.data[m] = o_conv_12_conv;
13839 LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
13840 *ret_copy = COption_CVec_NetAddressZZ_some(o_constr);
13841 uint64_t ret_ref = tag_ptr(ret_copy, true);
13845 uint64_t __attribute__((export_name("TS_COption_CVec_NetAddressZZ_none"))) TS_COption_CVec_NetAddressZZ_none() {
13846 LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
13847 *ret_copy = COption_CVec_NetAddressZZ_none();
13848 uint64_t ret_ref = tag_ptr(ret_copy, true);
13852 void __attribute__((export_name("TS_COption_CVec_NetAddressZZ_free"))) TS_COption_CVec_NetAddressZZ_free(uint64_t _res) {
13853 if (!ptr_is_owned(_res)) return;
13854 void* _res_ptr = untag_ptr(_res);
13855 CHECK_ACCESS(_res_ptr);
13856 LDKCOption_CVec_NetAddressZZ _res_conv = *(LDKCOption_CVec_NetAddressZZ*)(_res_ptr);
13857 FREE(untag_ptr(_res));
13858 COption_CVec_NetAddressZZ_free(_res_conv);
13861 static inline uint64_t COption_CVec_NetAddressZZ_clone_ptr(LDKCOption_CVec_NetAddressZZ *NONNULL_PTR arg) {
13862 LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
13863 *ret_copy = COption_CVec_NetAddressZZ_clone(arg);
13864 uint64_t ret_ref = tag_ptr(ret_copy, true);
13867 int64_t __attribute__((export_name("TS_COption_CVec_NetAddressZZ_clone_ptr"))) TS_COption_CVec_NetAddressZZ_clone_ptr(uint64_t arg) {
13868 LDKCOption_CVec_NetAddressZZ* arg_conv = (LDKCOption_CVec_NetAddressZZ*)untag_ptr(arg);
13869 int64_t ret_conv = COption_CVec_NetAddressZZ_clone_ptr(arg_conv);
13873 uint64_t __attribute__((export_name("TS_COption_CVec_NetAddressZZ_clone"))) TS_COption_CVec_NetAddressZZ_clone(uint64_t orig) {
13874 LDKCOption_CVec_NetAddressZZ* orig_conv = (LDKCOption_CVec_NetAddressZZ*)untag_ptr(orig);
13875 LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
13876 *ret_copy = COption_CVec_NetAddressZZ_clone(orig_conv);
13877 uint64_t ret_ref = tag_ptr(ret_copy, true);
13881 uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(uint64_t o) {
13882 LDKDelayedPaymentOutputDescriptor o_conv;
13883 o_conv.inner = untag_ptr(o);
13884 o_conv.is_owned = ptr_is_owned(o);
13885 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
13886 o_conv = DelayedPaymentOutputDescriptor_clone(&o_conv);
13887 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
13888 *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(o_conv);
13889 return tag_ptr(ret_conv, true);
13892 uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(uint64_t e) {
13893 LDKDecodeError e_conv;
13894 e_conv.inner = untag_ptr(e);
13895 e_conv.is_owned = ptr_is_owned(e);
13896 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13897 e_conv = DecodeError_clone(&e_conv);
13898 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
13899 *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(e_conv);
13900 return tag_ptr(ret_conv, true);
13903 jboolean __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(uint64_t o) {
13904 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(o);
13905 jboolean ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(o_conv);
13909 void __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(uint64_t _res) {
13910 if (!ptr_is_owned(_res)) return;
13911 void* _res_ptr = untag_ptr(_res);
13912 CHECK_ACCESS(_res_ptr);
13913 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(_res_ptr);
13914 FREE(untag_ptr(_res));
13915 CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(_res_conv);
13918 static inline uint64_t CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) {
13919 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
13920 *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(arg);
13921 return tag_ptr(ret_conv, true);
13923 int64_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(uint64_t arg) {
13924 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(arg);
13925 int64_t ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv);
13929 uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(uint64_t orig) {
13930 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(orig);
13931 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
13932 *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(orig_conv);
13933 return tag_ptr(ret_conv, true);
13936 uint64_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(uint64_t o) {
13937 LDKStaticPaymentOutputDescriptor o_conv;
13938 o_conv.inner = untag_ptr(o);
13939 o_conv.is_owned = ptr_is_owned(o);
13940 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
13941 o_conv = StaticPaymentOutputDescriptor_clone(&o_conv);
13942 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
13943 *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(o_conv);
13944 return tag_ptr(ret_conv, true);
13947 uint64_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(uint64_t e) {
13948 LDKDecodeError e_conv;
13949 e_conv.inner = untag_ptr(e);
13950 e_conv.is_owned = ptr_is_owned(e);
13951 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13952 e_conv = DecodeError_clone(&e_conv);
13953 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
13954 *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(e_conv);
13955 return tag_ptr(ret_conv, true);
13958 jboolean __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(uint64_t o) {
13959 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(o);
13960 jboolean ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(o_conv);
13964 void __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(uint64_t _res) {
13965 if (!ptr_is_owned(_res)) return;
13966 void* _res_ptr = untag_ptr(_res);
13967 CHECK_ACCESS(_res_ptr);
13968 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(_res_ptr);
13969 FREE(untag_ptr(_res));
13970 CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(_res_conv);
13973 static inline uint64_t CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) {
13974 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
13975 *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(arg);
13976 return tag_ptr(ret_conv, true);
13978 int64_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(uint64_t arg) {
13979 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(arg);
13980 int64_t ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv);
13984 uint64_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(uint64_t orig) {
13985 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(orig);
13986 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
13987 *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(orig_conv);
13988 return tag_ptr(ret_conv, true);
13991 uint64_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_ok"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_ok(uint64_t o) {
13992 void* o_ptr = untag_ptr(o);
13993 CHECK_ACCESS(o_ptr);
13994 LDKSpendableOutputDescriptor o_conv = *(LDKSpendableOutputDescriptor*)(o_ptr);
13995 o_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(o));
13996 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
13997 *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_ok(o_conv);
13998 return tag_ptr(ret_conv, true);
14001 uint64_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_err"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_err(uint64_t e) {
14002 LDKDecodeError e_conv;
14003 e_conv.inner = untag_ptr(e);
14004 e_conv.is_owned = ptr_is_owned(e);
14005 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
14006 e_conv = DecodeError_clone(&e_conv);
14007 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
14008 *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_err(e_conv);
14009 return tag_ptr(ret_conv, true);
14012 jboolean __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(uint64_t o) {
14013 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(o);
14014 jboolean ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(o_conv);
14018 void __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_free"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_free(uint64_t _res) {
14019 if (!ptr_is_owned(_res)) return;
14020 void* _res_ptr = untag_ptr(_res);
14021 CHECK_ACCESS(_res_ptr);
14022 LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(_res_ptr);
14023 FREE(untag_ptr(_res));
14024 CResult_SpendableOutputDescriptorDecodeErrorZ_free(_res_conv);
14027 static inline uint64_t CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) {
14028 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
14029 *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone(arg);
14030 return tag_ptr(ret_conv, true);
14032 int64_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(uint64_t arg) {
14033 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(arg);
14034 int64_t ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv);
14038 uint64_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_clone"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_clone(uint64_t orig) {
14039 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(orig);
14040 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
14041 *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone(orig_conv);
14042 return tag_ptr(ret_conv, true);
14045 void __attribute__((export_name("TS_CVec_PaymentPreimageZ_free"))) TS_CVec_PaymentPreimageZ_free(ptrArray _res) {
14046 LDKCVec_PaymentPreimageZ _res_constr;
14047 _res_constr.datalen = _res->arr_len;
14048 if (_res_constr.datalen > 0)
14049 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_PaymentPreimageZ Elements");
14051 _res_constr.data = NULL;
14052 int8_tArray* _res_vals = (void*) _res->elems;
14053 for (size_t m = 0; m < _res_constr.datalen; m++) {
14054 int8_tArray _res_conv_12 = _res_vals[m];
14055 LDKThirtyTwoBytes _res_conv_12_ref;
14056 CHECK(_res_conv_12->arr_len == 32);
14057 memcpy(_res_conv_12_ref.data, _res_conv_12->elems, 32); FREE(_res_conv_12);
14058 _res_constr.data[m] = _res_conv_12_ref;
14061 CVec_PaymentPreimageZ_free(_res_constr);
14064 static inline uint64_t C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR arg) {
14065 LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
14066 *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone(arg);
14067 return tag_ptr(ret_conv, true);
14069 int64_t __attribute__((export_name("TS_C2Tuple_SignatureCVec_SignatureZZ_clone_ptr"))) TS_C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(uint64_t arg) {
14070 LDKC2Tuple_SignatureCVec_SignatureZZ* arg_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)untag_ptr(arg);
14071 int64_t ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(arg_conv);
14075 uint64_t __attribute__((export_name("TS_C2Tuple_SignatureCVec_SignatureZZ_clone"))) TS_C2Tuple_SignatureCVec_SignatureZZ_clone(uint64_t orig) {
14076 LDKC2Tuple_SignatureCVec_SignatureZZ* orig_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)untag_ptr(orig);
14077 LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
14078 *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone(orig_conv);
14079 return tag_ptr(ret_conv, true);
14082 uint64_t __attribute__((export_name("TS_C2Tuple_SignatureCVec_SignatureZZ_new"))) TS_C2Tuple_SignatureCVec_SignatureZZ_new(int8_tArray a, ptrArray b) {
14083 LDKSignature a_ref;
14084 CHECK(a->arr_len == 64);
14085 memcpy(a_ref.compact_form, a->elems, 64); FREE(a);
14086 LDKCVec_SignatureZ b_constr;
14087 b_constr.datalen = b->arr_len;
14088 if (b_constr.datalen > 0)
14089 b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
14091 b_constr.data = NULL;
14092 int8_tArray* b_vals = (void*) b->elems;
14093 for (size_t m = 0; m < b_constr.datalen; m++) {
14094 int8_tArray b_conv_12 = b_vals[m];
14095 LDKSignature b_conv_12_ref;
14096 CHECK(b_conv_12->arr_len == 64);
14097 memcpy(b_conv_12_ref.compact_form, b_conv_12->elems, 64); FREE(b_conv_12);
14098 b_constr.data[m] = b_conv_12_ref;
14101 LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
14102 *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_new(a_ref, b_constr);
14103 return tag_ptr(ret_conv, true);
14106 void __attribute__((export_name("TS_C2Tuple_SignatureCVec_SignatureZZ_free"))) TS_C2Tuple_SignatureCVec_SignatureZZ_free(uint64_t _res) {
14107 if (!ptr_is_owned(_res)) return;
14108 void* _res_ptr = untag_ptr(_res);
14109 CHECK_ACCESS(_res_ptr);
14110 LDKC2Tuple_SignatureCVec_SignatureZZ _res_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)(_res_ptr);
14111 FREE(untag_ptr(_res));
14112 C2Tuple_SignatureCVec_SignatureZZ_free(_res_conv);
14115 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(uint64_t o) {
14116 void* o_ptr = untag_ptr(o);
14117 CHECK_ACCESS(o_ptr);
14118 LDKC2Tuple_SignatureCVec_SignatureZZ o_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)(o_ptr);
14119 o_conv = C2Tuple_SignatureCVec_SignatureZZ_clone((LDKC2Tuple_SignatureCVec_SignatureZZ*)untag_ptr(o));
14120 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
14121 *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(o_conv);
14122 return tag_ptr(ret_conv, true);
14125 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err() {
14126 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
14127 *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err();
14128 return tag_ptr(ret_conv, true);
14131 jboolean __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(uint64_t o) {
14132 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* o_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)untag_ptr(o);
14133 jboolean ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(o_conv);
14137 void __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(uint64_t _res) {
14138 if (!ptr_is_owned(_res)) return;
14139 void* _res_ptr = untag_ptr(_res);
14140 CHECK_ACCESS(_res_ptr);
14141 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(_res_ptr);
14142 FREE(untag_ptr(_res));
14143 CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(_res_conv);
14146 static inline uint64_t CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR arg) {
14147 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
14148 *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(arg);
14149 return tag_ptr(ret_conv, true);
14151 int64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(uint64_t arg) {
14152 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* arg_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)untag_ptr(arg);
14153 int64_t ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(arg_conv);
14157 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(uint64_t orig) {
14158 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* orig_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)untag_ptr(orig);
14159 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
14160 *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(orig_conv);
14161 return tag_ptr(ret_conv, true);
14164 uint64_t __attribute__((export_name("TS_CResult_SignatureNoneZ_ok"))) TS_CResult_SignatureNoneZ_ok(int8_tArray o) {
14165 LDKSignature o_ref;
14166 CHECK(o->arr_len == 64);
14167 memcpy(o_ref.compact_form, o->elems, 64); FREE(o);
14168 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
14169 *ret_conv = CResult_SignatureNoneZ_ok(o_ref);
14170 return tag_ptr(ret_conv, true);
14173 uint64_t __attribute__((export_name("TS_CResult_SignatureNoneZ_err"))) TS_CResult_SignatureNoneZ_err() {
14174 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
14175 *ret_conv = CResult_SignatureNoneZ_err();
14176 return tag_ptr(ret_conv, true);
14179 jboolean __attribute__((export_name("TS_CResult_SignatureNoneZ_is_ok"))) TS_CResult_SignatureNoneZ_is_ok(uint64_t o) {
14180 LDKCResult_SignatureNoneZ* o_conv = (LDKCResult_SignatureNoneZ*)untag_ptr(o);
14181 jboolean ret_conv = CResult_SignatureNoneZ_is_ok(o_conv);
14185 void __attribute__((export_name("TS_CResult_SignatureNoneZ_free"))) TS_CResult_SignatureNoneZ_free(uint64_t _res) {
14186 if (!ptr_is_owned(_res)) return;
14187 void* _res_ptr = untag_ptr(_res);
14188 CHECK_ACCESS(_res_ptr);
14189 LDKCResult_SignatureNoneZ _res_conv = *(LDKCResult_SignatureNoneZ*)(_res_ptr);
14190 FREE(untag_ptr(_res));
14191 CResult_SignatureNoneZ_free(_res_conv);
14194 static inline uint64_t CResult_SignatureNoneZ_clone_ptr(LDKCResult_SignatureNoneZ *NONNULL_PTR arg) {
14195 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
14196 *ret_conv = CResult_SignatureNoneZ_clone(arg);
14197 return tag_ptr(ret_conv, true);
14199 int64_t __attribute__((export_name("TS_CResult_SignatureNoneZ_clone_ptr"))) TS_CResult_SignatureNoneZ_clone_ptr(uint64_t arg) {
14200 LDKCResult_SignatureNoneZ* arg_conv = (LDKCResult_SignatureNoneZ*)untag_ptr(arg);
14201 int64_t ret_conv = CResult_SignatureNoneZ_clone_ptr(arg_conv);
14205 uint64_t __attribute__((export_name("TS_CResult_SignatureNoneZ_clone"))) TS_CResult_SignatureNoneZ_clone(uint64_t orig) {
14206 LDKCResult_SignatureNoneZ* orig_conv = (LDKCResult_SignatureNoneZ*)untag_ptr(orig);
14207 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
14208 *ret_conv = CResult_SignatureNoneZ_clone(orig_conv);
14209 return tag_ptr(ret_conv, true);
14212 static inline uint64_t C2Tuple_SignatureSignatureZ_clone_ptr(LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR arg) {
14213 LDKC2Tuple_SignatureSignatureZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureSignatureZ), "LDKC2Tuple_SignatureSignatureZ");
14214 *ret_conv = C2Tuple_SignatureSignatureZ_clone(arg);
14215 return tag_ptr(ret_conv, true);
14217 int64_t __attribute__((export_name("TS_C2Tuple_SignatureSignatureZ_clone_ptr"))) TS_C2Tuple_SignatureSignatureZ_clone_ptr(uint64_t arg) {
14218 LDKC2Tuple_SignatureSignatureZ* arg_conv = (LDKC2Tuple_SignatureSignatureZ*)untag_ptr(arg);
14219 int64_t ret_conv = C2Tuple_SignatureSignatureZ_clone_ptr(arg_conv);
14223 uint64_t __attribute__((export_name("TS_C2Tuple_SignatureSignatureZ_clone"))) TS_C2Tuple_SignatureSignatureZ_clone(uint64_t orig) {
14224 LDKC2Tuple_SignatureSignatureZ* orig_conv = (LDKC2Tuple_SignatureSignatureZ*)untag_ptr(orig);
14225 LDKC2Tuple_SignatureSignatureZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureSignatureZ), "LDKC2Tuple_SignatureSignatureZ");
14226 *ret_conv = C2Tuple_SignatureSignatureZ_clone(orig_conv);
14227 return tag_ptr(ret_conv, true);
14230 uint64_t __attribute__((export_name("TS_C2Tuple_SignatureSignatureZ_new"))) TS_C2Tuple_SignatureSignatureZ_new(int8_tArray a, int8_tArray b) {
14231 LDKSignature a_ref;
14232 CHECK(a->arr_len == 64);
14233 memcpy(a_ref.compact_form, a->elems, 64); FREE(a);
14234 LDKSignature b_ref;
14235 CHECK(b->arr_len == 64);
14236 memcpy(b_ref.compact_form, b->elems, 64); FREE(b);
14237 LDKC2Tuple_SignatureSignatureZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureSignatureZ), "LDKC2Tuple_SignatureSignatureZ");
14238 *ret_conv = C2Tuple_SignatureSignatureZ_new(a_ref, b_ref);
14239 return tag_ptr(ret_conv, true);
14242 void __attribute__((export_name("TS_C2Tuple_SignatureSignatureZ_free"))) TS_C2Tuple_SignatureSignatureZ_free(uint64_t _res) {
14243 if (!ptr_is_owned(_res)) return;
14244 void* _res_ptr = untag_ptr(_res);
14245 CHECK_ACCESS(_res_ptr);
14246 LDKC2Tuple_SignatureSignatureZ _res_conv = *(LDKC2Tuple_SignatureSignatureZ*)(_res_ptr);
14247 FREE(untag_ptr(_res));
14248 C2Tuple_SignatureSignatureZ_free(_res_conv);
14251 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureSignatureZNoneZ_ok"))) TS_CResult_C2Tuple_SignatureSignatureZNoneZ_ok(uint64_t o) {
14252 void* o_ptr = untag_ptr(o);
14253 CHECK_ACCESS(o_ptr);
14254 LDKC2Tuple_SignatureSignatureZ o_conv = *(LDKC2Tuple_SignatureSignatureZ*)(o_ptr);
14255 o_conv = C2Tuple_SignatureSignatureZ_clone((LDKC2Tuple_SignatureSignatureZ*)untag_ptr(o));
14256 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ");
14257 *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_ok(o_conv);
14258 return tag_ptr(ret_conv, true);
14261 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureSignatureZNoneZ_err"))) TS_CResult_C2Tuple_SignatureSignatureZNoneZ_err() {
14262 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ");
14263 *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_err();
14264 return tag_ptr(ret_conv, true);
14267 jboolean __attribute__((export_name("TS_CResult_C2Tuple_SignatureSignatureZNoneZ_is_ok"))) TS_CResult_C2Tuple_SignatureSignatureZNoneZ_is_ok(uint64_t o) {
14268 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* o_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)untag_ptr(o);
14269 jboolean ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_is_ok(o_conv);
14273 void __attribute__((export_name("TS_CResult_C2Tuple_SignatureSignatureZNoneZ_free"))) TS_CResult_C2Tuple_SignatureSignatureZNoneZ_free(uint64_t _res) {
14274 if (!ptr_is_owned(_res)) return;
14275 void* _res_ptr = untag_ptr(_res);
14276 CHECK_ACCESS(_res_ptr);
14277 LDKCResult_C2Tuple_SignatureSignatureZNoneZ _res_conv = *(LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)(_res_ptr);
14278 FREE(untag_ptr(_res));
14279 CResult_C2Tuple_SignatureSignatureZNoneZ_free(_res_conv);
14282 static inline uint64_t CResult_C2Tuple_SignatureSignatureZNoneZ_clone_ptr(LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR arg) {
14283 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ");
14284 *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_clone(arg);
14285 return tag_ptr(ret_conv, true);
14287 int64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureSignatureZNoneZ_clone_ptr"))) TS_CResult_C2Tuple_SignatureSignatureZNoneZ_clone_ptr(uint64_t arg) {
14288 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* arg_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)untag_ptr(arg);
14289 int64_t ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_clone_ptr(arg_conv);
14293 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureSignatureZNoneZ_clone"))) TS_CResult_C2Tuple_SignatureSignatureZNoneZ_clone(uint64_t orig) {
14294 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* orig_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)untag_ptr(orig);
14295 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ");
14296 *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_clone(orig_conv);
14297 return tag_ptr(ret_conv, true);
14300 uint64_t __attribute__((export_name("TS_CResult_SecretKeyNoneZ_ok"))) TS_CResult_SecretKeyNoneZ_ok(int8_tArray o) {
14301 LDKSecretKey o_ref;
14302 CHECK(o->arr_len == 32);
14303 memcpy(o_ref.bytes, o->elems, 32); FREE(o);
14304 LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ");
14305 *ret_conv = CResult_SecretKeyNoneZ_ok(o_ref);
14306 return tag_ptr(ret_conv, true);
14309 uint64_t __attribute__((export_name("TS_CResult_SecretKeyNoneZ_err"))) TS_CResult_SecretKeyNoneZ_err() {
14310 LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ");
14311 *ret_conv = CResult_SecretKeyNoneZ_err();
14312 return tag_ptr(ret_conv, true);
14315 jboolean __attribute__((export_name("TS_CResult_SecretKeyNoneZ_is_ok"))) TS_CResult_SecretKeyNoneZ_is_ok(uint64_t o) {
14316 LDKCResult_SecretKeyNoneZ* o_conv = (LDKCResult_SecretKeyNoneZ*)untag_ptr(o);
14317 jboolean ret_conv = CResult_SecretKeyNoneZ_is_ok(o_conv);
14321 void __attribute__((export_name("TS_CResult_SecretKeyNoneZ_free"))) TS_CResult_SecretKeyNoneZ_free(uint64_t _res) {
14322 if (!ptr_is_owned(_res)) return;
14323 void* _res_ptr = untag_ptr(_res);
14324 CHECK_ACCESS(_res_ptr);
14325 LDKCResult_SecretKeyNoneZ _res_conv = *(LDKCResult_SecretKeyNoneZ*)(_res_ptr);
14326 FREE(untag_ptr(_res));
14327 CResult_SecretKeyNoneZ_free(_res_conv);
14330 static inline uint64_t CResult_SecretKeyNoneZ_clone_ptr(LDKCResult_SecretKeyNoneZ *NONNULL_PTR arg) {
14331 LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ");
14332 *ret_conv = CResult_SecretKeyNoneZ_clone(arg);
14333 return tag_ptr(ret_conv, true);
14335 int64_t __attribute__((export_name("TS_CResult_SecretKeyNoneZ_clone_ptr"))) TS_CResult_SecretKeyNoneZ_clone_ptr(uint64_t arg) {
14336 LDKCResult_SecretKeyNoneZ* arg_conv = (LDKCResult_SecretKeyNoneZ*)untag_ptr(arg);
14337 int64_t ret_conv = CResult_SecretKeyNoneZ_clone_ptr(arg_conv);
14341 uint64_t __attribute__((export_name("TS_CResult_SecretKeyNoneZ_clone"))) TS_CResult_SecretKeyNoneZ_clone(uint64_t orig) {
14342 LDKCResult_SecretKeyNoneZ* orig_conv = (LDKCResult_SecretKeyNoneZ*)untag_ptr(orig);
14343 LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ");
14344 *ret_conv = CResult_SecretKeyNoneZ_clone(orig_conv);
14345 return tag_ptr(ret_conv, true);
14348 uint64_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_ok"))) TS_CResult_SignDecodeErrorZ_ok(uint64_t o) {
14349 void* o_ptr = untag_ptr(o);
14350 CHECK_ACCESS(o_ptr);
14351 LDKSign o_conv = *(LDKSign*)(o_ptr);
14352 if (o_conv.free == LDKSign_JCalls_free) {
14353 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
14354 LDKSign_JCalls_cloned(&o_conv);
14356 LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
14357 *ret_conv = CResult_SignDecodeErrorZ_ok(o_conv);
14358 return tag_ptr(ret_conv, true);
14361 uint64_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_err"))) TS_CResult_SignDecodeErrorZ_err(uint64_t e) {
14362 LDKDecodeError e_conv;
14363 e_conv.inner = untag_ptr(e);
14364 e_conv.is_owned = ptr_is_owned(e);
14365 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
14366 e_conv = DecodeError_clone(&e_conv);
14367 LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
14368 *ret_conv = CResult_SignDecodeErrorZ_err(e_conv);
14369 return tag_ptr(ret_conv, true);
14372 jboolean __attribute__((export_name("TS_CResult_SignDecodeErrorZ_is_ok"))) TS_CResult_SignDecodeErrorZ_is_ok(uint64_t o) {
14373 LDKCResult_SignDecodeErrorZ* o_conv = (LDKCResult_SignDecodeErrorZ*)untag_ptr(o);
14374 jboolean ret_conv = CResult_SignDecodeErrorZ_is_ok(o_conv);
14378 void __attribute__((export_name("TS_CResult_SignDecodeErrorZ_free"))) TS_CResult_SignDecodeErrorZ_free(uint64_t _res) {
14379 if (!ptr_is_owned(_res)) return;
14380 void* _res_ptr = untag_ptr(_res);
14381 CHECK_ACCESS(_res_ptr);
14382 LDKCResult_SignDecodeErrorZ _res_conv = *(LDKCResult_SignDecodeErrorZ*)(_res_ptr);
14383 FREE(untag_ptr(_res));
14384 CResult_SignDecodeErrorZ_free(_res_conv);
14387 static inline uint64_t CResult_SignDecodeErrorZ_clone_ptr(LDKCResult_SignDecodeErrorZ *NONNULL_PTR arg) {
14388 LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
14389 *ret_conv = CResult_SignDecodeErrorZ_clone(arg);
14390 return tag_ptr(ret_conv, true);
14392 int64_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_clone_ptr"))) TS_CResult_SignDecodeErrorZ_clone_ptr(uint64_t arg) {
14393 LDKCResult_SignDecodeErrorZ* arg_conv = (LDKCResult_SignDecodeErrorZ*)untag_ptr(arg);
14394 int64_t ret_conv = CResult_SignDecodeErrorZ_clone_ptr(arg_conv);
14398 uint64_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_clone"))) TS_CResult_SignDecodeErrorZ_clone(uint64_t orig) {
14399 LDKCResult_SignDecodeErrorZ* orig_conv = (LDKCResult_SignDecodeErrorZ*)untag_ptr(orig);
14400 LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
14401 *ret_conv = CResult_SignDecodeErrorZ_clone(orig_conv);
14402 return tag_ptr(ret_conv, true);
14405 void __attribute__((export_name("TS_CVec_u5Z_free"))) TS_CVec_u5Z_free(ptrArray _res) {
14406 LDKCVec_u5Z _res_constr;
14407 _res_constr.datalen = _res->arr_len;
14408 if (_res_constr.datalen > 0)
14409 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKu5), "LDKCVec_u5Z Elements");
14411 _res_constr.data = NULL;
14412 int8_t* _res_vals = (void*) _res->elems;
14413 for (size_t h = 0; h < _res_constr.datalen; h++) {
14414 int8_t _res_conv_7 = _res_vals[h];
14416 _res_constr.data[h] = (LDKu5){ ._0 = _res_conv_7 };
14419 CVec_u5Z_free(_res_constr);
14422 uint64_t __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_ok"))) TS_CResult_RecoverableSignatureNoneZ_ok(int8_tArray o) {
14423 LDKRecoverableSignature o_ref;
14424 CHECK(o->arr_len == 68);
14425 memcpy(o_ref.serialized_form, o->elems, 68); FREE(o);
14426 LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
14427 *ret_conv = CResult_RecoverableSignatureNoneZ_ok(o_ref);
14428 return tag_ptr(ret_conv, true);
14431 uint64_t __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_err"))) TS_CResult_RecoverableSignatureNoneZ_err() {
14432 LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
14433 *ret_conv = CResult_RecoverableSignatureNoneZ_err();
14434 return tag_ptr(ret_conv, true);
14437 jboolean __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_is_ok"))) TS_CResult_RecoverableSignatureNoneZ_is_ok(uint64_t o) {
14438 LDKCResult_RecoverableSignatureNoneZ* o_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(o);
14439 jboolean ret_conv = CResult_RecoverableSignatureNoneZ_is_ok(o_conv);
14443 void __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_free"))) TS_CResult_RecoverableSignatureNoneZ_free(uint64_t _res) {
14444 if (!ptr_is_owned(_res)) return;
14445 void* _res_ptr = untag_ptr(_res);
14446 CHECK_ACCESS(_res_ptr);
14447 LDKCResult_RecoverableSignatureNoneZ _res_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(_res_ptr);
14448 FREE(untag_ptr(_res));
14449 CResult_RecoverableSignatureNoneZ_free(_res_conv);
14452 static inline uint64_t CResult_RecoverableSignatureNoneZ_clone_ptr(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR arg) {
14453 LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
14454 *ret_conv = CResult_RecoverableSignatureNoneZ_clone(arg);
14455 return tag_ptr(ret_conv, true);
14457 int64_t __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_clone_ptr"))) TS_CResult_RecoverableSignatureNoneZ_clone_ptr(uint64_t arg) {
14458 LDKCResult_RecoverableSignatureNoneZ* arg_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(arg);
14459 int64_t ret_conv = CResult_RecoverableSignatureNoneZ_clone_ptr(arg_conv);
14463 uint64_t __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_clone"))) TS_CResult_RecoverableSignatureNoneZ_clone(uint64_t orig) {
14464 LDKCResult_RecoverableSignatureNoneZ* orig_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(orig);
14465 LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
14466 *ret_conv = CResult_RecoverableSignatureNoneZ_clone(orig_conv);
14467 return tag_ptr(ret_conv, true);
14470 void __attribute__((export_name("TS_CVec_u8Z_free"))) TS_CVec_u8Z_free(int8_tArray _res) {
14471 LDKCVec_u8Z _res_ref;
14472 _res_ref.datalen = _res->arr_len;
14473 _res_ref.data = MALLOC(_res_ref.datalen, "LDKCVec_u8Z Bytes");
14474 memcpy(_res_ref.data, _res->elems, _res_ref.datalen); FREE(_res);
14475 CVec_u8Z_free(_res_ref);
14478 void __attribute__((export_name("TS_CVec_CVec_u8ZZ_free"))) TS_CVec_CVec_u8ZZ_free(ptrArray _res) {
14479 LDKCVec_CVec_u8ZZ _res_constr;
14480 _res_constr.datalen = _res->arr_len;
14481 if (_res_constr.datalen > 0)
14482 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCVec_u8Z), "LDKCVec_CVec_u8ZZ Elements");
14484 _res_constr.data = NULL;
14485 int8_tArray* _res_vals = (void*) _res->elems;
14486 for (size_t m = 0; m < _res_constr.datalen; m++) {
14487 int8_tArray _res_conv_12 = _res_vals[m];
14488 LDKCVec_u8Z _res_conv_12_ref;
14489 _res_conv_12_ref.datalen = _res_conv_12->arr_len;
14490 _res_conv_12_ref.data = MALLOC(_res_conv_12_ref.datalen, "LDKCVec_u8Z Bytes");
14491 memcpy(_res_conv_12_ref.data, _res_conv_12->elems, _res_conv_12_ref.datalen); FREE(_res_conv_12);
14492 _res_constr.data[m] = _res_conv_12_ref;
14495 CVec_CVec_u8ZZ_free(_res_constr);
14498 uint64_t __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_ok"))) TS_CResult_CVec_CVec_u8ZZNoneZ_ok(ptrArray o) {
14499 LDKCVec_CVec_u8ZZ o_constr;
14500 o_constr.datalen = o->arr_len;
14501 if (o_constr.datalen > 0)
14502 o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKCVec_u8Z), "LDKCVec_CVec_u8ZZ Elements");
14504 o_constr.data = NULL;
14505 int8_tArray* o_vals = (void*) o->elems;
14506 for (size_t m = 0; m < o_constr.datalen; m++) {
14507 int8_tArray o_conv_12 = o_vals[m];
14508 LDKCVec_u8Z o_conv_12_ref;
14509 o_conv_12_ref.datalen = o_conv_12->arr_len;
14510 o_conv_12_ref.data = MALLOC(o_conv_12_ref.datalen, "LDKCVec_u8Z Bytes");
14511 memcpy(o_conv_12_ref.data, o_conv_12->elems, o_conv_12_ref.datalen); FREE(o_conv_12);
14512 o_constr.data[m] = o_conv_12_ref;
14515 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
14516 *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_ok(o_constr);
14517 return tag_ptr(ret_conv, true);
14520 uint64_t __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_err"))) TS_CResult_CVec_CVec_u8ZZNoneZ_err() {
14521 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
14522 *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_err();
14523 return tag_ptr(ret_conv, true);
14526 jboolean __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_is_ok"))) TS_CResult_CVec_CVec_u8ZZNoneZ_is_ok(uint64_t o) {
14527 LDKCResult_CVec_CVec_u8ZZNoneZ* o_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(o);
14528 jboolean ret_conv = CResult_CVec_CVec_u8ZZNoneZ_is_ok(o_conv);
14532 void __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_free"))) TS_CResult_CVec_CVec_u8ZZNoneZ_free(uint64_t _res) {
14533 if (!ptr_is_owned(_res)) return;
14534 void* _res_ptr = untag_ptr(_res);
14535 CHECK_ACCESS(_res_ptr);
14536 LDKCResult_CVec_CVec_u8ZZNoneZ _res_conv = *(LDKCResult_CVec_CVec_u8ZZNoneZ*)(_res_ptr);
14537 FREE(untag_ptr(_res));
14538 CResult_CVec_CVec_u8ZZNoneZ_free(_res_conv);
14541 static inline uint64_t CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR arg) {
14542 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
14543 *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone(arg);
14544 return tag_ptr(ret_conv, true);
14546 int64_t __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_clone_ptr"))) TS_CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(uint64_t arg) {
14547 LDKCResult_CVec_CVec_u8ZZNoneZ* arg_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(arg);
14548 int64_t ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(arg_conv);
14552 uint64_t __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_clone"))) TS_CResult_CVec_CVec_u8ZZNoneZ_clone(uint64_t orig) {
14553 LDKCResult_CVec_CVec_u8ZZNoneZ* orig_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(orig);
14554 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
14555 *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone(orig_conv);
14556 return tag_ptr(ret_conv, true);
14559 uint64_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_ok"))) TS_CResult_InMemorySignerDecodeErrorZ_ok(uint64_t o) {
14560 LDKInMemorySigner o_conv;
14561 o_conv.inner = untag_ptr(o);
14562 o_conv.is_owned = ptr_is_owned(o);
14563 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
14564 o_conv = InMemorySigner_clone(&o_conv);
14565 LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
14566 *ret_conv = CResult_InMemorySignerDecodeErrorZ_ok(o_conv);
14567 return tag_ptr(ret_conv, true);
14570 uint64_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_err"))) TS_CResult_InMemorySignerDecodeErrorZ_err(uint64_t e) {
14571 LDKDecodeError e_conv;
14572 e_conv.inner = untag_ptr(e);
14573 e_conv.is_owned = ptr_is_owned(e);
14574 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
14575 e_conv = DecodeError_clone(&e_conv);
14576 LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
14577 *ret_conv = CResult_InMemorySignerDecodeErrorZ_err(e_conv);
14578 return tag_ptr(ret_conv, true);
14581 jboolean __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_is_ok"))) TS_CResult_InMemorySignerDecodeErrorZ_is_ok(uint64_t o) {
14582 LDKCResult_InMemorySignerDecodeErrorZ* o_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(o);
14583 jboolean ret_conv = CResult_InMemorySignerDecodeErrorZ_is_ok(o_conv);
14587 void __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_free"))) TS_CResult_InMemorySignerDecodeErrorZ_free(uint64_t _res) {
14588 if (!ptr_is_owned(_res)) return;
14589 void* _res_ptr = untag_ptr(_res);
14590 CHECK_ACCESS(_res_ptr);
14591 LDKCResult_InMemorySignerDecodeErrorZ _res_conv = *(LDKCResult_InMemorySignerDecodeErrorZ*)(_res_ptr);
14592 FREE(untag_ptr(_res));
14593 CResult_InMemorySignerDecodeErrorZ_free(_res_conv);
14596 static inline uint64_t CResult_InMemorySignerDecodeErrorZ_clone_ptr(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR arg) {
14597 LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
14598 *ret_conv = CResult_InMemorySignerDecodeErrorZ_clone(arg);
14599 return tag_ptr(ret_conv, true);
14601 int64_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_clone_ptr"))) TS_CResult_InMemorySignerDecodeErrorZ_clone_ptr(uint64_t arg) {
14602 LDKCResult_InMemorySignerDecodeErrorZ* arg_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(arg);
14603 int64_t ret_conv = CResult_InMemorySignerDecodeErrorZ_clone_ptr(arg_conv);
14607 uint64_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_clone"))) TS_CResult_InMemorySignerDecodeErrorZ_clone(uint64_t orig) {
14608 LDKCResult_InMemorySignerDecodeErrorZ* orig_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(orig);
14609 LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
14610 *ret_conv = CResult_InMemorySignerDecodeErrorZ_clone(orig_conv);
14611 return tag_ptr(ret_conv, true);
14614 void __attribute__((export_name("TS_CVec_TxOutZ_free"))) TS_CVec_TxOutZ_free(uint64_tArray _res) {
14615 LDKCVec_TxOutZ _res_constr;
14616 _res_constr.datalen = _res->arr_len;
14617 if (_res_constr.datalen > 0)
14618 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements");
14620 _res_constr.data = NULL;
14621 uint64_t* _res_vals = _res->elems;
14622 for (size_t h = 0; h < _res_constr.datalen; h++) {
14623 uint64_t _res_conv_7 = _res_vals[h];
14624 void* _res_conv_7_ptr = untag_ptr(_res_conv_7);
14625 CHECK_ACCESS(_res_conv_7_ptr);
14626 LDKTxOut _res_conv_7_conv = *(LDKTxOut*)(_res_conv_7_ptr);
14627 FREE(untag_ptr(_res_conv_7));
14628 _res_constr.data[h] = _res_conv_7_conv;
14631 CVec_TxOutZ_free(_res_constr);
14634 uint64_t __attribute__((export_name("TS_CResult_TransactionNoneZ_ok"))) TS_CResult_TransactionNoneZ_ok(int8_tArray o) {
14635 LDKTransaction o_ref;
14636 o_ref.datalen = o->arr_len;
14637 o_ref.data = MALLOC(o_ref.datalen, "LDKTransaction Bytes");
14638 memcpy(o_ref.data, o->elems, o_ref.datalen); FREE(o);
14639 o_ref.data_is_owned = true;
14640 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
14641 *ret_conv = CResult_TransactionNoneZ_ok(o_ref);
14642 return tag_ptr(ret_conv, true);
14645 uint64_t __attribute__((export_name("TS_CResult_TransactionNoneZ_err"))) TS_CResult_TransactionNoneZ_err() {
14646 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
14647 *ret_conv = CResult_TransactionNoneZ_err();
14648 return tag_ptr(ret_conv, true);
14651 jboolean __attribute__((export_name("TS_CResult_TransactionNoneZ_is_ok"))) TS_CResult_TransactionNoneZ_is_ok(uint64_t o) {
14652 LDKCResult_TransactionNoneZ* o_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(o);
14653 jboolean ret_conv = CResult_TransactionNoneZ_is_ok(o_conv);
14657 void __attribute__((export_name("TS_CResult_TransactionNoneZ_free"))) TS_CResult_TransactionNoneZ_free(uint64_t _res) {
14658 if (!ptr_is_owned(_res)) return;
14659 void* _res_ptr = untag_ptr(_res);
14660 CHECK_ACCESS(_res_ptr);
14661 LDKCResult_TransactionNoneZ _res_conv = *(LDKCResult_TransactionNoneZ*)(_res_ptr);
14662 FREE(untag_ptr(_res));
14663 CResult_TransactionNoneZ_free(_res_conv);
14666 static inline uint64_t CResult_TransactionNoneZ_clone_ptr(LDKCResult_TransactionNoneZ *NONNULL_PTR arg) {
14667 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
14668 *ret_conv = CResult_TransactionNoneZ_clone(arg);
14669 return tag_ptr(ret_conv, true);
14671 int64_t __attribute__((export_name("TS_CResult_TransactionNoneZ_clone_ptr"))) TS_CResult_TransactionNoneZ_clone_ptr(uint64_t arg) {
14672 LDKCResult_TransactionNoneZ* arg_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(arg);
14673 int64_t ret_conv = CResult_TransactionNoneZ_clone_ptr(arg_conv);
14677 uint64_t __attribute__((export_name("TS_CResult_TransactionNoneZ_clone"))) TS_CResult_TransactionNoneZ_clone(uint64_t orig) {
14678 LDKCResult_TransactionNoneZ* orig_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(orig);
14679 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
14680 *ret_conv = CResult_TransactionNoneZ_clone(orig_conv);
14681 return tag_ptr(ret_conv, true);
14684 uint64_t __attribute__((export_name("TS_COption_u16Z_some"))) TS_COption_u16Z_some(int16_t o) {
14685 LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
14686 *ret_copy = COption_u16Z_some(o);
14687 uint64_t ret_ref = tag_ptr(ret_copy, true);
14691 uint64_t __attribute__((export_name("TS_COption_u16Z_none"))) TS_COption_u16Z_none() {
14692 LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
14693 *ret_copy = COption_u16Z_none();
14694 uint64_t ret_ref = tag_ptr(ret_copy, true);
14698 void __attribute__((export_name("TS_COption_u16Z_free"))) TS_COption_u16Z_free(uint64_t _res) {
14699 if (!ptr_is_owned(_res)) return;
14700 void* _res_ptr = untag_ptr(_res);
14701 CHECK_ACCESS(_res_ptr);
14702 LDKCOption_u16Z _res_conv = *(LDKCOption_u16Z*)(_res_ptr);
14703 FREE(untag_ptr(_res));
14704 COption_u16Z_free(_res_conv);
14707 static inline uint64_t COption_u16Z_clone_ptr(LDKCOption_u16Z *NONNULL_PTR arg) {
14708 LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
14709 *ret_copy = COption_u16Z_clone(arg);
14710 uint64_t ret_ref = tag_ptr(ret_copy, true);
14713 int64_t __attribute__((export_name("TS_COption_u16Z_clone_ptr"))) TS_COption_u16Z_clone_ptr(uint64_t arg) {
14714 LDKCOption_u16Z* arg_conv = (LDKCOption_u16Z*)untag_ptr(arg);
14715 int64_t ret_conv = COption_u16Z_clone_ptr(arg_conv);
14719 uint64_t __attribute__((export_name("TS_COption_u16Z_clone"))) TS_COption_u16Z_clone(uint64_t orig) {
14720 LDKCOption_u16Z* orig_conv = (LDKCOption_u16Z*)untag_ptr(orig);
14721 LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
14722 *ret_copy = COption_u16Z_clone(orig_conv);
14723 uint64_t ret_ref = tag_ptr(ret_copy, true);
14727 uint64_t __attribute__((export_name("TS_CResult_NoneAPIErrorZ_ok"))) TS_CResult_NoneAPIErrorZ_ok() {
14728 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
14729 *ret_conv = CResult_NoneAPIErrorZ_ok();
14730 return tag_ptr(ret_conv, true);
14733 uint64_t __attribute__((export_name("TS_CResult_NoneAPIErrorZ_err"))) TS_CResult_NoneAPIErrorZ_err(uint64_t e) {
14734 void* e_ptr = untag_ptr(e);
14735 CHECK_ACCESS(e_ptr);
14736 LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
14737 e_conv = APIError_clone((LDKAPIError*)untag_ptr(e));
14738 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
14739 *ret_conv = CResult_NoneAPIErrorZ_err(e_conv);
14740 return tag_ptr(ret_conv, true);
14743 jboolean __attribute__((export_name("TS_CResult_NoneAPIErrorZ_is_ok"))) TS_CResult_NoneAPIErrorZ_is_ok(uint64_t o) {
14744 LDKCResult_NoneAPIErrorZ* o_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(o);
14745 jboolean ret_conv = CResult_NoneAPIErrorZ_is_ok(o_conv);
14749 void __attribute__((export_name("TS_CResult_NoneAPIErrorZ_free"))) TS_CResult_NoneAPIErrorZ_free(uint64_t _res) {
14750 if (!ptr_is_owned(_res)) return;
14751 void* _res_ptr = untag_ptr(_res);
14752 CHECK_ACCESS(_res_ptr);
14753 LDKCResult_NoneAPIErrorZ _res_conv = *(LDKCResult_NoneAPIErrorZ*)(_res_ptr);
14754 FREE(untag_ptr(_res));
14755 CResult_NoneAPIErrorZ_free(_res_conv);
14758 static inline uint64_t CResult_NoneAPIErrorZ_clone_ptr(LDKCResult_NoneAPIErrorZ *NONNULL_PTR arg) {
14759 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
14760 *ret_conv = CResult_NoneAPIErrorZ_clone(arg);
14761 return tag_ptr(ret_conv, true);
14763 int64_t __attribute__((export_name("TS_CResult_NoneAPIErrorZ_clone_ptr"))) TS_CResult_NoneAPIErrorZ_clone_ptr(uint64_t arg) {
14764 LDKCResult_NoneAPIErrorZ* arg_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(arg);
14765 int64_t ret_conv = CResult_NoneAPIErrorZ_clone_ptr(arg_conv);
14769 uint64_t __attribute__((export_name("TS_CResult_NoneAPIErrorZ_clone"))) TS_CResult_NoneAPIErrorZ_clone(uint64_t orig) {
14770 LDKCResult_NoneAPIErrorZ* orig_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(orig);
14771 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
14772 *ret_conv = CResult_NoneAPIErrorZ_clone(orig_conv);
14773 return tag_ptr(ret_conv, true);
14776 void __attribute__((export_name("TS_CVec_CResult_NoneAPIErrorZZ_free"))) TS_CVec_CResult_NoneAPIErrorZZ_free(uint64_tArray _res) {
14777 LDKCVec_CResult_NoneAPIErrorZZ _res_constr;
14778 _res_constr.datalen = _res->arr_len;
14779 if (_res_constr.datalen > 0)
14780 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
14782 _res_constr.data = NULL;
14783 uint64_t* _res_vals = _res->elems;
14784 for (size_t w = 0; w < _res_constr.datalen; w++) {
14785 uint64_t _res_conv_22 = _res_vals[w];
14786 void* _res_conv_22_ptr = untag_ptr(_res_conv_22);
14787 CHECK_ACCESS(_res_conv_22_ptr);
14788 LDKCResult_NoneAPIErrorZ _res_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(_res_conv_22_ptr);
14789 FREE(untag_ptr(_res_conv_22));
14790 _res_constr.data[w] = _res_conv_22_conv;
14793 CVec_CResult_NoneAPIErrorZZ_free(_res_constr);
14796 void __attribute__((export_name("TS_CVec_APIErrorZ_free"))) TS_CVec_APIErrorZ_free(uint64_tArray _res) {
14797 LDKCVec_APIErrorZ _res_constr;
14798 _res_constr.datalen = _res->arr_len;
14799 if (_res_constr.datalen > 0)
14800 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKAPIError), "LDKCVec_APIErrorZ Elements");
14802 _res_constr.data = NULL;
14803 uint64_t* _res_vals = _res->elems;
14804 for (size_t k = 0; k < _res_constr.datalen; k++) {
14805 uint64_t _res_conv_10 = _res_vals[k];
14806 void* _res_conv_10_ptr = untag_ptr(_res_conv_10);
14807 CHECK_ACCESS(_res_conv_10_ptr);
14808 LDKAPIError _res_conv_10_conv = *(LDKAPIError*)(_res_conv_10_ptr);
14809 FREE(untag_ptr(_res_conv_10));
14810 _res_constr.data[k] = _res_conv_10_conv;
14813 CVec_APIErrorZ_free(_res_constr);
14816 uint64_t __attribute__((export_name("TS_CResult__u832APIErrorZ_ok"))) TS_CResult__u832APIErrorZ_ok(int8_tArray o) {
14817 LDKThirtyTwoBytes o_ref;
14818 CHECK(o->arr_len == 32);
14819 memcpy(o_ref.data, o->elems, 32); FREE(o);
14820 LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
14821 *ret_conv = CResult__u832APIErrorZ_ok(o_ref);
14822 return tag_ptr(ret_conv, true);
14825 uint64_t __attribute__((export_name("TS_CResult__u832APIErrorZ_err"))) TS_CResult__u832APIErrorZ_err(uint64_t e) {
14826 void* e_ptr = untag_ptr(e);
14827 CHECK_ACCESS(e_ptr);
14828 LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
14829 e_conv = APIError_clone((LDKAPIError*)untag_ptr(e));
14830 LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
14831 *ret_conv = CResult__u832APIErrorZ_err(e_conv);
14832 return tag_ptr(ret_conv, true);
14835 jboolean __attribute__((export_name("TS_CResult__u832APIErrorZ_is_ok"))) TS_CResult__u832APIErrorZ_is_ok(uint64_t o) {
14836 LDKCResult__u832APIErrorZ* o_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(o);
14837 jboolean ret_conv = CResult__u832APIErrorZ_is_ok(o_conv);
14841 void __attribute__((export_name("TS_CResult__u832APIErrorZ_free"))) TS_CResult__u832APIErrorZ_free(uint64_t _res) {
14842 if (!ptr_is_owned(_res)) return;
14843 void* _res_ptr = untag_ptr(_res);
14844 CHECK_ACCESS(_res_ptr);
14845 LDKCResult__u832APIErrorZ _res_conv = *(LDKCResult__u832APIErrorZ*)(_res_ptr);
14846 FREE(untag_ptr(_res));
14847 CResult__u832APIErrorZ_free(_res_conv);
14850 static inline uint64_t CResult__u832APIErrorZ_clone_ptr(LDKCResult__u832APIErrorZ *NONNULL_PTR arg) {
14851 LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
14852 *ret_conv = CResult__u832APIErrorZ_clone(arg);
14853 return tag_ptr(ret_conv, true);
14855 int64_t __attribute__((export_name("TS_CResult__u832APIErrorZ_clone_ptr"))) TS_CResult__u832APIErrorZ_clone_ptr(uint64_t arg) {
14856 LDKCResult__u832APIErrorZ* arg_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(arg);
14857 int64_t ret_conv = CResult__u832APIErrorZ_clone_ptr(arg_conv);
14861 uint64_t __attribute__((export_name("TS_CResult__u832APIErrorZ_clone"))) TS_CResult__u832APIErrorZ_clone(uint64_t orig) {
14862 LDKCResult__u832APIErrorZ* orig_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(orig);
14863 LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
14864 *ret_conv = CResult__u832APIErrorZ_clone(orig_conv);
14865 return tag_ptr(ret_conv, true);
14868 uint64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_ok"))) TS_CResult_PaymentIdPaymentSendFailureZ_ok(int8_tArray o) {
14869 LDKThirtyTwoBytes o_ref;
14870 CHECK(o->arr_len == 32);
14871 memcpy(o_ref.data, o->elems, 32); FREE(o);
14872 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
14873 *ret_conv = CResult_PaymentIdPaymentSendFailureZ_ok(o_ref);
14874 return tag_ptr(ret_conv, true);
14877 uint64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_err"))) TS_CResult_PaymentIdPaymentSendFailureZ_err(uint64_t e) {
14878 void* e_ptr = untag_ptr(e);
14879 CHECK_ACCESS(e_ptr);
14880 LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr);
14881 e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(e));
14882 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
14883 *ret_conv = CResult_PaymentIdPaymentSendFailureZ_err(e_conv);
14884 return tag_ptr(ret_conv, true);
14887 jboolean __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_is_ok"))) TS_CResult_PaymentIdPaymentSendFailureZ_is_ok(uint64_t o) {
14888 LDKCResult_PaymentIdPaymentSendFailureZ* o_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)untag_ptr(o);
14889 jboolean ret_conv = CResult_PaymentIdPaymentSendFailureZ_is_ok(o_conv);
14893 void __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_free"))) TS_CResult_PaymentIdPaymentSendFailureZ_free(uint64_t _res) {
14894 if (!ptr_is_owned(_res)) return;
14895 void* _res_ptr = untag_ptr(_res);
14896 CHECK_ACCESS(_res_ptr);
14897 LDKCResult_PaymentIdPaymentSendFailureZ _res_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(_res_ptr);
14898 FREE(untag_ptr(_res));
14899 CResult_PaymentIdPaymentSendFailureZ_free(_res_conv);
14902 static inline uint64_t CResult_PaymentIdPaymentSendFailureZ_clone_ptr(LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR arg) {
14903 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
14904 *ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone(arg);
14905 return tag_ptr(ret_conv, true);
14907 int64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_clone_ptr"))) TS_CResult_PaymentIdPaymentSendFailureZ_clone_ptr(uint64_t arg) {
14908 LDKCResult_PaymentIdPaymentSendFailureZ* arg_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)untag_ptr(arg);
14909 int64_t ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone_ptr(arg_conv);
14913 uint64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_clone"))) TS_CResult_PaymentIdPaymentSendFailureZ_clone(uint64_t orig) {
14914 LDKCResult_PaymentIdPaymentSendFailureZ* orig_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)untag_ptr(orig);
14915 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
14916 *ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone(orig_conv);
14917 return tag_ptr(ret_conv, true);
14920 uint64_t __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_ok"))) TS_CResult_NonePaymentSendFailureZ_ok() {
14921 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
14922 *ret_conv = CResult_NonePaymentSendFailureZ_ok();
14923 return tag_ptr(ret_conv, true);
14926 uint64_t __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_err"))) TS_CResult_NonePaymentSendFailureZ_err(uint64_t e) {
14927 void* e_ptr = untag_ptr(e);
14928 CHECK_ACCESS(e_ptr);
14929 LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr);
14930 e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(e));
14931 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
14932 *ret_conv = CResult_NonePaymentSendFailureZ_err(e_conv);
14933 return tag_ptr(ret_conv, true);
14936 jboolean __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_is_ok"))) TS_CResult_NonePaymentSendFailureZ_is_ok(uint64_t o) {
14937 LDKCResult_NonePaymentSendFailureZ* o_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(o);
14938 jboolean ret_conv = CResult_NonePaymentSendFailureZ_is_ok(o_conv);
14942 void __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_free"))) TS_CResult_NonePaymentSendFailureZ_free(uint64_t _res) {
14943 if (!ptr_is_owned(_res)) return;
14944 void* _res_ptr = untag_ptr(_res);
14945 CHECK_ACCESS(_res_ptr);
14946 LDKCResult_NonePaymentSendFailureZ _res_conv = *(LDKCResult_NonePaymentSendFailureZ*)(_res_ptr);
14947 FREE(untag_ptr(_res));
14948 CResult_NonePaymentSendFailureZ_free(_res_conv);
14951 static inline uint64_t CResult_NonePaymentSendFailureZ_clone_ptr(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR arg) {
14952 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
14953 *ret_conv = CResult_NonePaymentSendFailureZ_clone(arg);
14954 return tag_ptr(ret_conv, true);
14956 int64_t __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_clone_ptr"))) TS_CResult_NonePaymentSendFailureZ_clone_ptr(uint64_t arg) {
14957 LDKCResult_NonePaymentSendFailureZ* arg_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(arg);
14958 int64_t ret_conv = CResult_NonePaymentSendFailureZ_clone_ptr(arg_conv);
14962 uint64_t __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_clone"))) TS_CResult_NonePaymentSendFailureZ_clone(uint64_t orig) {
14963 LDKCResult_NonePaymentSendFailureZ* orig_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(orig);
14964 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
14965 *ret_conv = CResult_NonePaymentSendFailureZ_clone(orig_conv);
14966 return tag_ptr(ret_conv, true);
14969 static inline uint64_t C2Tuple_PaymentHashPaymentIdZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR arg) {
14970 LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ");
14971 *ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone(arg);
14972 return tag_ptr(ret_conv, true);
14974 int64_t __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentIdZ_clone_ptr"))) TS_C2Tuple_PaymentHashPaymentIdZ_clone_ptr(uint64_t arg) {
14975 LDKC2Tuple_PaymentHashPaymentIdZ* arg_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)untag_ptr(arg);
14976 int64_t ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone_ptr(arg_conv);
14980 uint64_t __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentIdZ_clone"))) TS_C2Tuple_PaymentHashPaymentIdZ_clone(uint64_t orig) {
14981 LDKC2Tuple_PaymentHashPaymentIdZ* orig_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)untag_ptr(orig);
14982 LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ");
14983 *ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone(orig_conv);
14984 return tag_ptr(ret_conv, true);
14987 uint64_t __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentIdZ_new"))) TS_C2Tuple_PaymentHashPaymentIdZ_new(int8_tArray a, int8_tArray b) {
14988 LDKThirtyTwoBytes a_ref;
14989 CHECK(a->arr_len == 32);
14990 memcpy(a_ref.data, a->elems, 32); FREE(a);
14991 LDKThirtyTwoBytes b_ref;
14992 CHECK(b->arr_len == 32);
14993 memcpy(b_ref.data, b->elems, 32); FREE(b);
14994 LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ");
14995 *ret_conv = C2Tuple_PaymentHashPaymentIdZ_new(a_ref, b_ref);
14996 return tag_ptr(ret_conv, true);
14999 void __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentIdZ_free"))) TS_C2Tuple_PaymentHashPaymentIdZ_free(uint64_t _res) {
15000 if (!ptr_is_owned(_res)) return;
15001 void* _res_ptr = untag_ptr(_res);
15002 CHECK_ACCESS(_res_ptr);
15003 LDKC2Tuple_PaymentHashPaymentIdZ _res_conv = *(LDKC2Tuple_PaymentHashPaymentIdZ*)(_res_ptr);
15004 FREE(untag_ptr(_res));
15005 C2Tuple_PaymentHashPaymentIdZ_free(_res_conv);
15008 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(uint64_t o) {
15009 void* o_ptr = untag_ptr(o);
15010 CHECK_ACCESS(o_ptr);
15011 LDKC2Tuple_PaymentHashPaymentIdZ o_conv = *(LDKC2Tuple_PaymentHashPaymentIdZ*)(o_ptr);
15012 o_conv = C2Tuple_PaymentHashPaymentIdZ_clone((LDKC2Tuple_PaymentHashPaymentIdZ*)untag_ptr(o));
15013 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
15014 *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(o_conv);
15015 return tag_ptr(ret_conv, true);
15018 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(uint64_t e) {
15019 void* e_ptr = untag_ptr(e);
15020 CHECK_ACCESS(e_ptr);
15021 LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr);
15022 e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(e));
15023 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
15024 *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(e_conv);
15025 return tag_ptr(ret_conv, true);
15028 jboolean __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(uint64_t o) {
15029 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)untag_ptr(o);
15030 jboolean ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(o_conv);
15034 void __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(uint64_t _res) {
15035 if (!ptr_is_owned(_res)) return;
15036 void* _res_ptr = untag_ptr(_res);
15037 CHECK_ACCESS(_res_ptr);
15038 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(_res_ptr);
15039 FREE(untag_ptr(_res));
15040 CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(_res_conv);
15043 static inline uint64_t CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR arg) {
15044 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
15045 *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(arg);
15046 return tag_ptr(ret_conv, true);
15048 int64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(uint64_t arg) {
15049 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)untag_ptr(arg);
15050 int64_t ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(arg_conv);
15054 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(uint64_t orig) {
15055 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)untag_ptr(orig);
15056 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
15057 *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(orig_conv);
15058 return tag_ptr(ret_conv, true);
15061 void __attribute__((export_name("TS_CVec_ThirtyTwoBytesZ_free"))) TS_CVec_ThirtyTwoBytesZ_free(ptrArray _res) {
15062 LDKCVec_ThirtyTwoBytesZ _res_constr;
15063 _res_constr.datalen = _res->arr_len;
15064 if (_res_constr.datalen > 0)
15065 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_ThirtyTwoBytesZ Elements");
15067 _res_constr.data = NULL;
15068 int8_tArray* _res_vals = (void*) _res->elems;
15069 for (size_t m = 0; m < _res_constr.datalen; m++) {
15070 int8_tArray _res_conv_12 = _res_vals[m];
15071 LDKThirtyTwoBytes _res_conv_12_ref;
15072 CHECK(_res_conv_12->arr_len == 32);
15073 memcpy(_res_conv_12_ref.data, _res_conv_12->elems, 32); FREE(_res_conv_12);
15074 _res_constr.data[m] = _res_conv_12_ref;
15077 CVec_ThirtyTwoBytesZ_free(_res_constr);
15080 static inline uint64_t C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR arg) {
15081 LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
15082 *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone(arg);
15083 return tag_ptr(ret_conv, true);
15085 int64_t __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentSecretZ_clone_ptr"))) TS_C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(uint64_t arg) {
15086 LDKC2Tuple_PaymentHashPaymentSecretZ* arg_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(arg);
15087 int64_t ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(arg_conv);
15091 uint64_t __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentSecretZ_clone"))) TS_C2Tuple_PaymentHashPaymentSecretZ_clone(uint64_t orig) {
15092 LDKC2Tuple_PaymentHashPaymentSecretZ* orig_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(orig);
15093 LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
15094 *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone(orig_conv);
15095 return tag_ptr(ret_conv, true);
15098 uint64_t __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentSecretZ_new"))) TS_C2Tuple_PaymentHashPaymentSecretZ_new(int8_tArray a, int8_tArray b) {
15099 LDKThirtyTwoBytes a_ref;
15100 CHECK(a->arr_len == 32);
15101 memcpy(a_ref.data, a->elems, 32); FREE(a);
15102 LDKThirtyTwoBytes b_ref;
15103 CHECK(b->arr_len == 32);
15104 memcpy(b_ref.data, b->elems, 32); FREE(b);
15105 LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
15106 *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_new(a_ref, b_ref);
15107 return tag_ptr(ret_conv, true);
15110 void __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentSecretZ_free"))) TS_C2Tuple_PaymentHashPaymentSecretZ_free(uint64_t _res) {
15111 if (!ptr_is_owned(_res)) return;
15112 void* _res_ptr = untag_ptr(_res);
15113 CHECK_ACCESS(_res_ptr);
15114 LDKC2Tuple_PaymentHashPaymentSecretZ _res_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(_res_ptr);
15115 FREE(untag_ptr(_res));
15116 C2Tuple_PaymentHashPaymentSecretZ_free(_res_conv);
15119 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(uint64_t o) {
15120 void* o_ptr = untag_ptr(o);
15121 CHECK_ACCESS(o_ptr);
15122 LDKC2Tuple_PaymentHashPaymentSecretZ o_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(o_ptr);
15123 o_conv = C2Tuple_PaymentHashPaymentSecretZ_clone((LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(o));
15124 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
15125 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(o_conv);
15126 return tag_ptr(ret_conv, true);
15129 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err() {
15130 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
15131 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err();
15132 return tag_ptr(ret_conv, true);
15135 jboolean __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(uint64_t o) {
15136 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)untag_ptr(o);
15137 jboolean ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(o_conv);
15141 void __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(uint64_t _res) {
15142 if (!ptr_is_owned(_res)) return;
15143 void* _res_ptr = untag_ptr(_res);
15144 CHECK_ACCESS(_res_ptr);
15145 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(_res_ptr);
15146 FREE(untag_ptr(_res));
15147 CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(_res_conv);
15150 static inline uint64_t CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR arg) {
15151 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
15152 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(arg);
15153 return tag_ptr(ret_conv, true);
15155 int64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(uint64_t arg) {
15156 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)untag_ptr(arg);
15157 int64_t ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(arg_conv);
15161 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(uint64_t orig) {
15162 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)untag_ptr(orig);
15163 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
15164 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(orig_conv);
15165 return tag_ptr(ret_conv, true);
15168 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(uint64_t o) {
15169 void* o_ptr = untag_ptr(o);
15170 CHECK_ACCESS(o_ptr);
15171 LDKC2Tuple_PaymentHashPaymentSecretZ o_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(o_ptr);
15172 o_conv = C2Tuple_PaymentHashPaymentSecretZ_clone((LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(o));
15173 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
15174 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(o_conv);
15175 return tag_ptr(ret_conv, true);
15178 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(uint64_t e) {
15179 void* e_ptr = untag_ptr(e);
15180 CHECK_ACCESS(e_ptr);
15181 LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
15182 e_conv = APIError_clone((LDKAPIError*)untag_ptr(e));
15183 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
15184 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(e_conv);
15185 return tag_ptr(ret_conv, true);
15188 jboolean __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(uint64_t o) {
15189 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)untag_ptr(o);
15190 jboolean ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(o_conv);
15194 void __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(uint64_t _res) {
15195 if (!ptr_is_owned(_res)) return;
15196 void* _res_ptr = untag_ptr(_res);
15197 CHECK_ACCESS(_res_ptr);
15198 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(_res_ptr);
15199 FREE(untag_ptr(_res));
15200 CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(_res_conv);
15203 static inline uint64_t CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR arg) {
15204 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
15205 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(arg);
15206 return tag_ptr(ret_conv, true);
15208 int64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(uint64_t arg) {
15209 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)untag_ptr(arg);
15210 int64_t ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(arg_conv);
15214 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(uint64_t orig) {
15215 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)untag_ptr(orig);
15216 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
15217 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(orig_conv);
15218 return tag_ptr(ret_conv, true);
15221 uint64_t __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_ok"))) TS_CResult_PaymentSecretNoneZ_ok(int8_tArray o) {
15222 LDKThirtyTwoBytes o_ref;
15223 CHECK(o->arr_len == 32);
15224 memcpy(o_ref.data, o->elems, 32); FREE(o);
15225 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
15226 *ret_conv = CResult_PaymentSecretNoneZ_ok(o_ref);
15227 return tag_ptr(ret_conv, true);
15230 uint64_t __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_err"))) TS_CResult_PaymentSecretNoneZ_err() {
15231 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
15232 *ret_conv = CResult_PaymentSecretNoneZ_err();
15233 return tag_ptr(ret_conv, true);
15236 jboolean __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_is_ok"))) TS_CResult_PaymentSecretNoneZ_is_ok(uint64_t o) {
15237 LDKCResult_PaymentSecretNoneZ* o_conv = (LDKCResult_PaymentSecretNoneZ*)untag_ptr(o);
15238 jboolean ret_conv = CResult_PaymentSecretNoneZ_is_ok(o_conv);
15242 void __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_free"))) TS_CResult_PaymentSecretNoneZ_free(uint64_t _res) {
15243 if (!ptr_is_owned(_res)) return;
15244 void* _res_ptr = untag_ptr(_res);
15245 CHECK_ACCESS(_res_ptr);
15246 LDKCResult_PaymentSecretNoneZ _res_conv = *(LDKCResult_PaymentSecretNoneZ*)(_res_ptr);
15247 FREE(untag_ptr(_res));
15248 CResult_PaymentSecretNoneZ_free(_res_conv);
15251 static inline uint64_t CResult_PaymentSecretNoneZ_clone_ptr(LDKCResult_PaymentSecretNoneZ *NONNULL_PTR arg) {
15252 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
15253 *ret_conv = CResult_PaymentSecretNoneZ_clone(arg);
15254 return tag_ptr(ret_conv, true);
15256 int64_t __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_clone_ptr"))) TS_CResult_PaymentSecretNoneZ_clone_ptr(uint64_t arg) {
15257 LDKCResult_PaymentSecretNoneZ* arg_conv = (LDKCResult_PaymentSecretNoneZ*)untag_ptr(arg);
15258 int64_t ret_conv = CResult_PaymentSecretNoneZ_clone_ptr(arg_conv);
15262 uint64_t __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_clone"))) TS_CResult_PaymentSecretNoneZ_clone(uint64_t orig) {
15263 LDKCResult_PaymentSecretNoneZ* orig_conv = (LDKCResult_PaymentSecretNoneZ*)untag_ptr(orig);
15264 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
15265 *ret_conv = CResult_PaymentSecretNoneZ_clone(orig_conv);
15266 return tag_ptr(ret_conv, true);
15269 uint64_t __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_ok"))) TS_CResult_PaymentSecretAPIErrorZ_ok(int8_tArray o) {
15270 LDKThirtyTwoBytes o_ref;
15271 CHECK(o->arr_len == 32);
15272 memcpy(o_ref.data, o->elems, 32); FREE(o);
15273 LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
15274 *ret_conv = CResult_PaymentSecretAPIErrorZ_ok(o_ref);
15275 return tag_ptr(ret_conv, true);
15278 uint64_t __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_err"))) TS_CResult_PaymentSecretAPIErrorZ_err(uint64_t e) {
15279 void* e_ptr = untag_ptr(e);
15280 CHECK_ACCESS(e_ptr);
15281 LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
15282 e_conv = APIError_clone((LDKAPIError*)untag_ptr(e));
15283 LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
15284 *ret_conv = CResult_PaymentSecretAPIErrorZ_err(e_conv);
15285 return tag_ptr(ret_conv, true);
15288 jboolean __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_is_ok"))) TS_CResult_PaymentSecretAPIErrorZ_is_ok(uint64_t o) {
15289 LDKCResult_PaymentSecretAPIErrorZ* o_conv = (LDKCResult_PaymentSecretAPIErrorZ*)untag_ptr(o);
15290 jboolean ret_conv = CResult_PaymentSecretAPIErrorZ_is_ok(o_conv);
15294 void __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_free"))) TS_CResult_PaymentSecretAPIErrorZ_free(uint64_t _res) {
15295 if (!ptr_is_owned(_res)) return;
15296 void* _res_ptr = untag_ptr(_res);
15297 CHECK_ACCESS(_res_ptr);
15298 LDKCResult_PaymentSecretAPIErrorZ _res_conv = *(LDKCResult_PaymentSecretAPIErrorZ*)(_res_ptr);
15299 FREE(untag_ptr(_res));
15300 CResult_PaymentSecretAPIErrorZ_free(_res_conv);
15303 static inline uint64_t CResult_PaymentSecretAPIErrorZ_clone_ptr(LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR arg) {
15304 LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
15305 *ret_conv = CResult_PaymentSecretAPIErrorZ_clone(arg);
15306 return tag_ptr(ret_conv, true);
15308 int64_t __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_clone_ptr"))) TS_CResult_PaymentSecretAPIErrorZ_clone_ptr(uint64_t arg) {
15309 LDKCResult_PaymentSecretAPIErrorZ* arg_conv = (LDKCResult_PaymentSecretAPIErrorZ*)untag_ptr(arg);
15310 int64_t ret_conv = CResult_PaymentSecretAPIErrorZ_clone_ptr(arg_conv);
15314 uint64_t __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_clone"))) TS_CResult_PaymentSecretAPIErrorZ_clone(uint64_t orig) {
15315 LDKCResult_PaymentSecretAPIErrorZ* orig_conv = (LDKCResult_PaymentSecretAPIErrorZ*)untag_ptr(orig);
15316 LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
15317 *ret_conv = CResult_PaymentSecretAPIErrorZ_clone(orig_conv);
15318 return tag_ptr(ret_conv, true);
15321 uint64_t __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_ok"))) TS_CResult_PaymentPreimageAPIErrorZ_ok(int8_tArray o) {
15322 LDKThirtyTwoBytes o_ref;
15323 CHECK(o->arr_len == 32);
15324 memcpy(o_ref.data, o->elems, 32); FREE(o);
15325 LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
15326 *ret_conv = CResult_PaymentPreimageAPIErrorZ_ok(o_ref);
15327 return tag_ptr(ret_conv, true);
15330 uint64_t __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_err"))) TS_CResult_PaymentPreimageAPIErrorZ_err(uint64_t e) {
15331 void* e_ptr = untag_ptr(e);
15332 CHECK_ACCESS(e_ptr);
15333 LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
15334 e_conv = APIError_clone((LDKAPIError*)untag_ptr(e));
15335 LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
15336 *ret_conv = CResult_PaymentPreimageAPIErrorZ_err(e_conv);
15337 return tag_ptr(ret_conv, true);
15340 jboolean __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_is_ok"))) TS_CResult_PaymentPreimageAPIErrorZ_is_ok(uint64_t o) {
15341 LDKCResult_PaymentPreimageAPIErrorZ* o_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)untag_ptr(o);
15342 jboolean ret_conv = CResult_PaymentPreimageAPIErrorZ_is_ok(o_conv);
15346 void __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_free"))) TS_CResult_PaymentPreimageAPIErrorZ_free(uint64_t _res) {
15347 if (!ptr_is_owned(_res)) return;
15348 void* _res_ptr = untag_ptr(_res);
15349 CHECK_ACCESS(_res_ptr);
15350 LDKCResult_PaymentPreimageAPIErrorZ _res_conv = *(LDKCResult_PaymentPreimageAPIErrorZ*)(_res_ptr);
15351 FREE(untag_ptr(_res));
15352 CResult_PaymentPreimageAPIErrorZ_free(_res_conv);
15355 static inline uint64_t CResult_PaymentPreimageAPIErrorZ_clone_ptr(LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR arg) {
15356 LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
15357 *ret_conv = CResult_PaymentPreimageAPIErrorZ_clone(arg);
15358 return tag_ptr(ret_conv, true);
15360 int64_t __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_clone_ptr"))) TS_CResult_PaymentPreimageAPIErrorZ_clone_ptr(uint64_t arg) {
15361 LDKCResult_PaymentPreimageAPIErrorZ* arg_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)untag_ptr(arg);
15362 int64_t ret_conv = CResult_PaymentPreimageAPIErrorZ_clone_ptr(arg_conv);
15366 uint64_t __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_clone"))) TS_CResult_PaymentPreimageAPIErrorZ_clone(uint64_t orig) {
15367 LDKCResult_PaymentPreimageAPIErrorZ* orig_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)untag_ptr(orig);
15368 LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
15369 *ret_conv = CResult_PaymentPreimageAPIErrorZ_clone(orig_conv);
15370 return tag_ptr(ret_conv, true);
15373 uint64_t __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_ok"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(uint64_t o) {
15374 LDKCounterpartyForwardingInfo o_conv;
15375 o_conv.inner = untag_ptr(o);
15376 o_conv.is_owned = ptr_is_owned(o);
15377 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
15378 o_conv = CounterpartyForwardingInfo_clone(&o_conv);
15379 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
15380 *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(o_conv);
15381 return tag_ptr(ret_conv, true);
15384 uint64_t __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_err"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_err(uint64_t e) {
15385 LDKDecodeError e_conv;
15386 e_conv.inner = untag_ptr(e);
15387 e_conv.is_owned = ptr_is_owned(e);
15388 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
15389 e_conv = DecodeError_clone(&e_conv);
15390 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
15391 *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_err(e_conv);
15392 return tag_ptr(ret_conv, true);
15395 jboolean __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(uint64_t o) {
15396 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* o_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(o);
15397 jboolean ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(o_conv);
15401 void __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_free"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_free(uint64_t _res) {
15402 if (!ptr_is_owned(_res)) return;
15403 void* _res_ptr = untag_ptr(_res);
15404 CHECK_ACCESS(_res_ptr);
15405 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)(_res_ptr);
15406 FREE(untag_ptr(_res));
15407 CResult_CounterpartyForwardingInfoDecodeErrorZ_free(_res_conv);
15410 static inline uint64_t CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR arg) {
15411 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
15412 *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(arg);
15413 return tag_ptr(ret_conv, true);
15415 int64_t __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(uint64_t arg) {
15416 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(arg);
15417 int64_t ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(arg_conv);
15421 uint64_t __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_clone"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(uint64_t orig) {
15422 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(orig);
15423 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
15424 *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(orig_conv);
15425 return tag_ptr(ret_conv, true);
15428 uint64_t __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_ok"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_ok(uint64_t o) {
15429 LDKChannelCounterparty o_conv;
15430 o_conv.inner = untag_ptr(o);
15431 o_conv.is_owned = ptr_is_owned(o);
15432 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
15433 o_conv = ChannelCounterparty_clone(&o_conv);
15434 LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
15435 *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_ok(o_conv);
15436 return tag_ptr(ret_conv, true);
15439 uint64_t __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_err"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_err(uint64_t e) {
15440 LDKDecodeError e_conv;
15441 e_conv.inner = untag_ptr(e);
15442 e_conv.is_owned = ptr_is_owned(e);
15443 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
15444 e_conv = DecodeError_clone(&e_conv);
15445 LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
15446 *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_err(e_conv);
15447 return tag_ptr(ret_conv, true);
15450 jboolean __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_is_ok"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_is_ok(uint64_t o) {
15451 LDKCResult_ChannelCounterpartyDecodeErrorZ* o_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(o);
15452 jboolean ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_is_ok(o_conv);
15456 void __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_free"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_free(uint64_t _res) {
15457 if (!ptr_is_owned(_res)) return;
15458 void* _res_ptr = untag_ptr(_res);
15459 CHECK_ACCESS(_res_ptr);
15460 LDKCResult_ChannelCounterpartyDecodeErrorZ _res_conv = *(LDKCResult_ChannelCounterpartyDecodeErrorZ*)(_res_ptr);
15461 FREE(untag_ptr(_res));
15462 CResult_ChannelCounterpartyDecodeErrorZ_free(_res_conv);
15465 static inline uint64_t CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR arg) {
15466 LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
15467 *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone(arg);
15468 return tag_ptr(ret_conv, true);
15470 int64_t __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(uint64_t arg) {
15471 LDKCResult_ChannelCounterpartyDecodeErrorZ* arg_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(arg);
15472 int64_t ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(arg_conv);
15476 uint64_t __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_clone"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_clone(uint64_t orig) {
15477 LDKCResult_ChannelCounterpartyDecodeErrorZ* orig_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(orig);
15478 LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
15479 *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone(orig_conv);
15480 return tag_ptr(ret_conv, true);
15483 uint64_t __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_ok"))) TS_CResult_ChannelDetailsDecodeErrorZ_ok(uint64_t o) {
15484 LDKChannelDetails o_conv;
15485 o_conv.inner = untag_ptr(o);
15486 o_conv.is_owned = ptr_is_owned(o);
15487 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
15488 o_conv = ChannelDetails_clone(&o_conv);
15489 LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
15490 *ret_conv = CResult_ChannelDetailsDecodeErrorZ_ok(o_conv);
15491 return tag_ptr(ret_conv, true);
15494 uint64_t __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_err"))) TS_CResult_ChannelDetailsDecodeErrorZ_err(uint64_t e) {
15495 LDKDecodeError e_conv;
15496 e_conv.inner = untag_ptr(e);
15497 e_conv.is_owned = ptr_is_owned(e);
15498 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
15499 e_conv = DecodeError_clone(&e_conv);
15500 LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
15501 *ret_conv = CResult_ChannelDetailsDecodeErrorZ_err(e_conv);
15502 return tag_ptr(ret_conv, true);
15505 jboolean __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_is_ok"))) TS_CResult_ChannelDetailsDecodeErrorZ_is_ok(uint64_t o) {
15506 LDKCResult_ChannelDetailsDecodeErrorZ* o_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(o);
15507 jboolean ret_conv = CResult_ChannelDetailsDecodeErrorZ_is_ok(o_conv);
15511 void __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_free"))) TS_CResult_ChannelDetailsDecodeErrorZ_free(uint64_t _res) {
15512 if (!ptr_is_owned(_res)) return;
15513 void* _res_ptr = untag_ptr(_res);
15514 CHECK_ACCESS(_res_ptr);
15515 LDKCResult_ChannelDetailsDecodeErrorZ _res_conv = *(LDKCResult_ChannelDetailsDecodeErrorZ*)(_res_ptr);
15516 FREE(untag_ptr(_res));
15517 CResult_ChannelDetailsDecodeErrorZ_free(_res_conv);
15520 static inline uint64_t CResult_ChannelDetailsDecodeErrorZ_clone_ptr(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR arg) {
15521 LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
15522 *ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone(arg);
15523 return tag_ptr(ret_conv, true);
15525 int64_t __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelDetailsDecodeErrorZ_clone_ptr(uint64_t arg) {
15526 LDKCResult_ChannelDetailsDecodeErrorZ* arg_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(arg);
15527 int64_t ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone_ptr(arg_conv);
15531 uint64_t __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_clone"))) TS_CResult_ChannelDetailsDecodeErrorZ_clone(uint64_t orig) {
15532 LDKCResult_ChannelDetailsDecodeErrorZ* orig_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(orig);
15533 LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
15534 *ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone(orig_conv);
15535 return tag_ptr(ret_conv, true);
15538 uint64_t __attribute__((export_name("TS_CResult_PhantomRouteHintsDecodeErrorZ_ok"))) TS_CResult_PhantomRouteHintsDecodeErrorZ_ok(uint64_t o) {
15539 LDKPhantomRouteHints o_conv;
15540 o_conv.inner = untag_ptr(o);
15541 o_conv.is_owned = ptr_is_owned(o);
15542 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
15543 o_conv = PhantomRouteHints_clone(&o_conv);
15544 LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
15545 *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_ok(o_conv);
15546 return tag_ptr(ret_conv, true);
15549 uint64_t __attribute__((export_name("TS_CResult_PhantomRouteHintsDecodeErrorZ_err"))) TS_CResult_PhantomRouteHintsDecodeErrorZ_err(uint64_t e) {
15550 LDKDecodeError e_conv;
15551 e_conv.inner = untag_ptr(e);
15552 e_conv.is_owned = ptr_is_owned(e);
15553 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
15554 e_conv = DecodeError_clone(&e_conv);
15555 LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
15556 *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_err(e_conv);
15557 return tag_ptr(ret_conv, true);
15560 jboolean __attribute__((export_name("TS_CResult_PhantomRouteHintsDecodeErrorZ_is_ok"))) TS_CResult_PhantomRouteHintsDecodeErrorZ_is_ok(uint64_t o) {
15561 LDKCResult_PhantomRouteHintsDecodeErrorZ* o_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(o);
15562 jboolean ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_is_ok(o_conv);
15566 void __attribute__((export_name("TS_CResult_PhantomRouteHintsDecodeErrorZ_free"))) TS_CResult_PhantomRouteHintsDecodeErrorZ_free(uint64_t _res) {
15567 if (!ptr_is_owned(_res)) return;
15568 void* _res_ptr = untag_ptr(_res);
15569 CHECK_ACCESS(_res_ptr);
15570 LDKCResult_PhantomRouteHintsDecodeErrorZ _res_conv = *(LDKCResult_PhantomRouteHintsDecodeErrorZ*)(_res_ptr);
15571 FREE(untag_ptr(_res));
15572 CResult_PhantomRouteHintsDecodeErrorZ_free(_res_conv);
15575 static inline uint64_t CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR arg) {
15576 LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
15577 *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_clone(arg);
15578 return tag_ptr(ret_conv, true);
15580 int64_t __attribute__((export_name("TS_CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr"))) TS_CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr(uint64_t arg) {
15581 LDKCResult_PhantomRouteHintsDecodeErrorZ* arg_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(arg);
15582 int64_t ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr(arg_conv);
15586 uint64_t __attribute__((export_name("TS_CResult_PhantomRouteHintsDecodeErrorZ_clone"))) TS_CResult_PhantomRouteHintsDecodeErrorZ_clone(uint64_t orig) {
15587 LDKCResult_PhantomRouteHintsDecodeErrorZ* orig_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(orig);
15588 LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
15589 *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_clone(orig_conv);
15590 return tag_ptr(ret_conv, true);
15593 void __attribute__((export_name("TS_CVec_ChannelMonitorZ_free"))) TS_CVec_ChannelMonitorZ_free(uint64_tArray _res) {
15594 LDKCVec_ChannelMonitorZ _res_constr;
15595 _res_constr.datalen = _res->arr_len;
15596 if (_res_constr.datalen > 0)
15597 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKChannelMonitor), "LDKCVec_ChannelMonitorZ Elements");
15599 _res_constr.data = NULL;
15600 uint64_t* _res_vals = _res->elems;
15601 for (size_t q = 0; q < _res_constr.datalen; q++) {
15602 uint64_t _res_conv_16 = _res_vals[q];
15603 LDKChannelMonitor _res_conv_16_conv;
15604 _res_conv_16_conv.inner = untag_ptr(_res_conv_16);
15605 _res_conv_16_conv.is_owned = ptr_is_owned(_res_conv_16);
15606 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv);
15607 _res_constr.data[q] = _res_conv_16_conv;
15610 CVec_ChannelMonitorZ_free(_res_constr);
15613 uint64_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelManagerZ_new"))) TS_C2Tuple_BlockHashChannelManagerZ_new(int8_tArray a, uint64_t b) {
15614 LDKThirtyTwoBytes a_ref;
15615 CHECK(a->arr_len == 32);
15616 memcpy(a_ref.data, a->elems, 32); FREE(a);
15617 LDKChannelManager b_conv;
15618 b_conv.inner = untag_ptr(b);
15619 b_conv.is_owned = ptr_is_owned(b);
15620 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
15621 // WARNING: we need a move here but no clone is available for LDKChannelManager
15623 LDKC2Tuple_BlockHashChannelManagerZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelManagerZ), "LDKC2Tuple_BlockHashChannelManagerZ");
15624 *ret_conv = C2Tuple_BlockHashChannelManagerZ_new(a_ref, b_conv);
15625 return tag_ptr(ret_conv, true);
15628 void __attribute__((export_name("TS_C2Tuple_BlockHashChannelManagerZ_free"))) TS_C2Tuple_BlockHashChannelManagerZ_free(uint64_t _res) {
15629 if (!ptr_is_owned(_res)) return;
15630 void* _res_ptr = untag_ptr(_res);
15631 CHECK_ACCESS(_res_ptr);
15632 LDKC2Tuple_BlockHashChannelManagerZ _res_conv = *(LDKC2Tuple_BlockHashChannelManagerZ*)(_res_ptr);
15633 FREE(untag_ptr(_res));
15634 C2Tuple_BlockHashChannelManagerZ_free(_res_conv);
15637 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(uint64_t o) {
15638 void* o_ptr = untag_ptr(o);
15639 CHECK_ACCESS(o_ptr);
15640 LDKC2Tuple_BlockHashChannelManagerZ o_conv = *(LDKC2Tuple_BlockHashChannelManagerZ*)(o_ptr);
15641 // WARNING: we may need a move here but no clone is available for LDKC2Tuple_BlockHashChannelManagerZ
15642 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ");
15643 *ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(o_conv);
15644 return tag_ptr(ret_conv, true);
15647 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(uint64_t e) {
15648 LDKDecodeError e_conv;
15649 e_conv.inner = untag_ptr(e);
15650 e_conv.is_owned = ptr_is_owned(e);
15651 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
15652 e_conv = DecodeError_clone(&e_conv);
15653 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ");
15654 *ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(e_conv);
15655 return tag_ptr(ret_conv, true);
15658 jboolean __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(uint64_t o) {
15659 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* o_conv = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)untag_ptr(o);
15660 jboolean ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(o_conv);
15664 void __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(uint64_t _res) {
15665 if (!ptr_is_owned(_res)) return;
15666 void* _res_ptr = untag_ptr(_res);
15667 CHECK_ACCESS(_res_ptr);
15668 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(_res_ptr);
15669 FREE(untag_ptr(_res));
15670 CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(_res_conv);
15673 uint64_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_ok"))) TS_CResult_ChannelConfigDecodeErrorZ_ok(uint64_t o) {
15674 LDKChannelConfig o_conv;
15675 o_conv.inner = untag_ptr(o);
15676 o_conv.is_owned = ptr_is_owned(o);
15677 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
15678 o_conv = ChannelConfig_clone(&o_conv);
15679 LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
15680 *ret_conv = CResult_ChannelConfigDecodeErrorZ_ok(o_conv);
15681 return tag_ptr(ret_conv, true);
15684 uint64_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_err"))) TS_CResult_ChannelConfigDecodeErrorZ_err(uint64_t e) {
15685 LDKDecodeError e_conv;
15686 e_conv.inner = untag_ptr(e);
15687 e_conv.is_owned = ptr_is_owned(e);
15688 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
15689 e_conv = DecodeError_clone(&e_conv);
15690 LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
15691 *ret_conv = CResult_ChannelConfigDecodeErrorZ_err(e_conv);
15692 return tag_ptr(ret_conv, true);
15695 jboolean __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_is_ok"))) TS_CResult_ChannelConfigDecodeErrorZ_is_ok(uint64_t o) {
15696 LDKCResult_ChannelConfigDecodeErrorZ* o_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(o);
15697 jboolean ret_conv = CResult_ChannelConfigDecodeErrorZ_is_ok(o_conv);
15701 void __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_free"))) TS_CResult_ChannelConfigDecodeErrorZ_free(uint64_t _res) {
15702 if (!ptr_is_owned(_res)) return;
15703 void* _res_ptr = untag_ptr(_res);
15704 CHECK_ACCESS(_res_ptr);
15705 LDKCResult_ChannelConfigDecodeErrorZ _res_conv = *(LDKCResult_ChannelConfigDecodeErrorZ*)(_res_ptr);
15706 FREE(untag_ptr(_res));
15707 CResult_ChannelConfigDecodeErrorZ_free(_res_conv);
15710 static inline uint64_t CResult_ChannelConfigDecodeErrorZ_clone_ptr(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR arg) {
15711 LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
15712 *ret_conv = CResult_ChannelConfigDecodeErrorZ_clone(arg);
15713 return tag_ptr(ret_conv, true);
15715 int64_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelConfigDecodeErrorZ_clone_ptr(uint64_t arg) {
15716 LDKCResult_ChannelConfigDecodeErrorZ* arg_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(arg);
15717 int64_t ret_conv = CResult_ChannelConfigDecodeErrorZ_clone_ptr(arg_conv);
15721 uint64_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_clone"))) TS_CResult_ChannelConfigDecodeErrorZ_clone(uint64_t orig) {
15722 LDKCResult_ChannelConfigDecodeErrorZ* orig_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(orig);
15723 LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
15724 *ret_conv = CResult_ChannelConfigDecodeErrorZ_clone(orig_conv);
15725 return tag_ptr(ret_conv, true);
15728 uint64_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_ok"))) TS_CResult_OutPointDecodeErrorZ_ok(uint64_t o) {
15729 LDKOutPoint o_conv;
15730 o_conv.inner = untag_ptr(o);
15731 o_conv.is_owned = ptr_is_owned(o);
15732 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
15733 o_conv = OutPoint_clone(&o_conv);
15734 LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
15735 *ret_conv = CResult_OutPointDecodeErrorZ_ok(o_conv);
15736 return tag_ptr(ret_conv, true);
15739 uint64_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_err"))) TS_CResult_OutPointDecodeErrorZ_err(uint64_t e) {
15740 LDKDecodeError e_conv;
15741 e_conv.inner = untag_ptr(e);
15742 e_conv.is_owned = ptr_is_owned(e);
15743 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
15744 e_conv = DecodeError_clone(&e_conv);
15745 LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
15746 *ret_conv = CResult_OutPointDecodeErrorZ_err(e_conv);
15747 return tag_ptr(ret_conv, true);
15750 jboolean __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_is_ok"))) TS_CResult_OutPointDecodeErrorZ_is_ok(uint64_t o) {
15751 LDKCResult_OutPointDecodeErrorZ* o_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(o);
15752 jboolean ret_conv = CResult_OutPointDecodeErrorZ_is_ok(o_conv);
15756 void __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_free"))) TS_CResult_OutPointDecodeErrorZ_free(uint64_t _res) {
15757 if (!ptr_is_owned(_res)) return;
15758 void* _res_ptr = untag_ptr(_res);
15759 CHECK_ACCESS(_res_ptr);
15760 LDKCResult_OutPointDecodeErrorZ _res_conv = *(LDKCResult_OutPointDecodeErrorZ*)(_res_ptr);
15761 FREE(untag_ptr(_res));
15762 CResult_OutPointDecodeErrorZ_free(_res_conv);
15765 static inline uint64_t CResult_OutPointDecodeErrorZ_clone_ptr(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR arg) {
15766 LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
15767 *ret_conv = CResult_OutPointDecodeErrorZ_clone(arg);
15768 return tag_ptr(ret_conv, true);
15770 int64_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_clone_ptr"))) TS_CResult_OutPointDecodeErrorZ_clone_ptr(uint64_t arg) {
15771 LDKCResult_OutPointDecodeErrorZ* arg_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(arg);
15772 int64_t ret_conv = CResult_OutPointDecodeErrorZ_clone_ptr(arg_conv);
15776 uint64_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_clone"))) TS_CResult_OutPointDecodeErrorZ_clone(uint64_t orig) {
15777 LDKCResult_OutPointDecodeErrorZ* orig_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(orig);
15778 LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
15779 *ret_conv = CResult_OutPointDecodeErrorZ_clone(orig_conv);
15780 return tag_ptr(ret_conv, true);
15783 uint64_t __attribute__((export_name("TS_COption_TypeZ_some"))) TS_COption_TypeZ_some(uint64_t o) {
15784 void* o_ptr = untag_ptr(o);
15785 CHECK_ACCESS(o_ptr);
15786 LDKType o_conv = *(LDKType*)(o_ptr);
15787 if (o_conv.free == LDKType_JCalls_free) {
15788 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
15789 LDKType_JCalls_cloned(&o_conv);
15791 LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
15792 *ret_copy = COption_TypeZ_some(o_conv);
15793 uint64_t ret_ref = tag_ptr(ret_copy, true);
15797 uint64_t __attribute__((export_name("TS_COption_TypeZ_none"))) TS_COption_TypeZ_none() {
15798 LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
15799 *ret_copy = COption_TypeZ_none();
15800 uint64_t ret_ref = tag_ptr(ret_copy, true);
15804 void __attribute__((export_name("TS_COption_TypeZ_free"))) TS_COption_TypeZ_free(uint64_t _res) {
15805 if (!ptr_is_owned(_res)) return;
15806 void* _res_ptr = untag_ptr(_res);
15807 CHECK_ACCESS(_res_ptr);
15808 LDKCOption_TypeZ _res_conv = *(LDKCOption_TypeZ*)(_res_ptr);
15809 FREE(untag_ptr(_res));
15810 COption_TypeZ_free(_res_conv);
15813 static inline uint64_t COption_TypeZ_clone_ptr(LDKCOption_TypeZ *NONNULL_PTR arg) {
15814 LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
15815 *ret_copy = COption_TypeZ_clone(arg);
15816 uint64_t ret_ref = tag_ptr(ret_copy, true);
15819 int64_t __attribute__((export_name("TS_COption_TypeZ_clone_ptr"))) TS_COption_TypeZ_clone_ptr(uint64_t arg) {
15820 LDKCOption_TypeZ* arg_conv = (LDKCOption_TypeZ*)untag_ptr(arg);
15821 int64_t ret_conv = COption_TypeZ_clone_ptr(arg_conv);
15825 uint64_t __attribute__((export_name("TS_COption_TypeZ_clone"))) TS_COption_TypeZ_clone(uint64_t orig) {
15826 LDKCOption_TypeZ* orig_conv = (LDKCOption_TypeZ*)untag_ptr(orig);
15827 LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
15828 *ret_copy = COption_TypeZ_clone(orig_conv);
15829 uint64_t ret_ref = tag_ptr(ret_copy, true);
15833 uint64_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_ok"))) TS_CResult_COption_TypeZDecodeErrorZ_ok(uint64_t o) {
15834 void* o_ptr = untag_ptr(o);
15835 CHECK_ACCESS(o_ptr);
15836 LDKCOption_TypeZ o_conv = *(LDKCOption_TypeZ*)(o_ptr);
15837 o_conv = COption_TypeZ_clone((LDKCOption_TypeZ*)untag_ptr(o));
15838 LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
15839 *ret_conv = CResult_COption_TypeZDecodeErrorZ_ok(o_conv);
15840 return tag_ptr(ret_conv, true);
15843 uint64_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_err"))) TS_CResult_COption_TypeZDecodeErrorZ_err(uint64_t e) {
15844 LDKDecodeError e_conv;
15845 e_conv.inner = untag_ptr(e);
15846 e_conv.is_owned = ptr_is_owned(e);
15847 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
15848 e_conv = DecodeError_clone(&e_conv);
15849 LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
15850 *ret_conv = CResult_COption_TypeZDecodeErrorZ_err(e_conv);
15851 return tag_ptr(ret_conv, true);
15854 jboolean __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_is_ok"))) TS_CResult_COption_TypeZDecodeErrorZ_is_ok(uint64_t o) {
15855 LDKCResult_COption_TypeZDecodeErrorZ* o_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(o);
15856 jboolean ret_conv = CResult_COption_TypeZDecodeErrorZ_is_ok(o_conv);
15860 void __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_free"))) TS_CResult_COption_TypeZDecodeErrorZ_free(uint64_t _res) {
15861 if (!ptr_is_owned(_res)) return;
15862 void* _res_ptr = untag_ptr(_res);
15863 CHECK_ACCESS(_res_ptr);
15864 LDKCResult_COption_TypeZDecodeErrorZ _res_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(_res_ptr);
15865 FREE(untag_ptr(_res));
15866 CResult_COption_TypeZDecodeErrorZ_free(_res_conv);
15869 static inline uint64_t CResult_COption_TypeZDecodeErrorZ_clone_ptr(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR arg) {
15870 LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
15871 *ret_conv = CResult_COption_TypeZDecodeErrorZ_clone(arg);
15872 return tag_ptr(ret_conv, true);
15874 int64_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_TypeZDecodeErrorZ_clone_ptr(uint64_t arg) {
15875 LDKCResult_COption_TypeZDecodeErrorZ* arg_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(arg);
15876 int64_t ret_conv = CResult_COption_TypeZDecodeErrorZ_clone_ptr(arg_conv);
15880 uint64_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_clone"))) TS_CResult_COption_TypeZDecodeErrorZ_clone(uint64_t orig) {
15881 LDKCResult_COption_TypeZDecodeErrorZ* orig_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(orig);
15882 LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
15883 *ret_conv = CResult_COption_TypeZDecodeErrorZ_clone(orig_conv);
15884 return tag_ptr(ret_conv, true);
15887 uint64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentErrorZ_ok"))) TS_CResult_PaymentIdPaymentErrorZ_ok(int8_tArray o) {
15888 LDKThirtyTwoBytes o_ref;
15889 CHECK(o->arr_len == 32);
15890 memcpy(o_ref.data, o->elems, 32); FREE(o);
15891 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
15892 *ret_conv = CResult_PaymentIdPaymentErrorZ_ok(o_ref);
15893 return tag_ptr(ret_conv, true);
15896 uint64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentErrorZ_err"))) TS_CResult_PaymentIdPaymentErrorZ_err(uint64_t e) {
15897 void* e_ptr = untag_ptr(e);
15898 CHECK_ACCESS(e_ptr);
15899 LDKPaymentError e_conv = *(LDKPaymentError*)(e_ptr);
15900 e_conv = PaymentError_clone((LDKPaymentError*)untag_ptr(e));
15901 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
15902 *ret_conv = CResult_PaymentIdPaymentErrorZ_err(e_conv);
15903 return tag_ptr(ret_conv, true);
15906 jboolean __attribute__((export_name("TS_CResult_PaymentIdPaymentErrorZ_is_ok"))) TS_CResult_PaymentIdPaymentErrorZ_is_ok(uint64_t o) {
15907 LDKCResult_PaymentIdPaymentErrorZ* o_conv = (LDKCResult_PaymentIdPaymentErrorZ*)untag_ptr(o);
15908 jboolean ret_conv = CResult_PaymentIdPaymentErrorZ_is_ok(o_conv);
15912 void __attribute__((export_name("TS_CResult_PaymentIdPaymentErrorZ_free"))) TS_CResult_PaymentIdPaymentErrorZ_free(uint64_t _res) {
15913 if (!ptr_is_owned(_res)) return;
15914 void* _res_ptr = untag_ptr(_res);
15915 CHECK_ACCESS(_res_ptr);
15916 LDKCResult_PaymentIdPaymentErrorZ _res_conv = *(LDKCResult_PaymentIdPaymentErrorZ*)(_res_ptr);
15917 FREE(untag_ptr(_res));
15918 CResult_PaymentIdPaymentErrorZ_free(_res_conv);
15921 static inline uint64_t CResult_PaymentIdPaymentErrorZ_clone_ptr(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR arg) {
15922 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
15923 *ret_conv = CResult_PaymentIdPaymentErrorZ_clone(arg);
15924 return tag_ptr(ret_conv, true);
15926 int64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentErrorZ_clone_ptr"))) TS_CResult_PaymentIdPaymentErrorZ_clone_ptr(uint64_t arg) {
15927 LDKCResult_PaymentIdPaymentErrorZ* arg_conv = (LDKCResult_PaymentIdPaymentErrorZ*)untag_ptr(arg);
15928 int64_t ret_conv = CResult_PaymentIdPaymentErrorZ_clone_ptr(arg_conv);
15932 uint64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentErrorZ_clone"))) TS_CResult_PaymentIdPaymentErrorZ_clone(uint64_t orig) {
15933 LDKCResult_PaymentIdPaymentErrorZ* orig_conv = (LDKCResult_PaymentIdPaymentErrorZ*)untag_ptr(orig);
15934 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
15935 *ret_conv = CResult_PaymentIdPaymentErrorZ_clone(orig_conv);
15936 return tag_ptr(ret_conv, true);
15939 uint64_t __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_ok"))) TS_CResult_SiPrefixParseErrorZ_ok(uint32_t o) {
15940 LDKSiPrefix o_conv = LDKSiPrefix_from_js(o);
15941 LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
15942 *ret_conv = CResult_SiPrefixParseErrorZ_ok(o_conv);
15943 return tag_ptr(ret_conv, true);
15946 uint64_t __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_err"))) TS_CResult_SiPrefixParseErrorZ_err(uint64_t e) {
15947 void* e_ptr = untag_ptr(e);
15948 CHECK_ACCESS(e_ptr);
15949 LDKParseError e_conv = *(LDKParseError*)(e_ptr);
15950 e_conv = ParseError_clone((LDKParseError*)untag_ptr(e));
15951 LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
15952 *ret_conv = CResult_SiPrefixParseErrorZ_err(e_conv);
15953 return tag_ptr(ret_conv, true);
15956 jboolean __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_is_ok"))) TS_CResult_SiPrefixParseErrorZ_is_ok(uint64_t o) {
15957 LDKCResult_SiPrefixParseErrorZ* o_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(o);
15958 jboolean ret_conv = CResult_SiPrefixParseErrorZ_is_ok(o_conv);
15962 void __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_free"))) TS_CResult_SiPrefixParseErrorZ_free(uint64_t _res) {
15963 if (!ptr_is_owned(_res)) return;
15964 void* _res_ptr = untag_ptr(_res);
15965 CHECK_ACCESS(_res_ptr);
15966 LDKCResult_SiPrefixParseErrorZ _res_conv = *(LDKCResult_SiPrefixParseErrorZ*)(_res_ptr);
15967 FREE(untag_ptr(_res));
15968 CResult_SiPrefixParseErrorZ_free(_res_conv);
15971 static inline uint64_t CResult_SiPrefixParseErrorZ_clone_ptr(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR arg) {
15972 LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
15973 *ret_conv = CResult_SiPrefixParseErrorZ_clone(arg);
15974 return tag_ptr(ret_conv, true);
15976 int64_t __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_clone_ptr"))) TS_CResult_SiPrefixParseErrorZ_clone_ptr(uint64_t arg) {
15977 LDKCResult_SiPrefixParseErrorZ* arg_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(arg);
15978 int64_t ret_conv = CResult_SiPrefixParseErrorZ_clone_ptr(arg_conv);
15982 uint64_t __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_clone"))) TS_CResult_SiPrefixParseErrorZ_clone(uint64_t orig) {
15983 LDKCResult_SiPrefixParseErrorZ* orig_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(orig);
15984 LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
15985 *ret_conv = CResult_SiPrefixParseErrorZ_clone(orig_conv);
15986 return tag_ptr(ret_conv, true);
15989 uint64_t __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_ok"))) TS_CResult_InvoiceParseOrSemanticErrorZ_ok(uint64_t o) {
15991 o_conv.inner = untag_ptr(o);
15992 o_conv.is_owned = ptr_is_owned(o);
15993 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
15994 o_conv = Invoice_clone(&o_conv);
15995 LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
15996 *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_ok(o_conv);
15997 return tag_ptr(ret_conv, true);
16000 uint64_t __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_err"))) TS_CResult_InvoiceParseOrSemanticErrorZ_err(uint64_t e) {
16001 void* e_ptr = untag_ptr(e);
16002 CHECK_ACCESS(e_ptr);
16003 LDKParseOrSemanticError e_conv = *(LDKParseOrSemanticError*)(e_ptr);
16004 e_conv = ParseOrSemanticError_clone((LDKParseOrSemanticError*)untag_ptr(e));
16005 LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
16006 *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_err(e_conv);
16007 return tag_ptr(ret_conv, true);
16010 jboolean __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_is_ok"))) TS_CResult_InvoiceParseOrSemanticErrorZ_is_ok(uint64_t o) {
16011 LDKCResult_InvoiceParseOrSemanticErrorZ* o_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(o);
16012 jboolean ret_conv = CResult_InvoiceParseOrSemanticErrorZ_is_ok(o_conv);
16016 void __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_free"))) TS_CResult_InvoiceParseOrSemanticErrorZ_free(uint64_t _res) {
16017 if (!ptr_is_owned(_res)) return;
16018 void* _res_ptr = untag_ptr(_res);
16019 CHECK_ACCESS(_res_ptr);
16020 LDKCResult_InvoiceParseOrSemanticErrorZ _res_conv = *(LDKCResult_InvoiceParseOrSemanticErrorZ*)(_res_ptr);
16021 FREE(untag_ptr(_res));
16022 CResult_InvoiceParseOrSemanticErrorZ_free(_res_conv);
16025 static inline uint64_t CResult_InvoiceParseOrSemanticErrorZ_clone_ptr(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR arg) {
16026 LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
16027 *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone(arg);
16028 return tag_ptr(ret_conv, true);
16030 int64_t __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_clone_ptr"))) TS_CResult_InvoiceParseOrSemanticErrorZ_clone_ptr(uint64_t arg) {
16031 LDKCResult_InvoiceParseOrSemanticErrorZ* arg_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(arg);
16032 int64_t ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone_ptr(arg_conv);
16036 uint64_t __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_clone"))) TS_CResult_InvoiceParseOrSemanticErrorZ_clone(uint64_t orig) {
16037 LDKCResult_InvoiceParseOrSemanticErrorZ* orig_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(orig);
16038 LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
16039 *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone(orig_conv);
16040 return tag_ptr(ret_conv, true);
16043 uint64_t __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_ok"))) TS_CResult_SignedRawInvoiceParseErrorZ_ok(uint64_t o) {
16044 LDKSignedRawInvoice o_conv;
16045 o_conv.inner = untag_ptr(o);
16046 o_conv.is_owned = ptr_is_owned(o);
16047 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16048 o_conv = SignedRawInvoice_clone(&o_conv);
16049 LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
16050 *ret_conv = CResult_SignedRawInvoiceParseErrorZ_ok(o_conv);
16051 return tag_ptr(ret_conv, true);
16054 uint64_t __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_err"))) TS_CResult_SignedRawInvoiceParseErrorZ_err(uint64_t e) {
16055 void* e_ptr = untag_ptr(e);
16056 CHECK_ACCESS(e_ptr);
16057 LDKParseError e_conv = *(LDKParseError*)(e_ptr);
16058 e_conv = ParseError_clone((LDKParseError*)untag_ptr(e));
16059 LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
16060 *ret_conv = CResult_SignedRawInvoiceParseErrorZ_err(e_conv);
16061 return tag_ptr(ret_conv, true);
16064 jboolean __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_is_ok"))) TS_CResult_SignedRawInvoiceParseErrorZ_is_ok(uint64_t o) {
16065 LDKCResult_SignedRawInvoiceParseErrorZ* o_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(o);
16066 jboolean ret_conv = CResult_SignedRawInvoiceParseErrorZ_is_ok(o_conv);
16070 void __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_free"))) TS_CResult_SignedRawInvoiceParseErrorZ_free(uint64_t _res) {
16071 if (!ptr_is_owned(_res)) return;
16072 void* _res_ptr = untag_ptr(_res);
16073 CHECK_ACCESS(_res_ptr);
16074 LDKCResult_SignedRawInvoiceParseErrorZ _res_conv = *(LDKCResult_SignedRawInvoiceParseErrorZ*)(_res_ptr);
16075 FREE(untag_ptr(_res));
16076 CResult_SignedRawInvoiceParseErrorZ_free(_res_conv);
16079 static inline uint64_t CResult_SignedRawInvoiceParseErrorZ_clone_ptr(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR arg) {
16080 LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
16081 *ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone(arg);
16082 return tag_ptr(ret_conv, true);
16084 int64_t __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_clone_ptr"))) TS_CResult_SignedRawInvoiceParseErrorZ_clone_ptr(uint64_t arg) {
16085 LDKCResult_SignedRawInvoiceParseErrorZ* arg_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(arg);
16086 int64_t ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone_ptr(arg_conv);
16090 uint64_t __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_clone"))) TS_CResult_SignedRawInvoiceParseErrorZ_clone(uint64_t orig) {
16091 LDKCResult_SignedRawInvoiceParseErrorZ* orig_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(orig);
16092 LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
16093 *ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone(orig_conv);
16094 return tag_ptr(ret_conv, true);
16097 static inline uint64_t C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR arg) {
16098 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
16099 *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(arg);
16100 return tag_ptr(ret_conv, true);
16102 int64_t __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(uint64_t arg) {
16103 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* arg_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(arg);
16104 int64_t ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(arg_conv);
16108 uint64_t __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(uint64_t orig) {
16109 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* orig_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(orig);
16110 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
16111 *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(orig_conv);
16112 return tag_ptr(ret_conv, true);
16115 uint64_t __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_new"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(uint64_t a, int8_tArray b, uint64_t c) {
16116 LDKRawInvoice a_conv;
16117 a_conv.inner = untag_ptr(a);
16118 a_conv.is_owned = ptr_is_owned(a);
16119 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
16120 a_conv = RawInvoice_clone(&a_conv);
16121 LDKThirtyTwoBytes b_ref;
16122 CHECK(b->arr_len == 32);
16123 memcpy(b_ref.data, b->elems, 32); FREE(b);
16124 LDKInvoiceSignature c_conv;
16125 c_conv.inner = untag_ptr(c);
16126 c_conv.is_owned = ptr_is_owned(c);
16127 CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv);
16128 c_conv = InvoiceSignature_clone(&c_conv);
16129 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
16130 *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(a_conv, b_ref, c_conv);
16131 return tag_ptr(ret_conv, true);
16134 void __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_free"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(uint64_t _res) {
16135 if (!ptr_is_owned(_res)) return;
16136 void* _res_ptr = untag_ptr(_res);
16137 CHECK_ACCESS(_res_ptr);
16138 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res_conv = *(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(_res_ptr);
16139 FREE(untag_ptr(_res));
16140 C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(_res_conv);
16143 uint64_t __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_ok"))) TS_CResult_PayeePubKeyErrorZ_ok(uint64_t o) {
16144 LDKPayeePubKey o_conv;
16145 o_conv.inner = untag_ptr(o);
16146 o_conv.is_owned = ptr_is_owned(o);
16147 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16148 o_conv = PayeePubKey_clone(&o_conv);
16149 LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
16150 *ret_conv = CResult_PayeePubKeyErrorZ_ok(o_conv);
16151 return tag_ptr(ret_conv, true);
16154 uint64_t __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_err"))) TS_CResult_PayeePubKeyErrorZ_err(uint32_t e) {
16155 LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_js(e);
16156 LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
16157 *ret_conv = CResult_PayeePubKeyErrorZ_err(e_conv);
16158 return tag_ptr(ret_conv, true);
16161 jboolean __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_is_ok"))) TS_CResult_PayeePubKeyErrorZ_is_ok(uint64_t o) {
16162 LDKCResult_PayeePubKeyErrorZ* o_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(o);
16163 jboolean ret_conv = CResult_PayeePubKeyErrorZ_is_ok(o_conv);
16167 void __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_free"))) TS_CResult_PayeePubKeyErrorZ_free(uint64_t _res) {
16168 if (!ptr_is_owned(_res)) return;
16169 void* _res_ptr = untag_ptr(_res);
16170 CHECK_ACCESS(_res_ptr);
16171 LDKCResult_PayeePubKeyErrorZ _res_conv = *(LDKCResult_PayeePubKeyErrorZ*)(_res_ptr);
16172 FREE(untag_ptr(_res));
16173 CResult_PayeePubKeyErrorZ_free(_res_conv);
16176 static inline uint64_t CResult_PayeePubKeyErrorZ_clone_ptr(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR arg) {
16177 LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
16178 *ret_conv = CResult_PayeePubKeyErrorZ_clone(arg);
16179 return tag_ptr(ret_conv, true);
16181 int64_t __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_clone_ptr"))) TS_CResult_PayeePubKeyErrorZ_clone_ptr(uint64_t arg) {
16182 LDKCResult_PayeePubKeyErrorZ* arg_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(arg);
16183 int64_t ret_conv = CResult_PayeePubKeyErrorZ_clone_ptr(arg_conv);
16187 uint64_t __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_clone"))) TS_CResult_PayeePubKeyErrorZ_clone(uint64_t orig) {
16188 LDKCResult_PayeePubKeyErrorZ* orig_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(orig);
16189 LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
16190 *ret_conv = CResult_PayeePubKeyErrorZ_clone(orig_conv);
16191 return tag_ptr(ret_conv, true);
16194 void __attribute__((export_name("TS_CVec_PrivateRouteZ_free"))) TS_CVec_PrivateRouteZ_free(uint64_tArray _res) {
16195 LDKCVec_PrivateRouteZ _res_constr;
16196 _res_constr.datalen = _res->arr_len;
16197 if (_res_constr.datalen > 0)
16198 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPrivateRoute), "LDKCVec_PrivateRouteZ Elements");
16200 _res_constr.data = NULL;
16201 uint64_t* _res_vals = _res->elems;
16202 for (size_t o = 0; o < _res_constr.datalen; o++) {
16203 uint64_t _res_conv_14 = _res_vals[o];
16204 LDKPrivateRoute _res_conv_14_conv;
16205 _res_conv_14_conv.inner = untag_ptr(_res_conv_14);
16206 _res_conv_14_conv.is_owned = ptr_is_owned(_res_conv_14);
16207 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv);
16208 _res_constr.data[o] = _res_conv_14_conv;
16211 CVec_PrivateRouteZ_free(_res_constr);
16214 uint64_t __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_ok"))) TS_CResult_PositiveTimestampCreationErrorZ_ok(uint64_t o) {
16215 LDKPositiveTimestamp o_conv;
16216 o_conv.inner = untag_ptr(o);
16217 o_conv.is_owned = ptr_is_owned(o);
16218 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16219 o_conv = PositiveTimestamp_clone(&o_conv);
16220 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
16221 *ret_conv = CResult_PositiveTimestampCreationErrorZ_ok(o_conv);
16222 return tag_ptr(ret_conv, true);
16225 uint64_t __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_err"))) TS_CResult_PositiveTimestampCreationErrorZ_err(uint32_t e) {
16226 LDKCreationError e_conv = LDKCreationError_from_js(e);
16227 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
16228 *ret_conv = CResult_PositiveTimestampCreationErrorZ_err(e_conv);
16229 return tag_ptr(ret_conv, true);
16232 jboolean __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_is_ok"))) TS_CResult_PositiveTimestampCreationErrorZ_is_ok(uint64_t o) {
16233 LDKCResult_PositiveTimestampCreationErrorZ* o_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(o);
16234 jboolean ret_conv = CResult_PositiveTimestampCreationErrorZ_is_ok(o_conv);
16238 void __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_free"))) TS_CResult_PositiveTimestampCreationErrorZ_free(uint64_t _res) {
16239 if (!ptr_is_owned(_res)) return;
16240 void* _res_ptr = untag_ptr(_res);
16241 CHECK_ACCESS(_res_ptr);
16242 LDKCResult_PositiveTimestampCreationErrorZ _res_conv = *(LDKCResult_PositiveTimestampCreationErrorZ*)(_res_ptr);
16243 FREE(untag_ptr(_res));
16244 CResult_PositiveTimestampCreationErrorZ_free(_res_conv);
16247 static inline uint64_t CResult_PositiveTimestampCreationErrorZ_clone_ptr(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR arg) {
16248 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
16249 *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(arg);
16250 return tag_ptr(ret_conv, true);
16252 int64_t __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_clone_ptr"))) TS_CResult_PositiveTimestampCreationErrorZ_clone_ptr(uint64_t arg) {
16253 LDKCResult_PositiveTimestampCreationErrorZ* arg_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(arg);
16254 int64_t ret_conv = CResult_PositiveTimestampCreationErrorZ_clone_ptr(arg_conv);
16258 uint64_t __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_clone"))) TS_CResult_PositiveTimestampCreationErrorZ_clone(uint64_t orig) {
16259 LDKCResult_PositiveTimestampCreationErrorZ* orig_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(orig);
16260 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
16261 *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(orig_conv);
16262 return tag_ptr(ret_conv, true);
16265 uint64_t __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_ok"))) TS_CResult_NoneSemanticErrorZ_ok() {
16266 LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
16267 *ret_conv = CResult_NoneSemanticErrorZ_ok();
16268 return tag_ptr(ret_conv, true);
16271 uint64_t __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_err"))) TS_CResult_NoneSemanticErrorZ_err(uint32_t e) {
16272 LDKSemanticError e_conv = LDKSemanticError_from_js(e);
16273 LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
16274 *ret_conv = CResult_NoneSemanticErrorZ_err(e_conv);
16275 return tag_ptr(ret_conv, true);
16278 jboolean __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_is_ok"))) TS_CResult_NoneSemanticErrorZ_is_ok(uint64_t o) {
16279 LDKCResult_NoneSemanticErrorZ* o_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(o);
16280 jboolean ret_conv = CResult_NoneSemanticErrorZ_is_ok(o_conv);
16284 void __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_free"))) TS_CResult_NoneSemanticErrorZ_free(uint64_t _res) {
16285 if (!ptr_is_owned(_res)) return;
16286 void* _res_ptr = untag_ptr(_res);
16287 CHECK_ACCESS(_res_ptr);
16288 LDKCResult_NoneSemanticErrorZ _res_conv = *(LDKCResult_NoneSemanticErrorZ*)(_res_ptr);
16289 FREE(untag_ptr(_res));
16290 CResult_NoneSemanticErrorZ_free(_res_conv);
16293 static inline uint64_t CResult_NoneSemanticErrorZ_clone_ptr(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR arg) {
16294 LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
16295 *ret_conv = CResult_NoneSemanticErrorZ_clone(arg);
16296 return tag_ptr(ret_conv, true);
16298 int64_t __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_clone_ptr"))) TS_CResult_NoneSemanticErrorZ_clone_ptr(uint64_t arg) {
16299 LDKCResult_NoneSemanticErrorZ* arg_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(arg);
16300 int64_t ret_conv = CResult_NoneSemanticErrorZ_clone_ptr(arg_conv);
16304 uint64_t __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_clone"))) TS_CResult_NoneSemanticErrorZ_clone(uint64_t orig) {
16305 LDKCResult_NoneSemanticErrorZ* orig_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(orig);
16306 LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
16307 *ret_conv = CResult_NoneSemanticErrorZ_clone(orig_conv);
16308 return tag_ptr(ret_conv, true);
16311 uint64_t __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_ok"))) TS_CResult_InvoiceSemanticErrorZ_ok(uint64_t o) {
16313 o_conv.inner = untag_ptr(o);
16314 o_conv.is_owned = ptr_is_owned(o);
16315 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16316 o_conv = Invoice_clone(&o_conv);
16317 LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
16318 *ret_conv = CResult_InvoiceSemanticErrorZ_ok(o_conv);
16319 return tag_ptr(ret_conv, true);
16322 uint64_t __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_err"))) TS_CResult_InvoiceSemanticErrorZ_err(uint32_t e) {
16323 LDKSemanticError e_conv = LDKSemanticError_from_js(e);
16324 LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
16325 *ret_conv = CResult_InvoiceSemanticErrorZ_err(e_conv);
16326 return tag_ptr(ret_conv, true);
16329 jboolean __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_is_ok"))) TS_CResult_InvoiceSemanticErrorZ_is_ok(uint64_t o) {
16330 LDKCResult_InvoiceSemanticErrorZ* o_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(o);
16331 jboolean ret_conv = CResult_InvoiceSemanticErrorZ_is_ok(o_conv);
16335 void __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_free"))) TS_CResult_InvoiceSemanticErrorZ_free(uint64_t _res) {
16336 if (!ptr_is_owned(_res)) return;
16337 void* _res_ptr = untag_ptr(_res);
16338 CHECK_ACCESS(_res_ptr);
16339 LDKCResult_InvoiceSemanticErrorZ _res_conv = *(LDKCResult_InvoiceSemanticErrorZ*)(_res_ptr);
16340 FREE(untag_ptr(_res));
16341 CResult_InvoiceSemanticErrorZ_free(_res_conv);
16344 static inline uint64_t CResult_InvoiceSemanticErrorZ_clone_ptr(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR arg) {
16345 LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
16346 *ret_conv = CResult_InvoiceSemanticErrorZ_clone(arg);
16347 return tag_ptr(ret_conv, true);
16349 int64_t __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_clone_ptr"))) TS_CResult_InvoiceSemanticErrorZ_clone_ptr(uint64_t arg) {
16350 LDKCResult_InvoiceSemanticErrorZ* arg_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(arg);
16351 int64_t ret_conv = CResult_InvoiceSemanticErrorZ_clone_ptr(arg_conv);
16355 uint64_t __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_clone"))) TS_CResult_InvoiceSemanticErrorZ_clone(uint64_t orig) {
16356 LDKCResult_InvoiceSemanticErrorZ* orig_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(orig);
16357 LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
16358 *ret_conv = CResult_InvoiceSemanticErrorZ_clone(orig_conv);
16359 return tag_ptr(ret_conv, true);
16362 uint64_t __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_ok"))) TS_CResult_DescriptionCreationErrorZ_ok(uint64_t o) {
16363 LDKDescription o_conv;
16364 o_conv.inner = untag_ptr(o);
16365 o_conv.is_owned = ptr_is_owned(o);
16366 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16367 o_conv = Description_clone(&o_conv);
16368 LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
16369 *ret_conv = CResult_DescriptionCreationErrorZ_ok(o_conv);
16370 return tag_ptr(ret_conv, true);
16373 uint64_t __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_err"))) TS_CResult_DescriptionCreationErrorZ_err(uint32_t e) {
16374 LDKCreationError e_conv = LDKCreationError_from_js(e);
16375 LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
16376 *ret_conv = CResult_DescriptionCreationErrorZ_err(e_conv);
16377 return tag_ptr(ret_conv, true);
16380 jboolean __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_is_ok"))) TS_CResult_DescriptionCreationErrorZ_is_ok(uint64_t o) {
16381 LDKCResult_DescriptionCreationErrorZ* o_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(o);
16382 jboolean ret_conv = CResult_DescriptionCreationErrorZ_is_ok(o_conv);
16386 void __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_free"))) TS_CResult_DescriptionCreationErrorZ_free(uint64_t _res) {
16387 if (!ptr_is_owned(_res)) return;
16388 void* _res_ptr = untag_ptr(_res);
16389 CHECK_ACCESS(_res_ptr);
16390 LDKCResult_DescriptionCreationErrorZ _res_conv = *(LDKCResult_DescriptionCreationErrorZ*)(_res_ptr);
16391 FREE(untag_ptr(_res));
16392 CResult_DescriptionCreationErrorZ_free(_res_conv);
16395 static inline uint64_t CResult_DescriptionCreationErrorZ_clone_ptr(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR arg) {
16396 LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
16397 *ret_conv = CResult_DescriptionCreationErrorZ_clone(arg);
16398 return tag_ptr(ret_conv, true);
16400 int64_t __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_clone_ptr"))) TS_CResult_DescriptionCreationErrorZ_clone_ptr(uint64_t arg) {
16401 LDKCResult_DescriptionCreationErrorZ* arg_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(arg);
16402 int64_t ret_conv = CResult_DescriptionCreationErrorZ_clone_ptr(arg_conv);
16406 uint64_t __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_clone"))) TS_CResult_DescriptionCreationErrorZ_clone(uint64_t orig) {
16407 LDKCResult_DescriptionCreationErrorZ* orig_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(orig);
16408 LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
16409 *ret_conv = CResult_DescriptionCreationErrorZ_clone(orig_conv);
16410 return tag_ptr(ret_conv, true);
16413 uint64_t __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_ok"))) TS_CResult_PrivateRouteCreationErrorZ_ok(uint64_t o) {
16414 LDKPrivateRoute o_conv;
16415 o_conv.inner = untag_ptr(o);
16416 o_conv.is_owned = ptr_is_owned(o);
16417 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16418 o_conv = PrivateRoute_clone(&o_conv);
16419 LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
16420 *ret_conv = CResult_PrivateRouteCreationErrorZ_ok(o_conv);
16421 return tag_ptr(ret_conv, true);
16424 uint64_t __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_err"))) TS_CResult_PrivateRouteCreationErrorZ_err(uint32_t e) {
16425 LDKCreationError e_conv = LDKCreationError_from_js(e);
16426 LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
16427 *ret_conv = CResult_PrivateRouteCreationErrorZ_err(e_conv);
16428 return tag_ptr(ret_conv, true);
16431 jboolean __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_is_ok"))) TS_CResult_PrivateRouteCreationErrorZ_is_ok(uint64_t o) {
16432 LDKCResult_PrivateRouteCreationErrorZ* o_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(o);
16433 jboolean ret_conv = CResult_PrivateRouteCreationErrorZ_is_ok(o_conv);
16437 void __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_free"))) TS_CResult_PrivateRouteCreationErrorZ_free(uint64_t _res) {
16438 if (!ptr_is_owned(_res)) return;
16439 void* _res_ptr = untag_ptr(_res);
16440 CHECK_ACCESS(_res_ptr);
16441 LDKCResult_PrivateRouteCreationErrorZ _res_conv = *(LDKCResult_PrivateRouteCreationErrorZ*)(_res_ptr);
16442 FREE(untag_ptr(_res));
16443 CResult_PrivateRouteCreationErrorZ_free(_res_conv);
16446 static inline uint64_t CResult_PrivateRouteCreationErrorZ_clone_ptr(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR arg) {
16447 LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
16448 *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(arg);
16449 return tag_ptr(ret_conv, true);
16451 int64_t __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_clone_ptr"))) TS_CResult_PrivateRouteCreationErrorZ_clone_ptr(uint64_t arg) {
16452 LDKCResult_PrivateRouteCreationErrorZ* arg_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(arg);
16453 int64_t ret_conv = CResult_PrivateRouteCreationErrorZ_clone_ptr(arg_conv);
16457 uint64_t __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_clone"))) TS_CResult_PrivateRouteCreationErrorZ_clone(uint64_t orig) {
16458 LDKCResult_PrivateRouteCreationErrorZ* orig_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(orig);
16459 LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
16460 *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(orig_conv);
16461 return tag_ptr(ret_conv, true);
16464 uint64_t __attribute__((export_name("TS_CResult_StringErrorZ_ok"))) TS_CResult_StringErrorZ_ok(jstring o) {
16465 LDKStr o_conv = str_ref_to_owned_c(o);
16466 LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
16467 *ret_conv = CResult_StringErrorZ_ok(o_conv);
16468 return tag_ptr(ret_conv, true);
16471 uint64_t __attribute__((export_name("TS_CResult_StringErrorZ_err"))) TS_CResult_StringErrorZ_err(uint32_t e) {
16472 LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_js(e);
16473 LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
16474 *ret_conv = CResult_StringErrorZ_err(e_conv);
16475 return tag_ptr(ret_conv, true);
16478 jboolean __attribute__((export_name("TS_CResult_StringErrorZ_is_ok"))) TS_CResult_StringErrorZ_is_ok(uint64_t o) {
16479 LDKCResult_StringErrorZ* o_conv = (LDKCResult_StringErrorZ*)untag_ptr(o);
16480 jboolean ret_conv = CResult_StringErrorZ_is_ok(o_conv);
16484 void __attribute__((export_name("TS_CResult_StringErrorZ_free"))) TS_CResult_StringErrorZ_free(uint64_t _res) {
16485 if (!ptr_is_owned(_res)) return;
16486 void* _res_ptr = untag_ptr(_res);
16487 CHECK_ACCESS(_res_ptr);
16488 LDKCResult_StringErrorZ _res_conv = *(LDKCResult_StringErrorZ*)(_res_ptr);
16489 FREE(untag_ptr(_res));
16490 CResult_StringErrorZ_free(_res_conv);
16493 static inline uint64_t CResult_StringErrorZ_clone_ptr(LDKCResult_StringErrorZ *NONNULL_PTR arg) {
16494 LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
16495 *ret_conv = CResult_StringErrorZ_clone(arg);
16496 return tag_ptr(ret_conv, true);
16498 int64_t __attribute__((export_name("TS_CResult_StringErrorZ_clone_ptr"))) TS_CResult_StringErrorZ_clone_ptr(uint64_t arg) {
16499 LDKCResult_StringErrorZ* arg_conv = (LDKCResult_StringErrorZ*)untag_ptr(arg);
16500 int64_t ret_conv = CResult_StringErrorZ_clone_ptr(arg_conv);
16504 uint64_t __attribute__((export_name("TS_CResult_StringErrorZ_clone"))) TS_CResult_StringErrorZ_clone(uint64_t orig) {
16505 LDKCResult_StringErrorZ* orig_conv = (LDKCResult_StringErrorZ*)untag_ptr(orig);
16506 LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
16507 *ret_conv = CResult_StringErrorZ_clone(orig_conv);
16508 return tag_ptr(ret_conv, true);
16511 uint64_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_ok"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_ok(uint64_t o) {
16512 LDKChannelMonitorUpdate o_conv;
16513 o_conv.inner = untag_ptr(o);
16514 o_conv.is_owned = ptr_is_owned(o);
16515 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16516 o_conv = ChannelMonitorUpdate_clone(&o_conv);
16517 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
16518 *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_ok(o_conv);
16519 return tag_ptr(ret_conv, true);
16522 uint64_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_err"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_err(uint64_t e) {
16523 LDKDecodeError e_conv;
16524 e_conv.inner = untag_ptr(e);
16525 e_conv.is_owned = ptr_is_owned(e);
16526 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
16527 e_conv = DecodeError_clone(&e_conv);
16528 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
16529 *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_err(e_conv);
16530 return tag_ptr(ret_conv, true);
16533 jboolean __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(uint64_t o) {
16534 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* o_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(o);
16535 jboolean ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(o_conv);
16539 void __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_free"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_free(uint64_t _res) {
16540 if (!ptr_is_owned(_res)) return;
16541 void* _res_ptr = untag_ptr(_res);
16542 CHECK_ACCESS(_res_ptr);
16543 LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res_conv = *(LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(_res_ptr);
16544 FREE(untag_ptr(_res));
16545 CResult_ChannelMonitorUpdateDecodeErrorZ_free(_res_conv);
16548 static inline uint64_t CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR arg) {
16549 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
16550 *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone(arg);
16551 return tag_ptr(ret_conv, true);
16553 int64_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(uint64_t arg) {
16554 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* arg_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(arg);
16555 int64_t ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(arg_conv);
16559 uint64_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_clone"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_clone(uint64_t orig) {
16560 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* orig_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(orig);
16561 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
16562 *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone(orig_conv);
16563 return tag_ptr(ret_conv, true);
16566 uint64_t __attribute__((export_name("TS_COption_MonitorEventZ_some"))) TS_COption_MonitorEventZ_some(uint64_t o) {
16567 void* o_ptr = untag_ptr(o);
16568 CHECK_ACCESS(o_ptr);
16569 LDKMonitorEvent o_conv = *(LDKMonitorEvent*)(o_ptr);
16570 o_conv = MonitorEvent_clone((LDKMonitorEvent*)untag_ptr(o));
16571 LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
16572 *ret_copy = COption_MonitorEventZ_some(o_conv);
16573 uint64_t ret_ref = tag_ptr(ret_copy, true);
16577 uint64_t __attribute__((export_name("TS_COption_MonitorEventZ_none"))) TS_COption_MonitorEventZ_none() {
16578 LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
16579 *ret_copy = COption_MonitorEventZ_none();
16580 uint64_t ret_ref = tag_ptr(ret_copy, true);
16584 void __attribute__((export_name("TS_COption_MonitorEventZ_free"))) TS_COption_MonitorEventZ_free(uint64_t _res) {
16585 if (!ptr_is_owned(_res)) return;
16586 void* _res_ptr = untag_ptr(_res);
16587 CHECK_ACCESS(_res_ptr);
16588 LDKCOption_MonitorEventZ _res_conv = *(LDKCOption_MonitorEventZ*)(_res_ptr);
16589 FREE(untag_ptr(_res));
16590 COption_MonitorEventZ_free(_res_conv);
16593 static inline uint64_t COption_MonitorEventZ_clone_ptr(LDKCOption_MonitorEventZ *NONNULL_PTR arg) {
16594 LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
16595 *ret_copy = COption_MonitorEventZ_clone(arg);
16596 uint64_t ret_ref = tag_ptr(ret_copy, true);
16599 int64_t __attribute__((export_name("TS_COption_MonitorEventZ_clone_ptr"))) TS_COption_MonitorEventZ_clone_ptr(uint64_t arg) {
16600 LDKCOption_MonitorEventZ* arg_conv = (LDKCOption_MonitorEventZ*)untag_ptr(arg);
16601 int64_t ret_conv = COption_MonitorEventZ_clone_ptr(arg_conv);
16605 uint64_t __attribute__((export_name("TS_COption_MonitorEventZ_clone"))) TS_COption_MonitorEventZ_clone(uint64_t orig) {
16606 LDKCOption_MonitorEventZ* orig_conv = (LDKCOption_MonitorEventZ*)untag_ptr(orig);
16607 LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
16608 *ret_copy = COption_MonitorEventZ_clone(orig_conv);
16609 uint64_t ret_ref = tag_ptr(ret_copy, true);
16613 uint64_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_ok"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_ok(uint64_t o) {
16614 void* o_ptr = untag_ptr(o);
16615 CHECK_ACCESS(o_ptr);
16616 LDKCOption_MonitorEventZ o_conv = *(LDKCOption_MonitorEventZ*)(o_ptr);
16617 o_conv = COption_MonitorEventZ_clone((LDKCOption_MonitorEventZ*)untag_ptr(o));
16618 LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
16619 *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_ok(o_conv);
16620 return tag_ptr(ret_conv, true);
16623 uint64_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_err"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_err(uint64_t e) {
16624 LDKDecodeError e_conv;
16625 e_conv.inner = untag_ptr(e);
16626 e_conv.is_owned = ptr_is_owned(e);
16627 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
16628 e_conv = DecodeError_clone(&e_conv);
16629 LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
16630 *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_err(e_conv);
16631 return tag_ptr(ret_conv, true);
16634 jboolean __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_is_ok"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_is_ok(uint64_t o) {
16635 LDKCResult_COption_MonitorEventZDecodeErrorZ* o_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(o);
16636 jboolean ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_is_ok(o_conv);
16640 void __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_free"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_free(uint64_t _res) {
16641 if (!ptr_is_owned(_res)) return;
16642 void* _res_ptr = untag_ptr(_res);
16643 CHECK_ACCESS(_res_ptr);
16644 LDKCResult_COption_MonitorEventZDecodeErrorZ _res_conv = *(LDKCResult_COption_MonitorEventZDecodeErrorZ*)(_res_ptr);
16645 FREE(untag_ptr(_res));
16646 CResult_COption_MonitorEventZDecodeErrorZ_free(_res_conv);
16649 static inline uint64_t CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR arg) {
16650 LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
16651 *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone(arg);
16652 return tag_ptr(ret_conv, true);
16654 int64_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(uint64_t arg) {
16655 LDKCResult_COption_MonitorEventZDecodeErrorZ* arg_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(arg);
16656 int64_t ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(arg_conv);
16660 uint64_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_clone"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_clone(uint64_t orig) {
16661 LDKCResult_COption_MonitorEventZDecodeErrorZ* orig_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(orig);
16662 LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
16663 *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone(orig_conv);
16664 return tag_ptr(ret_conv, true);
16667 uint64_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_ok"))) TS_CResult_HTLCUpdateDecodeErrorZ_ok(uint64_t o) {
16668 LDKHTLCUpdate o_conv;
16669 o_conv.inner = untag_ptr(o);
16670 o_conv.is_owned = ptr_is_owned(o);
16671 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16672 o_conv = HTLCUpdate_clone(&o_conv);
16673 LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
16674 *ret_conv = CResult_HTLCUpdateDecodeErrorZ_ok(o_conv);
16675 return tag_ptr(ret_conv, true);
16678 uint64_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_err"))) TS_CResult_HTLCUpdateDecodeErrorZ_err(uint64_t e) {
16679 LDKDecodeError e_conv;
16680 e_conv.inner = untag_ptr(e);
16681 e_conv.is_owned = ptr_is_owned(e);
16682 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
16683 e_conv = DecodeError_clone(&e_conv);
16684 LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
16685 *ret_conv = CResult_HTLCUpdateDecodeErrorZ_err(e_conv);
16686 return tag_ptr(ret_conv, true);
16689 jboolean __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_is_ok"))) TS_CResult_HTLCUpdateDecodeErrorZ_is_ok(uint64_t o) {
16690 LDKCResult_HTLCUpdateDecodeErrorZ* o_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(o);
16691 jboolean ret_conv = CResult_HTLCUpdateDecodeErrorZ_is_ok(o_conv);
16695 void __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_free"))) TS_CResult_HTLCUpdateDecodeErrorZ_free(uint64_t _res) {
16696 if (!ptr_is_owned(_res)) return;
16697 void* _res_ptr = untag_ptr(_res);
16698 CHECK_ACCESS(_res_ptr);
16699 LDKCResult_HTLCUpdateDecodeErrorZ _res_conv = *(LDKCResult_HTLCUpdateDecodeErrorZ*)(_res_ptr);
16700 FREE(untag_ptr(_res));
16701 CResult_HTLCUpdateDecodeErrorZ_free(_res_conv);
16704 static inline uint64_t CResult_HTLCUpdateDecodeErrorZ_clone_ptr(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR arg) {
16705 LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
16706 *ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone(arg);
16707 return tag_ptr(ret_conv, true);
16709 int64_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_clone_ptr"))) TS_CResult_HTLCUpdateDecodeErrorZ_clone_ptr(uint64_t arg) {
16710 LDKCResult_HTLCUpdateDecodeErrorZ* arg_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(arg);
16711 int64_t ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone_ptr(arg_conv);
16715 uint64_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_clone"))) TS_CResult_HTLCUpdateDecodeErrorZ_clone(uint64_t orig) {
16716 LDKCResult_HTLCUpdateDecodeErrorZ* orig_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(orig);
16717 LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
16718 *ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone(orig_conv);
16719 return tag_ptr(ret_conv, true);
16722 static inline uint64_t C2Tuple_OutPointScriptZ_clone_ptr(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR arg) {
16723 LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
16724 *ret_conv = C2Tuple_OutPointScriptZ_clone(arg);
16725 return tag_ptr(ret_conv, true);
16727 int64_t __attribute__((export_name("TS_C2Tuple_OutPointScriptZ_clone_ptr"))) TS_C2Tuple_OutPointScriptZ_clone_ptr(uint64_t arg) {
16728 LDKC2Tuple_OutPointScriptZ* arg_conv = (LDKC2Tuple_OutPointScriptZ*)untag_ptr(arg);
16729 int64_t ret_conv = C2Tuple_OutPointScriptZ_clone_ptr(arg_conv);
16733 uint64_t __attribute__((export_name("TS_C2Tuple_OutPointScriptZ_clone"))) TS_C2Tuple_OutPointScriptZ_clone(uint64_t orig) {
16734 LDKC2Tuple_OutPointScriptZ* orig_conv = (LDKC2Tuple_OutPointScriptZ*)untag_ptr(orig);
16735 LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
16736 *ret_conv = C2Tuple_OutPointScriptZ_clone(orig_conv);
16737 return tag_ptr(ret_conv, true);
16740 uint64_t __attribute__((export_name("TS_C2Tuple_OutPointScriptZ_new"))) TS_C2Tuple_OutPointScriptZ_new(uint64_t a, int8_tArray b) {
16741 LDKOutPoint a_conv;
16742 a_conv.inner = untag_ptr(a);
16743 a_conv.is_owned = ptr_is_owned(a);
16744 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
16745 a_conv = OutPoint_clone(&a_conv);
16747 b_ref.datalen = b->arr_len;
16748 b_ref.data = MALLOC(b_ref.datalen, "LDKCVec_u8Z Bytes");
16749 memcpy(b_ref.data, b->elems, b_ref.datalen); FREE(b);
16750 LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
16751 *ret_conv = C2Tuple_OutPointScriptZ_new(a_conv, b_ref);
16752 return tag_ptr(ret_conv, true);
16755 void __attribute__((export_name("TS_C2Tuple_OutPointScriptZ_free"))) TS_C2Tuple_OutPointScriptZ_free(uint64_t _res) {
16756 if (!ptr_is_owned(_res)) return;
16757 void* _res_ptr = untag_ptr(_res);
16758 CHECK_ACCESS(_res_ptr);
16759 LDKC2Tuple_OutPointScriptZ _res_conv = *(LDKC2Tuple_OutPointScriptZ*)(_res_ptr);
16760 FREE(untag_ptr(_res));
16761 C2Tuple_OutPointScriptZ_free(_res_conv);
16764 static inline uint64_t C2Tuple_u32ScriptZ_clone_ptr(LDKC2Tuple_u32ScriptZ *NONNULL_PTR arg) {
16765 LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ");
16766 *ret_conv = C2Tuple_u32ScriptZ_clone(arg);
16767 return tag_ptr(ret_conv, true);
16769 int64_t __attribute__((export_name("TS_C2Tuple_u32ScriptZ_clone_ptr"))) TS_C2Tuple_u32ScriptZ_clone_ptr(uint64_t arg) {
16770 LDKC2Tuple_u32ScriptZ* arg_conv = (LDKC2Tuple_u32ScriptZ*)untag_ptr(arg);
16771 int64_t ret_conv = C2Tuple_u32ScriptZ_clone_ptr(arg_conv);
16775 uint64_t __attribute__((export_name("TS_C2Tuple_u32ScriptZ_clone"))) TS_C2Tuple_u32ScriptZ_clone(uint64_t orig) {
16776 LDKC2Tuple_u32ScriptZ* orig_conv = (LDKC2Tuple_u32ScriptZ*)untag_ptr(orig);
16777 LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ");
16778 *ret_conv = C2Tuple_u32ScriptZ_clone(orig_conv);
16779 return tag_ptr(ret_conv, true);
16782 uint64_t __attribute__((export_name("TS_C2Tuple_u32ScriptZ_new"))) TS_C2Tuple_u32ScriptZ_new(int32_t a, int8_tArray b) {
16784 b_ref.datalen = b->arr_len;
16785 b_ref.data = MALLOC(b_ref.datalen, "LDKCVec_u8Z Bytes");
16786 memcpy(b_ref.data, b->elems, b_ref.datalen); FREE(b);
16787 LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ");
16788 *ret_conv = C2Tuple_u32ScriptZ_new(a, b_ref);
16789 return tag_ptr(ret_conv, true);
16792 void __attribute__((export_name("TS_C2Tuple_u32ScriptZ_free"))) TS_C2Tuple_u32ScriptZ_free(uint64_t _res) {
16793 if (!ptr_is_owned(_res)) return;
16794 void* _res_ptr = untag_ptr(_res);
16795 CHECK_ACCESS(_res_ptr);
16796 LDKC2Tuple_u32ScriptZ _res_conv = *(LDKC2Tuple_u32ScriptZ*)(_res_ptr);
16797 FREE(untag_ptr(_res));
16798 C2Tuple_u32ScriptZ_free(_res_conv);
16801 void __attribute__((export_name("TS_CVec_C2Tuple_u32ScriptZZ_free"))) TS_CVec_C2Tuple_u32ScriptZZ_free(uint64_tArray _res) {
16802 LDKCVec_C2Tuple_u32ScriptZZ _res_constr;
16803 _res_constr.datalen = _res->arr_len;
16804 if (_res_constr.datalen > 0)
16805 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_u32ScriptZ), "LDKCVec_C2Tuple_u32ScriptZZ Elements");
16807 _res_constr.data = NULL;
16808 uint64_t* _res_vals = _res->elems;
16809 for (size_t v = 0; v < _res_constr.datalen; v++) {
16810 uint64_t _res_conv_21 = _res_vals[v];
16811 void* _res_conv_21_ptr = untag_ptr(_res_conv_21);
16812 CHECK_ACCESS(_res_conv_21_ptr);
16813 LDKC2Tuple_u32ScriptZ _res_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(_res_conv_21_ptr);
16814 FREE(untag_ptr(_res_conv_21));
16815 _res_constr.data[v] = _res_conv_21_conv;
16818 CVec_C2Tuple_u32ScriptZZ_free(_res_constr);
16821 static inline uint64_t C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR arg) {
16822 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ");
16823 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(arg);
16824 return tag_ptr(ret_conv, true);
16826 int64_t __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr"))) TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(uint64_t arg) {
16827 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* arg_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)untag_ptr(arg);
16828 int64_t ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(arg_conv);
16832 uint64_t __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone"))) TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(uint64_t orig) {
16833 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* orig_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)untag_ptr(orig);
16834 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ");
16835 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(orig_conv);
16836 return tag_ptr(ret_conv, true);
16839 uint64_t __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new"))) TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(int8_tArray a, uint64_tArray b) {
16840 LDKThirtyTwoBytes a_ref;
16841 CHECK(a->arr_len == 32);
16842 memcpy(a_ref.data, a->elems, 32); FREE(a);
16843 LDKCVec_C2Tuple_u32ScriptZZ b_constr;
16844 b_constr.datalen = b->arr_len;
16845 if (b_constr.datalen > 0)
16846 b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKC2Tuple_u32ScriptZ), "LDKCVec_C2Tuple_u32ScriptZZ Elements");
16848 b_constr.data = NULL;
16849 uint64_t* b_vals = b->elems;
16850 for (size_t v = 0; v < b_constr.datalen; v++) {
16851 uint64_t b_conv_21 = b_vals[v];
16852 void* b_conv_21_ptr = untag_ptr(b_conv_21);
16853 CHECK_ACCESS(b_conv_21_ptr);
16854 LDKC2Tuple_u32ScriptZ b_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(b_conv_21_ptr);
16855 b_conv_21_conv = C2Tuple_u32ScriptZ_clone((LDKC2Tuple_u32ScriptZ*)untag_ptr(b_conv_21));
16856 b_constr.data[v] = b_conv_21_conv;
16859 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ");
16860 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(a_ref, b_constr);
16861 return tag_ptr(ret_conv, true);
16864 void __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free"))) TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(uint64_t _res) {
16865 if (!ptr_is_owned(_res)) return;
16866 void* _res_ptr = untag_ptr(_res);
16867 CHECK_ACCESS(_res_ptr);
16868 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(_res_ptr);
16869 FREE(untag_ptr(_res));
16870 C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(_res_conv);
16873 void __attribute__((export_name("TS_CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free"))) TS_CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(uint64_tArray _res) {
16874 LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res_constr;
16875 _res_constr.datalen = _res->arr_len;
16876 if (_res_constr.datalen > 0)
16877 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ Elements");
16879 _res_constr.data = NULL;
16880 uint64_t* _res_vals = _res->elems;
16881 for (size_t o = 0; o < _res_constr.datalen; o++) {
16882 uint64_t _res_conv_40 = _res_vals[o];
16883 void* _res_conv_40_ptr = untag_ptr(_res_conv_40);
16884 CHECK_ACCESS(_res_conv_40_ptr);
16885 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv_40_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(_res_conv_40_ptr);
16886 FREE(untag_ptr(_res_conv_40));
16887 _res_constr.data[o] = _res_conv_40_conv;
16890 CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(_res_constr);
16893 void __attribute__((export_name("TS_CVec_EventZ_free"))) TS_CVec_EventZ_free(uint64_tArray _res) {
16894 LDKCVec_EventZ _res_constr;
16895 _res_constr.datalen = _res->arr_len;
16896 if (_res_constr.datalen > 0)
16897 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKEvent), "LDKCVec_EventZ Elements");
16899 _res_constr.data = NULL;
16900 uint64_t* _res_vals = _res->elems;
16901 for (size_t h = 0; h < _res_constr.datalen; h++) {
16902 uint64_t _res_conv_7 = _res_vals[h];
16903 void* _res_conv_7_ptr = untag_ptr(_res_conv_7);
16904 CHECK_ACCESS(_res_conv_7_ptr);
16905 LDKEvent _res_conv_7_conv = *(LDKEvent*)(_res_conv_7_ptr);
16906 FREE(untag_ptr(_res_conv_7));
16907 _res_constr.data[h] = _res_conv_7_conv;
16910 CVec_EventZ_free(_res_constr);
16913 void __attribute__((export_name("TS_CVec_TransactionZ_free"))) TS_CVec_TransactionZ_free(ptrArray _res) {
16914 LDKCVec_TransactionZ _res_constr;
16915 _res_constr.datalen = _res->arr_len;
16916 if (_res_constr.datalen > 0)
16917 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTransaction), "LDKCVec_TransactionZ Elements");
16919 _res_constr.data = NULL;
16920 int8_tArray* _res_vals = (void*) _res->elems;
16921 for (size_t m = 0; m < _res_constr.datalen; m++) {
16922 int8_tArray _res_conv_12 = _res_vals[m];
16923 LDKTransaction _res_conv_12_ref;
16924 _res_conv_12_ref.datalen = _res_conv_12->arr_len;
16925 _res_conv_12_ref.data = MALLOC(_res_conv_12_ref.datalen, "LDKTransaction Bytes");
16926 memcpy(_res_conv_12_ref.data, _res_conv_12->elems, _res_conv_12_ref.datalen); FREE(_res_conv_12);
16927 _res_conv_12_ref.data_is_owned = true;
16928 _res_constr.data[m] = _res_conv_12_ref;
16931 CVec_TransactionZ_free(_res_constr);
16934 static inline uint64_t C2Tuple_u32TxOutZ_clone_ptr(LDKC2Tuple_u32TxOutZ *NONNULL_PTR arg) {
16935 LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
16936 *ret_conv = C2Tuple_u32TxOutZ_clone(arg);
16937 return tag_ptr(ret_conv, true);
16939 int64_t __attribute__((export_name("TS_C2Tuple_u32TxOutZ_clone_ptr"))) TS_C2Tuple_u32TxOutZ_clone_ptr(uint64_t arg) {
16940 LDKC2Tuple_u32TxOutZ* arg_conv = (LDKC2Tuple_u32TxOutZ*)untag_ptr(arg);
16941 int64_t ret_conv = C2Tuple_u32TxOutZ_clone_ptr(arg_conv);
16945 uint64_t __attribute__((export_name("TS_C2Tuple_u32TxOutZ_clone"))) TS_C2Tuple_u32TxOutZ_clone(uint64_t orig) {
16946 LDKC2Tuple_u32TxOutZ* orig_conv = (LDKC2Tuple_u32TxOutZ*)untag_ptr(orig);
16947 LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
16948 *ret_conv = C2Tuple_u32TxOutZ_clone(orig_conv);
16949 return tag_ptr(ret_conv, true);
16952 uint64_t __attribute__((export_name("TS_C2Tuple_u32TxOutZ_new"))) TS_C2Tuple_u32TxOutZ_new(int32_t a, uint64_t b) {
16953 void* b_ptr = untag_ptr(b);
16954 CHECK_ACCESS(b_ptr);
16955 LDKTxOut b_conv = *(LDKTxOut*)(b_ptr);
16956 b_conv = TxOut_clone((LDKTxOut*)untag_ptr(b));
16957 LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
16958 *ret_conv = C2Tuple_u32TxOutZ_new(a, b_conv);
16959 return tag_ptr(ret_conv, true);
16962 void __attribute__((export_name("TS_C2Tuple_u32TxOutZ_free"))) TS_C2Tuple_u32TxOutZ_free(uint64_t _res) {
16963 if (!ptr_is_owned(_res)) return;
16964 void* _res_ptr = untag_ptr(_res);
16965 CHECK_ACCESS(_res_ptr);
16966 LDKC2Tuple_u32TxOutZ _res_conv = *(LDKC2Tuple_u32TxOutZ*)(_res_ptr);
16967 FREE(untag_ptr(_res));
16968 C2Tuple_u32TxOutZ_free(_res_conv);
16971 void __attribute__((export_name("TS_CVec_C2Tuple_u32TxOutZZ_free"))) TS_CVec_C2Tuple_u32TxOutZZ_free(uint64_tArray _res) {
16972 LDKCVec_C2Tuple_u32TxOutZZ _res_constr;
16973 _res_constr.datalen = _res->arr_len;
16974 if (_res_constr.datalen > 0)
16975 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_u32TxOutZ), "LDKCVec_C2Tuple_u32TxOutZZ Elements");
16977 _res_constr.data = NULL;
16978 uint64_t* _res_vals = _res->elems;
16979 for (size_t u = 0; u < _res_constr.datalen; u++) {
16980 uint64_t _res_conv_20 = _res_vals[u];
16981 void* _res_conv_20_ptr = untag_ptr(_res_conv_20);
16982 CHECK_ACCESS(_res_conv_20_ptr);
16983 LDKC2Tuple_u32TxOutZ _res_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(_res_conv_20_ptr);
16984 FREE(untag_ptr(_res_conv_20));
16985 _res_constr.data[u] = _res_conv_20_conv;
16988 CVec_C2Tuple_u32TxOutZZ_free(_res_constr);
16991 static inline uint64_t C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR arg) {
16992 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
16993 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(arg);
16994 return tag_ptr(ret_conv, true);
16996 int64_t __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr"))) TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(uint64_t arg) {
16997 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* arg_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)untag_ptr(arg);
16998 int64_t ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(arg_conv);
17002 uint64_t __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone"))) TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(uint64_t orig) {
17003 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* orig_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)untag_ptr(orig);
17004 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
17005 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(orig_conv);
17006 return tag_ptr(ret_conv, true);
17009 uint64_t __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new"))) TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(int8_tArray a, uint64_tArray b) {
17010 LDKThirtyTwoBytes a_ref;
17011 CHECK(a->arr_len == 32);
17012 memcpy(a_ref.data, a->elems, 32); FREE(a);
17013 LDKCVec_C2Tuple_u32TxOutZZ b_constr;
17014 b_constr.datalen = b->arr_len;
17015 if (b_constr.datalen > 0)
17016 b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKC2Tuple_u32TxOutZ), "LDKCVec_C2Tuple_u32TxOutZZ Elements");
17018 b_constr.data = NULL;
17019 uint64_t* b_vals = b->elems;
17020 for (size_t u = 0; u < b_constr.datalen; u++) {
17021 uint64_t b_conv_20 = b_vals[u];
17022 void* b_conv_20_ptr = untag_ptr(b_conv_20);
17023 CHECK_ACCESS(b_conv_20_ptr);
17024 LDKC2Tuple_u32TxOutZ b_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(b_conv_20_ptr);
17025 b_conv_20_conv = C2Tuple_u32TxOutZ_clone((LDKC2Tuple_u32TxOutZ*)untag_ptr(b_conv_20));
17026 b_constr.data[u] = b_conv_20_conv;
17029 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
17030 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(a_ref, b_constr);
17031 return tag_ptr(ret_conv, true);
17034 void __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free"))) TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(uint64_t _res) {
17035 if (!ptr_is_owned(_res)) return;
17036 void* _res_ptr = untag_ptr(_res);
17037 CHECK_ACCESS(_res_ptr);
17038 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(_res_ptr);
17039 FREE(untag_ptr(_res));
17040 C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(_res_conv);
17043 void __attribute__((export_name("TS_CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free"))) TS_CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free(uint64_tArray _res) {
17044 LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ _res_constr;
17045 _res_constr.datalen = _res->arr_len;
17046 if (_res_constr.datalen > 0)
17047 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ Elements");
17049 _res_constr.data = NULL;
17050 uint64_t* _res_vals = _res->elems;
17051 for (size_t n = 0; n < _res_constr.datalen; n++) {
17052 uint64_t _res_conv_39 = _res_vals[n];
17053 void* _res_conv_39_ptr = untag_ptr(_res_conv_39);
17054 CHECK_ACCESS(_res_conv_39_ptr);
17055 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv_39_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(_res_conv_39_ptr);
17056 FREE(untag_ptr(_res_conv_39));
17057 _res_constr.data[n] = _res_conv_39_conv;
17060 CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free(_res_constr);
17063 void __attribute__((export_name("TS_CVec_BalanceZ_free"))) TS_CVec_BalanceZ_free(uint64_tArray _res) {
17064 LDKCVec_BalanceZ _res_constr;
17065 _res_constr.datalen = _res->arr_len;
17066 if (_res_constr.datalen > 0)
17067 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKBalance), "LDKCVec_BalanceZ Elements");
17069 _res_constr.data = NULL;
17070 uint64_t* _res_vals = _res->elems;
17071 for (size_t j = 0; j < _res_constr.datalen; j++) {
17072 uint64_t _res_conv_9 = _res_vals[j];
17073 void* _res_conv_9_ptr = untag_ptr(_res_conv_9);
17074 CHECK_ACCESS(_res_conv_9_ptr);
17075 LDKBalance _res_conv_9_conv = *(LDKBalance*)(_res_conv_9_ptr);
17076 FREE(untag_ptr(_res_conv_9));
17077 _res_constr.data[j] = _res_conv_9_conv;
17080 CVec_BalanceZ_free(_res_constr);
17083 static inline uint64_t C2Tuple_BlockHashChannelMonitorZ_clone_ptr(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR arg) {
17084 LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
17085 *ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone(arg);
17086 return tag_ptr(ret_conv, true);
17088 int64_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_clone_ptr"))) TS_C2Tuple_BlockHashChannelMonitorZ_clone_ptr(uint64_t arg) {
17089 LDKC2Tuple_BlockHashChannelMonitorZ* arg_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(arg);
17090 int64_t ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone_ptr(arg_conv);
17094 uint64_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_clone"))) TS_C2Tuple_BlockHashChannelMonitorZ_clone(uint64_t orig) {
17095 LDKC2Tuple_BlockHashChannelMonitorZ* orig_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(orig);
17096 LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
17097 *ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone(orig_conv);
17098 return tag_ptr(ret_conv, true);
17101 uint64_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_new"))) TS_C2Tuple_BlockHashChannelMonitorZ_new(int8_tArray a, uint64_t b) {
17102 LDKThirtyTwoBytes a_ref;
17103 CHECK(a->arr_len == 32);
17104 memcpy(a_ref.data, a->elems, 32); FREE(a);
17105 LDKChannelMonitor b_conv;
17106 b_conv.inner = untag_ptr(b);
17107 b_conv.is_owned = ptr_is_owned(b);
17108 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
17109 b_conv = ChannelMonitor_clone(&b_conv);
17110 LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
17111 *ret_conv = C2Tuple_BlockHashChannelMonitorZ_new(a_ref, b_conv);
17112 return tag_ptr(ret_conv, true);
17115 void __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_free"))) TS_C2Tuple_BlockHashChannelMonitorZ_free(uint64_t _res) {
17116 if (!ptr_is_owned(_res)) return;
17117 void* _res_ptr = untag_ptr(_res);
17118 CHECK_ACCESS(_res_ptr);
17119 LDKC2Tuple_BlockHashChannelMonitorZ _res_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(_res_ptr);
17120 FREE(untag_ptr(_res));
17121 C2Tuple_BlockHashChannelMonitorZ_free(_res_conv);
17124 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(uint64_t o) {
17125 void* o_ptr = untag_ptr(o);
17126 CHECK_ACCESS(o_ptr);
17127 LDKC2Tuple_BlockHashChannelMonitorZ o_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(o_ptr);
17128 o_conv = C2Tuple_BlockHashChannelMonitorZ_clone((LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(o));
17129 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
17130 *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(o_conv);
17131 return tag_ptr(ret_conv, true);
17134 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(uint64_t e) {
17135 LDKDecodeError e_conv;
17136 e_conv.inner = untag_ptr(e);
17137 e_conv.is_owned = ptr_is_owned(e);
17138 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17139 e_conv = DecodeError_clone(&e_conv);
17140 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
17141 *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(e_conv);
17142 return tag_ptr(ret_conv, true);
17145 jboolean __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(uint64_t o) {
17146 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* o_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(o);
17147 jboolean ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(o_conv);
17151 void __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(uint64_t _res) {
17152 if (!ptr_is_owned(_res)) return;
17153 void* _res_ptr = untag_ptr(_res);
17154 CHECK_ACCESS(_res_ptr);
17155 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(_res_ptr);
17156 FREE(untag_ptr(_res));
17157 CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(_res_conv);
17160 static inline uint64_t CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR arg) {
17161 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
17162 *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(arg);
17163 return tag_ptr(ret_conv, true);
17165 int64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(uint64_t arg) {
17166 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* arg_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(arg);
17167 int64_t ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(arg_conv);
17171 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(uint64_t orig) {
17172 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* orig_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(orig);
17173 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
17174 *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(orig_conv);
17175 return tag_ptr(ret_conv, true);
17178 static inline uint64_t C2Tuple_PublicKeyTypeZ_clone_ptr(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR arg) {
17179 LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
17180 *ret_conv = C2Tuple_PublicKeyTypeZ_clone(arg);
17181 return tag_ptr(ret_conv, true);
17183 int64_t __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_clone_ptr"))) TS_C2Tuple_PublicKeyTypeZ_clone_ptr(uint64_t arg) {
17184 LDKC2Tuple_PublicKeyTypeZ* arg_conv = (LDKC2Tuple_PublicKeyTypeZ*)untag_ptr(arg);
17185 int64_t ret_conv = C2Tuple_PublicKeyTypeZ_clone_ptr(arg_conv);
17189 uint64_t __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_clone"))) TS_C2Tuple_PublicKeyTypeZ_clone(uint64_t orig) {
17190 LDKC2Tuple_PublicKeyTypeZ* orig_conv = (LDKC2Tuple_PublicKeyTypeZ*)untag_ptr(orig);
17191 LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
17192 *ret_conv = C2Tuple_PublicKeyTypeZ_clone(orig_conv);
17193 return tag_ptr(ret_conv, true);
17196 uint64_t __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_new"))) TS_C2Tuple_PublicKeyTypeZ_new(int8_tArray a, uint64_t b) {
17197 LDKPublicKey a_ref;
17198 CHECK(a->arr_len == 33);
17199 memcpy(a_ref.compressed_form, a->elems, 33); FREE(a);
17200 void* b_ptr = untag_ptr(b);
17201 CHECK_ACCESS(b_ptr);
17202 LDKType b_conv = *(LDKType*)(b_ptr);
17203 if (b_conv.free == LDKType_JCalls_free) {
17204 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
17205 LDKType_JCalls_cloned(&b_conv);
17207 LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
17208 *ret_conv = C2Tuple_PublicKeyTypeZ_new(a_ref, b_conv);
17209 return tag_ptr(ret_conv, true);
17212 void __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_free"))) TS_C2Tuple_PublicKeyTypeZ_free(uint64_t _res) {
17213 if (!ptr_is_owned(_res)) return;
17214 void* _res_ptr = untag_ptr(_res);
17215 CHECK_ACCESS(_res_ptr);
17216 LDKC2Tuple_PublicKeyTypeZ _res_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(_res_ptr);
17217 FREE(untag_ptr(_res));
17218 C2Tuple_PublicKeyTypeZ_free(_res_conv);
17221 void __attribute__((export_name("TS_CVec_C2Tuple_PublicKeyTypeZZ_free"))) TS_CVec_C2Tuple_PublicKeyTypeZZ_free(uint64_tArray _res) {
17222 LDKCVec_C2Tuple_PublicKeyTypeZZ _res_constr;
17223 _res_constr.datalen = _res->arr_len;
17224 if (_res_constr.datalen > 0)
17225 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKCVec_C2Tuple_PublicKeyTypeZZ Elements");
17227 _res_constr.data = NULL;
17228 uint64_t* _res_vals = _res->elems;
17229 for (size_t z = 0; z < _res_constr.datalen; z++) {
17230 uint64_t _res_conv_25 = _res_vals[z];
17231 void* _res_conv_25_ptr = untag_ptr(_res_conv_25);
17232 CHECK_ACCESS(_res_conv_25_ptr);
17233 LDKC2Tuple_PublicKeyTypeZ _res_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(_res_conv_25_ptr);
17234 FREE(untag_ptr(_res_conv_25));
17235 _res_constr.data[z] = _res_conv_25_conv;
17238 CVec_C2Tuple_PublicKeyTypeZZ_free(_res_constr);
17241 uint64_t __attribute__((export_name("TS_COption_NetAddressZ_some"))) TS_COption_NetAddressZ_some(uint64_t o) {
17242 void* o_ptr = untag_ptr(o);
17243 CHECK_ACCESS(o_ptr);
17244 LDKNetAddress o_conv = *(LDKNetAddress*)(o_ptr);
17245 o_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(o));
17246 LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
17247 *ret_copy = COption_NetAddressZ_some(o_conv);
17248 uint64_t ret_ref = tag_ptr(ret_copy, true);
17252 uint64_t __attribute__((export_name("TS_COption_NetAddressZ_none"))) TS_COption_NetAddressZ_none() {
17253 LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
17254 *ret_copy = COption_NetAddressZ_none();
17255 uint64_t ret_ref = tag_ptr(ret_copy, true);
17259 void __attribute__((export_name("TS_COption_NetAddressZ_free"))) TS_COption_NetAddressZ_free(uint64_t _res) {
17260 if (!ptr_is_owned(_res)) return;
17261 void* _res_ptr = untag_ptr(_res);
17262 CHECK_ACCESS(_res_ptr);
17263 LDKCOption_NetAddressZ _res_conv = *(LDKCOption_NetAddressZ*)(_res_ptr);
17264 FREE(untag_ptr(_res));
17265 COption_NetAddressZ_free(_res_conv);
17268 static inline uint64_t COption_NetAddressZ_clone_ptr(LDKCOption_NetAddressZ *NONNULL_PTR arg) {
17269 LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
17270 *ret_copy = COption_NetAddressZ_clone(arg);
17271 uint64_t ret_ref = tag_ptr(ret_copy, true);
17274 int64_t __attribute__((export_name("TS_COption_NetAddressZ_clone_ptr"))) TS_COption_NetAddressZ_clone_ptr(uint64_t arg) {
17275 LDKCOption_NetAddressZ* arg_conv = (LDKCOption_NetAddressZ*)untag_ptr(arg);
17276 int64_t ret_conv = COption_NetAddressZ_clone_ptr(arg_conv);
17280 uint64_t __attribute__((export_name("TS_COption_NetAddressZ_clone"))) TS_COption_NetAddressZ_clone(uint64_t orig) {
17281 LDKCOption_NetAddressZ* orig_conv = (LDKCOption_NetAddressZ*)untag_ptr(orig);
17282 LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
17283 *ret_copy = COption_NetAddressZ_clone(orig_conv);
17284 uint64_t ret_ref = tag_ptr(ret_copy, true);
17288 uint64_t __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_ok"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_ok(int8_tArray o) {
17290 o_ref.datalen = o->arr_len;
17291 o_ref.data = MALLOC(o_ref.datalen, "LDKCVec_u8Z Bytes");
17292 memcpy(o_ref.data, o->elems, o_ref.datalen); FREE(o);
17293 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
17294 *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_ok(o_ref);
17295 return tag_ptr(ret_conv, true);
17298 uint64_t __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_err"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_err(uint64_t e) {
17299 LDKPeerHandleError e_conv;
17300 e_conv.inner = untag_ptr(e);
17301 e_conv.is_owned = ptr_is_owned(e);
17302 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17303 e_conv = PeerHandleError_clone(&e_conv);
17304 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
17305 *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_err(e_conv);
17306 return tag_ptr(ret_conv, true);
17309 jboolean __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_is_ok"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_is_ok(uint64_t o) {
17310 LDKCResult_CVec_u8ZPeerHandleErrorZ* o_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(o);
17311 jboolean ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_is_ok(o_conv);
17315 void __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_free"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_free(uint64_t _res) {
17316 if (!ptr_is_owned(_res)) return;
17317 void* _res_ptr = untag_ptr(_res);
17318 CHECK_ACCESS(_res_ptr);
17319 LDKCResult_CVec_u8ZPeerHandleErrorZ _res_conv = *(LDKCResult_CVec_u8ZPeerHandleErrorZ*)(_res_ptr);
17320 FREE(untag_ptr(_res));
17321 CResult_CVec_u8ZPeerHandleErrorZ_free(_res_conv);
17324 static inline uint64_t CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR arg) {
17325 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
17326 *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone(arg);
17327 return tag_ptr(ret_conv, true);
17329 int64_t __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(uint64_t arg) {
17330 LDKCResult_CVec_u8ZPeerHandleErrorZ* arg_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(arg);
17331 int64_t ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(arg_conv);
17335 uint64_t __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_clone"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_clone(uint64_t orig) {
17336 LDKCResult_CVec_u8ZPeerHandleErrorZ* orig_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(orig);
17337 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
17338 *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone(orig_conv);
17339 return tag_ptr(ret_conv, true);
17342 uint64_t __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_ok"))) TS_CResult_NonePeerHandleErrorZ_ok() {
17343 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
17344 *ret_conv = CResult_NonePeerHandleErrorZ_ok();
17345 return tag_ptr(ret_conv, true);
17348 uint64_t __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_err"))) TS_CResult_NonePeerHandleErrorZ_err(uint64_t e) {
17349 LDKPeerHandleError e_conv;
17350 e_conv.inner = untag_ptr(e);
17351 e_conv.is_owned = ptr_is_owned(e);
17352 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17353 e_conv = PeerHandleError_clone(&e_conv);
17354 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
17355 *ret_conv = CResult_NonePeerHandleErrorZ_err(e_conv);
17356 return tag_ptr(ret_conv, true);
17359 jboolean __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_is_ok"))) TS_CResult_NonePeerHandleErrorZ_is_ok(uint64_t o) {
17360 LDKCResult_NonePeerHandleErrorZ* o_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(o);
17361 jboolean ret_conv = CResult_NonePeerHandleErrorZ_is_ok(o_conv);
17365 void __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_free"))) TS_CResult_NonePeerHandleErrorZ_free(uint64_t _res) {
17366 if (!ptr_is_owned(_res)) return;
17367 void* _res_ptr = untag_ptr(_res);
17368 CHECK_ACCESS(_res_ptr);
17369 LDKCResult_NonePeerHandleErrorZ _res_conv = *(LDKCResult_NonePeerHandleErrorZ*)(_res_ptr);
17370 FREE(untag_ptr(_res));
17371 CResult_NonePeerHandleErrorZ_free(_res_conv);
17374 static inline uint64_t CResult_NonePeerHandleErrorZ_clone_ptr(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR arg) {
17375 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
17376 *ret_conv = CResult_NonePeerHandleErrorZ_clone(arg);
17377 return tag_ptr(ret_conv, true);
17379 int64_t __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_clone_ptr"))) TS_CResult_NonePeerHandleErrorZ_clone_ptr(uint64_t arg) {
17380 LDKCResult_NonePeerHandleErrorZ* arg_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(arg);
17381 int64_t ret_conv = CResult_NonePeerHandleErrorZ_clone_ptr(arg_conv);
17385 uint64_t __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_clone"))) TS_CResult_NonePeerHandleErrorZ_clone(uint64_t orig) {
17386 LDKCResult_NonePeerHandleErrorZ* orig_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(orig);
17387 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
17388 *ret_conv = CResult_NonePeerHandleErrorZ_clone(orig_conv);
17389 return tag_ptr(ret_conv, true);
17392 uint64_t __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_ok"))) TS_CResult_boolPeerHandleErrorZ_ok(jboolean o) {
17393 LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
17394 *ret_conv = CResult_boolPeerHandleErrorZ_ok(o);
17395 return tag_ptr(ret_conv, true);
17398 uint64_t __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_err"))) TS_CResult_boolPeerHandleErrorZ_err(uint64_t e) {
17399 LDKPeerHandleError e_conv;
17400 e_conv.inner = untag_ptr(e);
17401 e_conv.is_owned = ptr_is_owned(e);
17402 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17403 e_conv = PeerHandleError_clone(&e_conv);
17404 LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
17405 *ret_conv = CResult_boolPeerHandleErrorZ_err(e_conv);
17406 return tag_ptr(ret_conv, true);
17409 jboolean __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_is_ok"))) TS_CResult_boolPeerHandleErrorZ_is_ok(uint64_t o) {
17410 LDKCResult_boolPeerHandleErrorZ* o_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(o);
17411 jboolean ret_conv = CResult_boolPeerHandleErrorZ_is_ok(o_conv);
17415 void __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_free"))) TS_CResult_boolPeerHandleErrorZ_free(uint64_t _res) {
17416 if (!ptr_is_owned(_res)) return;
17417 void* _res_ptr = untag_ptr(_res);
17418 CHECK_ACCESS(_res_ptr);
17419 LDKCResult_boolPeerHandleErrorZ _res_conv = *(LDKCResult_boolPeerHandleErrorZ*)(_res_ptr);
17420 FREE(untag_ptr(_res));
17421 CResult_boolPeerHandleErrorZ_free(_res_conv);
17424 static inline uint64_t CResult_boolPeerHandleErrorZ_clone_ptr(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR arg) {
17425 LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
17426 *ret_conv = CResult_boolPeerHandleErrorZ_clone(arg);
17427 return tag_ptr(ret_conv, true);
17429 int64_t __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_clone_ptr"))) TS_CResult_boolPeerHandleErrorZ_clone_ptr(uint64_t arg) {
17430 LDKCResult_boolPeerHandleErrorZ* arg_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(arg);
17431 int64_t ret_conv = CResult_boolPeerHandleErrorZ_clone_ptr(arg_conv);
17435 uint64_t __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_clone"))) TS_CResult_boolPeerHandleErrorZ_clone(uint64_t orig) {
17436 LDKCResult_boolPeerHandleErrorZ* orig_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(orig);
17437 LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
17438 *ret_conv = CResult_boolPeerHandleErrorZ_clone(orig_conv);
17439 return tag_ptr(ret_conv, true);
17442 uint64_t __attribute__((export_name("TS_CResult_NoneErrorZ_ok"))) TS_CResult_NoneErrorZ_ok() {
17443 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
17444 *ret_conv = CResult_NoneErrorZ_ok();
17445 return tag_ptr(ret_conv, true);
17448 uint64_t __attribute__((export_name("TS_CResult_NoneErrorZ_err"))) TS_CResult_NoneErrorZ_err(uint32_t e) {
17449 LDKIOError e_conv = LDKIOError_from_js(e);
17450 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
17451 *ret_conv = CResult_NoneErrorZ_err(e_conv);
17452 return tag_ptr(ret_conv, true);
17455 jboolean __attribute__((export_name("TS_CResult_NoneErrorZ_is_ok"))) TS_CResult_NoneErrorZ_is_ok(uint64_t o) {
17456 LDKCResult_NoneErrorZ* o_conv = (LDKCResult_NoneErrorZ*)untag_ptr(o);
17457 jboolean ret_conv = CResult_NoneErrorZ_is_ok(o_conv);
17461 void __attribute__((export_name("TS_CResult_NoneErrorZ_free"))) TS_CResult_NoneErrorZ_free(uint64_t _res) {
17462 if (!ptr_is_owned(_res)) return;
17463 void* _res_ptr = untag_ptr(_res);
17464 CHECK_ACCESS(_res_ptr);
17465 LDKCResult_NoneErrorZ _res_conv = *(LDKCResult_NoneErrorZ*)(_res_ptr);
17466 FREE(untag_ptr(_res));
17467 CResult_NoneErrorZ_free(_res_conv);
17470 static inline uint64_t CResult_NoneErrorZ_clone_ptr(LDKCResult_NoneErrorZ *NONNULL_PTR arg) {
17471 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
17472 *ret_conv = CResult_NoneErrorZ_clone(arg);
17473 return tag_ptr(ret_conv, true);
17475 int64_t __attribute__((export_name("TS_CResult_NoneErrorZ_clone_ptr"))) TS_CResult_NoneErrorZ_clone_ptr(uint64_t arg) {
17476 LDKCResult_NoneErrorZ* arg_conv = (LDKCResult_NoneErrorZ*)untag_ptr(arg);
17477 int64_t ret_conv = CResult_NoneErrorZ_clone_ptr(arg_conv);
17481 uint64_t __attribute__((export_name("TS_CResult_NoneErrorZ_clone"))) TS_CResult_NoneErrorZ_clone(uint64_t orig) {
17482 LDKCResult_NoneErrorZ* orig_conv = (LDKCResult_NoneErrorZ*)untag_ptr(orig);
17483 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
17484 *ret_conv = CResult_NoneErrorZ_clone(orig_conv);
17485 return tag_ptr(ret_conv, true);
17488 uint64_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_ok"))) TS_CResult_NetAddressDecodeErrorZ_ok(uint64_t o) {
17489 void* o_ptr = untag_ptr(o);
17490 CHECK_ACCESS(o_ptr);
17491 LDKNetAddress o_conv = *(LDKNetAddress*)(o_ptr);
17492 o_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(o));
17493 LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
17494 *ret_conv = CResult_NetAddressDecodeErrorZ_ok(o_conv);
17495 return tag_ptr(ret_conv, true);
17498 uint64_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_err"))) TS_CResult_NetAddressDecodeErrorZ_err(uint64_t e) {
17499 LDKDecodeError e_conv;
17500 e_conv.inner = untag_ptr(e);
17501 e_conv.is_owned = ptr_is_owned(e);
17502 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17503 e_conv = DecodeError_clone(&e_conv);
17504 LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
17505 *ret_conv = CResult_NetAddressDecodeErrorZ_err(e_conv);
17506 return tag_ptr(ret_conv, true);
17509 jboolean __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_is_ok"))) TS_CResult_NetAddressDecodeErrorZ_is_ok(uint64_t o) {
17510 LDKCResult_NetAddressDecodeErrorZ* o_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(o);
17511 jboolean ret_conv = CResult_NetAddressDecodeErrorZ_is_ok(o_conv);
17515 void __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_free"))) TS_CResult_NetAddressDecodeErrorZ_free(uint64_t _res) {
17516 if (!ptr_is_owned(_res)) return;
17517 void* _res_ptr = untag_ptr(_res);
17518 CHECK_ACCESS(_res_ptr);
17519 LDKCResult_NetAddressDecodeErrorZ _res_conv = *(LDKCResult_NetAddressDecodeErrorZ*)(_res_ptr);
17520 FREE(untag_ptr(_res));
17521 CResult_NetAddressDecodeErrorZ_free(_res_conv);
17524 static inline uint64_t CResult_NetAddressDecodeErrorZ_clone_ptr(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR arg) {
17525 LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
17526 *ret_conv = CResult_NetAddressDecodeErrorZ_clone(arg);
17527 return tag_ptr(ret_conv, true);
17529 int64_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_clone_ptr"))) TS_CResult_NetAddressDecodeErrorZ_clone_ptr(uint64_t arg) {
17530 LDKCResult_NetAddressDecodeErrorZ* arg_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(arg);
17531 int64_t ret_conv = CResult_NetAddressDecodeErrorZ_clone_ptr(arg_conv);
17535 uint64_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_clone"))) TS_CResult_NetAddressDecodeErrorZ_clone(uint64_t orig) {
17536 LDKCResult_NetAddressDecodeErrorZ* orig_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(orig);
17537 LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
17538 *ret_conv = CResult_NetAddressDecodeErrorZ_clone(orig_conv);
17539 return tag_ptr(ret_conv, true);
17542 void __attribute__((export_name("TS_CVec_UpdateAddHTLCZ_free"))) TS_CVec_UpdateAddHTLCZ_free(uint64_tArray _res) {
17543 LDKCVec_UpdateAddHTLCZ _res_constr;
17544 _res_constr.datalen = _res->arr_len;
17545 if (_res_constr.datalen > 0)
17546 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements");
17548 _res_constr.data = NULL;
17549 uint64_t* _res_vals = _res->elems;
17550 for (size_t p = 0; p < _res_constr.datalen; p++) {
17551 uint64_t _res_conv_15 = _res_vals[p];
17552 LDKUpdateAddHTLC _res_conv_15_conv;
17553 _res_conv_15_conv.inner = untag_ptr(_res_conv_15);
17554 _res_conv_15_conv.is_owned = ptr_is_owned(_res_conv_15);
17555 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_15_conv);
17556 _res_constr.data[p] = _res_conv_15_conv;
17559 CVec_UpdateAddHTLCZ_free(_res_constr);
17562 void __attribute__((export_name("TS_CVec_UpdateFulfillHTLCZ_free"))) TS_CVec_UpdateFulfillHTLCZ_free(uint64_tArray _res) {
17563 LDKCVec_UpdateFulfillHTLCZ _res_constr;
17564 _res_constr.datalen = _res->arr_len;
17565 if (_res_constr.datalen > 0)
17566 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements");
17568 _res_constr.data = NULL;
17569 uint64_t* _res_vals = _res->elems;
17570 for (size_t t = 0; t < _res_constr.datalen; t++) {
17571 uint64_t _res_conv_19 = _res_vals[t];
17572 LDKUpdateFulfillHTLC _res_conv_19_conv;
17573 _res_conv_19_conv.inner = untag_ptr(_res_conv_19);
17574 _res_conv_19_conv.is_owned = ptr_is_owned(_res_conv_19);
17575 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_19_conv);
17576 _res_constr.data[t] = _res_conv_19_conv;
17579 CVec_UpdateFulfillHTLCZ_free(_res_constr);
17582 void __attribute__((export_name("TS_CVec_UpdateFailHTLCZ_free"))) TS_CVec_UpdateFailHTLCZ_free(uint64_tArray _res) {
17583 LDKCVec_UpdateFailHTLCZ _res_constr;
17584 _res_constr.datalen = _res->arr_len;
17585 if (_res_constr.datalen > 0)
17586 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements");
17588 _res_constr.data = NULL;
17589 uint64_t* _res_vals = _res->elems;
17590 for (size_t q = 0; q < _res_constr.datalen; q++) {
17591 uint64_t _res_conv_16 = _res_vals[q];
17592 LDKUpdateFailHTLC _res_conv_16_conv;
17593 _res_conv_16_conv.inner = untag_ptr(_res_conv_16);
17594 _res_conv_16_conv.is_owned = ptr_is_owned(_res_conv_16);
17595 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv);
17596 _res_constr.data[q] = _res_conv_16_conv;
17599 CVec_UpdateFailHTLCZ_free(_res_constr);
17602 void __attribute__((export_name("TS_CVec_UpdateFailMalformedHTLCZ_free"))) TS_CVec_UpdateFailMalformedHTLCZ_free(uint64_tArray _res) {
17603 LDKCVec_UpdateFailMalformedHTLCZ _res_constr;
17604 _res_constr.datalen = _res->arr_len;
17605 if (_res_constr.datalen > 0)
17606 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements");
17608 _res_constr.data = NULL;
17609 uint64_t* _res_vals = _res->elems;
17610 for (size_t z = 0; z < _res_constr.datalen; z++) {
17611 uint64_t _res_conv_25 = _res_vals[z];
17612 LDKUpdateFailMalformedHTLC _res_conv_25_conv;
17613 _res_conv_25_conv.inner = untag_ptr(_res_conv_25);
17614 _res_conv_25_conv.is_owned = ptr_is_owned(_res_conv_25);
17615 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_25_conv);
17616 _res_constr.data[z] = _res_conv_25_conv;
17619 CVec_UpdateFailMalformedHTLCZ_free(_res_constr);
17622 uint64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_ok"))) TS_CResult_AcceptChannelDecodeErrorZ_ok(uint64_t o) {
17623 LDKAcceptChannel o_conv;
17624 o_conv.inner = untag_ptr(o);
17625 o_conv.is_owned = ptr_is_owned(o);
17626 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17627 o_conv = AcceptChannel_clone(&o_conv);
17628 LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
17629 *ret_conv = CResult_AcceptChannelDecodeErrorZ_ok(o_conv);
17630 return tag_ptr(ret_conv, true);
17633 uint64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_err"))) TS_CResult_AcceptChannelDecodeErrorZ_err(uint64_t e) {
17634 LDKDecodeError e_conv;
17635 e_conv.inner = untag_ptr(e);
17636 e_conv.is_owned = ptr_is_owned(e);
17637 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17638 e_conv = DecodeError_clone(&e_conv);
17639 LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
17640 *ret_conv = CResult_AcceptChannelDecodeErrorZ_err(e_conv);
17641 return tag_ptr(ret_conv, true);
17644 jboolean __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_is_ok"))) TS_CResult_AcceptChannelDecodeErrorZ_is_ok(uint64_t o) {
17645 LDKCResult_AcceptChannelDecodeErrorZ* o_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(o);
17646 jboolean ret_conv = CResult_AcceptChannelDecodeErrorZ_is_ok(o_conv);
17650 void __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_free"))) TS_CResult_AcceptChannelDecodeErrorZ_free(uint64_t _res) {
17651 if (!ptr_is_owned(_res)) return;
17652 void* _res_ptr = untag_ptr(_res);
17653 CHECK_ACCESS(_res_ptr);
17654 LDKCResult_AcceptChannelDecodeErrorZ _res_conv = *(LDKCResult_AcceptChannelDecodeErrorZ*)(_res_ptr);
17655 FREE(untag_ptr(_res));
17656 CResult_AcceptChannelDecodeErrorZ_free(_res_conv);
17659 static inline uint64_t CResult_AcceptChannelDecodeErrorZ_clone_ptr(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR arg) {
17660 LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
17661 *ret_conv = CResult_AcceptChannelDecodeErrorZ_clone(arg);
17662 return tag_ptr(ret_conv, true);
17664 int64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_clone_ptr"))) TS_CResult_AcceptChannelDecodeErrorZ_clone_ptr(uint64_t arg) {
17665 LDKCResult_AcceptChannelDecodeErrorZ* arg_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(arg);
17666 int64_t ret_conv = CResult_AcceptChannelDecodeErrorZ_clone_ptr(arg_conv);
17670 uint64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_clone"))) TS_CResult_AcceptChannelDecodeErrorZ_clone(uint64_t orig) {
17671 LDKCResult_AcceptChannelDecodeErrorZ* orig_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(orig);
17672 LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
17673 *ret_conv = CResult_AcceptChannelDecodeErrorZ_clone(orig_conv);
17674 return tag_ptr(ret_conv, true);
17677 uint64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_ok"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_ok(uint64_t o) {
17678 LDKAnnouncementSignatures o_conv;
17679 o_conv.inner = untag_ptr(o);
17680 o_conv.is_owned = ptr_is_owned(o);
17681 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17682 o_conv = AnnouncementSignatures_clone(&o_conv);
17683 LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
17684 *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_ok(o_conv);
17685 return tag_ptr(ret_conv, true);
17688 uint64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_err"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_err(uint64_t e) {
17689 LDKDecodeError e_conv;
17690 e_conv.inner = untag_ptr(e);
17691 e_conv.is_owned = ptr_is_owned(e);
17692 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17693 e_conv = DecodeError_clone(&e_conv);
17694 LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
17695 *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_err(e_conv);
17696 return tag_ptr(ret_conv, true);
17699 jboolean __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_is_ok"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(uint64_t o) {
17700 LDKCResult_AnnouncementSignaturesDecodeErrorZ* o_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(o);
17701 jboolean ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(o_conv);
17705 void __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_free"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_free(uint64_t _res) {
17706 if (!ptr_is_owned(_res)) return;
17707 void* _res_ptr = untag_ptr(_res);
17708 CHECK_ACCESS(_res_ptr);
17709 LDKCResult_AnnouncementSignaturesDecodeErrorZ _res_conv = *(LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(_res_ptr);
17710 FREE(untag_ptr(_res));
17711 CResult_AnnouncementSignaturesDecodeErrorZ_free(_res_conv);
17714 static inline uint64_t CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR arg) {
17715 LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
17716 *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_clone(arg);
17717 return tag_ptr(ret_conv, true);
17719 int64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(uint64_t arg) {
17720 LDKCResult_AnnouncementSignaturesDecodeErrorZ* arg_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(arg);
17721 int64_t ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(arg_conv);
17725 uint64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_clone"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_clone(uint64_t orig) {
17726 LDKCResult_AnnouncementSignaturesDecodeErrorZ* orig_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(orig);
17727 LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
17728 *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_clone(orig_conv);
17729 return tag_ptr(ret_conv, true);
17732 uint64_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_ok"))) TS_CResult_ChannelReestablishDecodeErrorZ_ok(uint64_t o) {
17733 LDKChannelReestablish o_conv;
17734 o_conv.inner = untag_ptr(o);
17735 o_conv.is_owned = ptr_is_owned(o);
17736 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17737 o_conv = ChannelReestablish_clone(&o_conv);
17738 LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
17739 *ret_conv = CResult_ChannelReestablishDecodeErrorZ_ok(o_conv);
17740 return tag_ptr(ret_conv, true);
17743 uint64_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_err"))) TS_CResult_ChannelReestablishDecodeErrorZ_err(uint64_t e) {
17744 LDKDecodeError e_conv;
17745 e_conv.inner = untag_ptr(e);
17746 e_conv.is_owned = ptr_is_owned(e);
17747 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17748 e_conv = DecodeError_clone(&e_conv);
17749 LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
17750 *ret_conv = CResult_ChannelReestablishDecodeErrorZ_err(e_conv);
17751 return tag_ptr(ret_conv, true);
17754 jboolean __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_is_ok"))) TS_CResult_ChannelReestablishDecodeErrorZ_is_ok(uint64_t o) {
17755 LDKCResult_ChannelReestablishDecodeErrorZ* o_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(o);
17756 jboolean ret_conv = CResult_ChannelReestablishDecodeErrorZ_is_ok(o_conv);
17760 void __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_free"))) TS_CResult_ChannelReestablishDecodeErrorZ_free(uint64_t _res) {
17761 if (!ptr_is_owned(_res)) return;
17762 void* _res_ptr = untag_ptr(_res);
17763 CHECK_ACCESS(_res_ptr);
17764 LDKCResult_ChannelReestablishDecodeErrorZ _res_conv = *(LDKCResult_ChannelReestablishDecodeErrorZ*)(_res_ptr);
17765 FREE(untag_ptr(_res));
17766 CResult_ChannelReestablishDecodeErrorZ_free(_res_conv);
17769 static inline uint64_t CResult_ChannelReestablishDecodeErrorZ_clone_ptr(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR arg) {
17770 LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
17771 *ret_conv = CResult_ChannelReestablishDecodeErrorZ_clone(arg);
17772 return tag_ptr(ret_conv, true);
17774 int64_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelReestablishDecodeErrorZ_clone_ptr(uint64_t arg) {
17775 LDKCResult_ChannelReestablishDecodeErrorZ* arg_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(arg);
17776 int64_t ret_conv = CResult_ChannelReestablishDecodeErrorZ_clone_ptr(arg_conv);
17780 uint64_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_clone"))) TS_CResult_ChannelReestablishDecodeErrorZ_clone(uint64_t orig) {
17781 LDKCResult_ChannelReestablishDecodeErrorZ* orig_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(orig);
17782 LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
17783 *ret_conv = CResult_ChannelReestablishDecodeErrorZ_clone(orig_conv);
17784 return tag_ptr(ret_conv, true);
17787 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_ok"))) TS_CResult_ClosingSignedDecodeErrorZ_ok(uint64_t o) {
17788 LDKClosingSigned o_conv;
17789 o_conv.inner = untag_ptr(o);
17790 o_conv.is_owned = ptr_is_owned(o);
17791 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17792 o_conv = ClosingSigned_clone(&o_conv);
17793 LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
17794 *ret_conv = CResult_ClosingSignedDecodeErrorZ_ok(o_conv);
17795 return tag_ptr(ret_conv, true);
17798 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_err"))) TS_CResult_ClosingSignedDecodeErrorZ_err(uint64_t e) {
17799 LDKDecodeError e_conv;
17800 e_conv.inner = untag_ptr(e);
17801 e_conv.is_owned = ptr_is_owned(e);
17802 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17803 e_conv = DecodeError_clone(&e_conv);
17804 LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
17805 *ret_conv = CResult_ClosingSignedDecodeErrorZ_err(e_conv);
17806 return tag_ptr(ret_conv, true);
17809 jboolean __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_is_ok"))) TS_CResult_ClosingSignedDecodeErrorZ_is_ok(uint64_t o) {
17810 LDKCResult_ClosingSignedDecodeErrorZ* o_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(o);
17811 jboolean ret_conv = CResult_ClosingSignedDecodeErrorZ_is_ok(o_conv);
17815 void __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_free"))) TS_CResult_ClosingSignedDecodeErrorZ_free(uint64_t _res) {
17816 if (!ptr_is_owned(_res)) return;
17817 void* _res_ptr = untag_ptr(_res);
17818 CHECK_ACCESS(_res_ptr);
17819 LDKCResult_ClosingSignedDecodeErrorZ _res_conv = *(LDKCResult_ClosingSignedDecodeErrorZ*)(_res_ptr);
17820 FREE(untag_ptr(_res));
17821 CResult_ClosingSignedDecodeErrorZ_free(_res_conv);
17824 static inline uint64_t CResult_ClosingSignedDecodeErrorZ_clone_ptr(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR arg) {
17825 LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
17826 *ret_conv = CResult_ClosingSignedDecodeErrorZ_clone(arg);
17827 return tag_ptr(ret_conv, true);
17829 int64_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_clone_ptr"))) TS_CResult_ClosingSignedDecodeErrorZ_clone_ptr(uint64_t arg) {
17830 LDKCResult_ClosingSignedDecodeErrorZ* arg_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(arg);
17831 int64_t ret_conv = CResult_ClosingSignedDecodeErrorZ_clone_ptr(arg_conv);
17835 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_clone"))) TS_CResult_ClosingSignedDecodeErrorZ_clone(uint64_t orig) {
17836 LDKCResult_ClosingSignedDecodeErrorZ* orig_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(orig);
17837 LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
17838 *ret_conv = CResult_ClosingSignedDecodeErrorZ_clone(orig_conv);
17839 return tag_ptr(ret_conv, true);
17842 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_ok"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(uint64_t o) {
17843 LDKClosingSignedFeeRange o_conv;
17844 o_conv.inner = untag_ptr(o);
17845 o_conv.is_owned = ptr_is_owned(o);
17846 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17847 o_conv = ClosingSignedFeeRange_clone(&o_conv);
17848 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
17849 *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(o_conv);
17850 return tag_ptr(ret_conv, true);
17853 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_err"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_err(uint64_t e) {
17854 LDKDecodeError e_conv;
17855 e_conv.inner = untag_ptr(e);
17856 e_conv.is_owned = ptr_is_owned(e);
17857 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17858 e_conv = DecodeError_clone(&e_conv);
17859 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
17860 *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_err(e_conv);
17861 return tag_ptr(ret_conv, true);
17864 jboolean __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(uint64_t o) {
17865 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* o_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(o);
17866 jboolean ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(o_conv);
17870 void __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_free"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_free(uint64_t _res) {
17871 if (!ptr_is_owned(_res)) return;
17872 void* _res_ptr = untag_ptr(_res);
17873 CHECK_ACCESS(_res_ptr);
17874 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res_conv = *(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(_res_ptr);
17875 FREE(untag_ptr(_res));
17876 CResult_ClosingSignedFeeRangeDecodeErrorZ_free(_res_conv);
17879 static inline uint64_t CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR arg) {
17880 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
17881 *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(arg);
17882 return tag_ptr(ret_conv, true);
17884 int64_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(uint64_t arg) {
17885 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* arg_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(arg);
17886 int64_t ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(arg_conv);
17890 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_clone"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(uint64_t orig) {
17891 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* orig_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(orig);
17892 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
17893 *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(orig_conv);
17894 return tag_ptr(ret_conv, true);
17897 uint64_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_ok"))) TS_CResult_CommitmentSignedDecodeErrorZ_ok(uint64_t o) {
17898 LDKCommitmentSigned o_conv;
17899 o_conv.inner = untag_ptr(o);
17900 o_conv.is_owned = ptr_is_owned(o);
17901 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17902 o_conv = CommitmentSigned_clone(&o_conv);
17903 LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
17904 *ret_conv = CResult_CommitmentSignedDecodeErrorZ_ok(o_conv);
17905 return tag_ptr(ret_conv, true);
17908 uint64_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_err"))) TS_CResult_CommitmentSignedDecodeErrorZ_err(uint64_t e) {
17909 LDKDecodeError e_conv;
17910 e_conv.inner = untag_ptr(e);
17911 e_conv.is_owned = ptr_is_owned(e);
17912 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17913 e_conv = DecodeError_clone(&e_conv);
17914 LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
17915 *ret_conv = CResult_CommitmentSignedDecodeErrorZ_err(e_conv);
17916 return tag_ptr(ret_conv, true);
17919 jboolean __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_is_ok"))) TS_CResult_CommitmentSignedDecodeErrorZ_is_ok(uint64_t o) {
17920 LDKCResult_CommitmentSignedDecodeErrorZ* o_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(o);
17921 jboolean ret_conv = CResult_CommitmentSignedDecodeErrorZ_is_ok(o_conv);
17925 void __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_free"))) TS_CResult_CommitmentSignedDecodeErrorZ_free(uint64_t _res) {
17926 if (!ptr_is_owned(_res)) return;
17927 void* _res_ptr = untag_ptr(_res);
17928 CHECK_ACCESS(_res_ptr);
17929 LDKCResult_CommitmentSignedDecodeErrorZ _res_conv = *(LDKCResult_CommitmentSignedDecodeErrorZ*)(_res_ptr);
17930 FREE(untag_ptr(_res));
17931 CResult_CommitmentSignedDecodeErrorZ_free(_res_conv);
17934 static inline uint64_t CResult_CommitmentSignedDecodeErrorZ_clone_ptr(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR arg) {
17935 LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
17936 *ret_conv = CResult_CommitmentSignedDecodeErrorZ_clone(arg);
17937 return tag_ptr(ret_conv, true);
17939 int64_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_clone_ptr"))) TS_CResult_CommitmentSignedDecodeErrorZ_clone_ptr(uint64_t arg) {
17940 LDKCResult_CommitmentSignedDecodeErrorZ* arg_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(arg);
17941 int64_t ret_conv = CResult_CommitmentSignedDecodeErrorZ_clone_ptr(arg_conv);
17945 uint64_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_clone"))) TS_CResult_CommitmentSignedDecodeErrorZ_clone(uint64_t orig) {
17946 LDKCResult_CommitmentSignedDecodeErrorZ* orig_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(orig);
17947 LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
17948 *ret_conv = CResult_CommitmentSignedDecodeErrorZ_clone(orig_conv);
17949 return tag_ptr(ret_conv, true);
17952 uint64_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_ok"))) TS_CResult_FundingCreatedDecodeErrorZ_ok(uint64_t o) {
17953 LDKFundingCreated o_conv;
17954 o_conv.inner = untag_ptr(o);
17955 o_conv.is_owned = ptr_is_owned(o);
17956 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17957 o_conv = FundingCreated_clone(&o_conv);
17958 LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
17959 *ret_conv = CResult_FundingCreatedDecodeErrorZ_ok(o_conv);
17960 return tag_ptr(ret_conv, true);
17963 uint64_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_err"))) TS_CResult_FundingCreatedDecodeErrorZ_err(uint64_t e) {
17964 LDKDecodeError e_conv;
17965 e_conv.inner = untag_ptr(e);
17966 e_conv.is_owned = ptr_is_owned(e);
17967 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17968 e_conv = DecodeError_clone(&e_conv);
17969 LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
17970 *ret_conv = CResult_FundingCreatedDecodeErrorZ_err(e_conv);
17971 return tag_ptr(ret_conv, true);
17974 jboolean __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_is_ok"))) TS_CResult_FundingCreatedDecodeErrorZ_is_ok(uint64_t o) {
17975 LDKCResult_FundingCreatedDecodeErrorZ* o_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(o);
17976 jboolean ret_conv = CResult_FundingCreatedDecodeErrorZ_is_ok(o_conv);
17980 void __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_free"))) TS_CResult_FundingCreatedDecodeErrorZ_free(uint64_t _res) {
17981 if (!ptr_is_owned(_res)) return;
17982 void* _res_ptr = untag_ptr(_res);
17983 CHECK_ACCESS(_res_ptr);
17984 LDKCResult_FundingCreatedDecodeErrorZ _res_conv = *(LDKCResult_FundingCreatedDecodeErrorZ*)(_res_ptr);
17985 FREE(untag_ptr(_res));
17986 CResult_FundingCreatedDecodeErrorZ_free(_res_conv);
17989 static inline uint64_t CResult_FundingCreatedDecodeErrorZ_clone_ptr(LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR arg) {
17990 LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
17991 *ret_conv = CResult_FundingCreatedDecodeErrorZ_clone(arg);
17992 return tag_ptr(ret_conv, true);
17994 int64_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_clone_ptr"))) TS_CResult_FundingCreatedDecodeErrorZ_clone_ptr(uint64_t arg) {
17995 LDKCResult_FundingCreatedDecodeErrorZ* arg_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(arg);
17996 int64_t ret_conv = CResult_FundingCreatedDecodeErrorZ_clone_ptr(arg_conv);
18000 uint64_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_clone"))) TS_CResult_FundingCreatedDecodeErrorZ_clone(uint64_t orig) {
18001 LDKCResult_FundingCreatedDecodeErrorZ* orig_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(orig);
18002 LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
18003 *ret_conv = CResult_FundingCreatedDecodeErrorZ_clone(orig_conv);
18004 return tag_ptr(ret_conv, true);
18007 uint64_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_ok"))) TS_CResult_FundingSignedDecodeErrorZ_ok(uint64_t o) {
18008 LDKFundingSigned o_conv;
18009 o_conv.inner = untag_ptr(o);
18010 o_conv.is_owned = ptr_is_owned(o);
18011 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18012 o_conv = FundingSigned_clone(&o_conv);
18013 LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
18014 *ret_conv = CResult_FundingSignedDecodeErrorZ_ok(o_conv);
18015 return tag_ptr(ret_conv, true);
18018 uint64_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_err"))) TS_CResult_FundingSignedDecodeErrorZ_err(uint64_t e) {
18019 LDKDecodeError e_conv;
18020 e_conv.inner = untag_ptr(e);
18021 e_conv.is_owned = ptr_is_owned(e);
18022 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18023 e_conv = DecodeError_clone(&e_conv);
18024 LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
18025 *ret_conv = CResult_FundingSignedDecodeErrorZ_err(e_conv);
18026 return tag_ptr(ret_conv, true);
18029 jboolean __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_is_ok"))) TS_CResult_FundingSignedDecodeErrorZ_is_ok(uint64_t o) {
18030 LDKCResult_FundingSignedDecodeErrorZ* o_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(o);
18031 jboolean ret_conv = CResult_FundingSignedDecodeErrorZ_is_ok(o_conv);
18035 void __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_free"))) TS_CResult_FundingSignedDecodeErrorZ_free(uint64_t _res) {
18036 if (!ptr_is_owned(_res)) return;
18037 void* _res_ptr = untag_ptr(_res);
18038 CHECK_ACCESS(_res_ptr);
18039 LDKCResult_FundingSignedDecodeErrorZ _res_conv = *(LDKCResult_FundingSignedDecodeErrorZ*)(_res_ptr);
18040 FREE(untag_ptr(_res));
18041 CResult_FundingSignedDecodeErrorZ_free(_res_conv);
18044 static inline uint64_t CResult_FundingSignedDecodeErrorZ_clone_ptr(LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR arg) {
18045 LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
18046 *ret_conv = CResult_FundingSignedDecodeErrorZ_clone(arg);
18047 return tag_ptr(ret_conv, true);
18049 int64_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_clone_ptr"))) TS_CResult_FundingSignedDecodeErrorZ_clone_ptr(uint64_t arg) {
18050 LDKCResult_FundingSignedDecodeErrorZ* arg_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(arg);
18051 int64_t ret_conv = CResult_FundingSignedDecodeErrorZ_clone_ptr(arg_conv);
18055 uint64_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_clone"))) TS_CResult_FundingSignedDecodeErrorZ_clone(uint64_t orig) {
18056 LDKCResult_FundingSignedDecodeErrorZ* orig_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(orig);
18057 LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
18058 *ret_conv = CResult_FundingSignedDecodeErrorZ_clone(orig_conv);
18059 return tag_ptr(ret_conv, true);
18062 uint64_t __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_ok"))) TS_CResult_ChannelReadyDecodeErrorZ_ok(uint64_t o) {
18063 LDKChannelReady o_conv;
18064 o_conv.inner = untag_ptr(o);
18065 o_conv.is_owned = ptr_is_owned(o);
18066 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18067 o_conv = ChannelReady_clone(&o_conv);
18068 LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
18069 *ret_conv = CResult_ChannelReadyDecodeErrorZ_ok(o_conv);
18070 return tag_ptr(ret_conv, true);
18073 uint64_t __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_err"))) TS_CResult_ChannelReadyDecodeErrorZ_err(uint64_t e) {
18074 LDKDecodeError e_conv;
18075 e_conv.inner = untag_ptr(e);
18076 e_conv.is_owned = ptr_is_owned(e);
18077 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18078 e_conv = DecodeError_clone(&e_conv);
18079 LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
18080 *ret_conv = CResult_ChannelReadyDecodeErrorZ_err(e_conv);
18081 return tag_ptr(ret_conv, true);
18084 jboolean __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_is_ok"))) TS_CResult_ChannelReadyDecodeErrorZ_is_ok(uint64_t o) {
18085 LDKCResult_ChannelReadyDecodeErrorZ* o_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(o);
18086 jboolean ret_conv = CResult_ChannelReadyDecodeErrorZ_is_ok(o_conv);
18090 void __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_free"))) TS_CResult_ChannelReadyDecodeErrorZ_free(uint64_t _res) {
18091 if (!ptr_is_owned(_res)) return;
18092 void* _res_ptr = untag_ptr(_res);
18093 CHECK_ACCESS(_res_ptr);
18094 LDKCResult_ChannelReadyDecodeErrorZ _res_conv = *(LDKCResult_ChannelReadyDecodeErrorZ*)(_res_ptr);
18095 FREE(untag_ptr(_res));
18096 CResult_ChannelReadyDecodeErrorZ_free(_res_conv);
18099 static inline uint64_t CResult_ChannelReadyDecodeErrorZ_clone_ptr(LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR arg) {
18100 LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
18101 *ret_conv = CResult_ChannelReadyDecodeErrorZ_clone(arg);
18102 return tag_ptr(ret_conv, true);
18104 int64_t __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelReadyDecodeErrorZ_clone_ptr(uint64_t arg) {
18105 LDKCResult_ChannelReadyDecodeErrorZ* arg_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(arg);
18106 int64_t ret_conv = CResult_ChannelReadyDecodeErrorZ_clone_ptr(arg_conv);
18110 uint64_t __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_clone"))) TS_CResult_ChannelReadyDecodeErrorZ_clone(uint64_t orig) {
18111 LDKCResult_ChannelReadyDecodeErrorZ* orig_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(orig);
18112 LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
18113 *ret_conv = CResult_ChannelReadyDecodeErrorZ_clone(orig_conv);
18114 return tag_ptr(ret_conv, true);
18117 uint64_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_ok"))) TS_CResult_InitDecodeErrorZ_ok(uint64_t o) {
18119 o_conv.inner = untag_ptr(o);
18120 o_conv.is_owned = ptr_is_owned(o);
18121 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18122 o_conv = Init_clone(&o_conv);
18123 LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
18124 *ret_conv = CResult_InitDecodeErrorZ_ok(o_conv);
18125 return tag_ptr(ret_conv, true);
18128 uint64_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_err"))) TS_CResult_InitDecodeErrorZ_err(uint64_t e) {
18129 LDKDecodeError e_conv;
18130 e_conv.inner = untag_ptr(e);
18131 e_conv.is_owned = ptr_is_owned(e);
18132 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18133 e_conv = DecodeError_clone(&e_conv);
18134 LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
18135 *ret_conv = CResult_InitDecodeErrorZ_err(e_conv);
18136 return tag_ptr(ret_conv, true);
18139 jboolean __attribute__((export_name("TS_CResult_InitDecodeErrorZ_is_ok"))) TS_CResult_InitDecodeErrorZ_is_ok(uint64_t o) {
18140 LDKCResult_InitDecodeErrorZ* o_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(o);
18141 jboolean ret_conv = CResult_InitDecodeErrorZ_is_ok(o_conv);
18145 void __attribute__((export_name("TS_CResult_InitDecodeErrorZ_free"))) TS_CResult_InitDecodeErrorZ_free(uint64_t _res) {
18146 if (!ptr_is_owned(_res)) return;
18147 void* _res_ptr = untag_ptr(_res);
18148 CHECK_ACCESS(_res_ptr);
18149 LDKCResult_InitDecodeErrorZ _res_conv = *(LDKCResult_InitDecodeErrorZ*)(_res_ptr);
18150 FREE(untag_ptr(_res));
18151 CResult_InitDecodeErrorZ_free(_res_conv);
18154 static inline uint64_t CResult_InitDecodeErrorZ_clone_ptr(LDKCResult_InitDecodeErrorZ *NONNULL_PTR arg) {
18155 LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
18156 *ret_conv = CResult_InitDecodeErrorZ_clone(arg);
18157 return tag_ptr(ret_conv, true);
18159 int64_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_clone_ptr"))) TS_CResult_InitDecodeErrorZ_clone_ptr(uint64_t arg) {
18160 LDKCResult_InitDecodeErrorZ* arg_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(arg);
18161 int64_t ret_conv = CResult_InitDecodeErrorZ_clone_ptr(arg_conv);
18165 uint64_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_clone"))) TS_CResult_InitDecodeErrorZ_clone(uint64_t orig) {
18166 LDKCResult_InitDecodeErrorZ* orig_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(orig);
18167 LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
18168 *ret_conv = CResult_InitDecodeErrorZ_clone(orig_conv);
18169 return tag_ptr(ret_conv, true);
18172 uint64_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_ok"))) TS_CResult_OpenChannelDecodeErrorZ_ok(uint64_t o) {
18173 LDKOpenChannel o_conv;
18174 o_conv.inner = untag_ptr(o);
18175 o_conv.is_owned = ptr_is_owned(o);
18176 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18177 o_conv = OpenChannel_clone(&o_conv);
18178 LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
18179 *ret_conv = CResult_OpenChannelDecodeErrorZ_ok(o_conv);
18180 return tag_ptr(ret_conv, true);
18183 uint64_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_err"))) TS_CResult_OpenChannelDecodeErrorZ_err(uint64_t e) {
18184 LDKDecodeError e_conv;
18185 e_conv.inner = untag_ptr(e);
18186 e_conv.is_owned = ptr_is_owned(e);
18187 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18188 e_conv = DecodeError_clone(&e_conv);
18189 LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
18190 *ret_conv = CResult_OpenChannelDecodeErrorZ_err(e_conv);
18191 return tag_ptr(ret_conv, true);
18194 jboolean __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_is_ok"))) TS_CResult_OpenChannelDecodeErrorZ_is_ok(uint64_t o) {
18195 LDKCResult_OpenChannelDecodeErrorZ* o_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(o);
18196 jboolean ret_conv = CResult_OpenChannelDecodeErrorZ_is_ok(o_conv);
18200 void __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_free"))) TS_CResult_OpenChannelDecodeErrorZ_free(uint64_t _res) {
18201 if (!ptr_is_owned(_res)) return;
18202 void* _res_ptr = untag_ptr(_res);
18203 CHECK_ACCESS(_res_ptr);
18204 LDKCResult_OpenChannelDecodeErrorZ _res_conv = *(LDKCResult_OpenChannelDecodeErrorZ*)(_res_ptr);
18205 FREE(untag_ptr(_res));
18206 CResult_OpenChannelDecodeErrorZ_free(_res_conv);
18209 static inline uint64_t CResult_OpenChannelDecodeErrorZ_clone_ptr(LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR arg) {
18210 LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
18211 *ret_conv = CResult_OpenChannelDecodeErrorZ_clone(arg);
18212 return tag_ptr(ret_conv, true);
18214 int64_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_clone_ptr"))) TS_CResult_OpenChannelDecodeErrorZ_clone_ptr(uint64_t arg) {
18215 LDKCResult_OpenChannelDecodeErrorZ* arg_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(arg);
18216 int64_t ret_conv = CResult_OpenChannelDecodeErrorZ_clone_ptr(arg_conv);
18220 uint64_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_clone"))) TS_CResult_OpenChannelDecodeErrorZ_clone(uint64_t orig) {
18221 LDKCResult_OpenChannelDecodeErrorZ* orig_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(orig);
18222 LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
18223 *ret_conv = CResult_OpenChannelDecodeErrorZ_clone(orig_conv);
18224 return tag_ptr(ret_conv, true);
18227 uint64_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_ok"))) TS_CResult_RevokeAndACKDecodeErrorZ_ok(uint64_t o) {
18228 LDKRevokeAndACK o_conv;
18229 o_conv.inner = untag_ptr(o);
18230 o_conv.is_owned = ptr_is_owned(o);
18231 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18232 o_conv = RevokeAndACK_clone(&o_conv);
18233 LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
18234 *ret_conv = CResult_RevokeAndACKDecodeErrorZ_ok(o_conv);
18235 return tag_ptr(ret_conv, true);
18238 uint64_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_err"))) TS_CResult_RevokeAndACKDecodeErrorZ_err(uint64_t e) {
18239 LDKDecodeError e_conv;
18240 e_conv.inner = untag_ptr(e);
18241 e_conv.is_owned = ptr_is_owned(e);
18242 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18243 e_conv = DecodeError_clone(&e_conv);
18244 LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
18245 *ret_conv = CResult_RevokeAndACKDecodeErrorZ_err(e_conv);
18246 return tag_ptr(ret_conv, true);
18249 jboolean __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_is_ok"))) TS_CResult_RevokeAndACKDecodeErrorZ_is_ok(uint64_t o) {
18250 LDKCResult_RevokeAndACKDecodeErrorZ* o_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(o);
18251 jboolean ret_conv = CResult_RevokeAndACKDecodeErrorZ_is_ok(o_conv);
18255 void __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_free"))) TS_CResult_RevokeAndACKDecodeErrorZ_free(uint64_t _res) {
18256 if (!ptr_is_owned(_res)) return;
18257 void* _res_ptr = untag_ptr(_res);
18258 CHECK_ACCESS(_res_ptr);
18259 LDKCResult_RevokeAndACKDecodeErrorZ _res_conv = *(LDKCResult_RevokeAndACKDecodeErrorZ*)(_res_ptr);
18260 FREE(untag_ptr(_res));
18261 CResult_RevokeAndACKDecodeErrorZ_free(_res_conv);
18264 static inline uint64_t CResult_RevokeAndACKDecodeErrorZ_clone_ptr(LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR arg) {
18265 LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
18266 *ret_conv = CResult_RevokeAndACKDecodeErrorZ_clone(arg);
18267 return tag_ptr(ret_conv, true);
18269 int64_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_clone_ptr"))) TS_CResult_RevokeAndACKDecodeErrorZ_clone_ptr(uint64_t arg) {
18270 LDKCResult_RevokeAndACKDecodeErrorZ* arg_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(arg);
18271 int64_t ret_conv = CResult_RevokeAndACKDecodeErrorZ_clone_ptr(arg_conv);
18275 uint64_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_clone"))) TS_CResult_RevokeAndACKDecodeErrorZ_clone(uint64_t orig) {
18276 LDKCResult_RevokeAndACKDecodeErrorZ* orig_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(orig);
18277 LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
18278 *ret_conv = CResult_RevokeAndACKDecodeErrorZ_clone(orig_conv);
18279 return tag_ptr(ret_conv, true);
18282 uint64_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_ok"))) TS_CResult_ShutdownDecodeErrorZ_ok(uint64_t o) {
18283 LDKShutdown o_conv;
18284 o_conv.inner = untag_ptr(o);
18285 o_conv.is_owned = ptr_is_owned(o);
18286 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18287 o_conv = Shutdown_clone(&o_conv);
18288 LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
18289 *ret_conv = CResult_ShutdownDecodeErrorZ_ok(o_conv);
18290 return tag_ptr(ret_conv, true);
18293 uint64_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_err"))) TS_CResult_ShutdownDecodeErrorZ_err(uint64_t e) {
18294 LDKDecodeError e_conv;
18295 e_conv.inner = untag_ptr(e);
18296 e_conv.is_owned = ptr_is_owned(e);
18297 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18298 e_conv = DecodeError_clone(&e_conv);
18299 LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
18300 *ret_conv = CResult_ShutdownDecodeErrorZ_err(e_conv);
18301 return tag_ptr(ret_conv, true);
18304 jboolean __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_is_ok"))) TS_CResult_ShutdownDecodeErrorZ_is_ok(uint64_t o) {
18305 LDKCResult_ShutdownDecodeErrorZ* o_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(o);
18306 jboolean ret_conv = CResult_ShutdownDecodeErrorZ_is_ok(o_conv);
18310 void __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_free"))) TS_CResult_ShutdownDecodeErrorZ_free(uint64_t _res) {
18311 if (!ptr_is_owned(_res)) return;
18312 void* _res_ptr = untag_ptr(_res);
18313 CHECK_ACCESS(_res_ptr);
18314 LDKCResult_ShutdownDecodeErrorZ _res_conv = *(LDKCResult_ShutdownDecodeErrorZ*)(_res_ptr);
18315 FREE(untag_ptr(_res));
18316 CResult_ShutdownDecodeErrorZ_free(_res_conv);
18319 static inline uint64_t CResult_ShutdownDecodeErrorZ_clone_ptr(LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR arg) {
18320 LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
18321 *ret_conv = CResult_ShutdownDecodeErrorZ_clone(arg);
18322 return tag_ptr(ret_conv, true);
18324 int64_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_clone_ptr"))) TS_CResult_ShutdownDecodeErrorZ_clone_ptr(uint64_t arg) {
18325 LDKCResult_ShutdownDecodeErrorZ* arg_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(arg);
18326 int64_t ret_conv = CResult_ShutdownDecodeErrorZ_clone_ptr(arg_conv);
18330 uint64_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_clone"))) TS_CResult_ShutdownDecodeErrorZ_clone(uint64_t orig) {
18331 LDKCResult_ShutdownDecodeErrorZ* orig_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(orig);
18332 LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
18333 *ret_conv = CResult_ShutdownDecodeErrorZ_clone(orig_conv);
18334 return tag_ptr(ret_conv, true);
18337 uint64_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_ok"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_ok(uint64_t o) {
18338 LDKUpdateFailHTLC o_conv;
18339 o_conv.inner = untag_ptr(o);
18340 o_conv.is_owned = ptr_is_owned(o);
18341 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18342 o_conv = UpdateFailHTLC_clone(&o_conv);
18343 LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
18344 *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_ok(o_conv);
18345 return tag_ptr(ret_conv, true);
18348 uint64_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_err"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_err(uint64_t e) {
18349 LDKDecodeError e_conv;
18350 e_conv.inner = untag_ptr(e);
18351 e_conv.is_owned = ptr_is_owned(e);
18352 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18353 e_conv = DecodeError_clone(&e_conv);
18354 LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
18355 *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_err(e_conv);
18356 return tag_ptr(ret_conv, true);
18359 jboolean __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_is_ok"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_is_ok(uint64_t o) {
18360 LDKCResult_UpdateFailHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(o);
18361 jboolean ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_is_ok(o_conv);
18365 void __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_free"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_free(uint64_t _res) {
18366 if (!ptr_is_owned(_res)) return;
18367 void* _res_ptr = untag_ptr(_res);
18368 CHECK_ACCESS(_res_ptr);
18369 LDKCResult_UpdateFailHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFailHTLCDecodeErrorZ*)(_res_ptr);
18370 FREE(untag_ptr(_res));
18371 CResult_UpdateFailHTLCDecodeErrorZ_free(_res_conv);
18374 static inline uint64_t CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR arg) {
18375 LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
18376 *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_clone(arg);
18377 return tag_ptr(ret_conv, true);
18379 int64_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(uint64_t arg) {
18380 LDKCResult_UpdateFailHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(arg);
18381 int64_t ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(arg_conv);
18385 uint64_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_clone"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_clone(uint64_t orig) {
18386 LDKCResult_UpdateFailHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(orig);
18387 LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
18388 *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_clone(orig_conv);
18389 return tag_ptr(ret_conv, true);
18392 uint64_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(uint64_t o) {
18393 LDKUpdateFailMalformedHTLC o_conv;
18394 o_conv.inner = untag_ptr(o);
18395 o_conv.is_owned = ptr_is_owned(o);
18396 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18397 o_conv = UpdateFailMalformedHTLC_clone(&o_conv);
18398 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
18399 *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(o_conv);
18400 return tag_ptr(ret_conv, true);
18403 uint64_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_err"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(uint64_t e) {
18404 LDKDecodeError e_conv;
18405 e_conv.inner = untag_ptr(e);
18406 e_conv.is_owned = ptr_is_owned(e);
18407 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18408 e_conv = DecodeError_clone(&e_conv);
18409 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
18410 *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(e_conv);
18411 return tag_ptr(ret_conv, true);
18414 jboolean __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(uint64_t o) {
18415 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(o);
18416 jboolean ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(o_conv);
18420 void __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_free"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(uint64_t _res) {
18421 if (!ptr_is_owned(_res)) return;
18422 void* _res_ptr = untag_ptr(_res);
18423 CHECK_ACCESS(_res_ptr);
18424 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(_res_ptr);
18425 FREE(untag_ptr(_res));
18426 CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(_res_conv);
18429 static inline uint64_t CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR arg) {
18430 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
18431 *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(arg);
18432 return tag_ptr(ret_conv, true);
18434 int64_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(uint64_t arg) {
18435 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(arg);
18436 int64_t ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(arg_conv);
18440 uint64_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(uint64_t orig) {
18441 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(orig);
18442 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
18443 *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(orig_conv);
18444 return tag_ptr(ret_conv, true);
18447 uint64_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_ok"))) TS_CResult_UpdateFeeDecodeErrorZ_ok(uint64_t o) {
18448 LDKUpdateFee o_conv;
18449 o_conv.inner = untag_ptr(o);
18450 o_conv.is_owned = ptr_is_owned(o);
18451 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18452 o_conv = UpdateFee_clone(&o_conv);
18453 LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
18454 *ret_conv = CResult_UpdateFeeDecodeErrorZ_ok(o_conv);
18455 return tag_ptr(ret_conv, true);
18458 uint64_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_err"))) TS_CResult_UpdateFeeDecodeErrorZ_err(uint64_t e) {
18459 LDKDecodeError e_conv;
18460 e_conv.inner = untag_ptr(e);
18461 e_conv.is_owned = ptr_is_owned(e);
18462 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18463 e_conv = DecodeError_clone(&e_conv);
18464 LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
18465 *ret_conv = CResult_UpdateFeeDecodeErrorZ_err(e_conv);
18466 return tag_ptr(ret_conv, true);
18469 jboolean __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_is_ok"))) TS_CResult_UpdateFeeDecodeErrorZ_is_ok(uint64_t o) {
18470 LDKCResult_UpdateFeeDecodeErrorZ* o_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(o);
18471 jboolean ret_conv = CResult_UpdateFeeDecodeErrorZ_is_ok(o_conv);
18475 void __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_free"))) TS_CResult_UpdateFeeDecodeErrorZ_free(uint64_t _res) {
18476 if (!ptr_is_owned(_res)) return;
18477 void* _res_ptr = untag_ptr(_res);
18478 CHECK_ACCESS(_res_ptr);
18479 LDKCResult_UpdateFeeDecodeErrorZ _res_conv = *(LDKCResult_UpdateFeeDecodeErrorZ*)(_res_ptr);
18480 FREE(untag_ptr(_res));
18481 CResult_UpdateFeeDecodeErrorZ_free(_res_conv);
18484 static inline uint64_t CResult_UpdateFeeDecodeErrorZ_clone_ptr(LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR arg) {
18485 LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
18486 *ret_conv = CResult_UpdateFeeDecodeErrorZ_clone(arg);
18487 return tag_ptr(ret_conv, true);
18489 int64_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_clone_ptr"))) TS_CResult_UpdateFeeDecodeErrorZ_clone_ptr(uint64_t arg) {
18490 LDKCResult_UpdateFeeDecodeErrorZ* arg_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(arg);
18491 int64_t ret_conv = CResult_UpdateFeeDecodeErrorZ_clone_ptr(arg_conv);
18495 uint64_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_clone"))) TS_CResult_UpdateFeeDecodeErrorZ_clone(uint64_t orig) {
18496 LDKCResult_UpdateFeeDecodeErrorZ* orig_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(orig);
18497 LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
18498 *ret_conv = CResult_UpdateFeeDecodeErrorZ_clone(orig_conv);
18499 return tag_ptr(ret_conv, true);
18502 uint64_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_ok"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_ok(uint64_t o) {
18503 LDKUpdateFulfillHTLC o_conv;
18504 o_conv.inner = untag_ptr(o);
18505 o_conv.is_owned = ptr_is_owned(o);
18506 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18507 o_conv = UpdateFulfillHTLC_clone(&o_conv);
18508 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
18509 *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_ok(o_conv);
18510 return tag_ptr(ret_conv, true);
18513 uint64_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_err"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_err(uint64_t e) {
18514 LDKDecodeError e_conv;
18515 e_conv.inner = untag_ptr(e);
18516 e_conv.is_owned = ptr_is_owned(e);
18517 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18518 e_conv = DecodeError_clone(&e_conv);
18519 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
18520 *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_err(e_conv);
18521 return tag_ptr(ret_conv, true);
18524 jboolean __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(uint64_t o) {
18525 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(o);
18526 jboolean ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(o_conv);
18530 void __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_free"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_free(uint64_t _res) {
18531 if (!ptr_is_owned(_res)) return;
18532 void* _res_ptr = untag_ptr(_res);
18533 CHECK_ACCESS(_res_ptr);
18534 LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(_res_ptr);
18535 FREE(untag_ptr(_res));
18536 CResult_UpdateFulfillHTLCDecodeErrorZ_free(_res_conv);
18539 static inline uint64_t CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR arg) {
18540 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
18541 *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_clone(arg);
18542 return tag_ptr(ret_conv, true);
18544 int64_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(uint64_t arg) {
18545 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(arg);
18546 int64_t ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(arg_conv);
18550 uint64_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_clone"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_clone(uint64_t orig) {
18551 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(orig);
18552 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
18553 *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_clone(orig_conv);
18554 return tag_ptr(ret_conv, true);
18557 uint64_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_ok"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_ok(uint64_t o) {
18558 LDKUpdateAddHTLC o_conv;
18559 o_conv.inner = untag_ptr(o);
18560 o_conv.is_owned = ptr_is_owned(o);
18561 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18562 o_conv = UpdateAddHTLC_clone(&o_conv);
18563 LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
18564 *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_ok(o_conv);
18565 return tag_ptr(ret_conv, true);
18568 uint64_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_err"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_err(uint64_t e) {
18569 LDKDecodeError e_conv;
18570 e_conv.inner = untag_ptr(e);
18571 e_conv.is_owned = ptr_is_owned(e);
18572 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18573 e_conv = DecodeError_clone(&e_conv);
18574 LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
18575 *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_err(e_conv);
18576 return tag_ptr(ret_conv, true);
18579 jboolean __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_is_ok"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_is_ok(uint64_t o) {
18580 LDKCResult_UpdateAddHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(o);
18581 jboolean ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_is_ok(o_conv);
18585 void __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_free"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_free(uint64_t _res) {
18586 if (!ptr_is_owned(_res)) return;
18587 void* _res_ptr = untag_ptr(_res);
18588 CHECK_ACCESS(_res_ptr);
18589 LDKCResult_UpdateAddHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateAddHTLCDecodeErrorZ*)(_res_ptr);
18590 FREE(untag_ptr(_res));
18591 CResult_UpdateAddHTLCDecodeErrorZ_free(_res_conv);
18594 static inline uint64_t CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR arg) {
18595 LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
18596 *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_clone(arg);
18597 return tag_ptr(ret_conv, true);
18599 int64_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(uint64_t arg) {
18600 LDKCResult_UpdateAddHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(arg);
18601 int64_t ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(arg_conv);
18605 uint64_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_clone"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_clone(uint64_t orig) {
18606 LDKCResult_UpdateAddHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(orig);
18607 LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
18608 *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_clone(orig_conv);
18609 return tag_ptr(ret_conv, true);
18612 uint64_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_ok"))) TS_CResult_PingDecodeErrorZ_ok(uint64_t o) {
18614 o_conv.inner = untag_ptr(o);
18615 o_conv.is_owned = ptr_is_owned(o);
18616 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18617 o_conv = Ping_clone(&o_conv);
18618 LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
18619 *ret_conv = CResult_PingDecodeErrorZ_ok(o_conv);
18620 return tag_ptr(ret_conv, true);
18623 uint64_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_err"))) TS_CResult_PingDecodeErrorZ_err(uint64_t e) {
18624 LDKDecodeError e_conv;
18625 e_conv.inner = untag_ptr(e);
18626 e_conv.is_owned = ptr_is_owned(e);
18627 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18628 e_conv = DecodeError_clone(&e_conv);
18629 LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
18630 *ret_conv = CResult_PingDecodeErrorZ_err(e_conv);
18631 return tag_ptr(ret_conv, true);
18634 jboolean __attribute__((export_name("TS_CResult_PingDecodeErrorZ_is_ok"))) TS_CResult_PingDecodeErrorZ_is_ok(uint64_t o) {
18635 LDKCResult_PingDecodeErrorZ* o_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(o);
18636 jboolean ret_conv = CResult_PingDecodeErrorZ_is_ok(o_conv);
18640 void __attribute__((export_name("TS_CResult_PingDecodeErrorZ_free"))) TS_CResult_PingDecodeErrorZ_free(uint64_t _res) {
18641 if (!ptr_is_owned(_res)) return;
18642 void* _res_ptr = untag_ptr(_res);
18643 CHECK_ACCESS(_res_ptr);
18644 LDKCResult_PingDecodeErrorZ _res_conv = *(LDKCResult_PingDecodeErrorZ*)(_res_ptr);
18645 FREE(untag_ptr(_res));
18646 CResult_PingDecodeErrorZ_free(_res_conv);
18649 static inline uint64_t CResult_PingDecodeErrorZ_clone_ptr(LDKCResult_PingDecodeErrorZ *NONNULL_PTR arg) {
18650 LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
18651 *ret_conv = CResult_PingDecodeErrorZ_clone(arg);
18652 return tag_ptr(ret_conv, true);
18654 int64_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_clone_ptr"))) TS_CResult_PingDecodeErrorZ_clone_ptr(uint64_t arg) {
18655 LDKCResult_PingDecodeErrorZ* arg_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(arg);
18656 int64_t ret_conv = CResult_PingDecodeErrorZ_clone_ptr(arg_conv);
18660 uint64_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_clone"))) TS_CResult_PingDecodeErrorZ_clone(uint64_t orig) {
18661 LDKCResult_PingDecodeErrorZ* orig_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(orig);
18662 LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
18663 *ret_conv = CResult_PingDecodeErrorZ_clone(orig_conv);
18664 return tag_ptr(ret_conv, true);
18667 uint64_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_ok"))) TS_CResult_PongDecodeErrorZ_ok(uint64_t o) {
18669 o_conv.inner = untag_ptr(o);
18670 o_conv.is_owned = ptr_is_owned(o);
18671 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18672 o_conv = Pong_clone(&o_conv);
18673 LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
18674 *ret_conv = CResult_PongDecodeErrorZ_ok(o_conv);
18675 return tag_ptr(ret_conv, true);
18678 uint64_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_err"))) TS_CResult_PongDecodeErrorZ_err(uint64_t e) {
18679 LDKDecodeError e_conv;
18680 e_conv.inner = untag_ptr(e);
18681 e_conv.is_owned = ptr_is_owned(e);
18682 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18683 e_conv = DecodeError_clone(&e_conv);
18684 LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
18685 *ret_conv = CResult_PongDecodeErrorZ_err(e_conv);
18686 return tag_ptr(ret_conv, true);
18689 jboolean __attribute__((export_name("TS_CResult_PongDecodeErrorZ_is_ok"))) TS_CResult_PongDecodeErrorZ_is_ok(uint64_t o) {
18690 LDKCResult_PongDecodeErrorZ* o_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(o);
18691 jboolean ret_conv = CResult_PongDecodeErrorZ_is_ok(o_conv);
18695 void __attribute__((export_name("TS_CResult_PongDecodeErrorZ_free"))) TS_CResult_PongDecodeErrorZ_free(uint64_t _res) {
18696 if (!ptr_is_owned(_res)) return;
18697 void* _res_ptr = untag_ptr(_res);
18698 CHECK_ACCESS(_res_ptr);
18699 LDKCResult_PongDecodeErrorZ _res_conv = *(LDKCResult_PongDecodeErrorZ*)(_res_ptr);
18700 FREE(untag_ptr(_res));
18701 CResult_PongDecodeErrorZ_free(_res_conv);
18704 static inline uint64_t CResult_PongDecodeErrorZ_clone_ptr(LDKCResult_PongDecodeErrorZ *NONNULL_PTR arg) {
18705 LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
18706 *ret_conv = CResult_PongDecodeErrorZ_clone(arg);
18707 return tag_ptr(ret_conv, true);
18709 int64_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_clone_ptr"))) TS_CResult_PongDecodeErrorZ_clone_ptr(uint64_t arg) {
18710 LDKCResult_PongDecodeErrorZ* arg_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(arg);
18711 int64_t ret_conv = CResult_PongDecodeErrorZ_clone_ptr(arg_conv);
18715 uint64_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_clone"))) TS_CResult_PongDecodeErrorZ_clone(uint64_t orig) {
18716 LDKCResult_PongDecodeErrorZ* orig_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(orig);
18717 LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
18718 *ret_conv = CResult_PongDecodeErrorZ_clone(orig_conv);
18719 return tag_ptr(ret_conv, true);
18722 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(uint64_t o) {
18723 LDKUnsignedChannelAnnouncement o_conv;
18724 o_conv.inner = untag_ptr(o);
18725 o_conv.is_owned = ptr_is_owned(o);
18726 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18727 o_conv = UnsignedChannelAnnouncement_clone(&o_conv);
18728 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
18729 *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(o_conv);
18730 return tag_ptr(ret_conv, true);
18733 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_err"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(uint64_t e) {
18734 LDKDecodeError e_conv;
18735 e_conv.inner = untag_ptr(e);
18736 e_conv.is_owned = ptr_is_owned(e);
18737 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18738 e_conv = DecodeError_clone(&e_conv);
18739 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
18740 *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(e_conv);
18741 return tag_ptr(ret_conv, true);
18744 jboolean __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(uint64_t o) {
18745 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* o_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(o);
18746 jboolean ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(o_conv);
18750 void __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_free"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(uint64_t _res) {
18751 if (!ptr_is_owned(_res)) return;
18752 void* _res_ptr = untag_ptr(_res);
18753 CHECK_ACCESS(_res_ptr);
18754 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(_res_ptr);
18755 FREE(untag_ptr(_res));
18756 CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(_res_conv);
18759 static inline uint64_t CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR arg) {
18760 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
18761 *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(arg);
18762 return tag_ptr(ret_conv, true);
18764 int64_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(uint64_t arg) {
18765 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(arg);
18766 int64_t ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(arg_conv);
18770 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(uint64_t orig) {
18771 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(orig);
18772 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
18773 *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(orig_conv);
18774 return tag_ptr(ret_conv, true);
18777 uint64_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_ok"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_ok(uint64_t o) {
18778 LDKChannelAnnouncement o_conv;
18779 o_conv.inner = untag_ptr(o);
18780 o_conv.is_owned = ptr_is_owned(o);
18781 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18782 o_conv = ChannelAnnouncement_clone(&o_conv);
18783 LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
18784 *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_ok(o_conv);
18785 return tag_ptr(ret_conv, true);
18788 uint64_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_err"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_err(uint64_t e) {
18789 LDKDecodeError e_conv;
18790 e_conv.inner = untag_ptr(e);
18791 e_conv.is_owned = ptr_is_owned(e);
18792 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18793 e_conv = DecodeError_clone(&e_conv);
18794 LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
18795 *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_err(e_conv);
18796 return tag_ptr(ret_conv, true);
18799 jboolean __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_is_ok"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_is_ok(uint64_t o) {
18800 LDKCResult_ChannelAnnouncementDecodeErrorZ* o_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(o);
18801 jboolean ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_is_ok(o_conv);
18805 void __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_free"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_free(uint64_t _res) {
18806 if (!ptr_is_owned(_res)) return;
18807 void* _res_ptr = untag_ptr(_res);
18808 CHECK_ACCESS(_res_ptr);
18809 LDKCResult_ChannelAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_ChannelAnnouncementDecodeErrorZ*)(_res_ptr);
18810 FREE(untag_ptr(_res));
18811 CResult_ChannelAnnouncementDecodeErrorZ_free(_res_conv);
18814 static inline uint64_t CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR arg) {
18815 LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
18816 *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_clone(arg);
18817 return tag_ptr(ret_conv, true);
18819 int64_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(uint64_t arg) {
18820 LDKCResult_ChannelAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(arg);
18821 int64_t ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(arg_conv);
18825 uint64_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_clone"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_clone(uint64_t orig) {
18826 LDKCResult_ChannelAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(orig);
18827 LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
18828 *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_clone(orig_conv);
18829 return tag_ptr(ret_conv, true);
18832 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_ok"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_ok(uint64_t o) {
18833 LDKUnsignedChannelUpdate o_conv;
18834 o_conv.inner = untag_ptr(o);
18835 o_conv.is_owned = ptr_is_owned(o);
18836 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18837 o_conv = UnsignedChannelUpdate_clone(&o_conv);
18838 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
18839 *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_ok(o_conv);
18840 return tag_ptr(ret_conv, true);
18843 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_err"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_err(uint64_t e) {
18844 LDKDecodeError e_conv;
18845 e_conv.inner = untag_ptr(e);
18846 e_conv.is_owned = ptr_is_owned(e);
18847 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18848 e_conv = DecodeError_clone(&e_conv);
18849 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
18850 *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_err(e_conv);
18851 return tag_ptr(ret_conv, true);
18854 jboolean __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(uint64_t o) {
18855 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* o_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(o);
18856 jboolean ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(o_conv);
18860 void __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_free"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_free(uint64_t _res) {
18861 if (!ptr_is_owned(_res)) return;
18862 void* _res_ptr = untag_ptr(_res);
18863 CHECK_ACCESS(_res_ptr);
18864 LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res_conv = *(LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(_res_ptr);
18865 FREE(untag_ptr(_res));
18866 CResult_UnsignedChannelUpdateDecodeErrorZ_free(_res_conv);
18869 static inline uint64_t CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR arg) {
18870 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
18871 *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_clone(arg);
18872 return tag_ptr(ret_conv, true);
18874 int64_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(uint64_t arg) {
18875 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* arg_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(arg);
18876 int64_t ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(arg_conv);
18880 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_clone"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_clone(uint64_t orig) {
18881 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* orig_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(orig);
18882 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
18883 *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_clone(orig_conv);
18884 return tag_ptr(ret_conv, true);
18887 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_ok"))) TS_CResult_ChannelUpdateDecodeErrorZ_ok(uint64_t o) {
18888 LDKChannelUpdate o_conv;
18889 o_conv.inner = untag_ptr(o);
18890 o_conv.is_owned = ptr_is_owned(o);
18891 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18892 o_conv = ChannelUpdate_clone(&o_conv);
18893 LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
18894 *ret_conv = CResult_ChannelUpdateDecodeErrorZ_ok(o_conv);
18895 return tag_ptr(ret_conv, true);
18898 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_err"))) TS_CResult_ChannelUpdateDecodeErrorZ_err(uint64_t e) {
18899 LDKDecodeError e_conv;
18900 e_conv.inner = untag_ptr(e);
18901 e_conv.is_owned = ptr_is_owned(e);
18902 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18903 e_conv = DecodeError_clone(&e_conv);
18904 LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
18905 *ret_conv = CResult_ChannelUpdateDecodeErrorZ_err(e_conv);
18906 return tag_ptr(ret_conv, true);
18909 jboolean __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_is_ok"))) TS_CResult_ChannelUpdateDecodeErrorZ_is_ok(uint64_t o) {
18910 LDKCResult_ChannelUpdateDecodeErrorZ* o_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(o);
18911 jboolean ret_conv = CResult_ChannelUpdateDecodeErrorZ_is_ok(o_conv);
18915 void __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_free"))) TS_CResult_ChannelUpdateDecodeErrorZ_free(uint64_t _res) {
18916 if (!ptr_is_owned(_res)) return;
18917 void* _res_ptr = untag_ptr(_res);
18918 CHECK_ACCESS(_res_ptr);
18919 LDKCResult_ChannelUpdateDecodeErrorZ _res_conv = *(LDKCResult_ChannelUpdateDecodeErrorZ*)(_res_ptr);
18920 FREE(untag_ptr(_res));
18921 CResult_ChannelUpdateDecodeErrorZ_free(_res_conv);
18924 static inline uint64_t CResult_ChannelUpdateDecodeErrorZ_clone_ptr(LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR arg) {
18925 LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
18926 *ret_conv = CResult_ChannelUpdateDecodeErrorZ_clone(arg);
18927 return tag_ptr(ret_conv, true);
18929 int64_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelUpdateDecodeErrorZ_clone_ptr(uint64_t arg) {
18930 LDKCResult_ChannelUpdateDecodeErrorZ* arg_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(arg);
18931 int64_t ret_conv = CResult_ChannelUpdateDecodeErrorZ_clone_ptr(arg_conv);
18935 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_clone"))) TS_CResult_ChannelUpdateDecodeErrorZ_clone(uint64_t orig) {
18936 LDKCResult_ChannelUpdateDecodeErrorZ* orig_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(orig);
18937 LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
18938 *ret_conv = CResult_ChannelUpdateDecodeErrorZ_clone(orig_conv);
18939 return tag_ptr(ret_conv, true);
18942 uint64_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_ok"))) TS_CResult_ErrorMessageDecodeErrorZ_ok(uint64_t o) {
18943 LDKErrorMessage o_conv;
18944 o_conv.inner = untag_ptr(o);
18945 o_conv.is_owned = ptr_is_owned(o);
18946 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18947 o_conv = ErrorMessage_clone(&o_conv);
18948 LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
18949 *ret_conv = CResult_ErrorMessageDecodeErrorZ_ok(o_conv);
18950 return tag_ptr(ret_conv, true);
18953 uint64_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_err"))) TS_CResult_ErrorMessageDecodeErrorZ_err(uint64_t e) {
18954 LDKDecodeError e_conv;
18955 e_conv.inner = untag_ptr(e);
18956 e_conv.is_owned = ptr_is_owned(e);
18957 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18958 e_conv = DecodeError_clone(&e_conv);
18959 LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
18960 *ret_conv = CResult_ErrorMessageDecodeErrorZ_err(e_conv);
18961 return tag_ptr(ret_conv, true);
18964 jboolean __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_is_ok"))) TS_CResult_ErrorMessageDecodeErrorZ_is_ok(uint64_t o) {
18965 LDKCResult_ErrorMessageDecodeErrorZ* o_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(o);
18966 jboolean ret_conv = CResult_ErrorMessageDecodeErrorZ_is_ok(o_conv);
18970 void __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_free"))) TS_CResult_ErrorMessageDecodeErrorZ_free(uint64_t _res) {
18971 if (!ptr_is_owned(_res)) return;
18972 void* _res_ptr = untag_ptr(_res);
18973 CHECK_ACCESS(_res_ptr);
18974 LDKCResult_ErrorMessageDecodeErrorZ _res_conv = *(LDKCResult_ErrorMessageDecodeErrorZ*)(_res_ptr);
18975 FREE(untag_ptr(_res));
18976 CResult_ErrorMessageDecodeErrorZ_free(_res_conv);
18979 static inline uint64_t CResult_ErrorMessageDecodeErrorZ_clone_ptr(LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR arg) {
18980 LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
18981 *ret_conv = CResult_ErrorMessageDecodeErrorZ_clone(arg);
18982 return tag_ptr(ret_conv, true);
18984 int64_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_clone_ptr"))) TS_CResult_ErrorMessageDecodeErrorZ_clone_ptr(uint64_t arg) {
18985 LDKCResult_ErrorMessageDecodeErrorZ* arg_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(arg);
18986 int64_t ret_conv = CResult_ErrorMessageDecodeErrorZ_clone_ptr(arg_conv);
18990 uint64_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_clone"))) TS_CResult_ErrorMessageDecodeErrorZ_clone(uint64_t orig) {
18991 LDKCResult_ErrorMessageDecodeErrorZ* orig_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(orig);
18992 LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
18993 *ret_conv = CResult_ErrorMessageDecodeErrorZ_clone(orig_conv);
18994 return tag_ptr(ret_conv, true);
18997 uint64_t __attribute__((export_name("TS_CResult_WarningMessageDecodeErrorZ_ok"))) TS_CResult_WarningMessageDecodeErrorZ_ok(uint64_t o) {
18998 LDKWarningMessage o_conv;
18999 o_conv.inner = untag_ptr(o);
19000 o_conv.is_owned = ptr_is_owned(o);
19001 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19002 o_conv = WarningMessage_clone(&o_conv);
19003 LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
19004 *ret_conv = CResult_WarningMessageDecodeErrorZ_ok(o_conv);
19005 return tag_ptr(ret_conv, true);
19008 uint64_t __attribute__((export_name("TS_CResult_WarningMessageDecodeErrorZ_err"))) TS_CResult_WarningMessageDecodeErrorZ_err(uint64_t e) {
19009 LDKDecodeError e_conv;
19010 e_conv.inner = untag_ptr(e);
19011 e_conv.is_owned = ptr_is_owned(e);
19012 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
19013 e_conv = DecodeError_clone(&e_conv);
19014 LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
19015 *ret_conv = CResult_WarningMessageDecodeErrorZ_err(e_conv);
19016 return tag_ptr(ret_conv, true);
19019 jboolean __attribute__((export_name("TS_CResult_WarningMessageDecodeErrorZ_is_ok"))) TS_CResult_WarningMessageDecodeErrorZ_is_ok(uint64_t o) {
19020 LDKCResult_WarningMessageDecodeErrorZ* o_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(o);
19021 jboolean ret_conv = CResult_WarningMessageDecodeErrorZ_is_ok(o_conv);
19025 void __attribute__((export_name("TS_CResult_WarningMessageDecodeErrorZ_free"))) TS_CResult_WarningMessageDecodeErrorZ_free(uint64_t _res) {
19026 if (!ptr_is_owned(_res)) return;
19027 void* _res_ptr = untag_ptr(_res);
19028 CHECK_ACCESS(_res_ptr);
19029 LDKCResult_WarningMessageDecodeErrorZ _res_conv = *(LDKCResult_WarningMessageDecodeErrorZ*)(_res_ptr);
19030 FREE(untag_ptr(_res));
19031 CResult_WarningMessageDecodeErrorZ_free(_res_conv);
19034 static inline uint64_t CResult_WarningMessageDecodeErrorZ_clone_ptr(LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR arg) {
19035 LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
19036 *ret_conv = CResult_WarningMessageDecodeErrorZ_clone(arg);
19037 return tag_ptr(ret_conv, true);
19039 int64_t __attribute__((export_name("TS_CResult_WarningMessageDecodeErrorZ_clone_ptr"))) TS_CResult_WarningMessageDecodeErrorZ_clone_ptr(uint64_t arg) {
19040 LDKCResult_WarningMessageDecodeErrorZ* arg_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(arg);
19041 int64_t ret_conv = CResult_WarningMessageDecodeErrorZ_clone_ptr(arg_conv);
19045 uint64_t __attribute__((export_name("TS_CResult_WarningMessageDecodeErrorZ_clone"))) TS_CResult_WarningMessageDecodeErrorZ_clone(uint64_t orig) {
19046 LDKCResult_WarningMessageDecodeErrorZ* orig_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(orig);
19047 LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
19048 *ret_conv = CResult_WarningMessageDecodeErrorZ_clone(orig_conv);
19049 return tag_ptr(ret_conv, true);
19052 uint64_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(uint64_t o) {
19053 LDKUnsignedNodeAnnouncement o_conv;
19054 o_conv.inner = untag_ptr(o);
19055 o_conv.is_owned = ptr_is_owned(o);
19056 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19057 o_conv = UnsignedNodeAnnouncement_clone(&o_conv);
19058 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
19059 *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(o_conv);
19060 return tag_ptr(ret_conv, true);
19063 uint64_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_err"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(uint64_t e) {
19064 LDKDecodeError e_conv;
19065 e_conv.inner = untag_ptr(e);
19066 e_conv.is_owned = ptr_is_owned(e);
19067 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
19068 e_conv = DecodeError_clone(&e_conv);
19069 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
19070 *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(e_conv);
19071 return tag_ptr(ret_conv, true);
19074 jboolean __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(uint64_t o) {
19075 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* o_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(o);
19076 jboolean ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(o_conv);
19080 void __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_free"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(uint64_t _res) {
19081 if (!ptr_is_owned(_res)) return;
19082 void* _res_ptr = untag_ptr(_res);
19083 CHECK_ACCESS(_res_ptr);
19084 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(_res_ptr);
19085 FREE(untag_ptr(_res));
19086 CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(_res_conv);
19089 static inline uint64_t CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR arg) {
19090 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
19091 *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(arg);
19092 return tag_ptr(ret_conv, true);
19094 int64_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(uint64_t arg) {
19095 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(arg);
19096 int64_t ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(arg_conv);
19100 uint64_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(uint64_t orig) {
19101 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(orig);
19102 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
19103 *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(orig_conv);
19104 return tag_ptr(ret_conv, true);
19107 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_ok"))) TS_CResult_NodeAnnouncementDecodeErrorZ_ok(uint64_t o) {
19108 LDKNodeAnnouncement o_conv;
19109 o_conv.inner = untag_ptr(o);
19110 o_conv.is_owned = ptr_is_owned(o);
19111 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19112 o_conv = NodeAnnouncement_clone(&o_conv);
19113 LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
19114 *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_ok(o_conv);
19115 return tag_ptr(ret_conv, true);
19118 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_err"))) TS_CResult_NodeAnnouncementDecodeErrorZ_err(uint64_t e) {
19119 LDKDecodeError e_conv;
19120 e_conv.inner = untag_ptr(e);
19121 e_conv.is_owned = ptr_is_owned(e);
19122 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
19123 e_conv = DecodeError_clone(&e_conv);
19124 LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
19125 *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_err(e_conv);
19126 return tag_ptr(ret_conv, true);
19129 jboolean __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_is_ok"))) TS_CResult_NodeAnnouncementDecodeErrorZ_is_ok(uint64_t o) {
19130 LDKCResult_NodeAnnouncementDecodeErrorZ* o_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(o);
19131 jboolean ret_conv = CResult_NodeAnnouncementDecodeErrorZ_is_ok(o_conv);
19135 void __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_free"))) TS_CResult_NodeAnnouncementDecodeErrorZ_free(uint64_t _res) {
19136 if (!ptr_is_owned(_res)) return;
19137 void* _res_ptr = untag_ptr(_res);
19138 CHECK_ACCESS(_res_ptr);
19139 LDKCResult_NodeAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_NodeAnnouncementDecodeErrorZ*)(_res_ptr);
19140 FREE(untag_ptr(_res));
19141 CResult_NodeAnnouncementDecodeErrorZ_free(_res_conv);
19144 static inline uint64_t CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR arg) {
19145 LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
19146 *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_clone(arg);
19147 return tag_ptr(ret_conv, true);
19149 int64_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_clone_ptr"))) TS_CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(uint64_t arg) {
19150 LDKCResult_NodeAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(arg);
19151 int64_t ret_conv = CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(arg_conv);
19155 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_clone"))) TS_CResult_NodeAnnouncementDecodeErrorZ_clone(uint64_t orig) {
19156 LDKCResult_NodeAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(orig);
19157 LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
19158 *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_clone(orig_conv);
19159 return tag_ptr(ret_conv, true);
19162 uint64_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_ok"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_ok(uint64_t o) {
19163 LDKQueryShortChannelIds o_conv;
19164 o_conv.inner = untag_ptr(o);
19165 o_conv.is_owned = ptr_is_owned(o);
19166 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19167 o_conv = QueryShortChannelIds_clone(&o_conv);
19168 LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
19169 *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_ok(o_conv);
19170 return tag_ptr(ret_conv, true);
19173 uint64_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_err"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_err(uint64_t e) {
19174 LDKDecodeError e_conv;
19175 e_conv.inner = untag_ptr(e);
19176 e_conv.is_owned = ptr_is_owned(e);
19177 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
19178 e_conv = DecodeError_clone(&e_conv);
19179 LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
19180 *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_err(e_conv);
19181 return tag_ptr(ret_conv, true);
19184 jboolean __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_is_ok"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(uint64_t o) {
19185 LDKCResult_QueryShortChannelIdsDecodeErrorZ* o_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(o);
19186 jboolean ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(o_conv);
19190 void __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_free"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_free(uint64_t _res) {
19191 if (!ptr_is_owned(_res)) return;
19192 void* _res_ptr = untag_ptr(_res);
19193 CHECK_ACCESS(_res_ptr);
19194 LDKCResult_QueryShortChannelIdsDecodeErrorZ _res_conv = *(LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(_res_ptr);
19195 FREE(untag_ptr(_res));
19196 CResult_QueryShortChannelIdsDecodeErrorZ_free(_res_conv);
19199 static inline uint64_t CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR arg) {
19200 LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
19201 *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_clone(arg);
19202 return tag_ptr(ret_conv, true);
19204 int64_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(uint64_t arg) {
19205 LDKCResult_QueryShortChannelIdsDecodeErrorZ* arg_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(arg);
19206 int64_t ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(arg_conv);
19210 uint64_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_clone"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_clone(uint64_t orig) {
19211 LDKCResult_QueryShortChannelIdsDecodeErrorZ* orig_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(orig);
19212 LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
19213 *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_clone(orig_conv);
19214 return tag_ptr(ret_conv, true);
19217 uint64_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(uint64_t o) {
19218 LDKReplyShortChannelIdsEnd o_conv;
19219 o_conv.inner = untag_ptr(o);
19220 o_conv.is_owned = ptr_is_owned(o);
19221 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19222 o_conv = ReplyShortChannelIdsEnd_clone(&o_conv);
19223 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
19224 *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(o_conv);
19225 return tag_ptr(ret_conv, true);
19228 uint64_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_err"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(uint64_t e) {
19229 LDKDecodeError e_conv;
19230 e_conv.inner = untag_ptr(e);
19231 e_conv.is_owned = ptr_is_owned(e);
19232 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
19233 e_conv = DecodeError_clone(&e_conv);
19234 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
19235 *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(e_conv);
19236 return tag_ptr(ret_conv, true);
19239 jboolean __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(uint64_t o) {
19240 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* o_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(o);
19241 jboolean ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(o_conv);
19245 void __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_free"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(uint64_t _res) {
19246 if (!ptr_is_owned(_res)) return;
19247 void* _res_ptr = untag_ptr(_res);
19248 CHECK_ACCESS(_res_ptr);
19249 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res_conv = *(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(_res_ptr);
19250 FREE(untag_ptr(_res));
19251 CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(_res_conv);
19254 static inline uint64_t CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR arg) {
19255 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
19256 *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(arg);
19257 return tag_ptr(ret_conv, true);
19259 int64_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(uint64_t arg) {
19260 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* arg_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(arg);
19261 int64_t ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(arg_conv);
19265 uint64_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(uint64_t orig) {
19266 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* orig_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(orig);
19267 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
19268 *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(orig_conv);
19269 return tag_ptr(ret_conv, true);
19272 uint64_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_ok"))) TS_CResult_QueryChannelRangeDecodeErrorZ_ok(uint64_t o) {
19273 LDKQueryChannelRange o_conv;
19274 o_conv.inner = untag_ptr(o);
19275 o_conv.is_owned = ptr_is_owned(o);
19276 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19277 o_conv = QueryChannelRange_clone(&o_conv);
19278 LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
19279 *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_ok(o_conv);
19280 return tag_ptr(ret_conv, true);
19283 uint64_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_err"))) TS_CResult_QueryChannelRangeDecodeErrorZ_err(uint64_t e) {
19284 LDKDecodeError e_conv;
19285 e_conv.inner = untag_ptr(e);
19286 e_conv.is_owned = ptr_is_owned(e);
19287 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
19288 e_conv = DecodeError_clone(&e_conv);
19289 LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
19290 *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_err(e_conv);
19291 return tag_ptr(ret_conv, true);
19294 jboolean __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_is_ok"))) TS_CResult_QueryChannelRangeDecodeErrorZ_is_ok(uint64_t o) {
19295 LDKCResult_QueryChannelRangeDecodeErrorZ* o_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(o);
19296 jboolean ret_conv = CResult_QueryChannelRangeDecodeErrorZ_is_ok(o_conv);
19300 void __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_free"))) TS_CResult_QueryChannelRangeDecodeErrorZ_free(uint64_t _res) {
19301 if (!ptr_is_owned(_res)) return;
19302 void* _res_ptr = untag_ptr(_res);
19303 CHECK_ACCESS(_res_ptr);
19304 LDKCResult_QueryChannelRangeDecodeErrorZ _res_conv = *(LDKCResult_QueryChannelRangeDecodeErrorZ*)(_res_ptr);
19305 FREE(untag_ptr(_res));
19306 CResult_QueryChannelRangeDecodeErrorZ_free(_res_conv);
19309 static inline uint64_t CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR arg) {
19310 LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
19311 *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_clone(arg);
19312 return tag_ptr(ret_conv, true);
19314 int64_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_clone_ptr"))) TS_CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(uint64_t arg) {
19315 LDKCResult_QueryChannelRangeDecodeErrorZ* arg_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(arg);
19316 int64_t ret_conv = CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(arg_conv);
19320 uint64_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_clone"))) TS_CResult_QueryChannelRangeDecodeErrorZ_clone(uint64_t orig) {
19321 LDKCResult_QueryChannelRangeDecodeErrorZ* orig_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(orig);
19322 LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
19323 *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_clone(orig_conv);
19324 return tag_ptr(ret_conv, true);
19327 uint64_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_ok"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_ok(uint64_t o) {
19328 LDKReplyChannelRange o_conv;
19329 o_conv.inner = untag_ptr(o);
19330 o_conv.is_owned = ptr_is_owned(o);
19331 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19332 o_conv = ReplyChannelRange_clone(&o_conv);
19333 LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
19334 *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_ok(o_conv);
19335 return tag_ptr(ret_conv, true);
19338 uint64_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_err"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_err(uint64_t e) {
19339 LDKDecodeError e_conv;
19340 e_conv.inner = untag_ptr(e);
19341 e_conv.is_owned = ptr_is_owned(e);
19342 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
19343 e_conv = DecodeError_clone(&e_conv);
19344 LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
19345 *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_err(e_conv);
19346 return tag_ptr(ret_conv, true);
19349 jboolean __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_is_ok"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_is_ok(uint64_t o) {
19350 LDKCResult_ReplyChannelRangeDecodeErrorZ* o_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(o);
19351 jboolean ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_is_ok(o_conv);
19355 void __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_free"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_free(uint64_t _res) {
19356 if (!ptr_is_owned(_res)) return;
19357 void* _res_ptr = untag_ptr(_res);
19358 CHECK_ACCESS(_res_ptr);
19359 LDKCResult_ReplyChannelRangeDecodeErrorZ _res_conv = *(LDKCResult_ReplyChannelRangeDecodeErrorZ*)(_res_ptr);
19360 FREE(untag_ptr(_res));
19361 CResult_ReplyChannelRangeDecodeErrorZ_free(_res_conv);
19364 static inline uint64_t CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR arg) {
19365 LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
19366 *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_clone(arg);
19367 return tag_ptr(ret_conv, true);
19369 int64_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(uint64_t arg) {
19370 LDKCResult_ReplyChannelRangeDecodeErrorZ* arg_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(arg);
19371 int64_t ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(arg_conv);
19375 uint64_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_clone"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_clone(uint64_t orig) {
19376 LDKCResult_ReplyChannelRangeDecodeErrorZ* orig_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(orig);
19377 LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
19378 *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_clone(orig_conv);
19379 return tag_ptr(ret_conv, true);
19382 uint64_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_ok"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_ok(uint64_t o) {
19383 LDKGossipTimestampFilter o_conv;
19384 o_conv.inner = untag_ptr(o);
19385 o_conv.is_owned = ptr_is_owned(o);
19386 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19387 o_conv = GossipTimestampFilter_clone(&o_conv);
19388 LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
19389 *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_ok(o_conv);
19390 return tag_ptr(ret_conv, true);
19393 uint64_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_err"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_err(uint64_t e) {
19394 LDKDecodeError e_conv;
19395 e_conv.inner = untag_ptr(e);
19396 e_conv.is_owned = ptr_is_owned(e);
19397 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
19398 e_conv = DecodeError_clone(&e_conv);
19399 LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
19400 *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_err(e_conv);
19401 return tag_ptr(ret_conv, true);
19404 jboolean __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_is_ok"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_is_ok(uint64_t o) {
19405 LDKCResult_GossipTimestampFilterDecodeErrorZ* o_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(o);
19406 jboolean ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_is_ok(o_conv);
19410 void __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_free"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_free(uint64_t _res) {
19411 if (!ptr_is_owned(_res)) return;
19412 void* _res_ptr = untag_ptr(_res);
19413 CHECK_ACCESS(_res_ptr);
19414 LDKCResult_GossipTimestampFilterDecodeErrorZ _res_conv = *(LDKCResult_GossipTimestampFilterDecodeErrorZ*)(_res_ptr);
19415 FREE(untag_ptr(_res));
19416 CResult_GossipTimestampFilterDecodeErrorZ_free(_res_conv);
19419 static inline uint64_t CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR arg) {
19420 LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
19421 *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_clone(arg);
19422 return tag_ptr(ret_conv, true);
19424 int64_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(uint64_t arg) {
19425 LDKCResult_GossipTimestampFilterDecodeErrorZ* arg_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(arg);
19426 int64_t ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(arg_conv);
19430 uint64_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_clone"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_clone(uint64_t orig) {
19431 LDKCResult_GossipTimestampFilterDecodeErrorZ* orig_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(orig);
19432 LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
19433 *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_clone(orig_conv);
19434 return tag_ptr(ret_conv, true);
19437 uint64_t __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_ok"))) TS_CResult_InvoiceSignOrCreationErrorZ_ok(uint64_t o) {
19439 o_conv.inner = untag_ptr(o);
19440 o_conv.is_owned = ptr_is_owned(o);
19441 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19442 o_conv = Invoice_clone(&o_conv);
19443 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
19444 *ret_conv = CResult_InvoiceSignOrCreationErrorZ_ok(o_conv);
19445 return tag_ptr(ret_conv, true);
19448 uint64_t __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_err"))) TS_CResult_InvoiceSignOrCreationErrorZ_err(uint64_t e) {
19449 void* e_ptr = untag_ptr(e);
19450 CHECK_ACCESS(e_ptr);
19451 LDKSignOrCreationError e_conv = *(LDKSignOrCreationError*)(e_ptr);
19452 e_conv = SignOrCreationError_clone((LDKSignOrCreationError*)untag_ptr(e));
19453 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
19454 *ret_conv = CResult_InvoiceSignOrCreationErrorZ_err(e_conv);
19455 return tag_ptr(ret_conv, true);
19458 jboolean __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_is_ok"))) TS_CResult_InvoiceSignOrCreationErrorZ_is_ok(uint64_t o) {
19459 LDKCResult_InvoiceSignOrCreationErrorZ* o_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(o);
19460 jboolean ret_conv = CResult_InvoiceSignOrCreationErrorZ_is_ok(o_conv);
19464 void __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_free"))) TS_CResult_InvoiceSignOrCreationErrorZ_free(uint64_t _res) {
19465 if (!ptr_is_owned(_res)) return;
19466 void* _res_ptr = untag_ptr(_res);
19467 CHECK_ACCESS(_res_ptr);
19468 LDKCResult_InvoiceSignOrCreationErrorZ _res_conv = *(LDKCResult_InvoiceSignOrCreationErrorZ*)(_res_ptr);
19469 FREE(untag_ptr(_res));
19470 CResult_InvoiceSignOrCreationErrorZ_free(_res_conv);
19473 static inline uint64_t CResult_InvoiceSignOrCreationErrorZ_clone_ptr(LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR arg) {
19474 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
19475 *ret_conv = CResult_InvoiceSignOrCreationErrorZ_clone(arg);
19476 return tag_ptr(ret_conv, true);
19478 int64_t __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_clone_ptr"))) TS_CResult_InvoiceSignOrCreationErrorZ_clone_ptr(uint64_t arg) {
19479 LDKCResult_InvoiceSignOrCreationErrorZ* arg_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(arg);
19480 int64_t ret_conv = CResult_InvoiceSignOrCreationErrorZ_clone_ptr(arg_conv);
19484 uint64_t __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_clone"))) TS_CResult_InvoiceSignOrCreationErrorZ_clone(uint64_t orig) {
19485 LDKCResult_InvoiceSignOrCreationErrorZ* orig_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(orig);
19486 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
19487 *ret_conv = CResult_InvoiceSignOrCreationErrorZ_clone(orig_conv);
19488 return tag_ptr(ret_conv, true);
19491 uint64_t __attribute__((export_name("TS_COption_FilterZ_some"))) TS_COption_FilterZ_some(uint64_t o) {
19492 void* o_ptr = untag_ptr(o);
19493 CHECK_ACCESS(o_ptr);
19494 LDKFilter o_conv = *(LDKFilter*)(o_ptr);
19495 if (o_conv.free == LDKFilter_JCalls_free) {
19496 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
19497 LDKFilter_JCalls_cloned(&o_conv);
19499 LDKCOption_FilterZ *ret_copy = MALLOC(sizeof(LDKCOption_FilterZ), "LDKCOption_FilterZ");
19500 *ret_copy = COption_FilterZ_some(o_conv);
19501 uint64_t ret_ref = tag_ptr(ret_copy, true);
19505 uint64_t __attribute__((export_name("TS_COption_FilterZ_none"))) TS_COption_FilterZ_none() {
19506 LDKCOption_FilterZ *ret_copy = MALLOC(sizeof(LDKCOption_FilterZ), "LDKCOption_FilterZ");
19507 *ret_copy = COption_FilterZ_none();
19508 uint64_t ret_ref = tag_ptr(ret_copy, true);
19512 void __attribute__((export_name("TS_COption_FilterZ_free"))) TS_COption_FilterZ_free(uint64_t _res) {
19513 if (!ptr_is_owned(_res)) return;
19514 void* _res_ptr = untag_ptr(_res);
19515 CHECK_ACCESS(_res_ptr);
19516 LDKCOption_FilterZ _res_conv = *(LDKCOption_FilterZ*)(_res_ptr);
19517 FREE(untag_ptr(_res));
19518 COption_FilterZ_free(_res_conv);
19521 uint64_t __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_ok"))) TS_CResult_LockedChannelMonitorNoneZ_ok(uint64_t o) {
19522 LDKLockedChannelMonitor o_conv;
19523 o_conv.inner = untag_ptr(o);
19524 o_conv.is_owned = ptr_is_owned(o);
19525 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19526 // WARNING: we need a move here but no clone is available for LDKLockedChannelMonitor
19528 LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ");
19529 *ret_conv = CResult_LockedChannelMonitorNoneZ_ok(o_conv);
19530 return tag_ptr(ret_conv, true);
19533 uint64_t __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_err"))) TS_CResult_LockedChannelMonitorNoneZ_err() {
19534 LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ");
19535 *ret_conv = CResult_LockedChannelMonitorNoneZ_err();
19536 return tag_ptr(ret_conv, true);
19539 jboolean __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_is_ok"))) TS_CResult_LockedChannelMonitorNoneZ_is_ok(uint64_t o) {
19540 LDKCResult_LockedChannelMonitorNoneZ* o_conv = (LDKCResult_LockedChannelMonitorNoneZ*)untag_ptr(o);
19541 jboolean ret_conv = CResult_LockedChannelMonitorNoneZ_is_ok(o_conv);
19545 void __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_free"))) TS_CResult_LockedChannelMonitorNoneZ_free(uint64_t _res) {
19546 if (!ptr_is_owned(_res)) return;
19547 void* _res_ptr = untag_ptr(_res);
19548 CHECK_ACCESS(_res_ptr);
19549 LDKCResult_LockedChannelMonitorNoneZ _res_conv = *(LDKCResult_LockedChannelMonitorNoneZ*)(_res_ptr);
19550 FREE(untag_ptr(_res));
19551 CResult_LockedChannelMonitorNoneZ_free(_res_conv);
19554 void __attribute__((export_name("TS_CVec_OutPointZ_free"))) TS_CVec_OutPointZ_free(uint64_tArray _res) {
19555 LDKCVec_OutPointZ _res_constr;
19556 _res_constr.datalen = _res->arr_len;
19557 if (_res_constr.datalen > 0)
19558 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKOutPoint), "LDKCVec_OutPointZ Elements");
19560 _res_constr.data = NULL;
19561 uint64_t* _res_vals = _res->elems;
19562 for (size_t k = 0; k < _res_constr.datalen; k++) {
19563 uint64_t _res_conv_10 = _res_vals[k];
19564 LDKOutPoint _res_conv_10_conv;
19565 _res_conv_10_conv.inner = untag_ptr(_res_conv_10);
19566 _res_conv_10_conv.is_owned = ptr_is_owned(_res_conv_10);
19567 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_10_conv);
19568 _res_constr.data[k] = _res_conv_10_conv;
19571 CVec_OutPointZ_free(_res_constr);
19574 void __attribute__((export_name("TS_PaymentPurpose_free"))) TS_PaymentPurpose_free(uint64_t this_ptr) {
19575 if (!ptr_is_owned(this_ptr)) return;
19576 void* this_ptr_ptr = untag_ptr(this_ptr);
19577 CHECK_ACCESS(this_ptr_ptr);
19578 LDKPaymentPurpose this_ptr_conv = *(LDKPaymentPurpose*)(this_ptr_ptr);
19579 FREE(untag_ptr(this_ptr));
19580 PaymentPurpose_free(this_ptr_conv);
19583 static inline uint64_t PaymentPurpose_clone_ptr(LDKPaymentPurpose *NONNULL_PTR arg) {
19584 LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
19585 *ret_copy = PaymentPurpose_clone(arg);
19586 uint64_t ret_ref = tag_ptr(ret_copy, true);
19589 int64_t __attribute__((export_name("TS_PaymentPurpose_clone_ptr"))) TS_PaymentPurpose_clone_ptr(uint64_t arg) {
19590 LDKPaymentPurpose* arg_conv = (LDKPaymentPurpose*)untag_ptr(arg);
19591 int64_t ret_conv = PaymentPurpose_clone_ptr(arg_conv);
19595 uint64_t __attribute__((export_name("TS_PaymentPurpose_clone"))) TS_PaymentPurpose_clone(uint64_t orig) {
19596 LDKPaymentPurpose* orig_conv = (LDKPaymentPurpose*)untag_ptr(orig);
19597 LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
19598 *ret_copy = PaymentPurpose_clone(orig_conv);
19599 uint64_t ret_ref = tag_ptr(ret_copy, true);
19603 uint64_t __attribute__((export_name("TS_PaymentPurpose_invoice_payment"))) TS_PaymentPurpose_invoice_payment(int8_tArray payment_preimage, int8_tArray payment_secret) {
19604 LDKThirtyTwoBytes payment_preimage_ref;
19605 CHECK(payment_preimage->arr_len == 32);
19606 memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage);
19607 LDKThirtyTwoBytes payment_secret_ref;
19608 CHECK(payment_secret->arr_len == 32);
19609 memcpy(payment_secret_ref.data, payment_secret->elems, 32); FREE(payment_secret);
19610 LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
19611 *ret_copy = PaymentPurpose_invoice_payment(payment_preimage_ref, payment_secret_ref);
19612 uint64_t ret_ref = tag_ptr(ret_copy, true);
19616 uint64_t __attribute__((export_name("TS_PaymentPurpose_spontaneous_payment"))) TS_PaymentPurpose_spontaneous_payment(int8_tArray a) {
19617 LDKThirtyTwoBytes a_ref;
19618 CHECK(a->arr_len == 32);
19619 memcpy(a_ref.data, a->elems, 32); FREE(a);
19620 LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
19621 *ret_copy = PaymentPurpose_spontaneous_payment(a_ref);
19622 uint64_t ret_ref = tag_ptr(ret_copy, true);
19626 int8_tArray __attribute__((export_name("TS_PaymentPurpose_write"))) TS_PaymentPurpose_write(uint64_t obj) {
19627 LDKPaymentPurpose* obj_conv = (LDKPaymentPurpose*)untag_ptr(obj);
19628 LDKCVec_u8Z ret_var = PaymentPurpose_write(obj_conv);
19629 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
19630 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
19631 CVec_u8Z_free(ret_var);
19635 uint64_t __attribute__((export_name("TS_PaymentPurpose_read"))) TS_PaymentPurpose_read(int8_tArray ser) {
19636 LDKu8slice ser_ref;
19637 ser_ref.datalen = ser->arr_len;
19638 ser_ref.data = ser->elems;
19639 LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
19640 *ret_conv = PaymentPurpose_read(ser_ref);
19642 return tag_ptr(ret_conv, true);
19645 void __attribute__((export_name("TS_ClosureReason_free"))) TS_ClosureReason_free(uint64_t this_ptr) {
19646 if (!ptr_is_owned(this_ptr)) return;
19647 void* this_ptr_ptr = untag_ptr(this_ptr);
19648 CHECK_ACCESS(this_ptr_ptr);
19649 LDKClosureReason this_ptr_conv = *(LDKClosureReason*)(this_ptr_ptr);
19650 FREE(untag_ptr(this_ptr));
19651 ClosureReason_free(this_ptr_conv);
19654 static inline uint64_t ClosureReason_clone_ptr(LDKClosureReason *NONNULL_PTR arg) {
19655 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
19656 *ret_copy = ClosureReason_clone(arg);
19657 uint64_t ret_ref = tag_ptr(ret_copy, true);
19660 int64_t __attribute__((export_name("TS_ClosureReason_clone_ptr"))) TS_ClosureReason_clone_ptr(uint64_t arg) {
19661 LDKClosureReason* arg_conv = (LDKClosureReason*)untag_ptr(arg);
19662 int64_t ret_conv = ClosureReason_clone_ptr(arg_conv);
19666 uint64_t __attribute__((export_name("TS_ClosureReason_clone"))) TS_ClosureReason_clone(uint64_t orig) {
19667 LDKClosureReason* orig_conv = (LDKClosureReason*)untag_ptr(orig);
19668 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
19669 *ret_copy = ClosureReason_clone(orig_conv);
19670 uint64_t ret_ref = tag_ptr(ret_copy, true);
19674 uint64_t __attribute__((export_name("TS_ClosureReason_counterparty_force_closed"))) TS_ClosureReason_counterparty_force_closed(jstring peer_msg) {
19675 LDKStr peer_msg_conv = str_ref_to_owned_c(peer_msg);
19676 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
19677 *ret_copy = ClosureReason_counterparty_force_closed(peer_msg_conv);
19678 uint64_t ret_ref = tag_ptr(ret_copy, true);
19682 uint64_t __attribute__((export_name("TS_ClosureReason_holder_force_closed"))) TS_ClosureReason_holder_force_closed() {
19683 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
19684 *ret_copy = ClosureReason_holder_force_closed();
19685 uint64_t ret_ref = tag_ptr(ret_copy, true);
19689 uint64_t __attribute__((export_name("TS_ClosureReason_cooperative_closure"))) TS_ClosureReason_cooperative_closure() {
19690 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
19691 *ret_copy = ClosureReason_cooperative_closure();
19692 uint64_t ret_ref = tag_ptr(ret_copy, true);
19696 uint64_t __attribute__((export_name("TS_ClosureReason_commitment_tx_confirmed"))) TS_ClosureReason_commitment_tx_confirmed() {
19697 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
19698 *ret_copy = ClosureReason_commitment_tx_confirmed();
19699 uint64_t ret_ref = tag_ptr(ret_copy, true);
19703 uint64_t __attribute__((export_name("TS_ClosureReason_funding_timed_out"))) TS_ClosureReason_funding_timed_out() {
19704 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
19705 *ret_copy = ClosureReason_funding_timed_out();
19706 uint64_t ret_ref = tag_ptr(ret_copy, true);
19710 uint64_t __attribute__((export_name("TS_ClosureReason_processing_error"))) TS_ClosureReason_processing_error(jstring err) {
19711 LDKStr err_conv = str_ref_to_owned_c(err);
19712 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
19713 *ret_copy = ClosureReason_processing_error(err_conv);
19714 uint64_t ret_ref = tag_ptr(ret_copy, true);
19718 uint64_t __attribute__((export_name("TS_ClosureReason_disconnected_peer"))) TS_ClosureReason_disconnected_peer() {
19719 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
19720 *ret_copy = ClosureReason_disconnected_peer();
19721 uint64_t ret_ref = tag_ptr(ret_copy, true);
19725 uint64_t __attribute__((export_name("TS_ClosureReason_outdated_channel_manager"))) TS_ClosureReason_outdated_channel_manager() {
19726 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
19727 *ret_copy = ClosureReason_outdated_channel_manager();
19728 uint64_t ret_ref = tag_ptr(ret_copy, true);
19732 int8_tArray __attribute__((export_name("TS_ClosureReason_write"))) TS_ClosureReason_write(uint64_t obj) {
19733 LDKClosureReason* obj_conv = (LDKClosureReason*)untag_ptr(obj);
19734 LDKCVec_u8Z ret_var = ClosureReason_write(obj_conv);
19735 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
19736 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
19737 CVec_u8Z_free(ret_var);
19741 uint64_t __attribute__((export_name("TS_ClosureReason_read"))) TS_ClosureReason_read(int8_tArray ser) {
19742 LDKu8slice ser_ref;
19743 ser_ref.datalen = ser->arr_len;
19744 ser_ref.data = ser->elems;
19745 LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
19746 *ret_conv = ClosureReason_read(ser_ref);
19748 return tag_ptr(ret_conv, true);
19751 void __attribute__((export_name("TS_HTLCDestination_free"))) TS_HTLCDestination_free(uint64_t this_ptr) {
19752 if (!ptr_is_owned(this_ptr)) return;
19753 void* this_ptr_ptr = untag_ptr(this_ptr);
19754 CHECK_ACCESS(this_ptr_ptr);
19755 LDKHTLCDestination this_ptr_conv = *(LDKHTLCDestination*)(this_ptr_ptr);
19756 FREE(untag_ptr(this_ptr));
19757 HTLCDestination_free(this_ptr_conv);
19760 static inline uint64_t HTLCDestination_clone_ptr(LDKHTLCDestination *NONNULL_PTR arg) {
19761 LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination");
19762 *ret_copy = HTLCDestination_clone(arg);
19763 uint64_t ret_ref = tag_ptr(ret_copy, true);
19766 int64_t __attribute__((export_name("TS_HTLCDestination_clone_ptr"))) TS_HTLCDestination_clone_ptr(uint64_t arg) {
19767 LDKHTLCDestination* arg_conv = (LDKHTLCDestination*)untag_ptr(arg);
19768 int64_t ret_conv = HTLCDestination_clone_ptr(arg_conv);
19772 uint64_t __attribute__((export_name("TS_HTLCDestination_clone"))) TS_HTLCDestination_clone(uint64_t orig) {
19773 LDKHTLCDestination* orig_conv = (LDKHTLCDestination*)untag_ptr(orig);
19774 LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination");
19775 *ret_copy = HTLCDestination_clone(orig_conv);
19776 uint64_t ret_ref = tag_ptr(ret_copy, true);
19780 uint64_t __attribute__((export_name("TS_HTLCDestination_next_hop_channel"))) TS_HTLCDestination_next_hop_channel(int8_tArray node_id, int8_tArray channel_id) {
19781 LDKPublicKey node_id_ref;
19782 CHECK(node_id->arr_len == 33);
19783 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
19784 LDKThirtyTwoBytes channel_id_ref;
19785 CHECK(channel_id->arr_len == 32);
19786 memcpy(channel_id_ref.data, channel_id->elems, 32); FREE(channel_id);
19787 LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination");
19788 *ret_copy = HTLCDestination_next_hop_channel(node_id_ref, channel_id_ref);
19789 uint64_t ret_ref = tag_ptr(ret_copy, true);
19793 uint64_t __attribute__((export_name("TS_HTLCDestination_unknown_next_hop"))) TS_HTLCDestination_unknown_next_hop(int64_t requested_forward_scid) {
19794 LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination");
19795 *ret_copy = HTLCDestination_unknown_next_hop(requested_forward_scid);
19796 uint64_t ret_ref = tag_ptr(ret_copy, true);
19800 uint64_t __attribute__((export_name("TS_HTLCDestination_failed_payment"))) TS_HTLCDestination_failed_payment(int8_tArray payment_hash) {
19801 LDKThirtyTwoBytes payment_hash_ref;
19802 CHECK(payment_hash->arr_len == 32);
19803 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
19804 LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination");
19805 *ret_copy = HTLCDestination_failed_payment(payment_hash_ref);
19806 uint64_t ret_ref = tag_ptr(ret_copy, true);
19810 int8_tArray __attribute__((export_name("TS_HTLCDestination_write"))) TS_HTLCDestination_write(uint64_t obj) {
19811 LDKHTLCDestination* obj_conv = (LDKHTLCDestination*)untag_ptr(obj);
19812 LDKCVec_u8Z ret_var = HTLCDestination_write(obj_conv);
19813 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
19814 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
19815 CVec_u8Z_free(ret_var);
19819 uint64_t __attribute__((export_name("TS_HTLCDestination_read"))) TS_HTLCDestination_read(int8_tArray ser) {
19820 LDKu8slice ser_ref;
19821 ser_ref.datalen = ser->arr_len;
19822 ser_ref.data = ser->elems;
19823 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ");
19824 *ret_conv = HTLCDestination_read(ser_ref);
19826 return tag_ptr(ret_conv, true);
19829 void __attribute__((export_name("TS_Event_free"))) TS_Event_free(uint64_t this_ptr) {
19830 if (!ptr_is_owned(this_ptr)) return;
19831 void* this_ptr_ptr = untag_ptr(this_ptr);
19832 CHECK_ACCESS(this_ptr_ptr);
19833 LDKEvent this_ptr_conv = *(LDKEvent*)(this_ptr_ptr);
19834 FREE(untag_ptr(this_ptr));
19835 Event_free(this_ptr_conv);
19838 static inline uint64_t Event_clone_ptr(LDKEvent *NONNULL_PTR arg) {
19839 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
19840 *ret_copy = Event_clone(arg);
19841 uint64_t ret_ref = tag_ptr(ret_copy, true);
19844 int64_t __attribute__((export_name("TS_Event_clone_ptr"))) TS_Event_clone_ptr(uint64_t arg) {
19845 LDKEvent* arg_conv = (LDKEvent*)untag_ptr(arg);
19846 int64_t ret_conv = Event_clone_ptr(arg_conv);
19850 uint64_t __attribute__((export_name("TS_Event_clone"))) TS_Event_clone(uint64_t orig) {
19851 LDKEvent* orig_conv = (LDKEvent*)untag_ptr(orig);
19852 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
19853 *ret_copy = Event_clone(orig_conv);
19854 uint64_t ret_ref = tag_ptr(ret_copy, true);
19858 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) {
19859 LDKThirtyTwoBytes temporary_channel_id_ref;
19860 CHECK(temporary_channel_id->arr_len == 32);
19861 memcpy(temporary_channel_id_ref.data, temporary_channel_id->elems, 32); FREE(temporary_channel_id);
19862 LDKPublicKey counterparty_node_id_ref;
19863 CHECK(counterparty_node_id->arr_len == 33);
19864 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
19865 LDKCVec_u8Z output_script_ref;
19866 output_script_ref.datalen = output_script->arr_len;
19867 output_script_ref.data = MALLOC(output_script_ref.datalen, "LDKCVec_u8Z Bytes");
19868 memcpy(output_script_ref.data, output_script->elems, output_script_ref.datalen); FREE(output_script);
19869 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
19870 *ret_copy = Event_funding_generation_ready(temporary_channel_id_ref, counterparty_node_id_ref, channel_value_satoshis, output_script_ref, user_channel_id);
19871 uint64_t ret_ref = tag_ptr(ret_copy, true);
19875 uint64_t __attribute__((export_name("TS_Event_payment_received"))) TS_Event_payment_received(int8_tArray payment_hash, int64_t amount_msat, uint64_t purpose) {
19876 LDKThirtyTwoBytes payment_hash_ref;
19877 CHECK(payment_hash->arr_len == 32);
19878 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
19879 void* purpose_ptr = untag_ptr(purpose);
19880 CHECK_ACCESS(purpose_ptr);
19881 LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr);
19882 purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(purpose));
19883 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
19884 *ret_copy = Event_payment_received(payment_hash_ref, amount_msat, purpose_conv);
19885 uint64_t ret_ref = tag_ptr(ret_copy, true);
19889 uint64_t __attribute__((export_name("TS_Event_payment_claimed"))) TS_Event_payment_claimed(int8_tArray payment_hash, int64_t amount_msat, uint64_t purpose) {
19890 LDKThirtyTwoBytes payment_hash_ref;
19891 CHECK(payment_hash->arr_len == 32);
19892 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
19893 void* purpose_ptr = untag_ptr(purpose);
19894 CHECK_ACCESS(purpose_ptr);
19895 LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr);
19896 purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(purpose));
19897 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
19898 *ret_copy = Event_payment_claimed(payment_hash_ref, amount_msat, purpose_conv);
19899 uint64_t ret_ref = tag_ptr(ret_copy, true);
19903 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) {
19904 LDKThirtyTwoBytes payment_id_ref;
19905 CHECK(payment_id->arr_len == 32);
19906 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
19907 LDKThirtyTwoBytes payment_preimage_ref;
19908 CHECK(payment_preimage->arr_len == 32);
19909 memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage);
19910 LDKThirtyTwoBytes payment_hash_ref;
19911 CHECK(payment_hash->arr_len == 32);
19912 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
19913 void* fee_paid_msat_ptr = untag_ptr(fee_paid_msat);
19914 CHECK_ACCESS(fee_paid_msat_ptr);
19915 LDKCOption_u64Z fee_paid_msat_conv = *(LDKCOption_u64Z*)(fee_paid_msat_ptr);
19916 fee_paid_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(fee_paid_msat));
19917 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
19918 *ret_copy = Event_payment_sent(payment_id_ref, payment_preimage_ref, payment_hash_ref, fee_paid_msat_conv);
19919 uint64_t ret_ref = tag_ptr(ret_copy, true);
19923 uint64_t __attribute__((export_name("TS_Event_payment_failed"))) TS_Event_payment_failed(int8_tArray payment_id, int8_tArray payment_hash) {
19924 LDKThirtyTwoBytes payment_id_ref;
19925 CHECK(payment_id->arr_len == 32);
19926 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
19927 LDKThirtyTwoBytes payment_hash_ref;
19928 CHECK(payment_hash->arr_len == 32);
19929 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
19930 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
19931 *ret_copy = Event_payment_failed(payment_id_ref, payment_hash_ref);
19932 uint64_t ret_ref = tag_ptr(ret_copy, true);
19936 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) {
19937 LDKThirtyTwoBytes payment_id_ref;
19938 CHECK(payment_id->arr_len == 32);
19939 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
19940 LDKThirtyTwoBytes payment_hash_ref;
19941 CHECK(payment_hash->arr_len == 32);
19942 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
19943 LDKCVec_RouteHopZ path_constr;
19944 path_constr.datalen = path->arr_len;
19945 if (path_constr.datalen > 0)
19946 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
19948 path_constr.data = NULL;
19949 uint64_t* path_vals = path->elems;
19950 for (size_t k = 0; k < path_constr.datalen; k++) {
19951 uint64_t path_conv_10 = path_vals[k];
19952 LDKRouteHop path_conv_10_conv;
19953 path_conv_10_conv.inner = untag_ptr(path_conv_10);
19954 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
19955 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
19956 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
19957 path_constr.data[k] = path_conv_10_conv;
19960 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
19961 *ret_copy = Event_payment_path_successful(payment_id_ref, payment_hash_ref, path_constr);
19962 uint64_t ret_ref = tag_ptr(ret_copy, true);
19966 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) {
19967 LDKThirtyTwoBytes payment_id_ref;
19968 CHECK(payment_id->arr_len == 32);
19969 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
19970 LDKThirtyTwoBytes payment_hash_ref;
19971 CHECK(payment_hash->arr_len == 32);
19972 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
19973 void* network_update_ptr = untag_ptr(network_update);
19974 CHECK_ACCESS(network_update_ptr);
19975 LDKCOption_NetworkUpdateZ network_update_conv = *(LDKCOption_NetworkUpdateZ*)(network_update_ptr);
19976 network_update_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)untag_ptr(network_update));
19977 LDKCVec_RouteHopZ path_constr;
19978 path_constr.datalen = path->arr_len;
19979 if (path_constr.datalen > 0)
19980 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
19982 path_constr.data = NULL;
19983 uint64_t* path_vals = path->elems;
19984 for (size_t k = 0; k < path_constr.datalen; k++) {
19985 uint64_t path_conv_10 = path_vals[k];
19986 LDKRouteHop path_conv_10_conv;
19987 path_conv_10_conv.inner = untag_ptr(path_conv_10);
19988 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
19989 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
19990 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
19991 path_constr.data[k] = path_conv_10_conv;
19994 void* short_channel_id_ptr = untag_ptr(short_channel_id);
19995 CHECK_ACCESS(short_channel_id_ptr);
19996 LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr);
19997 short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id));
19998 LDKRouteParameters retry_conv;
19999 retry_conv.inner = untag_ptr(retry);
20000 retry_conv.is_owned = ptr_is_owned(retry);
20001 CHECK_INNER_FIELD_ACCESS_OR_NULL(retry_conv);
20002 retry_conv = RouteParameters_clone(&retry_conv);
20003 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
20004 *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);
20005 uint64_t ret_ref = tag_ptr(ret_copy, true);
20009 uint64_t __attribute__((export_name("TS_Event_probe_successful"))) TS_Event_probe_successful(int8_tArray payment_id, int8_tArray payment_hash, uint64_tArray path) {
20010 LDKThirtyTwoBytes payment_id_ref;
20011 CHECK(payment_id->arr_len == 32);
20012 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
20013 LDKThirtyTwoBytes payment_hash_ref;
20014 CHECK(payment_hash->arr_len == 32);
20015 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
20016 LDKCVec_RouteHopZ path_constr;
20017 path_constr.datalen = path->arr_len;
20018 if (path_constr.datalen > 0)
20019 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
20021 path_constr.data = NULL;
20022 uint64_t* path_vals = path->elems;
20023 for (size_t k = 0; k < path_constr.datalen; k++) {
20024 uint64_t path_conv_10 = path_vals[k];
20025 LDKRouteHop path_conv_10_conv;
20026 path_conv_10_conv.inner = untag_ptr(path_conv_10);
20027 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
20028 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
20029 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
20030 path_constr.data[k] = path_conv_10_conv;
20033 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
20034 *ret_copy = Event_probe_successful(payment_id_ref, payment_hash_ref, path_constr);
20035 uint64_t ret_ref = tag_ptr(ret_copy, true);
20039 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) {
20040 LDKThirtyTwoBytes payment_id_ref;
20041 CHECK(payment_id->arr_len == 32);
20042 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
20043 LDKThirtyTwoBytes payment_hash_ref;
20044 CHECK(payment_hash->arr_len == 32);
20045 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
20046 LDKCVec_RouteHopZ path_constr;
20047 path_constr.datalen = path->arr_len;
20048 if (path_constr.datalen > 0)
20049 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
20051 path_constr.data = NULL;
20052 uint64_t* path_vals = path->elems;
20053 for (size_t k = 0; k < path_constr.datalen; k++) {
20054 uint64_t path_conv_10 = path_vals[k];
20055 LDKRouteHop path_conv_10_conv;
20056 path_conv_10_conv.inner = untag_ptr(path_conv_10);
20057 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
20058 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
20059 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
20060 path_constr.data[k] = path_conv_10_conv;
20063 void* short_channel_id_ptr = untag_ptr(short_channel_id);
20064 CHECK_ACCESS(short_channel_id_ptr);
20065 LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr);
20066 short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id));
20067 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
20068 *ret_copy = Event_probe_failed(payment_id_ref, payment_hash_ref, path_constr, short_channel_id_conv);
20069 uint64_t ret_ref = tag_ptr(ret_copy, true);
20073 uint64_t __attribute__((export_name("TS_Event_pending_htlcs_forwardable"))) TS_Event_pending_htlcs_forwardable(int64_t time_forwardable) {
20074 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
20075 *ret_copy = Event_pending_htlcs_forwardable(time_forwardable);
20076 uint64_t ret_ref = tag_ptr(ret_copy, true);
20080 uint64_t __attribute__((export_name("TS_Event_spendable_outputs"))) TS_Event_spendable_outputs(uint64_tArray outputs) {
20081 LDKCVec_SpendableOutputDescriptorZ outputs_constr;
20082 outputs_constr.datalen = outputs->arr_len;
20083 if (outputs_constr.datalen > 0)
20084 outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
20086 outputs_constr.data = NULL;
20087 uint64_t* outputs_vals = outputs->elems;
20088 for (size_t b = 0; b < outputs_constr.datalen; b++) {
20089 uint64_t outputs_conv_27 = outputs_vals[b];
20090 void* outputs_conv_27_ptr = untag_ptr(outputs_conv_27);
20091 CHECK_ACCESS(outputs_conv_27_ptr);
20092 LDKSpendableOutputDescriptor outputs_conv_27_conv = *(LDKSpendableOutputDescriptor*)(outputs_conv_27_ptr);
20093 outputs_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(outputs_conv_27));
20094 outputs_constr.data[b] = outputs_conv_27_conv;
20097 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
20098 *ret_copy = Event_spendable_outputs(outputs_constr);
20099 uint64_t ret_ref = tag_ptr(ret_copy, true);
20103 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) {
20104 LDKThirtyTwoBytes prev_channel_id_ref;
20105 CHECK(prev_channel_id->arr_len == 32);
20106 memcpy(prev_channel_id_ref.data, prev_channel_id->elems, 32); FREE(prev_channel_id);
20107 LDKThirtyTwoBytes next_channel_id_ref;
20108 CHECK(next_channel_id->arr_len == 32);
20109 memcpy(next_channel_id_ref.data, next_channel_id->elems, 32); FREE(next_channel_id);
20110 void* fee_earned_msat_ptr = untag_ptr(fee_earned_msat);
20111 CHECK_ACCESS(fee_earned_msat_ptr);
20112 LDKCOption_u64Z fee_earned_msat_conv = *(LDKCOption_u64Z*)(fee_earned_msat_ptr);
20113 fee_earned_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(fee_earned_msat));
20114 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
20115 *ret_copy = Event_payment_forwarded(prev_channel_id_ref, next_channel_id_ref, fee_earned_msat_conv, claim_from_onchain_tx);
20116 uint64_t ret_ref = tag_ptr(ret_copy, true);
20120 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) {
20121 LDKThirtyTwoBytes channel_id_ref;
20122 CHECK(channel_id->arr_len == 32);
20123 memcpy(channel_id_ref.data, channel_id->elems, 32); FREE(channel_id);
20124 void* reason_ptr = untag_ptr(reason);
20125 CHECK_ACCESS(reason_ptr);
20126 LDKClosureReason reason_conv = *(LDKClosureReason*)(reason_ptr);
20127 reason_conv = ClosureReason_clone((LDKClosureReason*)untag_ptr(reason));
20128 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
20129 *ret_copy = Event_channel_closed(channel_id_ref, user_channel_id, reason_conv);
20130 uint64_t ret_ref = tag_ptr(ret_copy, true);
20134 uint64_t __attribute__((export_name("TS_Event_discard_funding"))) TS_Event_discard_funding(int8_tArray channel_id, int8_tArray transaction) {
20135 LDKThirtyTwoBytes channel_id_ref;
20136 CHECK(channel_id->arr_len == 32);
20137 memcpy(channel_id_ref.data, channel_id->elems, 32); FREE(channel_id);
20138 LDKTransaction transaction_ref;
20139 transaction_ref.datalen = transaction->arr_len;
20140 transaction_ref.data = MALLOC(transaction_ref.datalen, "LDKTransaction Bytes");
20141 memcpy(transaction_ref.data, transaction->elems, transaction_ref.datalen); FREE(transaction);
20142 transaction_ref.data_is_owned = true;
20143 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
20144 *ret_copy = Event_discard_funding(channel_id_ref, transaction_ref);
20145 uint64_t ret_ref = tag_ptr(ret_copy, true);
20149 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) {
20150 LDKThirtyTwoBytes temporary_channel_id_ref;
20151 CHECK(temporary_channel_id->arr_len == 32);
20152 memcpy(temporary_channel_id_ref.data, temporary_channel_id->elems, 32); FREE(temporary_channel_id);
20153 LDKPublicKey counterparty_node_id_ref;
20154 CHECK(counterparty_node_id->arr_len == 33);
20155 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
20156 LDKChannelTypeFeatures channel_type_conv;
20157 channel_type_conv.inner = untag_ptr(channel_type);
20158 channel_type_conv.is_owned = ptr_is_owned(channel_type);
20159 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_conv);
20160 channel_type_conv = ChannelTypeFeatures_clone(&channel_type_conv);
20161 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
20162 *ret_copy = Event_open_channel_request(temporary_channel_id_ref, counterparty_node_id_ref, funding_satoshis, push_msat, channel_type_conv);
20163 uint64_t ret_ref = tag_ptr(ret_copy, true);
20167 uint64_t __attribute__((export_name("TS_Event_htlchandling_failed"))) TS_Event_htlchandling_failed(int8_tArray prev_channel_id, uint64_t failed_next_destination) {
20168 LDKThirtyTwoBytes prev_channel_id_ref;
20169 CHECK(prev_channel_id->arr_len == 32);
20170 memcpy(prev_channel_id_ref.data, prev_channel_id->elems, 32); FREE(prev_channel_id);
20171 void* failed_next_destination_ptr = untag_ptr(failed_next_destination);
20172 CHECK_ACCESS(failed_next_destination_ptr);
20173 LDKHTLCDestination failed_next_destination_conv = *(LDKHTLCDestination*)(failed_next_destination_ptr);
20174 failed_next_destination_conv = HTLCDestination_clone((LDKHTLCDestination*)untag_ptr(failed_next_destination));
20175 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
20176 *ret_copy = Event_htlchandling_failed(prev_channel_id_ref, failed_next_destination_conv);
20177 uint64_t ret_ref = tag_ptr(ret_copy, true);
20181 int8_tArray __attribute__((export_name("TS_Event_write"))) TS_Event_write(uint64_t obj) {
20182 LDKEvent* obj_conv = (LDKEvent*)untag_ptr(obj);
20183 LDKCVec_u8Z ret_var = Event_write(obj_conv);
20184 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
20185 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
20186 CVec_u8Z_free(ret_var);
20190 uint64_t __attribute__((export_name("TS_Event_read"))) TS_Event_read(int8_tArray ser) {
20191 LDKu8slice ser_ref;
20192 ser_ref.datalen = ser->arr_len;
20193 ser_ref.data = ser->elems;
20194 LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
20195 *ret_conv = Event_read(ser_ref);
20197 return tag_ptr(ret_conv, true);
20200 void __attribute__((export_name("TS_MessageSendEvent_free"))) TS_MessageSendEvent_free(uint64_t this_ptr) {
20201 if (!ptr_is_owned(this_ptr)) return;
20202 void* this_ptr_ptr = untag_ptr(this_ptr);
20203 CHECK_ACCESS(this_ptr_ptr);
20204 LDKMessageSendEvent this_ptr_conv = *(LDKMessageSendEvent*)(this_ptr_ptr);
20205 FREE(untag_ptr(this_ptr));
20206 MessageSendEvent_free(this_ptr_conv);
20209 static inline uint64_t MessageSendEvent_clone_ptr(LDKMessageSendEvent *NONNULL_PTR arg) {
20210 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20211 *ret_copy = MessageSendEvent_clone(arg);
20212 uint64_t ret_ref = tag_ptr(ret_copy, true);
20215 int64_t __attribute__((export_name("TS_MessageSendEvent_clone_ptr"))) TS_MessageSendEvent_clone_ptr(uint64_t arg) {
20216 LDKMessageSendEvent* arg_conv = (LDKMessageSendEvent*)untag_ptr(arg);
20217 int64_t ret_conv = MessageSendEvent_clone_ptr(arg_conv);
20221 uint64_t __attribute__((export_name("TS_MessageSendEvent_clone"))) TS_MessageSendEvent_clone(uint64_t orig) {
20222 LDKMessageSendEvent* orig_conv = (LDKMessageSendEvent*)untag_ptr(orig);
20223 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20224 *ret_copy = MessageSendEvent_clone(orig_conv);
20225 uint64_t ret_ref = tag_ptr(ret_copy, true);
20229 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_accept_channel"))) TS_MessageSendEvent_send_accept_channel(int8_tArray node_id, uint64_t msg) {
20230 LDKPublicKey node_id_ref;
20231 CHECK(node_id->arr_len == 33);
20232 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20233 LDKAcceptChannel msg_conv;
20234 msg_conv.inner = untag_ptr(msg);
20235 msg_conv.is_owned = ptr_is_owned(msg);
20236 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20237 msg_conv = AcceptChannel_clone(&msg_conv);
20238 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20239 *ret_copy = MessageSendEvent_send_accept_channel(node_id_ref, msg_conv);
20240 uint64_t ret_ref = tag_ptr(ret_copy, true);
20244 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_open_channel"))) TS_MessageSendEvent_send_open_channel(int8_tArray node_id, uint64_t msg) {
20245 LDKPublicKey node_id_ref;
20246 CHECK(node_id->arr_len == 33);
20247 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20248 LDKOpenChannel msg_conv;
20249 msg_conv.inner = untag_ptr(msg);
20250 msg_conv.is_owned = ptr_is_owned(msg);
20251 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20252 msg_conv = OpenChannel_clone(&msg_conv);
20253 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20254 *ret_copy = MessageSendEvent_send_open_channel(node_id_ref, msg_conv);
20255 uint64_t ret_ref = tag_ptr(ret_copy, true);
20259 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_funding_created"))) TS_MessageSendEvent_send_funding_created(int8_tArray node_id, uint64_t msg) {
20260 LDKPublicKey node_id_ref;
20261 CHECK(node_id->arr_len == 33);
20262 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20263 LDKFundingCreated msg_conv;
20264 msg_conv.inner = untag_ptr(msg);
20265 msg_conv.is_owned = ptr_is_owned(msg);
20266 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20267 msg_conv = FundingCreated_clone(&msg_conv);
20268 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20269 *ret_copy = MessageSendEvent_send_funding_created(node_id_ref, msg_conv);
20270 uint64_t ret_ref = tag_ptr(ret_copy, true);
20274 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_funding_signed"))) TS_MessageSendEvent_send_funding_signed(int8_tArray node_id, uint64_t msg) {
20275 LDKPublicKey node_id_ref;
20276 CHECK(node_id->arr_len == 33);
20277 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20278 LDKFundingSigned msg_conv;
20279 msg_conv.inner = untag_ptr(msg);
20280 msg_conv.is_owned = ptr_is_owned(msg);
20281 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20282 msg_conv = FundingSigned_clone(&msg_conv);
20283 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20284 *ret_copy = MessageSendEvent_send_funding_signed(node_id_ref, msg_conv);
20285 uint64_t ret_ref = tag_ptr(ret_copy, true);
20289 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_channel_ready"))) TS_MessageSendEvent_send_channel_ready(int8_tArray node_id, uint64_t msg) {
20290 LDKPublicKey node_id_ref;
20291 CHECK(node_id->arr_len == 33);
20292 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20293 LDKChannelReady msg_conv;
20294 msg_conv.inner = untag_ptr(msg);
20295 msg_conv.is_owned = ptr_is_owned(msg);
20296 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20297 msg_conv = ChannelReady_clone(&msg_conv);
20298 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20299 *ret_copy = MessageSendEvent_send_channel_ready(node_id_ref, msg_conv);
20300 uint64_t ret_ref = tag_ptr(ret_copy, true);
20304 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_announcement_signatures"))) TS_MessageSendEvent_send_announcement_signatures(int8_tArray node_id, uint64_t msg) {
20305 LDKPublicKey node_id_ref;
20306 CHECK(node_id->arr_len == 33);
20307 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20308 LDKAnnouncementSignatures msg_conv;
20309 msg_conv.inner = untag_ptr(msg);
20310 msg_conv.is_owned = ptr_is_owned(msg);
20311 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20312 msg_conv = AnnouncementSignatures_clone(&msg_conv);
20313 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20314 *ret_copy = MessageSendEvent_send_announcement_signatures(node_id_ref, msg_conv);
20315 uint64_t ret_ref = tag_ptr(ret_copy, true);
20319 uint64_t __attribute__((export_name("TS_MessageSendEvent_update_htlcs"))) TS_MessageSendEvent_update_htlcs(int8_tArray node_id, uint64_t updates) {
20320 LDKPublicKey node_id_ref;
20321 CHECK(node_id->arr_len == 33);
20322 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20323 LDKCommitmentUpdate updates_conv;
20324 updates_conv.inner = untag_ptr(updates);
20325 updates_conv.is_owned = ptr_is_owned(updates);
20326 CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv);
20327 updates_conv = CommitmentUpdate_clone(&updates_conv);
20328 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20329 *ret_copy = MessageSendEvent_update_htlcs(node_id_ref, updates_conv);
20330 uint64_t ret_ref = tag_ptr(ret_copy, true);
20334 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_revoke_and_ack"))) TS_MessageSendEvent_send_revoke_and_ack(int8_tArray node_id, uint64_t msg) {
20335 LDKPublicKey node_id_ref;
20336 CHECK(node_id->arr_len == 33);
20337 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20338 LDKRevokeAndACK msg_conv;
20339 msg_conv.inner = untag_ptr(msg);
20340 msg_conv.is_owned = ptr_is_owned(msg);
20341 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20342 msg_conv = RevokeAndACK_clone(&msg_conv);
20343 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20344 *ret_copy = MessageSendEvent_send_revoke_and_ack(node_id_ref, msg_conv);
20345 uint64_t ret_ref = tag_ptr(ret_copy, true);
20349 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_closing_signed"))) TS_MessageSendEvent_send_closing_signed(int8_tArray node_id, uint64_t msg) {
20350 LDKPublicKey node_id_ref;
20351 CHECK(node_id->arr_len == 33);
20352 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20353 LDKClosingSigned msg_conv;
20354 msg_conv.inner = untag_ptr(msg);
20355 msg_conv.is_owned = ptr_is_owned(msg);
20356 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20357 msg_conv = ClosingSigned_clone(&msg_conv);
20358 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20359 *ret_copy = MessageSendEvent_send_closing_signed(node_id_ref, msg_conv);
20360 uint64_t ret_ref = tag_ptr(ret_copy, true);
20364 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_shutdown"))) TS_MessageSendEvent_send_shutdown(int8_tArray node_id, uint64_t msg) {
20365 LDKPublicKey node_id_ref;
20366 CHECK(node_id->arr_len == 33);
20367 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20368 LDKShutdown msg_conv;
20369 msg_conv.inner = untag_ptr(msg);
20370 msg_conv.is_owned = ptr_is_owned(msg);
20371 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20372 msg_conv = Shutdown_clone(&msg_conv);
20373 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20374 *ret_copy = MessageSendEvent_send_shutdown(node_id_ref, msg_conv);
20375 uint64_t ret_ref = tag_ptr(ret_copy, true);
20379 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_channel_reestablish"))) TS_MessageSendEvent_send_channel_reestablish(int8_tArray node_id, uint64_t msg) {
20380 LDKPublicKey node_id_ref;
20381 CHECK(node_id->arr_len == 33);
20382 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20383 LDKChannelReestablish msg_conv;
20384 msg_conv.inner = untag_ptr(msg);
20385 msg_conv.is_owned = ptr_is_owned(msg);
20386 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20387 msg_conv = ChannelReestablish_clone(&msg_conv);
20388 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20389 *ret_copy = MessageSendEvent_send_channel_reestablish(node_id_ref, msg_conv);
20390 uint64_t ret_ref = tag_ptr(ret_copy, true);
20394 uint64_t __attribute__((export_name("TS_MessageSendEvent_broadcast_channel_announcement"))) TS_MessageSendEvent_broadcast_channel_announcement(uint64_t msg, uint64_t update_msg) {
20395 LDKChannelAnnouncement msg_conv;
20396 msg_conv.inner = untag_ptr(msg);
20397 msg_conv.is_owned = ptr_is_owned(msg);
20398 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20399 msg_conv = ChannelAnnouncement_clone(&msg_conv);
20400 LDKChannelUpdate update_msg_conv;
20401 update_msg_conv.inner = untag_ptr(update_msg);
20402 update_msg_conv.is_owned = ptr_is_owned(update_msg);
20403 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_conv);
20404 update_msg_conv = ChannelUpdate_clone(&update_msg_conv);
20405 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20406 *ret_copy = MessageSendEvent_broadcast_channel_announcement(msg_conv, update_msg_conv);
20407 uint64_t ret_ref = tag_ptr(ret_copy, true);
20411 uint64_t __attribute__((export_name("TS_MessageSendEvent_broadcast_node_announcement"))) TS_MessageSendEvent_broadcast_node_announcement(uint64_t msg) {
20412 LDKNodeAnnouncement msg_conv;
20413 msg_conv.inner = untag_ptr(msg);
20414 msg_conv.is_owned = ptr_is_owned(msg);
20415 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20416 msg_conv = NodeAnnouncement_clone(&msg_conv);
20417 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20418 *ret_copy = MessageSendEvent_broadcast_node_announcement(msg_conv);
20419 uint64_t ret_ref = tag_ptr(ret_copy, true);
20423 uint64_t __attribute__((export_name("TS_MessageSendEvent_broadcast_channel_update"))) TS_MessageSendEvent_broadcast_channel_update(uint64_t msg) {
20424 LDKChannelUpdate msg_conv;
20425 msg_conv.inner = untag_ptr(msg);
20426 msg_conv.is_owned = ptr_is_owned(msg);
20427 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20428 msg_conv = ChannelUpdate_clone(&msg_conv);
20429 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20430 *ret_copy = MessageSendEvent_broadcast_channel_update(msg_conv);
20431 uint64_t ret_ref = tag_ptr(ret_copy, true);
20435 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_channel_update"))) TS_MessageSendEvent_send_channel_update(int8_tArray node_id, uint64_t msg) {
20436 LDKPublicKey node_id_ref;
20437 CHECK(node_id->arr_len == 33);
20438 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20439 LDKChannelUpdate msg_conv;
20440 msg_conv.inner = untag_ptr(msg);
20441 msg_conv.is_owned = ptr_is_owned(msg);
20442 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20443 msg_conv = ChannelUpdate_clone(&msg_conv);
20444 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20445 *ret_copy = MessageSendEvent_send_channel_update(node_id_ref, msg_conv);
20446 uint64_t ret_ref = tag_ptr(ret_copy, true);
20450 uint64_t __attribute__((export_name("TS_MessageSendEvent_handle_error"))) TS_MessageSendEvent_handle_error(int8_tArray node_id, uint64_t action) {
20451 LDKPublicKey node_id_ref;
20452 CHECK(node_id->arr_len == 33);
20453 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20454 void* action_ptr = untag_ptr(action);
20455 CHECK_ACCESS(action_ptr);
20456 LDKErrorAction action_conv = *(LDKErrorAction*)(action_ptr);
20457 action_conv = ErrorAction_clone((LDKErrorAction*)untag_ptr(action));
20458 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20459 *ret_copy = MessageSendEvent_handle_error(node_id_ref, action_conv);
20460 uint64_t ret_ref = tag_ptr(ret_copy, true);
20464 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_channel_range_query"))) TS_MessageSendEvent_send_channel_range_query(int8_tArray node_id, uint64_t msg) {
20465 LDKPublicKey node_id_ref;
20466 CHECK(node_id->arr_len == 33);
20467 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20468 LDKQueryChannelRange msg_conv;
20469 msg_conv.inner = untag_ptr(msg);
20470 msg_conv.is_owned = ptr_is_owned(msg);
20471 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20472 msg_conv = QueryChannelRange_clone(&msg_conv);
20473 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20474 *ret_copy = MessageSendEvent_send_channel_range_query(node_id_ref, msg_conv);
20475 uint64_t ret_ref = tag_ptr(ret_copy, true);
20479 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_short_ids_query"))) TS_MessageSendEvent_send_short_ids_query(int8_tArray node_id, uint64_t msg) {
20480 LDKPublicKey node_id_ref;
20481 CHECK(node_id->arr_len == 33);
20482 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20483 LDKQueryShortChannelIds msg_conv;
20484 msg_conv.inner = untag_ptr(msg);
20485 msg_conv.is_owned = ptr_is_owned(msg);
20486 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20487 msg_conv = QueryShortChannelIds_clone(&msg_conv);
20488 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20489 *ret_copy = MessageSendEvent_send_short_ids_query(node_id_ref, msg_conv);
20490 uint64_t ret_ref = tag_ptr(ret_copy, true);
20494 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_reply_channel_range"))) TS_MessageSendEvent_send_reply_channel_range(int8_tArray node_id, uint64_t msg) {
20495 LDKPublicKey node_id_ref;
20496 CHECK(node_id->arr_len == 33);
20497 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20498 LDKReplyChannelRange msg_conv;
20499 msg_conv.inner = untag_ptr(msg);
20500 msg_conv.is_owned = ptr_is_owned(msg);
20501 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20502 msg_conv = ReplyChannelRange_clone(&msg_conv);
20503 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20504 *ret_copy = MessageSendEvent_send_reply_channel_range(node_id_ref, msg_conv);
20505 uint64_t ret_ref = tag_ptr(ret_copy, true);
20509 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_gossip_timestamp_filter"))) TS_MessageSendEvent_send_gossip_timestamp_filter(int8_tArray node_id, uint64_t msg) {
20510 LDKPublicKey node_id_ref;
20511 CHECK(node_id->arr_len == 33);
20512 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20513 LDKGossipTimestampFilter msg_conv;
20514 msg_conv.inner = untag_ptr(msg);
20515 msg_conv.is_owned = ptr_is_owned(msg);
20516 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20517 msg_conv = GossipTimestampFilter_clone(&msg_conv);
20518 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20519 *ret_copy = MessageSendEvent_send_gossip_timestamp_filter(node_id_ref, msg_conv);
20520 uint64_t ret_ref = tag_ptr(ret_copy, true);
20524 void __attribute__((export_name("TS_MessageSendEventsProvider_free"))) TS_MessageSendEventsProvider_free(uint64_t this_ptr) {
20525 if (!ptr_is_owned(this_ptr)) return;
20526 void* this_ptr_ptr = untag_ptr(this_ptr);
20527 CHECK_ACCESS(this_ptr_ptr);
20528 LDKMessageSendEventsProvider this_ptr_conv = *(LDKMessageSendEventsProvider*)(this_ptr_ptr);
20529 FREE(untag_ptr(this_ptr));
20530 MessageSendEventsProvider_free(this_ptr_conv);
20533 void __attribute__((export_name("TS_EventsProvider_free"))) TS_EventsProvider_free(uint64_t this_ptr) {
20534 if (!ptr_is_owned(this_ptr)) return;
20535 void* this_ptr_ptr = untag_ptr(this_ptr);
20536 CHECK_ACCESS(this_ptr_ptr);
20537 LDKEventsProvider this_ptr_conv = *(LDKEventsProvider*)(this_ptr_ptr);
20538 FREE(untag_ptr(this_ptr));
20539 EventsProvider_free(this_ptr_conv);
20542 void __attribute__((export_name("TS_EventHandler_free"))) TS_EventHandler_free(uint64_t this_ptr) {
20543 if (!ptr_is_owned(this_ptr)) return;
20544 void* this_ptr_ptr = untag_ptr(this_ptr);
20545 CHECK_ACCESS(this_ptr_ptr);
20546 LDKEventHandler this_ptr_conv = *(LDKEventHandler*)(this_ptr_ptr);
20547 FREE(untag_ptr(this_ptr));
20548 EventHandler_free(this_ptr_conv);
20551 void __attribute__((export_name("TS_APIError_free"))) TS_APIError_free(uint64_t this_ptr) {
20552 if (!ptr_is_owned(this_ptr)) return;
20553 void* this_ptr_ptr = untag_ptr(this_ptr);
20554 CHECK_ACCESS(this_ptr_ptr);
20555 LDKAPIError this_ptr_conv = *(LDKAPIError*)(this_ptr_ptr);
20556 FREE(untag_ptr(this_ptr));
20557 APIError_free(this_ptr_conv);
20560 static inline uint64_t APIError_clone_ptr(LDKAPIError *NONNULL_PTR arg) {
20561 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
20562 *ret_copy = APIError_clone(arg);
20563 uint64_t ret_ref = tag_ptr(ret_copy, true);
20566 int64_t __attribute__((export_name("TS_APIError_clone_ptr"))) TS_APIError_clone_ptr(uint64_t arg) {
20567 LDKAPIError* arg_conv = (LDKAPIError*)untag_ptr(arg);
20568 int64_t ret_conv = APIError_clone_ptr(arg_conv);
20572 uint64_t __attribute__((export_name("TS_APIError_clone"))) TS_APIError_clone(uint64_t orig) {
20573 LDKAPIError* orig_conv = (LDKAPIError*)untag_ptr(orig);
20574 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
20575 *ret_copy = APIError_clone(orig_conv);
20576 uint64_t ret_ref = tag_ptr(ret_copy, true);
20580 uint64_t __attribute__((export_name("TS_APIError_apimisuse_error"))) TS_APIError_apimisuse_error(jstring err) {
20581 LDKStr err_conv = str_ref_to_owned_c(err);
20582 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
20583 *ret_copy = APIError_apimisuse_error(err_conv);
20584 uint64_t ret_ref = tag_ptr(ret_copy, true);
20588 uint64_t __attribute__((export_name("TS_APIError_fee_rate_too_high"))) TS_APIError_fee_rate_too_high(jstring err, int32_t feerate) {
20589 LDKStr err_conv = str_ref_to_owned_c(err);
20590 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
20591 *ret_copy = APIError_fee_rate_too_high(err_conv, feerate);
20592 uint64_t ret_ref = tag_ptr(ret_copy, true);
20596 uint64_t __attribute__((export_name("TS_APIError_route_error"))) TS_APIError_route_error(jstring err) {
20597 LDKStr err_conv = str_ref_to_owned_c(err);
20598 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
20599 *ret_copy = APIError_route_error(err_conv);
20600 uint64_t ret_ref = tag_ptr(ret_copy, true);
20604 uint64_t __attribute__((export_name("TS_APIError_channel_unavailable"))) TS_APIError_channel_unavailable(jstring err) {
20605 LDKStr err_conv = str_ref_to_owned_c(err);
20606 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
20607 *ret_copy = APIError_channel_unavailable(err_conv);
20608 uint64_t ret_ref = tag_ptr(ret_copy, true);
20612 uint64_t __attribute__((export_name("TS_APIError_monitor_update_failed"))) TS_APIError_monitor_update_failed() {
20613 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
20614 *ret_copy = APIError_monitor_update_failed();
20615 uint64_t ret_ref = tag_ptr(ret_copy, true);
20619 uint64_t __attribute__((export_name("TS_APIError_incompatible_shutdown_script"))) TS_APIError_incompatible_shutdown_script(uint64_t script) {
20620 LDKShutdownScript script_conv;
20621 script_conv.inner = untag_ptr(script);
20622 script_conv.is_owned = ptr_is_owned(script);
20623 CHECK_INNER_FIELD_ACCESS_OR_NULL(script_conv);
20624 script_conv = ShutdownScript_clone(&script_conv);
20625 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
20626 *ret_copy = APIError_incompatible_shutdown_script(script_conv);
20627 uint64_t ret_ref = tag_ptr(ret_copy, true);
20631 void __attribute__((export_name("TS_BigSize_free"))) TS_BigSize_free(uint64_t this_obj) {
20632 LDKBigSize this_obj_conv;
20633 this_obj_conv.inner = untag_ptr(this_obj);
20634 this_obj_conv.is_owned = ptr_is_owned(this_obj);
20635 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
20636 BigSize_free(this_obj_conv);
20639 int64_t __attribute__((export_name("TS_BigSize_get_a"))) TS_BigSize_get_a(uint64_t this_ptr) {
20640 LDKBigSize this_ptr_conv;
20641 this_ptr_conv.inner = untag_ptr(this_ptr);
20642 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20643 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20644 this_ptr_conv.is_owned = false;
20645 int64_t ret_conv = BigSize_get_a(&this_ptr_conv);
20649 void __attribute__((export_name("TS_BigSize_set_a"))) TS_BigSize_set_a(uint64_t this_ptr, int64_t val) {
20650 LDKBigSize this_ptr_conv;
20651 this_ptr_conv.inner = untag_ptr(this_ptr);
20652 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20653 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20654 this_ptr_conv.is_owned = false;
20655 BigSize_set_a(&this_ptr_conv, val);
20658 uint64_t __attribute__((export_name("TS_BigSize_new"))) TS_BigSize_new(int64_t a_arg) {
20659 LDKBigSize ret_var = BigSize_new(a_arg);
20660 uint64_t ret_ref = 0;
20661 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
20662 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
20666 void __attribute__((export_name("TS_Hostname_free"))) TS_Hostname_free(uint64_t this_obj) {
20667 LDKHostname this_obj_conv;
20668 this_obj_conv.inner = untag_ptr(this_obj);
20669 this_obj_conv.is_owned = ptr_is_owned(this_obj);
20670 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
20671 Hostname_free(this_obj_conv);
20674 static inline uint64_t Hostname_clone_ptr(LDKHostname *NONNULL_PTR arg) {
20675 LDKHostname ret_var = Hostname_clone(arg);
20676 uint64_t ret_ref = 0;
20677 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
20678 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
20681 int64_t __attribute__((export_name("TS_Hostname_clone_ptr"))) TS_Hostname_clone_ptr(uint64_t arg) {
20682 LDKHostname arg_conv;
20683 arg_conv.inner = untag_ptr(arg);
20684 arg_conv.is_owned = ptr_is_owned(arg);
20685 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
20686 arg_conv.is_owned = false;
20687 int64_t ret_conv = Hostname_clone_ptr(&arg_conv);
20691 uint64_t __attribute__((export_name("TS_Hostname_clone"))) TS_Hostname_clone(uint64_t orig) {
20692 LDKHostname orig_conv;
20693 orig_conv.inner = untag_ptr(orig);
20694 orig_conv.is_owned = ptr_is_owned(orig);
20695 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
20696 orig_conv.is_owned = false;
20697 LDKHostname ret_var = Hostname_clone(&orig_conv);
20698 uint64_t ret_ref = 0;
20699 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
20700 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
20704 int8_t __attribute__((export_name("TS_Hostname_len"))) TS_Hostname_len(uint64_t this_arg) {
20705 LDKHostname this_arg_conv;
20706 this_arg_conv.inner = untag_ptr(this_arg);
20707 this_arg_conv.is_owned = ptr_is_owned(this_arg);
20708 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
20709 this_arg_conv.is_owned = false;
20710 int8_t ret_conv = Hostname_len(&this_arg_conv);
20714 uint64_t __attribute__((export_name("TS_sign"))) TS_sign(int8_tArray msg, int8_tArray sk) {
20715 LDKu8slice msg_ref;
20716 msg_ref.datalen = msg->arr_len;
20717 msg_ref.data = msg->elems;
20718 unsigned char sk_arr[32];
20719 CHECK(sk->arr_len == 32);
20720 memcpy(sk_arr, sk->elems, 32); FREE(sk);
20721 unsigned char (*sk_ref)[32] = &sk_arr;
20722 LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
20723 *ret_conv = sign(msg_ref, sk_ref);
20725 return tag_ptr(ret_conv, true);
20728 uint64_t __attribute__((export_name("TS_recover_pk"))) TS_recover_pk(int8_tArray msg, jstring sig) {
20729 LDKu8slice msg_ref;
20730 msg_ref.datalen = msg->arr_len;
20731 msg_ref.data = msg->elems;
20732 LDKStr sig_conv = str_ref_to_owned_c(sig);
20733 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
20734 *ret_conv = recover_pk(msg_ref, sig_conv);
20736 return tag_ptr(ret_conv, true);
20739 jboolean __attribute__((export_name("TS_verify"))) TS_verify(int8_tArray msg, jstring sig, int8_tArray pk) {
20740 LDKu8slice msg_ref;
20741 msg_ref.datalen = msg->arr_len;
20742 msg_ref.data = msg->elems;
20743 LDKStr sig_conv = str_ref_to_owned_c(sig);
20744 LDKPublicKey pk_ref;
20745 CHECK(pk->arr_len == 33);
20746 memcpy(pk_ref.compressed_form, pk->elems, 33); FREE(pk);
20747 jboolean ret_conv = verify(msg_ref, sig_conv, pk_ref);
20752 int8_tArray __attribute__((export_name("TS_construct_invoice_preimage"))) TS_construct_invoice_preimage(int8_tArray hrp_bytes, ptrArray data_without_signature) {
20753 LDKu8slice hrp_bytes_ref;
20754 hrp_bytes_ref.datalen = hrp_bytes->arr_len;
20755 hrp_bytes_ref.data = hrp_bytes->elems;
20756 LDKCVec_u5Z data_without_signature_constr;
20757 data_without_signature_constr.datalen = data_without_signature->arr_len;
20758 if (data_without_signature_constr.datalen > 0)
20759 data_without_signature_constr.data = MALLOC(data_without_signature_constr.datalen * sizeof(LDKu5), "LDKCVec_u5Z Elements");
20761 data_without_signature_constr.data = NULL;
20762 int8_t* data_without_signature_vals = (void*) data_without_signature->elems;
20763 for (size_t h = 0; h < data_without_signature_constr.datalen; h++) {
20764 int8_t data_without_signature_conv_7 = data_without_signature_vals[h];
20766 data_without_signature_constr.data[h] = (LDKu5){ ._0 = data_without_signature_conv_7 };
20768 FREE(data_without_signature);
20769 LDKCVec_u8Z ret_var = construct_invoice_preimage(hrp_bytes_ref, data_without_signature_constr);
20770 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
20771 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
20772 CVec_u8Z_free(ret_var);
20777 void __attribute__((export_name("TS_Persister_free"))) TS_Persister_free(uint64_t this_ptr) {
20778 if (!ptr_is_owned(this_ptr)) return;
20779 void* this_ptr_ptr = untag_ptr(this_ptr);
20780 CHECK_ACCESS(this_ptr_ptr);
20781 LDKPersister this_ptr_conv = *(LDKPersister*)(this_ptr_ptr);
20782 FREE(untag_ptr(this_ptr));
20783 Persister_free(this_ptr_conv);
20786 uint32_t __attribute__((export_name("TS_Level_clone"))) TS_Level_clone(uint64_t orig) {
20787 LDKLevel* orig_conv = (LDKLevel*)untag_ptr(orig);
20788 uint32_t ret_conv = LDKLevel_to_js(Level_clone(orig_conv));
20792 uint32_t __attribute__((export_name("TS_Level_gossip"))) TS_Level_gossip() {
20793 uint32_t ret_conv = LDKLevel_to_js(Level_gossip());
20797 uint32_t __attribute__((export_name("TS_Level_trace"))) TS_Level_trace() {
20798 uint32_t ret_conv = LDKLevel_to_js(Level_trace());
20802 uint32_t __attribute__((export_name("TS_Level_debug"))) TS_Level_debug() {
20803 uint32_t ret_conv = LDKLevel_to_js(Level_debug());
20807 uint32_t __attribute__((export_name("TS_Level_info"))) TS_Level_info() {
20808 uint32_t ret_conv = LDKLevel_to_js(Level_info());
20812 uint32_t __attribute__((export_name("TS_Level_warn"))) TS_Level_warn() {
20813 uint32_t ret_conv = LDKLevel_to_js(Level_warn());
20817 uint32_t __attribute__((export_name("TS_Level_error"))) TS_Level_error() {
20818 uint32_t ret_conv = LDKLevel_to_js(Level_error());
20822 jboolean __attribute__((export_name("TS_Level_eq"))) TS_Level_eq(uint64_t a, uint64_t b) {
20823 LDKLevel* a_conv = (LDKLevel*)untag_ptr(a);
20824 LDKLevel* b_conv = (LDKLevel*)untag_ptr(b);
20825 jboolean ret_conv = Level_eq(a_conv, b_conv);
20829 int64_t __attribute__((export_name("TS_Level_hash"))) TS_Level_hash(uint64_t o) {
20830 LDKLevel* o_conv = (LDKLevel*)untag_ptr(o);
20831 int64_t ret_conv = Level_hash(o_conv);
20835 uint32_t __attribute__((export_name("TS_Level_max"))) TS_Level_max() {
20836 uint32_t ret_conv = LDKLevel_to_js(Level_max());
20840 void __attribute__((export_name("TS_Record_free"))) TS_Record_free(uint64_t this_obj) {
20841 LDKRecord this_obj_conv;
20842 this_obj_conv.inner = untag_ptr(this_obj);
20843 this_obj_conv.is_owned = ptr_is_owned(this_obj);
20844 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
20845 Record_free(this_obj_conv);
20848 uint32_t __attribute__((export_name("TS_Record_get_level"))) TS_Record_get_level(uint64_t this_ptr) {
20849 LDKRecord this_ptr_conv;
20850 this_ptr_conv.inner = untag_ptr(this_ptr);
20851 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20852 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20853 this_ptr_conv.is_owned = false;
20854 uint32_t ret_conv = LDKLevel_to_js(Record_get_level(&this_ptr_conv));
20858 void __attribute__((export_name("TS_Record_set_level"))) TS_Record_set_level(uint64_t this_ptr, uint32_t val) {
20859 LDKRecord this_ptr_conv;
20860 this_ptr_conv.inner = untag_ptr(this_ptr);
20861 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20862 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20863 this_ptr_conv.is_owned = false;
20864 LDKLevel val_conv = LDKLevel_from_js(val);
20865 Record_set_level(&this_ptr_conv, val_conv);
20868 jstring __attribute__((export_name("TS_Record_get_args"))) TS_Record_get_args(uint64_t this_ptr) {
20869 LDKRecord this_ptr_conv;
20870 this_ptr_conv.inner = untag_ptr(this_ptr);
20871 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20872 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20873 this_ptr_conv.is_owned = false;
20874 LDKStr ret_str = Record_get_args(&this_ptr_conv);
20875 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
20880 void __attribute__((export_name("TS_Record_set_args"))) TS_Record_set_args(uint64_t this_ptr, jstring val) {
20881 LDKRecord this_ptr_conv;
20882 this_ptr_conv.inner = untag_ptr(this_ptr);
20883 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20884 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20885 this_ptr_conv.is_owned = false;
20886 LDKStr val_conv = str_ref_to_owned_c(val);
20887 Record_set_args(&this_ptr_conv, val_conv);
20890 jstring __attribute__((export_name("TS_Record_get_module_path"))) TS_Record_get_module_path(uint64_t this_ptr) {
20891 LDKRecord this_ptr_conv;
20892 this_ptr_conv.inner = untag_ptr(this_ptr);
20893 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20894 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20895 this_ptr_conv.is_owned = false;
20896 LDKStr ret_str = Record_get_module_path(&this_ptr_conv);
20897 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
20902 void __attribute__((export_name("TS_Record_set_module_path"))) TS_Record_set_module_path(uint64_t this_ptr, jstring val) {
20903 LDKRecord this_ptr_conv;
20904 this_ptr_conv.inner = untag_ptr(this_ptr);
20905 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20906 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20907 this_ptr_conv.is_owned = false;
20908 LDKStr val_conv = str_ref_to_owned_c(val);
20909 Record_set_module_path(&this_ptr_conv, val_conv);
20912 jstring __attribute__((export_name("TS_Record_get_file"))) TS_Record_get_file(uint64_t this_ptr) {
20913 LDKRecord this_ptr_conv;
20914 this_ptr_conv.inner = untag_ptr(this_ptr);
20915 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20916 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20917 this_ptr_conv.is_owned = false;
20918 LDKStr ret_str = Record_get_file(&this_ptr_conv);
20919 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
20924 void __attribute__((export_name("TS_Record_set_file"))) TS_Record_set_file(uint64_t this_ptr, jstring val) {
20925 LDKRecord this_ptr_conv;
20926 this_ptr_conv.inner = untag_ptr(this_ptr);
20927 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20928 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20929 this_ptr_conv.is_owned = false;
20930 LDKStr val_conv = str_ref_to_owned_c(val);
20931 Record_set_file(&this_ptr_conv, val_conv);
20934 int32_t __attribute__((export_name("TS_Record_get_line"))) TS_Record_get_line(uint64_t this_ptr) {
20935 LDKRecord this_ptr_conv;
20936 this_ptr_conv.inner = untag_ptr(this_ptr);
20937 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20938 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20939 this_ptr_conv.is_owned = false;
20940 int32_t ret_conv = Record_get_line(&this_ptr_conv);
20944 void __attribute__((export_name("TS_Record_set_line"))) TS_Record_set_line(uint64_t this_ptr, int32_t val) {
20945 LDKRecord this_ptr_conv;
20946 this_ptr_conv.inner = untag_ptr(this_ptr);
20947 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20948 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20949 this_ptr_conv.is_owned = false;
20950 Record_set_line(&this_ptr_conv, val);
20953 static inline uint64_t Record_clone_ptr(LDKRecord *NONNULL_PTR arg) {
20954 LDKRecord ret_var = Record_clone(arg);
20955 uint64_t ret_ref = 0;
20956 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
20957 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
20960 int64_t __attribute__((export_name("TS_Record_clone_ptr"))) TS_Record_clone_ptr(uint64_t arg) {
20961 LDKRecord arg_conv;
20962 arg_conv.inner = untag_ptr(arg);
20963 arg_conv.is_owned = ptr_is_owned(arg);
20964 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
20965 arg_conv.is_owned = false;
20966 int64_t ret_conv = Record_clone_ptr(&arg_conv);
20970 uint64_t __attribute__((export_name("TS_Record_clone"))) TS_Record_clone(uint64_t orig) {
20971 LDKRecord orig_conv;
20972 orig_conv.inner = untag_ptr(orig);
20973 orig_conv.is_owned = ptr_is_owned(orig);
20974 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
20975 orig_conv.is_owned = false;
20976 LDKRecord ret_var = Record_clone(&orig_conv);
20977 uint64_t ret_ref = 0;
20978 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
20979 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
20983 void __attribute__((export_name("TS_Logger_free"))) TS_Logger_free(uint64_t this_ptr) {
20984 if (!ptr_is_owned(this_ptr)) return;
20985 void* this_ptr_ptr = untag_ptr(this_ptr);
20986 CHECK_ACCESS(this_ptr_ptr);
20987 LDKLogger this_ptr_conv = *(LDKLogger*)(this_ptr_ptr);
20988 FREE(untag_ptr(this_ptr));
20989 Logger_free(this_ptr_conv);
20992 void __attribute__((export_name("TS_ChannelHandshakeConfig_free"))) TS_ChannelHandshakeConfig_free(uint64_t this_obj) {
20993 LDKChannelHandshakeConfig this_obj_conv;
20994 this_obj_conv.inner = untag_ptr(this_obj);
20995 this_obj_conv.is_owned = ptr_is_owned(this_obj);
20996 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
20997 ChannelHandshakeConfig_free(this_obj_conv);
21000 int32_t __attribute__((export_name("TS_ChannelHandshakeConfig_get_minimum_depth"))) TS_ChannelHandshakeConfig_get_minimum_depth(uint64_t this_ptr) {
21001 LDKChannelHandshakeConfig this_ptr_conv;
21002 this_ptr_conv.inner = untag_ptr(this_ptr);
21003 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21004 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21005 this_ptr_conv.is_owned = false;
21006 int32_t ret_conv = ChannelHandshakeConfig_get_minimum_depth(&this_ptr_conv);
21010 void __attribute__((export_name("TS_ChannelHandshakeConfig_set_minimum_depth"))) TS_ChannelHandshakeConfig_set_minimum_depth(uint64_t this_ptr, int32_t val) {
21011 LDKChannelHandshakeConfig this_ptr_conv;
21012 this_ptr_conv.inner = untag_ptr(this_ptr);
21013 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21014 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21015 this_ptr_conv.is_owned = false;
21016 ChannelHandshakeConfig_set_minimum_depth(&this_ptr_conv, val);
21019 int16_t __attribute__((export_name("TS_ChannelHandshakeConfig_get_our_to_self_delay"))) TS_ChannelHandshakeConfig_get_our_to_self_delay(uint64_t this_ptr) {
21020 LDKChannelHandshakeConfig this_ptr_conv;
21021 this_ptr_conv.inner = untag_ptr(this_ptr);
21022 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21023 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21024 this_ptr_conv.is_owned = false;
21025 int16_t ret_conv = ChannelHandshakeConfig_get_our_to_self_delay(&this_ptr_conv);
21029 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) {
21030 LDKChannelHandshakeConfig this_ptr_conv;
21031 this_ptr_conv.inner = untag_ptr(this_ptr);
21032 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21033 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21034 this_ptr_conv.is_owned = false;
21035 ChannelHandshakeConfig_set_our_to_self_delay(&this_ptr_conv, val);
21038 int64_t __attribute__((export_name("TS_ChannelHandshakeConfig_get_our_htlc_minimum_msat"))) TS_ChannelHandshakeConfig_get_our_htlc_minimum_msat(uint64_t this_ptr) {
21039 LDKChannelHandshakeConfig this_ptr_conv;
21040 this_ptr_conv.inner = untag_ptr(this_ptr);
21041 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21042 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21043 this_ptr_conv.is_owned = false;
21044 int64_t ret_conv = ChannelHandshakeConfig_get_our_htlc_minimum_msat(&this_ptr_conv);
21048 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) {
21049 LDKChannelHandshakeConfig this_ptr_conv;
21050 this_ptr_conv.inner = untag_ptr(this_ptr);
21051 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21052 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21053 this_ptr_conv.is_owned = false;
21054 ChannelHandshakeConfig_set_our_htlc_minimum_msat(&this_ptr_conv, val);
21057 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) {
21058 LDKChannelHandshakeConfig this_ptr_conv;
21059 this_ptr_conv.inner = untag_ptr(this_ptr);
21060 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21061 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21062 this_ptr_conv.is_owned = false;
21063 int8_t ret_conv = ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(&this_ptr_conv);
21067 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) {
21068 LDKChannelHandshakeConfig this_ptr_conv;
21069 this_ptr_conv.inner = untag_ptr(this_ptr);
21070 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21071 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21072 this_ptr_conv.is_owned = false;
21073 ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(&this_ptr_conv, val);
21076 jboolean __attribute__((export_name("TS_ChannelHandshakeConfig_get_negotiate_scid_privacy"))) TS_ChannelHandshakeConfig_get_negotiate_scid_privacy(uint64_t this_ptr) {
21077 LDKChannelHandshakeConfig this_ptr_conv;
21078 this_ptr_conv.inner = untag_ptr(this_ptr);
21079 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21080 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21081 this_ptr_conv.is_owned = false;
21082 jboolean ret_conv = ChannelHandshakeConfig_get_negotiate_scid_privacy(&this_ptr_conv);
21086 void __attribute__((export_name("TS_ChannelHandshakeConfig_set_negotiate_scid_privacy"))) TS_ChannelHandshakeConfig_set_negotiate_scid_privacy(uint64_t this_ptr, jboolean val) {
21087 LDKChannelHandshakeConfig this_ptr_conv;
21088 this_ptr_conv.inner = untag_ptr(this_ptr);
21089 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21090 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21091 this_ptr_conv.is_owned = false;
21092 ChannelHandshakeConfig_set_negotiate_scid_privacy(&this_ptr_conv, val);
21095 jboolean __attribute__((export_name("TS_ChannelHandshakeConfig_get_announced_channel"))) TS_ChannelHandshakeConfig_get_announced_channel(uint64_t this_ptr) {
21096 LDKChannelHandshakeConfig this_ptr_conv;
21097 this_ptr_conv.inner = untag_ptr(this_ptr);
21098 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21099 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21100 this_ptr_conv.is_owned = false;
21101 jboolean ret_conv = ChannelHandshakeConfig_get_announced_channel(&this_ptr_conv);
21105 void __attribute__((export_name("TS_ChannelHandshakeConfig_set_announced_channel"))) TS_ChannelHandshakeConfig_set_announced_channel(uint64_t this_ptr, jboolean val) {
21106 LDKChannelHandshakeConfig this_ptr_conv;
21107 this_ptr_conv.inner = untag_ptr(this_ptr);
21108 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21109 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21110 this_ptr_conv.is_owned = false;
21111 ChannelHandshakeConfig_set_announced_channel(&this_ptr_conv, val);
21114 jboolean __attribute__((export_name("TS_ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey"))) TS_ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(uint64_t this_ptr) {
21115 LDKChannelHandshakeConfig this_ptr_conv;
21116 this_ptr_conv.inner = untag_ptr(this_ptr);
21117 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21118 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21119 this_ptr_conv.is_owned = false;
21120 jboolean ret_conv = ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(&this_ptr_conv);
21124 void __attribute__((export_name("TS_ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey"))) TS_ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(uint64_t this_ptr, jboolean val) {
21125 LDKChannelHandshakeConfig this_ptr_conv;
21126 this_ptr_conv.inner = untag_ptr(this_ptr);
21127 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21128 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21129 this_ptr_conv.is_owned = false;
21130 ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(&this_ptr_conv, val);
21133 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) {
21134 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);
21135 uint64_t ret_ref = 0;
21136 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21137 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21141 static inline uint64_t ChannelHandshakeConfig_clone_ptr(LDKChannelHandshakeConfig *NONNULL_PTR arg) {
21142 LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(arg);
21143 uint64_t ret_ref = 0;
21144 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21145 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21148 int64_t __attribute__((export_name("TS_ChannelHandshakeConfig_clone_ptr"))) TS_ChannelHandshakeConfig_clone_ptr(uint64_t arg) {
21149 LDKChannelHandshakeConfig arg_conv;
21150 arg_conv.inner = untag_ptr(arg);
21151 arg_conv.is_owned = ptr_is_owned(arg);
21152 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
21153 arg_conv.is_owned = false;
21154 int64_t ret_conv = ChannelHandshakeConfig_clone_ptr(&arg_conv);
21158 uint64_t __attribute__((export_name("TS_ChannelHandshakeConfig_clone"))) TS_ChannelHandshakeConfig_clone(uint64_t orig) {
21159 LDKChannelHandshakeConfig orig_conv;
21160 orig_conv.inner = untag_ptr(orig);
21161 orig_conv.is_owned = ptr_is_owned(orig);
21162 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
21163 orig_conv.is_owned = false;
21164 LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(&orig_conv);
21165 uint64_t ret_ref = 0;
21166 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21167 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21171 uint64_t __attribute__((export_name("TS_ChannelHandshakeConfig_default"))) TS_ChannelHandshakeConfig_default() {
21172 LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_default();
21173 uint64_t ret_ref = 0;
21174 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21175 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21179 void __attribute__((export_name("TS_ChannelHandshakeLimits_free"))) TS_ChannelHandshakeLimits_free(uint64_t this_obj) {
21180 LDKChannelHandshakeLimits this_obj_conv;
21181 this_obj_conv.inner = untag_ptr(this_obj);
21182 this_obj_conv.is_owned = ptr_is_owned(this_obj);
21183 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
21184 ChannelHandshakeLimits_free(this_obj_conv);
21187 int64_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_min_funding_satoshis"))) TS_ChannelHandshakeLimits_get_min_funding_satoshis(uint64_t this_ptr) {
21188 LDKChannelHandshakeLimits this_ptr_conv;
21189 this_ptr_conv.inner = untag_ptr(this_ptr);
21190 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21191 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21192 this_ptr_conv.is_owned = false;
21193 int64_t ret_conv = ChannelHandshakeLimits_get_min_funding_satoshis(&this_ptr_conv);
21197 void __attribute__((export_name("TS_ChannelHandshakeLimits_set_min_funding_satoshis"))) TS_ChannelHandshakeLimits_set_min_funding_satoshis(uint64_t this_ptr, int64_t val) {
21198 LDKChannelHandshakeLimits this_ptr_conv;
21199 this_ptr_conv.inner = untag_ptr(this_ptr);
21200 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21201 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21202 this_ptr_conv.is_owned = false;
21203 ChannelHandshakeLimits_set_min_funding_satoshis(&this_ptr_conv, val);
21206 int64_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_max_funding_satoshis"))) TS_ChannelHandshakeLimits_get_max_funding_satoshis(uint64_t this_ptr) {
21207 LDKChannelHandshakeLimits this_ptr_conv;
21208 this_ptr_conv.inner = untag_ptr(this_ptr);
21209 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21210 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21211 this_ptr_conv.is_owned = false;
21212 int64_t ret_conv = ChannelHandshakeLimits_get_max_funding_satoshis(&this_ptr_conv);
21216 void __attribute__((export_name("TS_ChannelHandshakeLimits_set_max_funding_satoshis"))) TS_ChannelHandshakeLimits_set_max_funding_satoshis(uint64_t this_ptr, int64_t val) {
21217 LDKChannelHandshakeLimits this_ptr_conv;
21218 this_ptr_conv.inner = untag_ptr(this_ptr);
21219 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21220 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21221 this_ptr_conv.is_owned = false;
21222 ChannelHandshakeLimits_set_max_funding_satoshis(&this_ptr_conv, val);
21225 int64_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_max_htlc_minimum_msat"))) TS_ChannelHandshakeLimits_get_max_htlc_minimum_msat(uint64_t this_ptr) {
21226 LDKChannelHandshakeLimits this_ptr_conv;
21227 this_ptr_conv.inner = untag_ptr(this_ptr);
21228 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21229 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21230 this_ptr_conv.is_owned = false;
21231 int64_t ret_conv = ChannelHandshakeLimits_get_max_htlc_minimum_msat(&this_ptr_conv);
21235 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) {
21236 LDKChannelHandshakeLimits this_ptr_conv;
21237 this_ptr_conv.inner = untag_ptr(this_ptr);
21238 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21239 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21240 this_ptr_conv.is_owned = false;
21241 ChannelHandshakeLimits_set_max_htlc_minimum_msat(&this_ptr_conv, val);
21244 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) {
21245 LDKChannelHandshakeLimits this_ptr_conv;
21246 this_ptr_conv.inner = untag_ptr(this_ptr);
21247 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21248 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21249 this_ptr_conv.is_owned = false;
21250 int64_t ret_conv = ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(&this_ptr_conv);
21254 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) {
21255 LDKChannelHandshakeLimits this_ptr_conv;
21256 this_ptr_conv.inner = untag_ptr(this_ptr);
21257 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21258 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21259 this_ptr_conv.is_owned = false;
21260 ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(&this_ptr_conv, val);
21263 int64_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_max_channel_reserve_satoshis"))) TS_ChannelHandshakeLimits_get_max_channel_reserve_satoshis(uint64_t this_ptr) {
21264 LDKChannelHandshakeLimits this_ptr_conv;
21265 this_ptr_conv.inner = untag_ptr(this_ptr);
21266 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21267 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21268 this_ptr_conv.is_owned = false;
21269 int64_t ret_conv = ChannelHandshakeLimits_get_max_channel_reserve_satoshis(&this_ptr_conv);
21273 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) {
21274 LDKChannelHandshakeLimits this_ptr_conv;
21275 this_ptr_conv.inner = untag_ptr(this_ptr);
21276 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21277 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21278 this_ptr_conv.is_owned = false;
21279 ChannelHandshakeLimits_set_max_channel_reserve_satoshis(&this_ptr_conv, val);
21282 int16_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_min_max_accepted_htlcs"))) TS_ChannelHandshakeLimits_get_min_max_accepted_htlcs(uint64_t this_ptr) {
21283 LDKChannelHandshakeLimits this_ptr_conv;
21284 this_ptr_conv.inner = untag_ptr(this_ptr);
21285 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21286 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21287 this_ptr_conv.is_owned = false;
21288 int16_t ret_conv = ChannelHandshakeLimits_get_min_max_accepted_htlcs(&this_ptr_conv);
21292 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) {
21293 LDKChannelHandshakeLimits this_ptr_conv;
21294 this_ptr_conv.inner = untag_ptr(this_ptr);
21295 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21296 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21297 this_ptr_conv.is_owned = false;
21298 ChannelHandshakeLimits_set_min_max_accepted_htlcs(&this_ptr_conv, val);
21301 int32_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_max_minimum_depth"))) TS_ChannelHandshakeLimits_get_max_minimum_depth(uint64_t this_ptr) {
21302 LDKChannelHandshakeLimits this_ptr_conv;
21303 this_ptr_conv.inner = untag_ptr(this_ptr);
21304 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21305 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21306 this_ptr_conv.is_owned = false;
21307 int32_t ret_conv = ChannelHandshakeLimits_get_max_minimum_depth(&this_ptr_conv);
21311 void __attribute__((export_name("TS_ChannelHandshakeLimits_set_max_minimum_depth"))) TS_ChannelHandshakeLimits_set_max_minimum_depth(uint64_t this_ptr, int32_t val) {
21312 LDKChannelHandshakeLimits this_ptr_conv;
21313 this_ptr_conv.inner = untag_ptr(this_ptr);
21314 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21315 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21316 this_ptr_conv.is_owned = false;
21317 ChannelHandshakeLimits_set_max_minimum_depth(&this_ptr_conv, val);
21320 jboolean __attribute__((export_name("TS_ChannelHandshakeLimits_get_trust_own_funding_0conf"))) TS_ChannelHandshakeLimits_get_trust_own_funding_0conf(uint64_t this_ptr) {
21321 LDKChannelHandshakeLimits this_ptr_conv;
21322 this_ptr_conv.inner = untag_ptr(this_ptr);
21323 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21324 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21325 this_ptr_conv.is_owned = false;
21326 jboolean ret_conv = ChannelHandshakeLimits_get_trust_own_funding_0conf(&this_ptr_conv);
21330 void __attribute__((export_name("TS_ChannelHandshakeLimits_set_trust_own_funding_0conf"))) TS_ChannelHandshakeLimits_set_trust_own_funding_0conf(uint64_t this_ptr, jboolean val) {
21331 LDKChannelHandshakeLimits this_ptr_conv;
21332 this_ptr_conv.inner = untag_ptr(this_ptr);
21333 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21334 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21335 this_ptr_conv.is_owned = false;
21336 ChannelHandshakeLimits_set_trust_own_funding_0conf(&this_ptr_conv, val);
21339 jboolean __attribute__((export_name("TS_ChannelHandshakeLimits_get_force_announced_channel_preference"))) TS_ChannelHandshakeLimits_get_force_announced_channel_preference(uint64_t this_ptr) {
21340 LDKChannelHandshakeLimits this_ptr_conv;
21341 this_ptr_conv.inner = untag_ptr(this_ptr);
21342 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21343 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21344 this_ptr_conv.is_owned = false;
21345 jboolean ret_conv = ChannelHandshakeLimits_get_force_announced_channel_preference(&this_ptr_conv);
21349 void __attribute__((export_name("TS_ChannelHandshakeLimits_set_force_announced_channel_preference"))) TS_ChannelHandshakeLimits_set_force_announced_channel_preference(uint64_t this_ptr, jboolean val) {
21350 LDKChannelHandshakeLimits this_ptr_conv;
21351 this_ptr_conv.inner = untag_ptr(this_ptr);
21352 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21353 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21354 this_ptr_conv.is_owned = false;
21355 ChannelHandshakeLimits_set_force_announced_channel_preference(&this_ptr_conv, val);
21358 int16_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_their_to_self_delay"))) TS_ChannelHandshakeLimits_get_their_to_self_delay(uint64_t this_ptr) {
21359 LDKChannelHandshakeLimits this_ptr_conv;
21360 this_ptr_conv.inner = untag_ptr(this_ptr);
21361 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21362 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21363 this_ptr_conv.is_owned = false;
21364 int16_t ret_conv = ChannelHandshakeLimits_get_their_to_self_delay(&this_ptr_conv);
21368 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) {
21369 LDKChannelHandshakeLimits this_ptr_conv;
21370 this_ptr_conv.inner = untag_ptr(this_ptr);
21371 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21372 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21373 this_ptr_conv.is_owned = false;
21374 ChannelHandshakeLimits_set_their_to_self_delay(&this_ptr_conv, val);
21377 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) {
21378 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);
21379 uint64_t ret_ref = 0;
21380 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21381 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21385 static inline uint64_t ChannelHandshakeLimits_clone_ptr(LDKChannelHandshakeLimits *NONNULL_PTR arg) {
21386 LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(arg);
21387 uint64_t ret_ref = 0;
21388 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21389 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21392 int64_t __attribute__((export_name("TS_ChannelHandshakeLimits_clone_ptr"))) TS_ChannelHandshakeLimits_clone_ptr(uint64_t arg) {
21393 LDKChannelHandshakeLimits arg_conv;
21394 arg_conv.inner = untag_ptr(arg);
21395 arg_conv.is_owned = ptr_is_owned(arg);
21396 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
21397 arg_conv.is_owned = false;
21398 int64_t ret_conv = ChannelHandshakeLimits_clone_ptr(&arg_conv);
21402 uint64_t __attribute__((export_name("TS_ChannelHandshakeLimits_clone"))) TS_ChannelHandshakeLimits_clone(uint64_t orig) {
21403 LDKChannelHandshakeLimits orig_conv;
21404 orig_conv.inner = untag_ptr(orig);
21405 orig_conv.is_owned = ptr_is_owned(orig);
21406 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
21407 orig_conv.is_owned = false;
21408 LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(&orig_conv);
21409 uint64_t ret_ref = 0;
21410 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21411 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21415 uint64_t __attribute__((export_name("TS_ChannelHandshakeLimits_default"))) TS_ChannelHandshakeLimits_default() {
21416 LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_default();
21417 uint64_t ret_ref = 0;
21418 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21419 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21423 void __attribute__((export_name("TS_ChannelConfig_free"))) TS_ChannelConfig_free(uint64_t this_obj) {
21424 LDKChannelConfig this_obj_conv;
21425 this_obj_conv.inner = untag_ptr(this_obj);
21426 this_obj_conv.is_owned = ptr_is_owned(this_obj);
21427 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
21428 ChannelConfig_free(this_obj_conv);
21431 int32_t __attribute__((export_name("TS_ChannelConfig_get_forwarding_fee_proportional_millionths"))) TS_ChannelConfig_get_forwarding_fee_proportional_millionths(uint64_t this_ptr) {
21432 LDKChannelConfig this_ptr_conv;
21433 this_ptr_conv.inner = untag_ptr(this_ptr);
21434 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21435 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21436 this_ptr_conv.is_owned = false;
21437 int32_t ret_conv = ChannelConfig_get_forwarding_fee_proportional_millionths(&this_ptr_conv);
21441 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) {
21442 LDKChannelConfig this_ptr_conv;
21443 this_ptr_conv.inner = untag_ptr(this_ptr);
21444 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21445 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21446 this_ptr_conv.is_owned = false;
21447 ChannelConfig_set_forwarding_fee_proportional_millionths(&this_ptr_conv, val);
21450 int32_t __attribute__((export_name("TS_ChannelConfig_get_forwarding_fee_base_msat"))) TS_ChannelConfig_get_forwarding_fee_base_msat(uint64_t this_ptr) {
21451 LDKChannelConfig this_ptr_conv;
21452 this_ptr_conv.inner = untag_ptr(this_ptr);
21453 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21454 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21455 this_ptr_conv.is_owned = false;
21456 int32_t ret_conv = ChannelConfig_get_forwarding_fee_base_msat(&this_ptr_conv);
21460 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) {
21461 LDKChannelConfig this_ptr_conv;
21462 this_ptr_conv.inner = untag_ptr(this_ptr);
21463 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21464 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21465 this_ptr_conv.is_owned = false;
21466 ChannelConfig_set_forwarding_fee_base_msat(&this_ptr_conv, val);
21469 int16_t __attribute__((export_name("TS_ChannelConfig_get_cltv_expiry_delta"))) TS_ChannelConfig_get_cltv_expiry_delta(uint64_t this_ptr) {
21470 LDKChannelConfig this_ptr_conv;
21471 this_ptr_conv.inner = untag_ptr(this_ptr);
21472 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21473 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21474 this_ptr_conv.is_owned = false;
21475 int16_t ret_conv = ChannelConfig_get_cltv_expiry_delta(&this_ptr_conv);
21479 void __attribute__((export_name("TS_ChannelConfig_set_cltv_expiry_delta"))) TS_ChannelConfig_set_cltv_expiry_delta(uint64_t this_ptr, int16_t val) {
21480 LDKChannelConfig this_ptr_conv;
21481 this_ptr_conv.inner = untag_ptr(this_ptr);
21482 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21483 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21484 this_ptr_conv.is_owned = false;
21485 ChannelConfig_set_cltv_expiry_delta(&this_ptr_conv, val);
21488 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) {
21489 LDKChannelConfig this_ptr_conv;
21490 this_ptr_conv.inner = untag_ptr(this_ptr);
21491 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21492 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21493 this_ptr_conv.is_owned = false;
21494 int64_t ret_conv = ChannelConfig_get_max_dust_htlc_exposure_msat(&this_ptr_conv);
21498 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) {
21499 LDKChannelConfig this_ptr_conv;
21500 this_ptr_conv.inner = untag_ptr(this_ptr);
21501 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21502 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21503 this_ptr_conv.is_owned = false;
21504 ChannelConfig_set_max_dust_htlc_exposure_msat(&this_ptr_conv, val);
21507 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) {
21508 LDKChannelConfig this_ptr_conv;
21509 this_ptr_conv.inner = untag_ptr(this_ptr);
21510 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21511 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21512 this_ptr_conv.is_owned = false;
21513 int64_t ret_conv = ChannelConfig_get_force_close_avoidance_max_fee_satoshis(&this_ptr_conv);
21517 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) {
21518 LDKChannelConfig this_ptr_conv;
21519 this_ptr_conv.inner = untag_ptr(this_ptr);
21520 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21521 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21522 this_ptr_conv.is_owned = false;
21523 ChannelConfig_set_force_close_avoidance_max_fee_satoshis(&this_ptr_conv, val);
21526 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) {
21527 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);
21528 uint64_t ret_ref = 0;
21529 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21530 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21534 static inline uint64_t ChannelConfig_clone_ptr(LDKChannelConfig *NONNULL_PTR arg) {
21535 LDKChannelConfig ret_var = ChannelConfig_clone(arg);
21536 uint64_t ret_ref = 0;
21537 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21538 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21541 int64_t __attribute__((export_name("TS_ChannelConfig_clone_ptr"))) TS_ChannelConfig_clone_ptr(uint64_t arg) {
21542 LDKChannelConfig arg_conv;
21543 arg_conv.inner = untag_ptr(arg);
21544 arg_conv.is_owned = ptr_is_owned(arg);
21545 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
21546 arg_conv.is_owned = false;
21547 int64_t ret_conv = ChannelConfig_clone_ptr(&arg_conv);
21551 uint64_t __attribute__((export_name("TS_ChannelConfig_clone"))) TS_ChannelConfig_clone(uint64_t orig) {
21552 LDKChannelConfig orig_conv;
21553 orig_conv.inner = untag_ptr(orig);
21554 orig_conv.is_owned = ptr_is_owned(orig);
21555 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
21556 orig_conv.is_owned = false;
21557 LDKChannelConfig ret_var = ChannelConfig_clone(&orig_conv);
21558 uint64_t ret_ref = 0;
21559 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21560 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21564 uint64_t __attribute__((export_name("TS_ChannelConfig_default"))) TS_ChannelConfig_default() {
21565 LDKChannelConfig ret_var = ChannelConfig_default();
21566 uint64_t ret_ref = 0;
21567 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21568 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21572 int8_tArray __attribute__((export_name("TS_ChannelConfig_write"))) TS_ChannelConfig_write(uint64_t obj) {
21573 LDKChannelConfig obj_conv;
21574 obj_conv.inner = untag_ptr(obj);
21575 obj_conv.is_owned = ptr_is_owned(obj);
21576 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
21577 obj_conv.is_owned = false;
21578 LDKCVec_u8Z ret_var = ChannelConfig_write(&obj_conv);
21579 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
21580 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
21581 CVec_u8Z_free(ret_var);
21585 uint64_t __attribute__((export_name("TS_ChannelConfig_read"))) TS_ChannelConfig_read(int8_tArray ser) {
21586 LDKu8slice ser_ref;
21587 ser_ref.datalen = ser->arr_len;
21588 ser_ref.data = ser->elems;
21589 LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
21590 *ret_conv = ChannelConfig_read(ser_ref);
21592 return tag_ptr(ret_conv, true);
21595 void __attribute__((export_name("TS_UserConfig_free"))) TS_UserConfig_free(uint64_t this_obj) {
21596 LDKUserConfig this_obj_conv;
21597 this_obj_conv.inner = untag_ptr(this_obj);
21598 this_obj_conv.is_owned = ptr_is_owned(this_obj);
21599 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
21600 UserConfig_free(this_obj_conv);
21603 uint64_t __attribute__((export_name("TS_UserConfig_get_channel_handshake_config"))) TS_UserConfig_get_channel_handshake_config(uint64_t this_ptr) {
21604 LDKUserConfig this_ptr_conv;
21605 this_ptr_conv.inner = untag_ptr(this_ptr);
21606 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21607 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21608 this_ptr_conv.is_owned = false;
21609 LDKChannelHandshakeConfig ret_var = UserConfig_get_channel_handshake_config(&this_ptr_conv);
21610 uint64_t ret_ref = 0;
21611 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21612 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21616 void __attribute__((export_name("TS_UserConfig_set_channel_handshake_config"))) TS_UserConfig_set_channel_handshake_config(uint64_t this_ptr, uint64_t val) {
21617 LDKUserConfig this_ptr_conv;
21618 this_ptr_conv.inner = untag_ptr(this_ptr);
21619 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21620 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21621 this_ptr_conv.is_owned = false;
21622 LDKChannelHandshakeConfig val_conv;
21623 val_conv.inner = untag_ptr(val);
21624 val_conv.is_owned = ptr_is_owned(val);
21625 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
21626 val_conv = ChannelHandshakeConfig_clone(&val_conv);
21627 UserConfig_set_channel_handshake_config(&this_ptr_conv, val_conv);
21630 uint64_t __attribute__((export_name("TS_UserConfig_get_channel_handshake_limits"))) TS_UserConfig_get_channel_handshake_limits(uint64_t this_ptr) {
21631 LDKUserConfig this_ptr_conv;
21632 this_ptr_conv.inner = untag_ptr(this_ptr);
21633 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21634 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21635 this_ptr_conv.is_owned = false;
21636 LDKChannelHandshakeLimits ret_var = UserConfig_get_channel_handshake_limits(&this_ptr_conv);
21637 uint64_t ret_ref = 0;
21638 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21639 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21643 void __attribute__((export_name("TS_UserConfig_set_channel_handshake_limits"))) TS_UserConfig_set_channel_handshake_limits(uint64_t this_ptr, uint64_t val) {
21644 LDKUserConfig this_ptr_conv;
21645 this_ptr_conv.inner = untag_ptr(this_ptr);
21646 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21647 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21648 this_ptr_conv.is_owned = false;
21649 LDKChannelHandshakeLimits val_conv;
21650 val_conv.inner = untag_ptr(val);
21651 val_conv.is_owned = ptr_is_owned(val);
21652 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
21653 val_conv = ChannelHandshakeLimits_clone(&val_conv);
21654 UserConfig_set_channel_handshake_limits(&this_ptr_conv, val_conv);
21657 uint64_t __attribute__((export_name("TS_UserConfig_get_channel_config"))) TS_UserConfig_get_channel_config(uint64_t this_ptr) {
21658 LDKUserConfig this_ptr_conv;
21659 this_ptr_conv.inner = untag_ptr(this_ptr);
21660 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21661 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21662 this_ptr_conv.is_owned = false;
21663 LDKChannelConfig ret_var = UserConfig_get_channel_config(&this_ptr_conv);
21664 uint64_t ret_ref = 0;
21665 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21666 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21670 void __attribute__((export_name("TS_UserConfig_set_channel_config"))) TS_UserConfig_set_channel_config(uint64_t this_ptr, uint64_t val) {
21671 LDKUserConfig this_ptr_conv;
21672 this_ptr_conv.inner = untag_ptr(this_ptr);
21673 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21674 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21675 this_ptr_conv.is_owned = false;
21676 LDKChannelConfig val_conv;
21677 val_conv.inner = untag_ptr(val);
21678 val_conv.is_owned = ptr_is_owned(val);
21679 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
21680 val_conv = ChannelConfig_clone(&val_conv);
21681 UserConfig_set_channel_config(&this_ptr_conv, val_conv);
21684 jboolean __attribute__((export_name("TS_UserConfig_get_accept_forwards_to_priv_channels"))) TS_UserConfig_get_accept_forwards_to_priv_channels(uint64_t this_ptr) {
21685 LDKUserConfig this_ptr_conv;
21686 this_ptr_conv.inner = untag_ptr(this_ptr);
21687 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21688 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21689 this_ptr_conv.is_owned = false;
21690 jboolean ret_conv = UserConfig_get_accept_forwards_to_priv_channels(&this_ptr_conv);
21694 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) {
21695 LDKUserConfig this_ptr_conv;
21696 this_ptr_conv.inner = untag_ptr(this_ptr);
21697 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21698 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21699 this_ptr_conv.is_owned = false;
21700 UserConfig_set_accept_forwards_to_priv_channels(&this_ptr_conv, val);
21703 jboolean __attribute__((export_name("TS_UserConfig_get_accept_inbound_channels"))) TS_UserConfig_get_accept_inbound_channels(uint64_t this_ptr) {
21704 LDKUserConfig this_ptr_conv;
21705 this_ptr_conv.inner = untag_ptr(this_ptr);
21706 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21707 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21708 this_ptr_conv.is_owned = false;
21709 jboolean ret_conv = UserConfig_get_accept_inbound_channels(&this_ptr_conv);
21713 void __attribute__((export_name("TS_UserConfig_set_accept_inbound_channels"))) TS_UserConfig_set_accept_inbound_channels(uint64_t this_ptr, jboolean val) {
21714 LDKUserConfig this_ptr_conv;
21715 this_ptr_conv.inner = untag_ptr(this_ptr);
21716 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21717 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21718 this_ptr_conv.is_owned = false;
21719 UserConfig_set_accept_inbound_channels(&this_ptr_conv, val);
21722 jboolean __attribute__((export_name("TS_UserConfig_get_manually_accept_inbound_channels"))) TS_UserConfig_get_manually_accept_inbound_channels(uint64_t this_ptr) {
21723 LDKUserConfig this_ptr_conv;
21724 this_ptr_conv.inner = untag_ptr(this_ptr);
21725 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21726 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21727 this_ptr_conv.is_owned = false;
21728 jboolean ret_conv = UserConfig_get_manually_accept_inbound_channels(&this_ptr_conv);
21732 void __attribute__((export_name("TS_UserConfig_set_manually_accept_inbound_channels"))) TS_UserConfig_set_manually_accept_inbound_channels(uint64_t this_ptr, jboolean val) {
21733 LDKUserConfig this_ptr_conv;
21734 this_ptr_conv.inner = untag_ptr(this_ptr);
21735 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21736 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21737 this_ptr_conv.is_owned = false;
21738 UserConfig_set_manually_accept_inbound_channels(&this_ptr_conv, val);
21741 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) {
21742 LDKChannelHandshakeConfig channel_handshake_config_arg_conv;
21743 channel_handshake_config_arg_conv.inner = untag_ptr(channel_handshake_config_arg);
21744 channel_handshake_config_arg_conv.is_owned = ptr_is_owned(channel_handshake_config_arg);
21745 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_handshake_config_arg_conv);
21746 channel_handshake_config_arg_conv = ChannelHandshakeConfig_clone(&channel_handshake_config_arg_conv);
21747 LDKChannelHandshakeLimits channel_handshake_limits_arg_conv;
21748 channel_handshake_limits_arg_conv.inner = untag_ptr(channel_handshake_limits_arg);
21749 channel_handshake_limits_arg_conv.is_owned = ptr_is_owned(channel_handshake_limits_arg);
21750 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_handshake_limits_arg_conv);
21751 channel_handshake_limits_arg_conv = ChannelHandshakeLimits_clone(&channel_handshake_limits_arg_conv);
21752 LDKChannelConfig channel_config_arg_conv;
21753 channel_config_arg_conv.inner = untag_ptr(channel_config_arg);
21754 channel_config_arg_conv.is_owned = ptr_is_owned(channel_config_arg);
21755 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_config_arg_conv);
21756 channel_config_arg_conv = ChannelConfig_clone(&channel_config_arg_conv);
21757 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);
21758 uint64_t ret_ref = 0;
21759 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21760 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21764 static inline uint64_t UserConfig_clone_ptr(LDKUserConfig *NONNULL_PTR arg) {
21765 LDKUserConfig ret_var = UserConfig_clone(arg);
21766 uint64_t ret_ref = 0;
21767 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21768 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21771 int64_t __attribute__((export_name("TS_UserConfig_clone_ptr"))) TS_UserConfig_clone_ptr(uint64_t arg) {
21772 LDKUserConfig arg_conv;
21773 arg_conv.inner = untag_ptr(arg);
21774 arg_conv.is_owned = ptr_is_owned(arg);
21775 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
21776 arg_conv.is_owned = false;
21777 int64_t ret_conv = UserConfig_clone_ptr(&arg_conv);
21781 uint64_t __attribute__((export_name("TS_UserConfig_clone"))) TS_UserConfig_clone(uint64_t orig) {
21782 LDKUserConfig orig_conv;
21783 orig_conv.inner = untag_ptr(orig);
21784 orig_conv.is_owned = ptr_is_owned(orig);
21785 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
21786 orig_conv.is_owned = false;
21787 LDKUserConfig ret_var = UserConfig_clone(&orig_conv);
21788 uint64_t ret_ref = 0;
21789 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21790 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21794 uint64_t __attribute__((export_name("TS_UserConfig_default"))) TS_UserConfig_default() {
21795 LDKUserConfig ret_var = UserConfig_default();
21796 uint64_t ret_ref = 0;
21797 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21798 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21802 void __attribute__((export_name("TS_BestBlock_free"))) TS_BestBlock_free(uint64_t this_obj) {
21803 LDKBestBlock this_obj_conv;
21804 this_obj_conv.inner = untag_ptr(this_obj);
21805 this_obj_conv.is_owned = ptr_is_owned(this_obj);
21806 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
21807 BestBlock_free(this_obj_conv);
21810 static inline uint64_t BestBlock_clone_ptr(LDKBestBlock *NONNULL_PTR arg) {
21811 LDKBestBlock ret_var = BestBlock_clone(arg);
21812 uint64_t ret_ref = 0;
21813 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21814 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21817 int64_t __attribute__((export_name("TS_BestBlock_clone_ptr"))) TS_BestBlock_clone_ptr(uint64_t arg) {
21818 LDKBestBlock arg_conv;
21819 arg_conv.inner = untag_ptr(arg);
21820 arg_conv.is_owned = ptr_is_owned(arg);
21821 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
21822 arg_conv.is_owned = false;
21823 int64_t ret_conv = BestBlock_clone_ptr(&arg_conv);
21827 uint64_t __attribute__((export_name("TS_BestBlock_clone"))) TS_BestBlock_clone(uint64_t orig) {
21828 LDKBestBlock orig_conv;
21829 orig_conv.inner = untag_ptr(orig);
21830 orig_conv.is_owned = ptr_is_owned(orig);
21831 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
21832 orig_conv.is_owned = false;
21833 LDKBestBlock ret_var = BestBlock_clone(&orig_conv);
21834 uint64_t ret_ref = 0;
21835 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21836 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21840 uint64_t __attribute__((export_name("TS_BestBlock_from_genesis"))) TS_BestBlock_from_genesis(uint32_t network) {
21841 LDKNetwork network_conv = LDKNetwork_from_js(network);
21842 LDKBestBlock ret_var = BestBlock_from_genesis(network_conv);
21843 uint64_t ret_ref = 0;
21844 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21845 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21849 uint64_t __attribute__((export_name("TS_BestBlock_new"))) TS_BestBlock_new(int8_tArray block_hash, int32_t height) {
21850 LDKThirtyTwoBytes block_hash_ref;
21851 CHECK(block_hash->arr_len == 32);
21852 memcpy(block_hash_ref.data, block_hash->elems, 32); FREE(block_hash);
21853 LDKBestBlock ret_var = BestBlock_new(block_hash_ref, height);
21854 uint64_t ret_ref = 0;
21855 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21856 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21860 int8_tArray __attribute__((export_name("TS_BestBlock_block_hash"))) TS_BestBlock_block_hash(uint64_t this_arg) {
21861 LDKBestBlock this_arg_conv;
21862 this_arg_conv.inner = untag_ptr(this_arg);
21863 this_arg_conv.is_owned = ptr_is_owned(this_arg);
21864 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
21865 this_arg_conv.is_owned = false;
21866 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
21867 memcpy(ret_arr->elems, BestBlock_block_hash(&this_arg_conv).data, 32);
21871 int32_t __attribute__((export_name("TS_BestBlock_height"))) TS_BestBlock_height(uint64_t this_arg) {
21872 LDKBestBlock this_arg_conv;
21873 this_arg_conv.inner = untag_ptr(this_arg);
21874 this_arg_conv.is_owned = ptr_is_owned(this_arg);
21875 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
21876 this_arg_conv.is_owned = false;
21877 int32_t ret_conv = BestBlock_height(&this_arg_conv);
21881 uint32_t __attribute__((export_name("TS_AccessError_clone"))) TS_AccessError_clone(uint64_t orig) {
21882 LDKAccessError* orig_conv = (LDKAccessError*)untag_ptr(orig);
21883 uint32_t ret_conv = LDKAccessError_to_js(AccessError_clone(orig_conv));
21887 uint32_t __attribute__((export_name("TS_AccessError_unknown_chain"))) TS_AccessError_unknown_chain() {
21888 uint32_t ret_conv = LDKAccessError_to_js(AccessError_unknown_chain());
21892 uint32_t __attribute__((export_name("TS_AccessError_unknown_tx"))) TS_AccessError_unknown_tx() {
21893 uint32_t ret_conv = LDKAccessError_to_js(AccessError_unknown_tx());
21897 void __attribute__((export_name("TS_Access_free"))) TS_Access_free(uint64_t this_ptr) {
21898 if (!ptr_is_owned(this_ptr)) return;
21899 void* this_ptr_ptr = untag_ptr(this_ptr);
21900 CHECK_ACCESS(this_ptr_ptr);
21901 LDKAccess this_ptr_conv = *(LDKAccess*)(this_ptr_ptr);
21902 FREE(untag_ptr(this_ptr));
21903 Access_free(this_ptr_conv);
21906 void __attribute__((export_name("TS_Listen_free"))) TS_Listen_free(uint64_t this_ptr) {
21907 if (!ptr_is_owned(this_ptr)) return;
21908 void* this_ptr_ptr = untag_ptr(this_ptr);
21909 CHECK_ACCESS(this_ptr_ptr);
21910 LDKListen this_ptr_conv = *(LDKListen*)(this_ptr_ptr);
21911 FREE(untag_ptr(this_ptr));
21912 Listen_free(this_ptr_conv);
21915 void __attribute__((export_name("TS_Confirm_free"))) TS_Confirm_free(uint64_t this_ptr) {
21916 if (!ptr_is_owned(this_ptr)) return;
21917 void* this_ptr_ptr = untag_ptr(this_ptr);
21918 CHECK_ACCESS(this_ptr_ptr);
21919 LDKConfirm this_ptr_conv = *(LDKConfirm*)(this_ptr_ptr);
21920 FREE(untag_ptr(this_ptr));
21921 Confirm_free(this_ptr_conv);
21924 uint32_t __attribute__((export_name("TS_ChannelMonitorUpdateErr_clone"))) TS_ChannelMonitorUpdateErr_clone(uint64_t orig) {
21925 LDKChannelMonitorUpdateErr* orig_conv = (LDKChannelMonitorUpdateErr*)untag_ptr(orig);
21926 uint32_t ret_conv = LDKChannelMonitorUpdateErr_to_js(ChannelMonitorUpdateErr_clone(orig_conv));
21930 uint32_t __attribute__((export_name("TS_ChannelMonitorUpdateErr_temporary_failure"))) TS_ChannelMonitorUpdateErr_temporary_failure() {
21931 uint32_t ret_conv = LDKChannelMonitorUpdateErr_to_js(ChannelMonitorUpdateErr_temporary_failure());
21935 uint32_t __attribute__((export_name("TS_ChannelMonitorUpdateErr_permanent_failure"))) TS_ChannelMonitorUpdateErr_permanent_failure() {
21936 uint32_t ret_conv = LDKChannelMonitorUpdateErr_to_js(ChannelMonitorUpdateErr_permanent_failure());
21940 void __attribute__((export_name("TS_Watch_free"))) TS_Watch_free(uint64_t this_ptr) {
21941 if (!ptr_is_owned(this_ptr)) return;
21942 void* this_ptr_ptr = untag_ptr(this_ptr);
21943 CHECK_ACCESS(this_ptr_ptr);
21944 LDKWatch this_ptr_conv = *(LDKWatch*)(this_ptr_ptr);
21945 FREE(untag_ptr(this_ptr));
21946 Watch_free(this_ptr_conv);
21949 void __attribute__((export_name("TS_Filter_free"))) TS_Filter_free(uint64_t this_ptr) {
21950 if (!ptr_is_owned(this_ptr)) return;
21951 void* this_ptr_ptr = untag_ptr(this_ptr);
21952 CHECK_ACCESS(this_ptr_ptr);
21953 LDKFilter this_ptr_conv = *(LDKFilter*)(this_ptr_ptr);
21954 FREE(untag_ptr(this_ptr));
21955 Filter_free(this_ptr_conv);
21958 void __attribute__((export_name("TS_WatchedOutput_free"))) TS_WatchedOutput_free(uint64_t this_obj) {
21959 LDKWatchedOutput this_obj_conv;
21960 this_obj_conv.inner = untag_ptr(this_obj);
21961 this_obj_conv.is_owned = ptr_is_owned(this_obj);
21962 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
21963 WatchedOutput_free(this_obj_conv);
21966 int8_tArray __attribute__((export_name("TS_WatchedOutput_get_block_hash"))) TS_WatchedOutput_get_block_hash(uint64_t this_ptr) {
21967 LDKWatchedOutput this_ptr_conv;
21968 this_ptr_conv.inner = untag_ptr(this_ptr);
21969 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21970 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21971 this_ptr_conv.is_owned = false;
21972 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
21973 memcpy(ret_arr->elems, WatchedOutput_get_block_hash(&this_ptr_conv).data, 32);
21977 void __attribute__((export_name("TS_WatchedOutput_set_block_hash"))) TS_WatchedOutput_set_block_hash(uint64_t this_ptr, int8_tArray val) {
21978 LDKWatchedOutput this_ptr_conv;
21979 this_ptr_conv.inner = untag_ptr(this_ptr);
21980 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21981 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21982 this_ptr_conv.is_owned = false;
21983 LDKThirtyTwoBytes val_ref;
21984 CHECK(val->arr_len == 32);
21985 memcpy(val_ref.data, val->elems, 32); FREE(val);
21986 WatchedOutput_set_block_hash(&this_ptr_conv, val_ref);
21989 uint64_t __attribute__((export_name("TS_WatchedOutput_get_outpoint"))) TS_WatchedOutput_get_outpoint(uint64_t this_ptr) {
21990 LDKWatchedOutput this_ptr_conv;
21991 this_ptr_conv.inner = untag_ptr(this_ptr);
21992 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21993 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21994 this_ptr_conv.is_owned = false;
21995 LDKOutPoint ret_var = WatchedOutput_get_outpoint(&this_ptr_conv);
21996 uint64_t ret_ref = 0;
21997 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21998 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22002 void __attribute__((export_name("TS_WatchedOutput_set_outpoint"))) TS_WatchedOutput_set_outpoint(uint64_t this_ptr, uint64_t val) {
22003 LDKWatchedOutput this_ptr_conv;
22004 this_ptr_conv.inner = untag_ptr(this_ptr);
22005 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22006 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22007 this_ptr_conv.is_owned = false;
22008 LDKOutPoint val_conv;
22009 val_conv.inner = untag_ptr(val);
22010 val_conv.is_owned = ptr_is_owned(val);
22011 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
22012 val_conv = OutPoint_clone(&val_conv);
22013 WatchedOutput_set_outpoint(&this_ptr_conv, val_conv);
22016 int8_tArray __attribute__((export_name("TS_WatchedOutput_get_script_pubkey"))) TS_WatchedOutput_get_script_pubkey(uint64_t this_ptr) {
22017 LDKWatchedOutput this_ptr_conv;
22018 this_ptr_conv.inner = untag_ptr(this_ptr);
22019 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22020 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22021 this_ptr_conv.is_owned = false;
22022 LDKu8slice ret_var = WatchedOutput_get_script_pubkey(&this_ptr_conv);
22023 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
22024 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
22028 void __attribute__((export_name("TS_WatchedOutput_set_script_pubkey"))) TS_WatchedOutput_set_script_pubkey(uint64_t this_ptr, int8_tArray val) {
22029 LDKWatchedOutput this_ptr_conv;
22030 this_ptr_conv.inner = untag_ptr(this_ptr);
22031 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22032 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22033 this_ptr_conv.is_owned = false;
22034 LDKCVec_u8Z val_ref;
22035 val_ref.datalen = val->arr_len;
22036 val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes");
22037 memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val);
22038 WatchedOutput_set_script_pubkey(&this_ptr_conv, val_ref);
22041 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) {
22042 LDKThirtyTwoBytes block_hash_arg_ref;
22043 CHECK(block_hash_arg->arr_len == 32);
22044 memcpy(block_hash_arg_ref.data, block_hash_arg->elems, 32); FREE(block_hash_arg);
22045 LDKOutPoint outpoint_arg_conv;
22046 outpoint_arg_conv.inner = untag_ptr(outpoint_arg);
22047 outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg);
22048 CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv);
22049 outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv);
22050 LDKCVec_u8Z script_pubkey_arg_ref;
22051 script_pubkey_arg_ref.datalen = script_pubkey_arg->arr_len;
22052 script_pubkey_arg_ref.data = MALLOC(script_pubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes");
22053 memcpy(script_pubkey_arg_ref.data, script_pubkey_arg->elems, script_pubkey_arg_ref.datalen); FREE(script_pubkey_arg);
22054 LDKWatchedOutput ret_var = WatchedOutput_new(block_hash_arg_ref, outpoint_arg_conv, script_pubkey_arg_ref);
22055 uint64_t ret_ref = 0;
22056 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22057 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22061 static inline uint64_t WatchedOutput_clone_ptr(LDKWatchedOutput *NONNULL_PTR arg) {
22062 LDKWatchedOutput ret_var = WatchedOutput_clone(arg);
22063 uint64_t ret_ref = 0;
22064 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22065 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22068 int64_t __attribute__((export_name("TS_WatchedOutput_clone_ptr"))) TS_WatchedOutput_clone_ptr(uint64_t arg) {
22069 LDKWatchedOutput arg_conv;
22070 arg_conv.inner = untag_ptr(arg);
22071 arg_conv.is_owned = ptr_is_owned(arg);
22072 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
22073 arg_conv.is_owned = false;
22074 int64_t ret_conv = WatchedOutput_clone_ptr(&arg_conv);
22078 uint64_t __attribute__((export_name("TS_WatchedOutput_clone"))) TS_WatchedOutput_clone(uint64_t orig) {
22079 LDKWatchedOutput orig_conv;
22080 orig_conv.inner = untag_ptr(orig);
22081 orig_conv.is_owned = ptr_is_owned(orig);
22082 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
22083 orig_conv.is_owned = false;
22084 LDKWatchedOutput ret_var = WatchedOutput_clone(&orig_conv);
22085 uint64_t ret_ref = 0;
22086 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22087 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22091 int64_t __attribute__((export_name("TS_WatchedOutput_hash"))) TS_WatchedOutput_hash(uint64_t o) {
22092 LDKWatchedOutput o_conv;
22093 o_conv.inner = untag_ptr(o);
22094 o_conv.is_owned = ptr_is_owned(o);
22095 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
22096 o_conv.is_owned = false;
22097 int64_t ret_conv = WatchedOutput_hash(&o_conv);
22101 void __attribute__((export_name("TS_BroadcasterInterface_free"))) TS_BroadcasterInterface_free(uint64_t this_ptr) {
22102 if (!ptr_is_owned(this_ptr)) return;
22103 void* this_ptr_ptr = untag_ptr(this_ptr);
22104 CHECK_ACCESS(this_ptr_ptr);
22105 LDKBroadcasterInterface this_ptr_conv = *(LDKBroadcasterInterface*)(this_ptr_ptr);
22106 FREE(untag_ptr(this_ptr));
22107 BroadcasterInterface_free(this_ptr_conv);
22110 uint32_t __attribute__((export_name("TS_ConfirmationTarget_clone"))) TS_ConfirmationTarget_clone(uint64_t orig) {
22111 LDKConfirmationTarget* orig_conv = (LDKConfirmationTarget*)untag_ptr(orig);
22112 uint32_t ret_conv = LDKConfirmationTarget_to_js(ConfirmationTarget_clone(orig_conv));
22116 uint32_t __attribute__((export_name("TS_ConfirmationTarget_background"))) TS_ConfirmationTarget_background() {
22117 uint32_t ret_conv = LDKConfirmationTarget_to_js(ConfirmationTarget_background());
22121 uint32_t __attribute__((export_name("TS_ConfirmationTarget_normal"))) TS_ConfirmationTarget_normal() {
22122 uint32_t ret_conv = LDKConfirmationTarget_to_js(ConfirmationTarget_normal());
22126 uint32_t __attribute__((export_name("TS_ConfirmationTarget_high_priority"))) TS_ConfirmationTarget_high_priority() {
22127 uint32_t ret_conv = LDKConfirmationTarget_to_js(ConfirmationTarget_high_priority());
22131 jboolean __attribute__((export_name("TS_ConfirmationTarget_eq"))) TS_ConfirmationTarget_eq(uint64_t a, uint64_t b) {
22132 LDKConfirmationTarget* a_conv = (LDKConfirmationTarget*)untag_ptr(a);
22133 LDKConfirmationTarget* b_conv = (LDKConfirmationTarget*)untag_ptr(b);
22134 jboolean ret_conv = ConfirmationTarget_eq(a_conv, b_conv);
22138 void __attribute__((export_name("TS_FeeEstimator_free"))) TS_FeeEstimator_free(uint64_t this_ptr) {
22139 if (!ptr_is_owned(this_ptr)) return;
22140 void* this_ptr_ptr = untag_ptr(this_ptr);
22141 CHECK_ACCESS(this_ptr_ptr);
22142 LDKFeeEstimator this_ptr_conv = *(LDKFeeEstimator*)(this_ptr_ptr);
22143 FREE(untag_ptr(this_ptr));
22144 FeeEstimator_free(this_ptr_conv);
22147 void __attribute__((export_name("TS_MonitorUpdateId_free"))) TS_MonitorUpdateId_free(uint64_t this_obj) {
22148 LDKMonitorUpdateId this_obj_conv;
22149 this_obj_conv.inner = untag_ptr(this_obj);
22150 this_obj_conv.is_owned = ptr_is_owned(this_obj);
22151 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
22152 MonitorUpdateId_free(this_obj_conv);
22155 static inline uint64_t MonitorUpdateId_clone_ptr(LDKMonitorUpdateId *NONNULL_PTR arg) {
22156 LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(arg);
22157 uint64_t ret_ref = 0;
22158 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22159 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22162 int64_t __attribute__((export_name("TS_MonitorUpdateId_clone_ptr"))) TS_MonitorUpdateId_clone_ptr(uint64_t arg) {
22163 LDKMonitorUpdateId arg_conv;
22164 arg_conv.inner = untag_ptr(arg);
22165 arg_conv.is_owned = ptr_is_owned(arg);
22166 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
22167 arg_conv.is_owned = false;
22168 int64_t ret_conv = MonitorUpdateId_clone_ptr(&arg_conv);
22172 uint64_t __attribute__((export_name("TS_MonitorUpdateId_clone"))) TS_MonitorUpdateId_clone(uint64_t orig) {
22173 LDKMonitorUpdateId orig_conv;
22174 orig_conv.inner = untag_ptr(orig);
22175 orig_conv.is_owned = ptr_is_owned(orig);
22176 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
22177 orig_conv.is_owned = false;
22178 LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(&orig_conv);
22179 uint64_t ret_ref = 0;
22180 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22181 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22185 int64_t __attribute__((export_name("TS_MonitorUpdateId_hash"))) TS_MonitorUpdateId_hash(uint64_t o) {
22186 LDKMonitorUpdateId o_conv;
22187 o_conv.inner = untag_ptr(o);
22188 o_conv.is_owned = ptr_is_owned(o);
22189 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
22190 o_conv.is_owned = false;
22191 int64_t ret_conv = MonitorUpdateId_hash(&o_conv);
22195 jboolean __attribute__((export_name("TS_MonitorUpdateId_eq"))) TS_MonitorUpdateId_eq(uint64_t a, uint64_t b) {
22196 LDKMonitorUpdateId a_conv;
22197 a_conv.inner = untag_ptr(a);
22198 a_conv.is_owned = ptr_is_owned(a);
22199 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
22200 a_conv.is_owned = false;
22201 LDKMonitorUpdateId b_conv;
22202 b_conv.inner = untag_ptr(b);
22203 b_conv.is_owned = ptr_is_owned(b);
22204 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
22205 b_conv.is_owned = false;
22206 jboolean ret_conv = MonitorUpdateId_eq(&a_conv, &b_conv);
22210 void __attribute__((export_name("TS_Persist_free"))) TS_Persist_free(uint64_t this_ptr) {
22211 if (!ptr_is_owned(this_ptr)) return;
22212 void* this_ptr_ptr = untag_ptr(this_ptr);
22213 CHECK_ACCESS(this_ptr_ptr);
22214 LDKPersist this_ptr_conv = *(LDKPersist*)(this_ptr_ptr);
22215 FREE(untag_ptr(this_ptr));
22216 Persist_free(this_ptr_conv);
22219 void __attribute__((export_name("TS_LockedChannelMonitor_free"))) TS_LockedChannelMonitor_free(uint64_t this_obj) {
22220 LDKLockedChannelMonitor this_obj_conv;
22221 this_obj_conv.inner = untag_ptr(this_obj);
22222 this_obj_conv.is_owned = ptr_is_owned(this_obj);
22223 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
22224 LockedChannelMonitor_free(this_obj_conv);
22227 void __attribute__((export_name("TS_ChainMonitor_free"))) TS_ChainMonitor_free(uint64_t this_obj) {
22228 LDKChainMonitor this_obj_conv;
22229 this_obj_conv.inner = untag_ptr(this_obj);
22230 this_obj_conv.is_owned = ptr_is_owned(this_obj);
22231 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
22232 ChainMonitor_free(this_obj_conv);
22235 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) {
22236 void* chain_source_ptr = untag_ptr(chain_source);
22237 CHECK_ACCESS(chain_source_ptr);
22238 LDKCOption_FilterZ chain_source_conv = *(LDKCOption_FilterZ*)(chain_source_ptr);
22239 // WARNING: we may need a move here but no clone is available for LDKCOption_FilterZ
22240 if (chain_source_conv.tag == LDKCOption_FilterZ_Some) {
22241 // Manually implement clone for Java trait instances
22242 if (chain_source_conv.some.free == LDKFilter_JCalls_free) {
22243 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
22244 LDKFilter_JCalls_cloned(&chain_source_conv.some);
22247 void* broadcaster_ptr = untag_ptr(broadcaster);
22248 CHECK_ACCESS(broadcaster_ptr);
22249 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
22250 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
22251 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
22252 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
22254 void* logger_ptr = untag_ptr(logger);
22255 CHECK_ACCESS(logger_ptr);
22256 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
22257 if (logger_conv.free == LDKLogger_JCalls_free) {
22258 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
22259 LDKLogger_JCalls_cloned(&logger_conv);
22261 void* feeest_ptr = untag_ptr(feeest);
22262 CHECK_ACCESS(feeest_ptr);
22263 LDKFeeEstimator feeest_conv = *(LDKFeeEstimator*)(feeest_ptr);
22264 if (feeest_conv.free == LDKFeeEstimator_JCalls_free) {
22265 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
22266 LDKFeeEstimator_JCalls_cloned(&feeest_conv);
22268 void* persister_ptr = untag_ptr(persister);
22269 CHECK_ACCESS(persister_ptr);
22270 LDKPersist persister_conv = *(LDKPersist*)(persister_ptr);
22271 if (persister_conv.free == LDKPersist_JCalls_free) {
22272 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
22273 LDKPersist_JCalls_cloned(&persister_conv);
22275 LDKChainMonitor ret_var = ChainMonitor_new(chain_source_conv, broadcaster_conv, logger_conv, feeest_conv, persister_conv);
22276 uint64_t ret_ref = 0;
22277 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22278 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22282 uint64_tArray __attribute__((export_name("TS_ChainMonitor_get_claimable_balances"))) TS_ChainMonitor_get_claimable_balances(uint64_t this_arg, uint64_tArray ignored_channels) {
22283 LDKChainMonitor this_arg_conv;
22284 this_arg_conv.inner = untag_ptr(this_arg);
22285 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22286 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22287 this_arg_conv.is_owned = false;
22288 LDKCVec_ChannelDetailsZ ignored_channels_constr;
22289 ignored_channels_constr.datalen = ignored_channels->arr_len;
22290 if (ignored_channels_constr.datalen > 0)
22291 ignored_channels_constr.data = MALLOC(ignored_channels_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
22293 ignored_channels_constr.data = NULL;
22294 uint64_t* ignored_channels_vals = ignored_channels->elems;
22295 for (size_t q = 0; q < ignored_channels_constr.datalen; q++) {
22296 uint64_t ignored_channels_conv_16 = ignored_channels_vals[q];
22297 LDKChannelDetails ignored_channels_conv_16_conv;
22298 ignored_channels_conv_16_conv.inner = untag_ptr(ignored_channels_conv_16);
22299 ignored_channels_conv_16_conv.is_owned = ptr_is_owned(ignored_channels_conv_16);
22300 CHECK_INNER_FIELD_ACCESS_OR_NULL(ignored_channels_conv_16_conv);
22301 ignored_channels_conv_16_conv = ChannelDetails_clone(&ignored_channels_conv_16_conv);
22302 ignored_channels_constr.data[q] = ignored_channels_conv_16_conv;
22304 FREE(ignored_channels);
22305 LDKCVec_BalanceZ ret_var = ChainMonitor_get_claimable_balances(&this_arg_conv, ignored_channels_constr);
22306 uint64_tArray ret_arr = NULL;
22307 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
22308 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
22309 for (size_t j = 0; j < ret_var.datalen; j++) {
22310 LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
22311 *ret_conv_9_copy = ret_var.data[j];
22312 uint64_t ret_conv_9_ref = tag_ptr(ret_conv_9_copy, true);
22313 ret_arr_ptr[j] = ret_conv_9_ref;
22316 FREE(ret_var.data);
22320 uint64_t __attribute__((export_name("TS_ChainMonitor_get_monitor"))) TS_ChainMonitor_get_monitor(uint64_t this_arg, uint64_t funding_txo) {
22321 LDKChainMonitor this_arg_conv;
22322 this_arg_conv.inner = untag_ptr(this_arg);
22323 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22324 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22325 this_arg_conv.is_owned = false;
22326 LDKOutPoint funding_txo_conv;
22327 funding_txo_conv.inner = untag_ptr(funding_txo);
22328 funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
22329 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
22330 funding_txo_conv = OutPoint_clone(&funding_txo_conv);
22331 LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ");
22332 *ret_conv = ChainMonitor_get_monitor(&this_arg_conv, funding_txo_conv);
22333 return tag_ptr(ret_conv, true);
22336 uint64_tArray __attribute__((export_name("TS_ChainMonitor_list_monitors"))) TS_ChainMonitor_list_monitors(uint64_t this_arg) {
22337 LDKChainMonitor this_arg_conv;
22338 this_arg_conv.inner = untag_ptr(this_arg);
22339 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22340 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22341 this_arg_conv.is_owned = false;
22342 LDKCVec_OutPointZ ret_var = ChainMonitor_list_monitors(&this_arg_conv);
22343 uint64_tArray ret_arr = NULL;
22344 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
22345 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
22346 for (size_t k = 0; k < ret_var.datalen; k++) {
22347 LDKOutPoint ret_conv_10_var = ret_var.data[k];
22348 uint64_t ret_conv_10_ref = 0;
22349 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_10_var);
22350 ret_conv_10_ref = tag_ptr(ret_conv_10_var.inner, ret_conv_10_var.is_owned);
22351 ret_arr_ptr[k] = ret_conv_10_ref;
22354 FREE(ret_var.data);
22358 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) {
22359 LDKChainMonitor this_arg_conv;
22360 this_arg_conv.inner = untag_ptr(this_arg);
22361 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22362 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22363 this_arg_conv.is_owned = false;
22364 LDKOutPoint funding_txo_conv;
22365 funding_txo_conv.inner = untag_ptr(funding_txo);
22366 funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
22367 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
22368 funding_txo_conv = OutPoint_clone(&funding_txo_conv);
22369 LDKMonitorUpdateId completed_update_id_conv;
22370 completed_update_id_conv.inner = untag_ptr(completed_update_id);
22371 completed_update_id_conv.is_owned = ptr_is_owned(completed_update_id);
22372 CHECK_INNER_FIELD_ACCESS_OR_NULL(completed_update_id_conv);
22373 completed_update_id_conv = MonitorUpdateId_clone(&completed_update_id_conv);
22374 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
22375 *ret_conv = ChainMonitor_channel_monitor_updated(&this_arg_conv, funding_txo_conv, completed_update_id_conv);
22376 return tag_ptr(ret_conv, true);
22379 uint64_t __attribute__((export_name("TS_ChainMonitor_as_Listen"))) TS_ChainMonitor_as_Listen(uint64_t this_arg) {
22380 LDKChainMonitor this_arg_conv;
22381 this_arg_conv.inner = untag_ptr(this_arg);
22382 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22383 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22384 this_arg_conv.is_owned = false;
22385 LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen");
22386 *ret_ret = ChainMonitor_as_Listen(&this_arg_conv);
22387 return tag_ptr(ret_ret, true);
22390 uint64_t __attribute__((export_name("TS_ChainMonitor_as_Confirm"))) TS_ChainMonitor_as_Confirm(uint64_t this_arg) {
22391 LDKChainMonitor this_arg_conv;
22392 this_arg_conv.inner = untag_ptr(this_arg);
22393 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22394 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22395 this_arg_conv.is_owned = false;
22396 LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm");
22397 *ret_ret = ChainMonitor_as_Confirm(&this_arg_conv);
22398 return tag_ptr(ret_ret, true);
22401 uint64_t __attribute__((export_name("TS_ChainMonitor_as_Watch"))) TS_ChainMonitor_as_Watch(uint64_t this_arg) {
22402 LDKChainMonitor this_arg_conv;
22403 this_arg_conv.inner = untag_ptr(this_arg);
22404 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22405 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22406 this_arg_conv.is_owned = false;
22407 LDKWatch* ret_ret = MALLOC(sizeof(LDKWatch), "LDKWatch");
22408 *ret_ret = ChainMonitor_as_Watch(&this_arg_conv);
22409 return tag_ptr(ret_ret, true);
22412 uint64_t __attribute__((export_name("TS_ChainMonitor_as_EventsProvider"))) TS_ChainMonitor_as_EventsProvider(uint64_t this_arg) {
22413 LDKChainMonitor this_arg_conv;
22414 this_arg_conv.inner = untag_ptr(this_arg);
22415 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22416 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22417 this_arg_conv.is_owned = false;
22418 LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
22419 *ret_ret = ChainMonitor_as_EventsProvider(&this_arg_conv);
22420 return tag_ptr(ret_ret, true);
22423 void __attribute__((export_name("TS_ChannelMonitorUpdate_free"))) TS_ChannelMonitorUpdate_free(uint64_t this_obj) {
22424 LDKChannelMonitorUpdate this_obj_conv;
22425 this_obj_conv.inner = untag_ptr(this_obj);
22426 this_obj_conv.is_owned = ptr_is_owned(this_obj);
22427 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
22428 ChannelMonitorUpdate_free(this_obj_conv);
22431 int64_t __attribute__((export_name("TS_ChannelMonitorUpdate_get_update_id"))) TS_ChannelMonitorUpdate_get_update_id(uint64_t this_ptr) {
22432 LDKChannelMonitorUpdate this_ptr_conv;
22433 this_ptr_conv.inner = untag_ptr(this_ptr);
22434 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22435 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22436 this_ptr_conv.is_owned = false;
22437 int64_t ret_conv = ChannelMonitorUpdate_get_update_id(&this_ptr_conv);
22441 void __attribute__((export_name("TS_ChannelMonitorUpdate_set_update_id"))) TS_ChannelMonitorUpdate_set_update_id(uint64_t this_ptr, int64_t val) {
22442 LDKChannelMonitorUpdate this_ptr_conv;
22443 this_ptr_conv.inner = untag_ptr(this_ptr);
22444 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22445 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22446 this_ptr_conv.is_owned = false;
22447 ChannelMonitorUpdate_set_update_id(&this_ptr_conv, val);
22450 static inline uint64_t ChannelMonitorUpdate_clone_ptr(LDKChannelMonitorUpdate *NONNULL_PTR arg) {
22451 LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(arg);
22452 uint64_t ret_ref = 0;
22453 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22454 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22457 int64_t __attribute__((export_name("TS_ChannelMonitorUpdate_clone_ptr"))) TS_ChannelMonitorUpdate_clone_ptr(uint64_t arg) {
22458 LDKChannelMonitorUpdate arg_conv;
22459 arg_conv.inner = untag_ptr(arg);
22460 arg_conv.is_owned = ptr_is_owned(arg);
22461 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
22462 arg_conv.is_owned = false;
22463 int64_t ret_conv = ChannelMonitorUpdate_clone_ptr(&arg_conv);
22467 uint64_t __attribute__((export_name("TS_ChannelMonitorUpdate_clone"))) TS_ChannelMonitorUpdate_clone(uint64_t orig) {
22468 LDKChannelMonitorUpdate orig_conv;
22469 orig_conv.inner = untag_ptr(orig);
22470 orig_conv.is_owned = ptr_is_owned(orig);
22471 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
22472 orig_conv.is_owned = false;
22473 LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(&orig_conv);
22474 uint64_t ret_ref = 0;
22475 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22476 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22480 int8_tArray __attribute__((export_name("TS_ChannelMonitorUpdate_write"))) TS_ChannelMonitorUpdate_write(uint64_t obj) {
22481 LDKChannelMonitorUpdate obj_conv;
22482 obj_conv.inner = untag_ptr(obj);
22483 obj_conv.is_owned = ptr_is_owned(obj);
22484 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
22485 obj_conv.is_owned = false;
22486 LDKCVec_u8Z ret_var = ChannelMonitorUpdate_write(&obj_conv);
22487 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
22488 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
22489 CVec_u8Z_free(ret_var);
22493 uint64_t __attribute__((export_name("TS_ChannelMonitorUpdate_read"))) TS_ChannelMonitorUpdate_read(int8_tArray ser) {
22494 LDKu8slice ser_ref;
22495 ser_ref.datalen = ser->arr_len;
22496 ser_ref.data = ser->elems;
22497 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
22498 *ret_conv = ChannelMonitorUpdate_read(ser_ref);
22500 return tag_ptr(ret_conv, true);
22503 void __attribute__((export_name("TS_MonitorEvent_free"))) TS_MonitorEvent_free(uint64_t this_ptr) {
22504 if (!ptr_is_owned(this_ptr)) return;
22505 void* this_ptr_ptr = untag_ptr(this_ptr);
22506 CHECK_ACCESS(this_ptr_ptr);
22507 LDKMonitorEvent this_ptr_conv = *(LDKMonitorEvent*)(this_ptr_ptr);
22508 FREE(untag_ptr(this_ptr));
22509 MonitorEvent_free(this_ptr_conv);
22512 static inline uint64_t MonitorEvent_clone_ptr(LDKMonitorEvent *NONNULL_PTR arg) {
22513 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
22514 *ret_copy = MonitorEvent_clone(arg);
22515 uint64_t ret_ref = tag_ptr(ret_copy, true);
22518 int64_t __attribute__((export_name("TS_MonitorEvent_clone_ptr"))) TS_MonitorEvent_clone_ptr(uint64_t arg) {
22519 LDKMonitorEvent* arg_conv = (LDKMonitorEvent*)untag_ptr(arg);
22520 int64_t ret_conv = MonitorEvent_clone_ptr(arg_conv);
22524 uint64_t __attribute__((export_name("TS_MonitorEvent_clone"))) TS_MonitorEvent_clone(uint64_t orig) {
22525 LDKMonitorEvent* orig_conv = (LDKMonitorEvent*)untag_ptr(orig);
22526 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
22527 *ret_copy = MonitorEvent_clone(orig_conv);
22528 uint64_t ret_ref = tag_ptr(ret_copy, true);
22532 uint64_t __attribute__((export_name("TS_MonitorEvent_htlcevent"))) TS_MonitorEvent_htlcevent(uint64_t a) {
22533 LDKHTLCUpdate a_conv;
22534 a_conv.inner = untag_ptr(a);
22535 a_conv.is_owned = ptr_is_owned(a);
22536 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
22537 a_conv = HTLCUpdate_clone(&a_conv);
22538 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
22539 *ret_copy = MonitorEvent_htlcevent(a_conv);
22540 uint64_t ret_ref = tag_ptr(ret_copy, true);
22544 uint64_t __attribute__((export_name("TS_MonitorEvent_commitment_tx_confirmed"))) TS_MonitorEvent_commitment_tx_confirmed(uint64_t a) {
22545 LDKOutPoint a_conv;
22546 a_conv.inner = untag_ptr(a);
22547 a_conv.is_owned = ptr_is_owned(a);
22548 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
22549 a_conv = OutPoint_clone(&a_conv);
22550 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
22551 *ret_copy = MonitorEvent_commitment_tx_confirmed(a_conv);
22552 uint64_t ret_ref = tag_ptr(ret_copy, true);
22556 uint64_t __attribute__((export_name("TS_MonitorEvent_update_completed"))) TS_MonitorEvent_update_completed(uint64_t funding_txo, int64_t monitor_update_id) {
22557 LDKOutPoint funding_txo_conv;
22558 funding_txo_conv.inner = untag_ptr(funding_txo);
22559 funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
22560 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
22561 funding_txo_conv = OutPoint_clone(&funding_txo_conv);
22562 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
22563 *ret_copy = MonitorEvent_update_completed(funding_txo_conv, monitor_update_id);
22564 uint64_t ret_ref = tag_ptr(ret_copy, true);
22568 uint64_t __attribute__((export_name("TS_MonitorEvent_update_failed"))) TS_MonitorEvent_update_failed(uint64_t a) {
22569 LDKOutPoint a_conv;
22570 a_conv.inner = untag_ptr(a);
22571 a_conv.is_owned = ptr_is_owned(a);
22572 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
22573 a_conv = OutPoint_clone(&a_conv);
22574 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
22575 *ret_copy = MonitorEvent_update_failed(a_conv);
22576 uint64_t ret_ref = tag_ptr(ret_copy, true);
22580 int8_tArray __attribute__((export_name("TS_MonitorEvent_write"))) TS_MonitorEvent_write(uint64_t obj) {
22581 LDKMonitorEvent* obj_conv = (LDKMonitorEvent*)untag_ptr(obj);
22582 LDKCVec_u8Z ret_var = MonitorEvent_write(obj_conv);
22583 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
22584 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
22585 CVec_u8Z_free(ret_var);
22589 uint64_t __attribute__((export_name("TS_MonitorEvent_read"))) TS_MonitorEvent_read(int8_tArray ser) {
22590 LDKu8slice ser_ref;
22591 ser_ref.datalen = ser->arr_len;
22592 ser_ref.data = ser->elems;
22593 LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
22594 *ret_conv = MonitorEvent_read(ser_ref);
22596 return tag_ptr(ret_conv, true);
22599 void __attribute__((export_name("TS_HTLCUpdate_free"))) TS_HTLCUpdate_free(uint64_t this_obj) {
22600 LDKHTLCUpdate this_obj_conv;
22601 this_obj_conv.inner = untag_ptr(this_obj);
22602 this_obj_conv.is_owned = ptr_is_owned(this_obj);
22603 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
22604 HTLCUpdate_free(this_obj_conv);
22607 static inline uint64_t HTLCUpdate_clone_ptr(LDKHTLCUpdate *NONNULL_PTR arg) {
22608 LDKHTLCUpdate ret_var = HTLCUpdate_clone(arg);
22609 uint64_t ret_ref = 0;
22610 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22611 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22614 int64_t __attribute__((export_name("TS_HTLCUpdate_clone_ptr"))) TS_HTLCUpdate_clone_ptr(uint64_t arg) {
22615 LDKHTLCUpdate arg_conv;
22616 arg_conv.inner = untag_ptr(arg);
22617 arg_conv.is_owned = ptr_is_owned(arg);
22618 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
22619 arg_conv.is_owned = false;
22620 int64_t ret_conv = HTLCUpdate_clone_ptr(&arg_conv);
22624 uint64_t __attribute__((export_name("TS_HTLCUpdate_clone"))) TS_HTLCUpdate_clone(uint64_t orig) {
22625 LDKHTLCUpdate orig_conv;
22626 orig_conv.inner = untag_ptr(orig);
22627 orig_conv.is_owned = ptr_is_owned(orig);
22628 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
22629 orig_conv.is_owned = false;
22630 LDKHTLCUpdate ret_var = HTLCUpdate_clone(&orig_conv);
22631 uint64_t ret_ref = 0;
22632 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22633 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22637 int8_tArray __attribute__((export_name("TS_HTLCUpdate_write"))) TS_HTLCUpdate_write(uint64_t obj) {
22638 LDKHTLCUpdate obj_conv;
22639 obj_conv.inner = untag_ptr(obj);
22640 obj_conv.is_owned = ptr_is_owned(obj);
22641 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
22642 obj_conv.is_owned = false;
22643 LDKCVec_u8Z ret_var = HTLCUpdate_write(&obj_conv);
22644 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
22645 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
22646 CVec_u8Z_free(ret_var);
22650 uint64_t __attribute__((export_name("TS_HTLCUpdate_read"))) TS_HTLCUpdate_read(int8_tArray ser) {
22651 LDKu8slice ser_ref;
22652 ser_ref.datalen = ser->arr_len;
22653 ser_ref.data = ser->elems;
22654 LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
22655 *ret_conv = HTLCUpdate_read(ser_ref);
22657 return tag_ptr(ret_conv, true);
22660 void __attribute__((export_name("TS_Balance_free"))) TS_Balance_free(uint64_t this_ptr) {
22661 if (!ptr_is_owned(this_ptr)) return;
22662 void* this_ptr_ptr = untag_ptr(this_ptr);
22663 CHECK_ACCESS(this_ptr_ptr);
22664 LDKBalance this_ptr_conv = *(LDKBalance*)(this_ptr_ptr);
22665 FREE(untag_ptr(this_ptr));
22666 Balance_free(this_ptr_conv);
22669 static inline uint64_t Balance_clone_ptr(LDKBalance *NONNULL_PTR arg) {
22670 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
22671 *ret_copy = Balance_clone(arg);
22672 uint64_t ret_ref = tag_ptr(ret_copy, true);
22675 int64_t __attribute__((export_name("TS_Balance_clone_ptr"))) TS_Balance_clone_ptr(uint64_t arg) {
22676 LDKBalance* arg_conv = (LDKBalance*)untag_ptr(arg);
22677 int64_t ret_conv = Balance_clone_ptr(arg_conv);
22681 uint64_t __attribute__((export_name("TS_Balance_clone"))) TS_Balance_clone(uint64_t orig) {
22682 LDKBalance* orig_conv = (LDKBalance*)untag_ptr(orig);
22683 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
22684 *ret_copy = Balance_clone(orig_conv);
22685 uint64_t ret_ref = tag_ptr(ret_copy, true);
22689 uint64_t __attribute__((export_name("TS_Balance_claimable_on_channel_close"))) TS_Balance_claimable_on_channel_close(int64_t claimable_amount_satoshis) {
22690 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
22691 *ret_copy = Balance_claimable_on_channel_close(claimable_amount_satoshis);
22692 uint64_t ret_ref = tag_ptr(ret_copy, true);
22696 uint64_t __attribute__((export_name("TS_Balance_claimable_awaiting_confirmations"))) TS_Balance_claimable_awaiting_confirmations(int64_t claimable_amount_satoshis, int32_t confirmation_height) {
22697 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
22698 *ret_copy = Balance_claimable_awaiting_confirmations(claimable_amount_satoshis, confirmation_height);
22699 uint64_t ret_ref = tag_ptr(ret_copy, true);
22703 uint64_t __attribute__((export_name("TS_Balance_contentious_claimable"))) TS_Balance_contentious_claimable(int64_t claimable_amount_satoshis, int32_t timeout_height) {
22704 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
22705 *ret_copy = Balance_contentious_claimable(claimable_amount_satoshis, timeout_height);
22706 uint64_t ret_ref = tag_ptr(ret_copy, true);
22710 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) {
22711 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
22712 *ret_copy = Balance_maybe_claimable_htlcawaiting_timeout(claimable_amount_satoshis, claimable_height);
22713 uint64_t ret_ref = tag_ptr(ret_copy, true);
22717 jboolean __attribute__((export_name("TS_Balance_eq"))) TS_Balance_eq(uint64_t a, uint64_t b) {
22718 LDKBalance* a_conv = (LDKBalance*)untag_ptr(a);
22719 LDKBalance* b_conv = (LDKBalance*)untag_ptr(b);
22720 jboolean ret_conv = Balance_eq(a_conv, b_conv);
22724 void __attribute__((export_name("TS_ChannelMonitor_free"))) TS_ChannelMonitor_free(uint64_t this_obj) {
22725 LDKChannelMonitor this_obj_conv;
22726 this_obj_conv.inner = untag_ptr(this_obj);
22727 this_obj_conv.is_owned = ptr_is_owned(this_obj);
22728 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
22729 ChannelMonitor_free(this_obj_conv);
22732 static inline uint64_t ChannelMonitor_clone_ptr(LDKChannelMonitor *NONNULL_PTR arg) {
22733 LDKChannelMonitor ret_var = ChannelMonitor_clone(arg);
22734 uint64_t ret_ref = 0;
22735 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22736 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22739 int64_t __attribute__((export_name("TS_ChannelMonitor_clone_ptr"))) TS_ChannelMonitor_clone_ptr(uint64_t arg) {
22740 LDKChannelMonitor arg_conv;
22741 arg_conv.inner = untag_ptr(arg);
22742 arg_conv.is_owned = ptr_is_owned(arg);
22743 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
22744 arg_conv.is_owned = false;
22745 int64_t ret_conv = ChannelMonitor_clone_ptr(&arg_conv);
22749 uint64_t __attribute__((export_name("TS_ChannelMonitor_clone"))) TS_ChannelMonitor_clone(uint64_t orig) {
22750 LDKChannelMonitor orig_conv;
22751 orig_conv.inner = untag_ptr(orig);
22752 orig_conv.is_owned = ptr_is_owned(orig);
22753 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
22754 orig_conv.is_owned = false;
22755 LDKChannelMonitor ret_var = ChannelMonitor_clone(&orig_conv);
22756 uint64_t ret_ref = 0;
22757 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22758 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22762 int8_tArray __attribute__((export_name("TS_ChannelMonitor_write"))) TS_ChannelMonitor_write(uint64_t obj) {
22763 LDKChannelMonitor obj_conv;
22764 obj_conv.inner = untag_ptr(obj);
22765 obj_conv.is_owned = ptr_is_owned(obj);
22766 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
22767 obj_conv.is_owned = false;
22768 LDKCVec_u8Z ret_var = ChannelMonitor_write(&obj_conv);
22769 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
22770 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
22771 CVec_u8Z_free(ret_var);
22775 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) {
22776 LDKChannelMonitor this_arg_conv;
22777 this_arg_conv.inner = untag_ptr(this_arg);
22778 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22779 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22780 this_arg_conv.is_owned = false;
22781 LDKChannelMonitorUpdate updates_conv;
22782 updates_conv.inner = untag_ptr(updates);
22783 updates_conv.is_owned = ptr_is_owned(updates);
22784 CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv);
22785 updates_conv.is_owned = false;
22786 void* broadcaster_ptr = untag_ptr(broadcaster);
22787 if (ptr_is_owned(broadcaster)) { CHECK_ACCESS(broadcaster_ptr); }
22788 LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr;
22789 void* fee_estimator_ptr = untag_ptr(fee_estimator);
22790 CHECK_ACCESS(fee_estimator_ptr);
22791 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
22792 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
22793 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
22794 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
22796 void* logger_ptr = untag_ptr(logger);
22797 if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); }
22798 LDKLogger* logger_conv = (LDKLogger*)logger_ptr;
22799 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
22800 *ret_conv = ChannelMonitor_update_monitor(&this_arg_conv, &updates_conv, broadcaster_conv, fee_estimator_conv, logger_conv);
22801 return tag_ptr(ret_conv, true);
22804 int64_t __attribute__((export_name("TS_ChannelMonitor_get_latest_update_id"))) TS_ChannelMonitor_get_latest_update_id(uint64_t this_arg) {
22805 LDKChannelMonitor this_arg_conv;
22806 this_arg_conv.inner = untag_ptr(this_arg);
22807 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22808 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22809 this_arg_conv.is_owned = false;
22810 int64_t ret_conv = ChannelMonitor_get_latest_update_id(&this_arg_conv);
22814 uint64_t __attribute__((export_name("TS_ChannelMonitor_get_funding_txo"))) TS_ChannelMonitor_get_funding_txo(uint64_t this_arg) {
22815 LDKChannelMonitor this_arg_conv;
22816 this_arg_conv.inner = untag_ptr(this_arg);
22817 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22818 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22819 this_arg_conv.is_owned = false;
22820 LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
22821 *ret_conv = ChannelMonitor_get_funding_txo(&this_arg_conv);
22822 return tag_ptr(ret_conv, true);
22825 uint64_tArray __attribute__((export_name("TS_ChannelMonitor_get_outputs_to_watch"))) TS_ChannelMonitor_get_outputs_to_watch(uint64_t this_arg) {
22826 LDKChannelMonitor this_arg_conv;
22827 this_arg_conv.inner = untag_ptr(this_arg);
22828 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22829 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22830 this_arg_conv.is_owned = false;
22831 LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ret_var = ChannelMonitor_get_outputs_to_watch(&this_arg_conv);
22832 uint64_tArray ret_arr = NULL;
22833 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
22834 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
22835 for (size_t o = 0; o < ret_var.datalen; o++) {
22836 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv_40_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ");
22837 *ret_conv_40_conv = ret_var.data[o];
22838 ret_arr_ptr[o] = tag_ptr(ret_conv_40_conv, true);
22841 FREE(ret_var.data);
22845 void __attribute__((export_name("TS_ChannelMonitor_load_outputs_to_watch"))) TS_ChannelMonitor_load_outputs_to_watch(uint64_t this_arg, uint64_t filter) {
22846 LDKChannelMonitor this_arg_conv;
22847 this_arg_conv.inner = untag_ptr(this_arg);
22848 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22849 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22850 this_arg_conv.is_owned = false;
22851 void* filter_ptr = untag_ptr(filter);
22852 if (ptr_is_owned(filter)) { CHECK_ACCESS(filter_ptr); }
22853 LDKFilter* filter_conv = (LDKFilter*)filter_ptr;
22854 ChannelMonitor_load_outputs_to_watch(&this_arg_conv, filter_conv);
22857 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) {
22858 LDKChannelMonitor this_arg_conv;
22859 this_arg_conv.inner = untag_ptr(this_arg);
22860 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22861 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22862 this_arg_conv.is_owned = false;
22863 LDKCVec_MonitorEventZ ret_var = ChannelMonitor_get_and_clear_pending_monitor_events(&this_arg_conv);
22864 uint64_tArray ret_arr = NULL;
22865 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
22866 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
22867 for (size_t o = 0; o < ret_var.datalen; o++) {
22868 LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
22869 *ret_conv_14_copy = ret_var.data[o];
22870 uint64_t ret_conv_14_ref = tag_ptr(ret_conv_14_copy, true);
22871 ret_arr_ptr[o] = ret_conv_14_ref;
22874 FREE(ret_var.data);
22878 uint64_tArray __attribute__((export_name("TS_ChannelMonitor_get_and_clear_pending_events"))) TS_ChannelMonitor_get_and_clear_pending_events(uint64_t this_arg) {
22879 LDKChannelMonitor this_arg_conv;
22880 this_arg_conv.inner = untag_ptr(this_arg);
22881 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22882 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22883 this_arg_conv.is_owned = false;
22884 LDKCVec_EventZ ret_var = ChannelMonitor_get_and_clear_pending_events(&this_arg_conv);
22885 uint64_tArray ret_arr = NULL;
22886 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
22887 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
22888 for (size_t h = 0; h < ret_var.datalen; h++) {
22889 LDKEvent *ret_conv_7_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
22890 *ret_conv_7_copy = ret_var.data[h];
22891 uint64_t ret_conv_7_ref = tag_ptr(ret_conv_7_copy, true);
22892 ret_arr_ptr[h] = ret_conv_7_ref;
22895 FREE(ret_var.data);
22899 int8_tArray __attribute__((export_name("TS_ChannelMonitor_get_counterparty_node_id"))) TS_ChannelMonitor_get_counterparty_node_id(uint64_t this_arg) {
22900 LDKChannelMonitor this_arg_conv;
22901 this_arg_conv.inner = untag_ptr(this_arg);
22902 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22903 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22904 this_arg_conv.is_owned = false;
22905 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
22906 memcpy(ret_arr->elems, ChannelMonitor_get_counterparty_node_id(&this_arg_conv).compressed_form, 33);
22910 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) {
22911 LDKChannelMonitor this_arg_conv;
22912 this_arg_conv.inner = untag_ptr(this_arg);
22913 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22914 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22915 this_arg_conv.is_owned = false;
22916 void* logger_ptr = untag_ptr(logger);
22917 if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); }
22918 LDKLogger* logger_conv = (LDKLogger*)logger_ptr;
22919 LDKCVec_TransactionZ ret_var = ChannelMonitor_get_latest_holder_commitment_txn(&this_arg_conv, logger_conv);
22920 ptrArray ret_arr = NULL;
22921 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
22922 int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8);
22923 for (size_t m = 0; m < ret_var.datalen; m++) {
22924 LDKTransaction ret_conv_12_var = ret_var.data[m];
22925 int8_tArray ret_conv_12_arr = init_int8_tArray(ret_conv_12_var.datalen, __LINE__);
22926 memcpy(ret_conv_12_arr->elems, ret_conv_12_var.data, ret_conv_12_var.datalen);
22927 Transaction_free(ret_conv_12_var);
22928 ret_arr_ptr[m] = ret_conv_12_arr;
22931 FREE(ret_var.data);
22935 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) {
22936 LDKChannelMonitor this_arg_conv;
22937 this_arg_conv.inner = untag_ptr(this_arg);
22938 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22939 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22940 this_arg_conv.is_owned = false;
22941 unsigned char header_arr[80];
22942 CHECK(header->arr_len == 80);
22943 memcpy(header_arr, header->elems, 80); FREE(header);
22944 unsigned char (*header_ref)[80] = &header_arr;
22945 LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr;
22946 txdata_constr.datalen = txdata->arr_len;
22947 if (txdata_constr.datalen > 0)
22948 txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
22950 txdata_constr.data = NULL;
22951 uint64_t* txdata_vals = txdata->elems;
22952 for (size_t c = 0; c < txdata_constr.datalen; c++) {
22953 uint64_t txdata_conv_28 = txdata_vals[c];
22954 void* txdata_conv_28_ptr = untag_ptr(txdata_conv_28);
22955 CHECK_ACCESS(txdata_conv_28_ptr);
22956 LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr);
22957 txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(txdata_conv_28));
22958 txdata_constr.data[c] = txdata_conv_28_conv;
22961 void* broadcaster_ptr = untag_ptr(broadcaster);
22962 CHECK_ACCESS(broadcaster_ptr);
22963 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
22964 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
22965 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
22966 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
22968 void* fee_estimator_ptr = untag_ptr(fee_estimator);
22969 CHECK_ACCESS(fee_estimator_ptr);
22970 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
22971 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
22972 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
22973 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
22975 void* logger_ptr = untag_ptr(logger);
22976 CHECK_ACCESS(logger_ptr);
22977 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
22978 if (logger_conv.free == LDKLogger_JCalls_free) {
22979 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
22980 LDKLogger_JCalls_cloned(&logger_conv);
22982 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);
22983 uint64_tArray ret_arr = NULL;
22984 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
22985 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
22986 for (size_t n = 0; n < ret_var.datalen; n++) {
22987 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
22988 *ret_conv_39_conv = ret_var.data[n];
22989 ret_arr_ptr[n] = tag_ptr(ret_conv_39_conv, true);
22992 FREE(ret_var.data);
22996 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) {
22997 LDKChannelMonitor this_arg_conv;
22998 this_arg_conv.inner = untag_ptr(this_arg);
22999 this_arg_conv.is_owned = ptr_is_owned(this_arg);
23000 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
23001 this_arg_conv.is_owned = false;
23002 unsigned char header_arr[80];
23003 CHECK(header->arr_len == 80);
23004 memcpy(header_arr, header->elems, 80); FREE(header);
23005 unsigned char (*header_ref)[80] = &header_arr;
23006 void* broadcaster_ptr = untag_ptr(broadcaster);
23007 CHECK_ACCESS(broadcaster_ptr);
23008 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
23009 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
23010 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
23011 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
23013 void* fee_estimator_ptr = untag_ptr(fee_estimator);
23014 CHECK_ACCESS(fee_estimator_ptr);
23015 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
23016 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
23017 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
23018 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
23020 void* logger_ptr = untag_ptr(logger);
23021 CHECK_ACCESS(logger_ptr);
23022 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
23023 if (logger_conv.free == LDKLogger_JCalls_free) {
23024 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
23025 LDKLogger_JCalls_cloned(&logger_conv);
23027 ChannelMonitor_block_disconnected(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv);
23030 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) {
23031 LDKChannelMonitor this_arg_conv;
23032 this_arg_conv.inner = untag_ptr(this_arg);
23033 this_arg_conv.is_owned = ptr_is_owned(this_arg);
23034 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
23035 this_arg_conv.is_owned = false;
23036 unsigned char header_arr[80];
23037 CHECK(header->arr_len == 80);
23038 memcpy(header_arr, header->elems, 80); FREE(header);
23039 unsigned char (*header_ref)[80] = &header_arr;
23040 LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr;
23041 txdata_constr.datalen = txdata->arr_len;
23042 if (txdata_constr.datalen > 0)
23043 txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
23045 txdata_constr.data = NULL;
23046 uint64_t* txdata_vals = txdata->elems;
23047 for (size_t c = 0; c < txdata_constr.datalen; c++) {
23048 uint64_t txdata_conv_28 = txdata_vals[c];
23049 void* txdata_conv_28_ptr = untag_ptr(txdata_conv_28);
23050 CHECK_ACCESS(txdata_conv_28_ptr);
23051 LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr);
23052 txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(txdata_conv_28));
23053 txdata_constr.data[c] = txdata_conv_28_conv;
23056 void* broadcaster_ptr = untag_ptr(broadcaster);
23057 CHECK_ACCESS(broadcaster_ptr);
23058 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
23059 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
23060 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
23061 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
23063 void* fee_estimator_ptr = untag_ptr(fee_estimator);
23064 CHECK_ACCESS(fee_estimator_ptr);
23065 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
23066 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
23067 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
23068 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
23070 void* logger_ptr = untag_ptr(logger);
23071 CHECK_ACCESS(logger_ptr);
23072 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
23073 if (logger_conv.free == LDKLogger_JCalls_free) {
23074 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
23075 LDKLogger_JCalls_cloned(&logger_conv);
23077 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);
23078 uint64_tArray ret_arr = NULL;
23079 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
23080 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
23081 for (size_t n = 0; n < ret_var.datalen; n++) {
23082 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
23083 *ret_conv_39_conv = ret_var.data[n];
23084 ret_arr_ptr[n] = tag_ptr(ret_conv_39_conv, true);
23087 FREE(ret_var.data);
23091 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) {
23092 LDKChannelMonitor this_arg_conv;
23093 this_arg_conv.inner = untag_ptr(this_arg);
23094 this_arg_conv.is_owned = ptr_is_owned(this_arg);
23095 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
23096 this_arg_conv.is_owned = false;
23097 unsigned char txid_arr[32];
23098 CHECK(txid->arr_len == 32);
23099 memcpy(txid_arr, txid->elems, 32); FREE(txid);
23100 unsigned char (*txid_ref)[32] = &txid_arr;
23101 void* broadcaster_ptr = untag_ptr(broadcaster);
23102 CHECK_ACCESS(broadcaster_ptr);
23103 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
23104 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
23105 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
23106 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
23108 void* fee_estimator_ptr = untag_ptr(fee_estimator);
23109 CHECK_ACCESS(fee_estimator_ptr);
23110 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
23111 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
23112 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
23113 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
23115 void* logger_ptr = untag_ptr(logger);
23116 CHECK_ACCESS(logger_ptr);
23117 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
23118 if (logger_conv.free == LDKLogger_JCalls_free) {
23119 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
23120 LDKLogger_JCalls_cloned(&logger_conv);
23122 ChannelMonitor_transaction_unconfirmed(&this_arg_conv, txid_ref, broadcaster_conv, fee_estimator_conv, logger_conv);
23125 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) {
23126 LDKChannelMonitor this_arg_conv;
23127 this_arg_conv.inner = untag_ptr(this_arg);
23128 this_arg_conv.is_owned = ptr_is_owned(this_arg);
23129 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
23130 this_arg_conv.is_owned = false;
23131 unsigned char header_arr[80];
23132 CHECK(header->arr_len == 80);
23133 memcpy(header_arr, header->elems, 80); FREE(header);
23134 unsigned char (*header_ref)[80] = &header_arr;
23135 void* broadcaster_ptr = untag_ptr(broadcaster);
23136 CHECK_ACCESS(broadcaster_ptr);
23137 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
23138 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
23139 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
23140 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
23142 void* fee_estimator_ptr = untag_ptr(fee_estimator);
23143 CHECK_ACCESS(fee_estimator_ptr);
23144 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
23145 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
23146 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
23147 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
23149 void* logger_ptr = untag_ptr(logger);
23150 CHECK_ACCESS(logger_ptr);
23151 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
23152 if (logger_conv.free == LDKLogger_JCalls_free) {
23153 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
23154 LDKLogger_JCalls_cloned(&logger_conv);
23156 LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_best_block_updated(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv);
23157 uint64_tArray ret_arr = NULL;
23158 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
23159 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
23160 for (size_t n = 0; n < ret_var.datalen; n++) {
23161 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
23162 *ret_conv_39_conv = ret_var.data[n];
23163 ret_arr_ptr[n] = tag_ptr(ret_conv_39_conv, true);
23166 FREE(ret_var.data);
23170 ptrArray __attribute__((export_name("TS_ChannelMonitor_get_relevant_txids"))) TS_ChannelMonitor_get_relevant_txids(uint64_t this_arg) {
23171 LDKChannelMonitor this_arg_conv;
23172 this_arg_conv.inner = untag_ptr(this_arg);
23173 this_arg_conv.is_owned = ptr_is_owned(this_arg);
23174 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
23175 this_arg_conv.is_owned = false;
23176 LDKCVec_TxidZ ret_var = ChannelMonitor_get_relevant_txids(&this_arg_conv);
23177 ptrArray ret_arr = NULL;
23178 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
23179 int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8);
23180 for (size_t m = 0; m < ret_var.datalen; m++) {
23181 int8_tArray ret_conv_12_arr = init_int8_tArray(32, __LINE__);
23182 memcpy(ret_conv_12_arr->elems, ret_var.data[m].data, 32);
23183 ret_arr_ptr[m] = ret_conv_12_arr;
23186 FREE(ret_var.data);
23190 uint64_t __attribute__((export_name("TS_ChannelMonitor_current_best_block"))) TS_ChannelMonitor_current_best_block(uint64_t this_arg) {
23191 LDKChannelMonitor this_arg_conv;
23192 this_arg_conv.inner = untag_ptr(this_arg);
23193 this_arg_conv.is_owned = ptr_is_owned(this_arg);
23194 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
23195 this_arg_conv.is_owned = false;
23196 LDKBestBlock ret_var = ChannelMonitor_current_best_block(&this_arg_conv);
23197 uint64_t ret_ref = 0;
23198 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23199 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23203 uint64_tArray __attribute__((export_name("TS_ChannelMonitor_get_claimable_balances"))) TS_ChannelMonitor_get_claimable_balances(uint64_t this_arg) {
23204 LDKChannelMonitor this_arg_conv;
23205 this_arg_conv.inner = untag_ptr(this_arg);
23206 this_arg_conv.is_owned = ptr_is_owned(this_arg);
23207 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
23208 this_arg_conv.is_owned = false;
23209 LDKCVec_BalanceZ ret_var = ChannelMonitor_get_claimable_balances(&this_arg_conv);
23210 uint64_tArray ret_arr = NULL;
23211 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
23212 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
23213 for (size_t j = 0; j < ret_var.datalen; j++) {
23214 LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
23215 *ret_conv_9_copy = ret_var.data[j];
23216 uint64_t ret_conv_9_ref = tag_ptr(ret_conv_9_copy, true);
23217 ret_arr_ptr[j] = ret_conv_9_ref;
23220 FREE(ret_var.data);
23224 uint64_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_read"))) TS_C2Tuple_BlockHashChannelMonitorZ_read(int8_tArray ser, uint64_t arg) {
23225 LDKu8slice ser_ref;
23226 ser_ref.datalen = ser->arr_len;
23227 ser_ref.data = ser->elems;
23228 void* arg_ptr = untag_ptr(arg);
23229 if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); }
23230 LDKKeysInterface* arg_conv = (LDKKeysInterface*)arg_ptr;
23231 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
23232 *ret_conv = C2Tuple_BlockHashChannelMonitorZ_read(ser_ref, arg_conv);
23234 return tag_ptr(ret_conv, true);
23237 void __attribute__((export_name("TS_OutPoint_free"))) TS_OutPoint_free(uint64_t this_obj) {
23238 LDKOutPoint this_obj_conv;
23239 this_obj_conv.inner = untag_ptr(this_obj);
23240 this_obj_conv.is_owned = ptr_is_owned(this_obj);
23241 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
23242 OutPoint_free(this_obj_conv);
23245 int8_tArray __attribute__((export_name("TS_OutPoint_get_txid"))) TS_OutPoint_get_txid(uint64_t this_ptr) {
23246 LDKOutPoint this_ptr_conv;
23247 this_ptr_conv.inner = untag_ptr(this_ptr);
23248 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23249 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23250 this_ptr_conv.is_owned = false;
23251 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
23252 memcpy(ret_arr->elems, *OutPoint_get_txid(&this_ptr_conv), 32);
23256 void __attribute__((export_name("TS_OutPoint_set_txid"))) TS_OutPoint_set_txid(uint64_t this_ptr, int8_tArray val) {
23257 LDKOutPoint this_ptr_conv;
23258 this_ptr_conv.inner = untag_ptr(this_ptr);
23259 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23260 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23261 this_ptr_conv.is_owned = false;
23262 LDKThirtyTwoBytes val_ref;
23263 CHECK(val->arr_len == 32);
23264 memcpy(val_ref.data, val->elems, 32); FREE(val);
23265 OutPoint_set_txid(&this_ptr_conv, val_ref);
23268 int16_t __attribute__((export_name("TS_OutPoint_get_index"))) TS_OutPoint_get_index(uint64_t this_ptr) {
23269 LDKOutPoint this_ptr_conv;
23270 this_ptr_conv.inner = untag_ptr(this_ptr);
23271 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23272 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23273 this_ptr_conv.is_owned = false;
23274 int16_t ret_conv = OutPoint_get_index(&this_ptr_conv);
23278 void __attribute__((export_name("TS_OutPoint_set_index"))) TS_OutPoint_set_index(uint64_t this_ptr, int16_t val) {
23279 LDKOutPoint this_ptr_conv;
23280 this_ptr_conv.inner = untag_ptr(this_ptr);
23281 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23282 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23283 this_ptr_conv.is_owned = false;
23284 OutPoint_set_index(&this_ptr_conv, val);
23287 uint64_t __attribute__((export_name("TS_OutPoint_new"))) TS_OutPoint_new(int8_tArray txid_arg, int16_t index_arg) {
23288 LDKThirtyTwoBytes txid_arg_ref;
23289 CHECK(txid_arg->arr_len == 32);
23290 memcpy(txid_arg_ref.data, txid_arg->elems, 32); FREE(txid_arg);
23291 LDKOutPoint ret_var = OutPoint_new(txid_arg_ref, index_arg);
23292 uint64_t ret_ref = 0;
23293 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23294 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23298 static inline uint64_t OutPoint_clone_ptr(LDKOutPoint *NONNULL_PTR arg) {
23299 LDKOutPoint ret_var = OutPoint_clone(arg);
23300 uint64_t ret_ref = 0;
23301 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23302 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23305 int64_t __attribute__((export_name("TS_OutPoint_clone_ptr"))) TS_OutPoint_clone_ptr(uint64_t arg) {
23306 LDKOutPoint arg_conv;
23307 arg_conv.inner = untag_ptr(arg);
23308 arg_conv.is_owned = ptr_is_owned(arg);
23309 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
23310 arg_conv.is_owned = false;
23311 int64_t ret_conv = OutPoint_clone_ptr(&arg_conv);
23315 uint64_t __attribute__((export_name("TS_OutPoint_clone"))) TS_OutPoint_clone(uint64_t orig) {
23316 LDKOutPoint orig_conv;
23317 orig_conv.inner = untag_ptr(orig);
23318 orig_conv.is_owned = ptr_is_owned(orig);
23319 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
23320 orig_conv.is_owned = false;
23321 LDKOutPoint ret_var = OutPoint_clone(&orig_conv);
23322 uint64_t ret_ref = 0;
23323 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23324 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23328 jboolean __attribute__((export_name("TS_OutPoint_eq"))) TS_OutPoint_eq(uint64_t a, uint64_t b) {
23329 LDKOutPoint a_conv;
23330 a_conv.inner = untag_ptr(a);
23331 a_conv.is_owned = ptr_is_owned(a);
23332 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
23333 a_conv.is_owned = false;
23334 LDKOutPoint b_conv;
23335 b_conv.inner = untag_ptr(b);
23336 b_conv.is_owned = ptr_is_owned(b);
23337 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
23338 b_conv.is_owned = false;
23339 jboolean ret_conv = OutPoint_eq(&a_conv, &b_conv);
23343 int64_t __attribute__((export_name("TS_OutPoint_hash"))) TS_OutPoint_hash(uint64_t o) {
23344 LDKOutPoint o_conv;
23345 o_conv.inner = untag_ptr(o);
23346 o_conv.is_owned = ptr_is_owned(o);
23347 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
23348 o_conv.is_owned = false;
23349 int64_t ret_conv = OutPoint_hash(&o_conv);
23353 int8_tArray __attribute__((export_name("TS_OutPoint_to_channel_id"))) TS_OutPoint_to_channel_id(uint64_t this_arg) {
23354 LDKOutPoint this_arg_conv;
23355 this_arg_conv.inner = untag_ptr(this_arg);
23356 this_arg_conv.is_owned = ptr_is_owned(this_arg);
23357 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
23358 this_arg_conv.is_owned = false;
23359 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
23360 memcpy(ret_arr->elems, OutPoint_to_channel_id(&this_arg_conv).data, 32);
23364 int8_tArray __attribute__((export_name("TS_OutPoint_write"))) TS_OutPoint_write(uint64_t obj) {
23365 LDKOutPoint obj_conv;
23366 obj_conv.inner = untag_ptr(obj);
23367 obj_conv.is_owned = ptr_is_owned(obj);
23368 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
23369 obj_conv.is_owned = false;
23370 LDKCVec_u8Z ret_var = OutPoint_write(&obj_conv);
23371 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
23372 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
23373 CVec_u8Z_free(ret_var);
23377 uint64_t __attribute__((export_name("TS_OutPoint_read"))) TS_OutPoint_read(int8_tArray ser) {
23378 LDKu8slice ser_ref;
23379 ser_ref.datalen = ser->arr_len;
23380 ser_ref.data = ser->elems;
23381 LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
23382 *ret_conv = OutPoint_read(ser_ref);
23384 return tag_ptr(ret_conv, true);
23387 void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_free"))) TS_DelayedPaymentOutputDescriptor_free(uint64_t this_obj) {
23388 LDKDelayedPaymentOutputDescriptor this_obj_conv;
23389 this_obj_conv.inner = untag_ptr(this_obj);
23390 this_obj_conv.is_owned = ptr_is_owned(this_obj);
23391 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
23392 DelayedPaymentOutputDescriptor_free(this_obj_conv);
23395 uint64_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_get_outpoint"))) TS_DelayedPaymentOutputDescriptor_get_outpoint(uint64_t this_ptr) {
23396 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
23397 this_ptr_conv.inner = untag_ptr(this_ptr);
23398 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23399 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23400 this_ptr_conv.is_owned = false;
23401 LDKOutPoint ret_var = DelayedPaymentOutputDescriptor_get_outpoint(&this_ptr_conv);
23402 uint64_t ret_ref = 0;
23403 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23404 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23408 void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_set_outpoint"))) TS_DelayedPaymentOutputDescriptor_set_outpoint(uint64_t this_ptr, uint64_t val) {
23409 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
23410 this_ptr_conv.inner = untag_ptr(this_ptr);
23411 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23412 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23413 this_ptr_conv.is_owned = false;
23414 LDKOutPoint val_conv;
23415 val_conv.inner = untag_ptr(val);
23416 val_conv.is_owned = ptr_is_owned(val);
23417 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
23418 val_conv = OutPoint_clone(&val_conv);
23419 DelayedPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv);
23422 int8_tArray __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_get_per_commitment_point"))) TS_DelayedPaymentOutputDescriptor_get_per_commitment_point(uint64_t this_ptr) {
23423 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
23424 this_ptr_conv.inner = untag_ptr(this_ptr);
23425 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23426 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23427 this_ptr_conv.is_owned = false;
23428 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
23429 memcpy(ret_arr->elems, DelayedPaymentOutputDescriptor_get_per_commitment_point(&this_ptr_conv).compressed_form, 33);
23433 void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_set_per_commitment_point"))) TS_DelayedPaymentOutputDescriptor_set_per_commitment_point(uint64_t this_ptr, int8_tArray val) {
23434 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
23435 this_ptr_conv.inner = untag_ptr(this_ptr);
23436 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23437 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23438 this_ptr_conv.is_owned = false;
23439 LDKPublicKey val_ref;
23440 CHECK(val->arr_len == 33);
23441 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
23442 DelayedPaymentOutputDescriptor_set_per_commitment_point(&this_ptr_conv, val_ref);
23445 int16_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_get_to_self_delay"))) TS_DelayedPaymentOutputDescriptor_get_to_self_delay(uint64_t this_ptr) {
23446 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
23447 this_ptr_conv.inner = untag_ptr(this_ptr);
23448 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23449 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23450 this_ptr_conv.is_owned = false;
23451 int16_t ret_conv = DelayedPaymentOutputDescriptor_get_to_self_delay(&this_ptr_conv);
23455 void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_set_to_self_delay"))) TS_DelayedPaymentOutputDescriptor_set_to_self_delay(uint64_t this_ptr, int16_t val) {
23456 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
23457 this_ptr_conv.inner = untag_ptr(this_ptr);
23458 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23459 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23460 this_ptr_conv.is_owned = false;
23461 DelayedPaymentOutputDescriptor_set_to_self_delay(&this_ptr_conv, val);
23464 uint64_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_get_output"))) TS_DelayedPaymentOutputDescriptor_get_output(uint64_t this_ptr) {
23465 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
23466 this_ptr_conv.inner = untag_ptr(this_ptr);
23467 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23468 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23469 this_ptr_conv.is_owned = false;
23470 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
23471 *ret_ref = DelayedPaymentOutputDescriptor_get_output(&this_ptr_conv);
23472 return tag_ptr(ret_ref, true);
23475 void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_set_output"))) TS_DelayedPaymentOutputDescriptor_set_output(uint64_t this_ptr, uint64_t val) {
23476 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
23477 this_ptr_conv.inner = untag_ptr(this_ptr);
23478 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23479 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23480 this_ptr_conv.is_owned = false;
23481 void* val_ptr = untag_ptr(val);
23482 CHECK_ACCESS(val_ptr);
23483 LDKTxOut val_conv = *(LDKTxOut*)(val_ptr);
23484 val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val));
23485 DelayedPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv);
23488 int8_tArray __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_get_revocation_pubkey"))) TS_DelayedPaymentOutputDescriptor_get_revocation_pubkey(uint64_t this_ptr) {
23489 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
23490 this_ptr_conv.inner = untag_ptr(this_ptr);
23491 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23492 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23493 this_ptr_conv.is_owned = false;
23494 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
23495 memcpy(ret_arr->elems, DelayedPaymentOutputDescriptor_get_revocation_pubkey(&this_ptr_conv).compressed_form, 33);
23499 void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_set_revocation_pubkey"))) TS_DelayedPaymentOutputDescriptor_set_revocation_pubkey(uint64_t this_ptr, int8_tArray val) {
23500 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
23501 this_ptr_conv.inner = untag_ptr(this_ptr);
23502 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23503 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23504 this_ptr_conv.is_owned = false;
23505 LDKPublicKey val_ref;
23506 CHECK(val->arr_len == 33);
23507 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
23508 DelayedPaymentOutputDescriptor_set_revocation_pubkey(&this_ptr_conv, val_ref);
23511 int8_tArray __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_get_channel_keys_id"))) TS_DelayedPaymentOutputDescriptor_get_channel_keys_id(uint64_t this_ptr) {
23512 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
23513 this_ptr_conv.inner = untag_ptr(this_ptr);
23514 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23515 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23516 this_ptr_conv.is_owned = false;
23517 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
23518 memcpy(ret_arr->elems, *DelayedPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv), 32);
23522 void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_set_channel_keys_id"))) TS_DelayedPaymentOutputDescriptor_set_channel_keys_id(uint64_t this_ptr, int8_tArray val) {
23523 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
23524 this_ptr_conv.inner = untag_ptr(this_ptr);
23525 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23526 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23527 this_ptr_conv.is_owned = false;
23528 LDKThirtyTwoBytes val_ref;
23529 CHECK(val->arr_len == 32);
23530 memcpy(val_ref.data, val->elems, 32); FREE(val);
23531 DelayedPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_ref);
23534 int64_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_get_channel_value_satoshis"))) TS_DelayedPaymentOutputDescriptor_get_channel_value_satoshis(uint64_t this_ptr) {
23535 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
23536 this_ptr_conv.inner = untag_ptr(this_ptr);
23537 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23538 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23539 this_ptr_conv.is_owned = false;
23540 int64_t ret_conv = DelayedPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv);
23544 void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_set_channel_value_satoshis"))) TS_DelayedPaymentOutputDescriptor_set_channel_value_satoshis(uint64_t this_ptr, int64_t val) {
23545 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
23546 this_ptr_conv.inner = untag_ptr(this_ptr);
23547 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23548 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23549 this_ptr_conv.is_owned = false;
23550 DelayedPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val);
23553 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) {
23554 LDKOutPoint outpoint_arg_conv;
23555 outpoint_arg_conv.inner = untag_ptr(outpoint_arg);
23556 outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg);
23557 CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv);
23558 outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv);
23559 LDKPublicKey per_commitment_point_arg_ref;
23560 CHECK(per_commitment_point_arg->arr_len == 33);
23561 memcpy(per_commitment_point_arg_ref.compressed_form, per_commitment_point_arg->elems, 33); FREE(per_commitment_point_arg);
23562 void* output_arg_ptr = untag_ptr(output_arg);
23563 CHECK_ACCESS(output_arg_ptr);
23564 LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr);
23565 output_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(output_arg));
23566 LDKPublicKey revocation_pubkey_arg_ref;
23567 CHECK(revocation_pubkey_arg->arr_len == 33);
23568 memcpy(revocation_pubkey_arg_ref.compressed_form, revocation_pubkey_arg->elems, 33); FREE(revocation_pubkey_arg);
23569 LDKThirtyTwoBytes channel_keys_id_arg_ref;
23570 CHECK(channel_keys_id_arg->arr_len == 32);
23571 memcpy(channel_keys_id_arg_ref.data, channel_keys_id_arg->elems, 32); FREE(channel_keys_id_arg);
23572 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);
23573 uint64_t ret_ref = 0;
23574 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23575 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23579 static inline uint64_t DelayedPaymentOutputDescriptor_clone_ptr(LDKDelayedPaymentOutputDescriptor *NONNULL_PTR arg) {
23580 LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(arg);
23581 uint64_t ret_ref = 0;
23582 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23583 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23586 int64_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_clone_ptr"))) TS_DelayedPaymentOutputDescriptor_clone_ptr(uint64_t arg) {
23587 LDKDelayedPaymentOutputDescriptor arg_conv;
23588 arg_conv.inner = untag_ptr(arg);
23589 arg_conv.is_owned = ptr_is_owned(arg);
23590 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
23591 arg_conv.is_owned = false;
23592 int64_t ret_conv = DelayedPaymentOutputDescriptor_clone_ptr(&arg_conv);
23596 uint64_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_clone"))) TS_DelayedPaymentOutputDescriptor_clone(uint64_t orig) {
23597 LDKDelayedPaymentOutputDescriptor orig_conv;
23598 orig_conv.inner = untag_ptr(orig);
23599 orig_conv.is_owned = ptr_is_owned(orig);
23600 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
23601 orig_conv.is_owned = false;
23602 LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(&orig_conv);
23603 uint64_t ret_ref = 0;
23604 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23605 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23609 int8_tArray __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_write"))) TS_DelayedPaymentOutputDescriptor_write(uint64_t obj) {
23610 LDKDelayedPaymentOutputDescriptor obj_conv;
23611 obj_conv.inner = untag_ptr(obj);
23612 obj_conv.is_owned = ptr_is_owned(obj);
23613 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
23614 obj_conv.is_owned = false;
23615 LDKCVec_u8Z ret_var = DelayedPaymentOutputDescriptor_write(&obj_conv);
23616 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
23617 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
23618 CVec_u8Z_free(ret_var);
23622 uint64_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_read"))) TS_DelayedPaymentOutputDescriptor_read(int8_tArray ser) {
23623 LDKu8slice ser_ref;
23624 ser_ref.datalen = ser->arr_len;
23625 ser_ref.data = ser->elems;
23626 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
23627 *ret_conv = DelayedPaymentOutputDescriptor_read(ser_ref);
23629 return tag_ptr(ret_conv, true);
23632 void __attribute__((export_name("TS_StaticPaymentOutputDescriptor_free"))) TS_StaticPaymentOutputDescriptor_free(uint64_t this_obj) {
23633 LDKStaticPaymentOutputDescriptor this_obj_conv;
23634 this_obj_conv.inner = untag_ptr(this_obj);
23635 this_obj_conv.is_owned = ptr_is_owned(this_obj);
23636 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
23637 StaticPaymentOutputDescriptor_free(this_obj_conv);
23640 uint64_t __attribute__((export_name("TS_StaticPaymentOutputDescriptor_get_outpoint"))) TS_StaticPaymentOutputDescriptor_get_outpoint(uint64_t this_ptr) {
23641 LDKStaticPaymentOutputDescriptor this_ptr_conv;
23642 this_ptr_conv.inner = untag_ptr(this_ptr);
23643 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23644 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23645 this_ptr_conv.is_owned = false;
23646 LDKOutPoint ret_var = StaticPaymentOutputDescriptor_get_outpoint(&this_ptr_conv);
23647 uint64_t ret_ref = 0;
23648 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23649 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23653 void __attribute__((export_name("TS_StaticPaymentOutputDescriptor_set_outpoint"))) TS_StaticPaymentOutputDescriptor_set_outpoint(uint64_t this_ptr, uint64_t val) {
23654 LDKStaticPaymentOutputDescriptor this_ptr_conv;
23655 this_ptr_conv.inner = untag_ptr(this_ptr);
23656 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23657 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23658 this_ptr_conv.is_owned = false;
23659 LDKOutPoint val_conv;
23660 val_conv.inner = untag_ptr(val);
23661 val_conv.is_owned = ptr_is_owned(val);
23662 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
23663 val_conv = OutPoint_clone(&val_conv);
23664 StaticPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv);
23667 uint64_t __attribute__((export_name("TS_StaticPaymentOutputDescriptor_get_output"))) TS_StaticPaymentOutputDescriptor_get_output(uint64_t this_ptr) {
23668 LDKStaticPaymentOutputDescriptor this_ptr_conv;
23669 this_ptr_conv.inner = untag_ptr(this_ptr);
23670 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23671 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23672 this_ptr_conv.is_owned = false;
23673 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
23674 *ret_ref = StaticPaymentOutputDescriptor_get_output(&this_ptr_conv);
23675 return tag_ptr(ret_ref, true);
23678 void __attribute__((export_name("TS_StaticPaymentOutputDescriptor_set_output"))) TS_StaticPaymentOutputDescriptor_set_output(uint64_t this_ptr, uint64_t val) {
23679 LDKStaticPaymentOutputDescriptor this_ptr_conv;
23680 this_ptr_conv.inner = untag_ptr(this_ptr);
23681 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23682 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23683 this_ptr_conv.is_owned = false;
23684 void* val_ptr = untag_ptr(val);
23685 CHECK_ACCESS(val_ptr);
23686 LDKTxOut val_conv = *(LDKTxOut*)(val_ptr);
23687 val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val));
23688 StaticPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv);
23691 int8_tArray __attribute__((export_name("TS_StaticPaymentOutputDescriptor_get_channel_keys_id"))) TS_StaticPaymentOutputDescriptor_get_channel_keys_id(uint64_t this_ptr) {
23692 LDKStaticPaymentOutputDescriptor this_ptr_conv;
23693 this_ptr_conv.inner = untag_ptr(this_ptr);
23694 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23695 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23696 this_ptr_conv.is_owned = false;
23697 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
23698 memcpy(ret_arr->elems, *StaticPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv), 32);
23702 void __attribute__((export_name("TS_StaticPaymentOutputDescriptor_set_channel_keys_id"))) TS_StaticPaymentOutputDescriptor_set_channel_keys_id(uint64_t this_ptr, int8_tArray val) {
23703 LDKStaticPaymentOutputDescriptor this_ptr_conv;
23704 this_ptr_conv.inner = untag_ptr(this_ptr);
23705 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23706 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23707 this_ptr_conv.is_owned = false;
23708 LDKThirtyTwoBytes val_ref;
23709 CHECK(val->arr_len == 32);
23710 memcpy(val_ref.data, val->elems, 32); FREE(val);
23711 StaticPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_ref);
23714 int64_t __attribute__((export_name("TS_StaticPaymentOutputDescriptor_get_channel_value_satoshis"))) TS_StaticPaymentOutputDescriptor_get_channel_value_satoshis(uint64_t this_ptr) {
23715 LDKStaticPaymentOutputDescriptor this_ptr_conv;
23716 this_ptr_conv.inner = untag_ptr(this_ptr);
23717 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23718 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23719 this_ptr_conv.is_owned = false;
23720 int64_t ret_conv = StaticPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv);
23724 void __attribute__((export_name("TS_StaticPaymentOutputDescriptor_set_channel_value_satoshis"))) TS_StaticPaymentOutputDescriptor_set_channel_value_satoshis(uint64_t this_ptr, int64_t val) {
23725 LDKStaticPaymentOutputDescriptor this_ptr_conv;
23726 this_ptr_conv.inner = untag_ptr(this_ptr);
23727 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23728 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23729 this_ptr_conv.is_owned = false;
23730 StaticPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val);
23733 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) {
23734 LDKOutPoint outpoint_arg_conv;
23735 outpoint_arg_conv.inner = untag_ptr(outpoint_arg);
23736 outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg);
23737 CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv);
23738 outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv);
23739 void* output_arg_ptr = untag_ptr(output_arg);
23740 CHECK_ACCESS(output_arg_ptr);
23741 LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr);
23742 output_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(output_arg));
23743 LDKThirtyTwoBytes channel_keys_id_arg_ref;
23744 CHECK(channel_keys_id_arg->arr_len == 32);
23745 memcpy(channel_keys_id_arg_ref.data, channel_keys_id_arg->elems, 32); FREE(channel_keys_id_arg);
23746 LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_new(outpoint_arg_conv, output_arg_conv, channel_keys_id_arg_ref, channel_value_satoshis_arg);
23747 uint64_t ret_ref = 0;
23748 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23749 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23753 static inline uint64_t StaticPaymentOutputDescriptor_clone_ptr(LDKStaticPaymentOutputDescriptor *NONNULL_PTR arg) {
23754 LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(arg);
23755 uint64_t ret_ref = 0;
23756 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23757 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23760 int64_t __attribute__((export_name("TS_StaticPaymentOutputDescriptor_clone_ptr"))) TS_StaticPaymentOutputDescriptor_clone_ptr(uint64_t arg) {
23761 LDKStaticPaymentOutputDescriptor arg_conv;
23762 arg_conv.inner = untag_ptr(arg);
23763 arg_conv.is_owned = ptr_is_owned(arg);
23764 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
23765 arg_conv.is_owned = false;
23766 int64_t ret_conv = StaticPaymentOutputDescriptor_clone_ptr(&arg_conv);
23770 uint64_t __attribute__((export_name("TS_StaticPaymentOutputDescriptor_clone"))) TS_StaticPaymentOutputDescriptor_clone(uint64_t orig) {
23771 LDKStaticPaymentOutputDescriptor orig_conv;
23772 orig_conv.inner = untag_ptr(orig);
23773 orig_conv.is_owned = ptr_is_owned(orig);
23774 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
23775 orig_conv.is_owned = false;
23776 LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(&orig_conv);
23777 uint64_t ret_ref = 0;
23778 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23779 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23783 int8_tArray __attribute__((export_name("TS_StaticPaymentOutputDescriptor_write"))) TS_StaticPaymentOutputDescriptor_write(uint64_t obj) {
23784 LDKStaticPaymentOutputDescriptor obj_conv;
23785 obj_conv.inner = untag_ptr(obj);
23786 obj_conv.is_owned = ptr_is_owned(obj);
23787 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
23788 obj_conv.is_owned = false;
23789 LDKCVec_u8Z ret_var = StaticPaymentOutputDescriptor_write(&obj_conv);
23790 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
23791 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
23792 CVec_u8Z_free(ret_var);
23796 uint64_t __attribute__((export_name("TS_StaticPaymentOutputDescriptor_read"))) TS_StaticPaymentOutputDescriptor_read(int8_tArray ser) {
23797 LDKu8slice ser_ref;
23798 ser_ref.datalen = ser->arr_len;
23799 ser_ref.data = ser->elems;
23800 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
23801 *ret_conv = StaticPaymentOutputDescriptor_read(ser_ref);
23803 return tag_ptr(ret_conv, true);
23806 void __attribute__((export_name("TS_SpendableOutputDescriptor_free"))) TS_SpendableOutputDescriptor_free(uint64_t this_ptr) {
23807 if (!ptr_is_owned(this_ptr)) return;
23808 void* this_ptr_ptr = untag_ptr(this_ptr);
23809 CHECK_ACCESS(this_ptr_ptr);
23810 LDKSpendableOutputDescriptor this_ptr_conv = *(LDKSpendableOutputDescriptor*)(this_ptr_ptr);
23811 FREE(untag_ptr(this_ptr));
23812 SpendableOutputDescriptor_free(this_ptr_conv);
23815 static inline uint64_t SpendableOutputDescriptor_clone_ptr(LDKSpendableOutputDescriptor *NONNULL_PTR arg) {
23816 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
23817 *ret_copy = SpendableOutputDescriptor_clone(arg);
23818 uint64_t ret_ref = tag_ptr(ret_copy, true);
23821 int64_t __attribute__((export_name("TS_SpendableOutputDescriptor_clone_ptr"))) TS_SpendableOutputDescriptor_clone_ptr(uint64_t arg) {
23822 LDKSpendableOutputDescriptor* arg_conv = (LDKSpendableOutputDescriptor*)untag_ptr(arg);
23823 int64_t ret_conv = SpendableOutputDescriptor_clone_ptr(arg_conv);
23827 uint64_t __attribute__((export_name("TS_SpendableOutputDescriptor_clone"))) TS_SpendableOutputDescriptor_clone(uint64_t orig) {
23828 LDKSpendableOutputDescriptor* orig_conv = (LDKSpendableOutputDescriptor*)untag_ptr(orig);
23829 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
23830 *ret_copy = SpendableOutputDescriptor_clone(orig_conv);
23831 uint64_t ret_ref = tag_ptr(ret_copy, true);
23835 uint64_t __attribute__((export_name("TS_SpendableOutputDescriptor_static_output"))) TS_SpendableOutputDescriptor_static_output(uint64_t outpoint, uint64_t output) {
23836 LDKOutPoint outpoint_conv;
23837 outpoint_conv.inner = untag_ptr(outpoint);
23838 outpoint_conv.is_owned = ptr_is_owned(outpoint);
23839 CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_conv);
23840 outpoint_conv = OutPoint_clone(&outpoint_conv);
23841 void* output_ptr = untag_ptr(output);
23842 CHECK_ACCESS(output_ptr);
23843 LDKTxOut output_conv = *(LDKTxOut*)(output_ptr);
23844 output_conv = TxOut_clone((LDKTxOut*)untag_ptr(output));
23845 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
23846 *ret_copy = SpendableOutputDescriptor_static_output(outpoint_conv, output_conv);
23847 uint64_t ret_ref = tag_ptr(ret_copy, true);
23851 uint64_t __attribute__((export_name("TS_SpendableOutputDescriptor_delayed_payment_output"))) TS_SpendableOutputDescriptor_delayed_payment_output(uint64_t a) {
23852 LDKDelayedPaymentOutputDescriptor a_conv;
23853 a_conv.inner = untag_ptr(a);
23854 a_conv.is_owned = ptr_is_owned(a);
23855 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
23856 a_conv = DelayedPaymentOutputDescriptor_clone(&a_conv);
23857 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
23858 *ret_copy = SpendableOutputDescriptor_delayed_payment_output(a_conv);
23859 uint64_t ret_ref = tag_ptr(ret_copy, true);
23863 uint64_t __attribute__((export_name("TS_SpendableOutputDescriptor_static_payment_output"))) TS_SpendableOutputDescriptor_static_payment_output(uint64_t a) {
23864 LDKStaticPaymentOutputDescriptor a_conv;
23865 a_conv.inner = untag_ptr(a);
23866 a_conv.is_owned = ptr_is_owned(a);
23867 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
23868 a_conv = StaticPaymentOutputDescriptor_clone(&a_conv);
23869 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
23870 *ret_copy = SpendableOutputDescriptor_static_payment_output(a_conv);
23871 uint64_t ret_ref = tag_ptr(ret_copy, true);
23875 int8_tArray __attribute__((export_name("TS_SpendableOutputDescriptor_write"))) TS_SpendableOutputDescriptor_write(uint64_t obj) {
23876 LDKSpendableOutputDescriptor* obj_conv = (LDKSpendableOutputDescriptor*)untag_ptr(obj);
23877 LDKCVec_u8Z ret_var = SpendableOutputDescriptor_write(obj_conv);
23878 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
23879 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
23880 CVec_u8Z_free(ret_var);
23884 uint64_t __attribute__((export_name("TS_SpendableOutputDescriptor_read"))) TS_SpendableOutputDescriptor_read(int8_tArray ser) {
23885 LDKu8slice ser_ref;
23886 ser_ref.datalen = ser->arr_len;
23887 ser_ref.data = ser->elems;
23888 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
23889 *ret_conv = SpendableOutputDescriptor_read(ser_ref);
23891 return tag_ptr(ret_conv, true);
23894 void __attribute__((export_name("TS_BaseSign_free"))) TS_BaseSign_free(uint64_t this_ptr) {
23895 if (!ptr_is_owned(this_ptr)) return;
23896 void* this_ptr_ptr = untag_ptr(this_ptr);
23897 CHECK_ACCESS(this_ptr_ptr);
23898 LDKBaseSign this_ptr_conv = *(LDKBaseSign*)(this_ptr_ptr);
23899 FREE(untag_ptr(this_ptr));
23900 BaseSign_free(this_ptr_conv);
23903 static inline uint64_t Sign_clone_ptr(LDKSign *NONNULL_PTR arg) {
23904 LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
23905 *ret_ret = Sign_clone(arg);
23906 return tag_ptr(ret_ret, true);
23908 int64_t __attribute__((export_name("TS_Sign_clone_ptr"))) TS_Sign_clone_ptr(uint64_t arg) {
23909 void* arg_ptr = untag_ptr(arg);
23910 if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); }
23911 LDKSign* arg_conv = (LDKSign*)arg_ptr;
23912 int64_t ret_conv = Sign_clone_ptr(arg_conv);
23916 uint64_t __attribute__((export_name("TS_Sign_clone"))) TS_Sign_clone(uint64_t orig) {
23917 void* orig_ptr = untag_ptr(orig);
23918 if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); }
23919 LDKSign* orig_conv = (LDKSign*)orig_ptr;
23920 LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
23921 *ret_ret = Sign_clone(orig_conv);
23922 return tag_ptr(ret_ret, true);
23925 void __attribute__((export_name("TS_Sign_free"))) TS_Sign_free(uint64_t this_ptr) {
23926 if (!ptr_is_owned(this_ptr)) return;
23927 void* this_ptr_ptr = untag_ptr(this_ptr);
23928 CHECK_ACCESS(this_ptr_ptr);
23929 LDKSign this_ptr_conv = *(LDKSign*)(this_ptr_ptr);
23930 FREE(untag_ptr(this_ptr));
23931 Sign_free(this_ptr_conv);
23934 uint32_t __attribute__((export_name("TS_Recipient_clone"))) TS_Recipient_clone(uint64_t orig) {
23935 LDKRecipient* orig_conv = (LDKRecipient*)untag_ptr(orig);
23936 uint32_t ret_conv = LDKRecipient_to_js(Recipient_clone(orig_conv));
23940 uint32_t __attribute__((export_name("TS_Recipient_node"))) TS_Recipient_node() {
23941 uint32_t ret_conv = LDKRecipient_to_js(Recipient_node());
23945 uint32_t __attribute__((export_name("TS_Recipient_phantom_node"))) TS_Recipient_phantom_node() {
23946 uint32_t ret_conv = LDKRecipient_to_js(Recipient_phantom_node());
23950 void __attribute__((export_name("TS_KeysInterface_free"))) TS_KeysInterface_free(uint64_t this_ptr) {
23951 if (!ptr_is_owned(this_ptr)) return;
23952 void* this_ptr_ptr = untag_ptr(this_ptr);
23953 CHECK_ACCESS(this_ptr_ptr);
23954 LDKKeysInterface this_ptr_conv = *(LDKKeysInterface*)(this_ptr_ptr);
23955 FREE(untag_ptr(this_ptr));
23956 KeysInterface_free(this_ptr_conv);
23959 void __attribute__((export_name("TS_InMemorySigner_free"))) TS_InMemorySigner_free(uint64_t this_obj) {
23960 LDKInMemorySigner this_obj_conv;
23961 this_obj_conv.inner = untag_ptr(this_obj);
23962 this_obj_conv.is_owned = ptr_is_owned(this_obj);
23963 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
23964 InMemorySigner_free(this_obj_conv);
23967 int8_tArray __attribute__((export_name("TS_InMemorySigner_get_funding_key"))) TS_InMemorySigner_get_funding_key(uint64_t this_ptr) {
23968 LDKInMemorySigner this_ptr_conv;
23969 this_ptr_conv.inner = untag_ptr(this_ptr);
23970 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23971 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23972 this_ptr_conv.is_owned = false;
23973 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
23974 memcpy(ret_arr->elems, *InMemorySigner_get_funding_key(&this_ptr_conv), 32);
23978 void __attribute__((export_name("TS_InMemorySigner_set_funding_key"))) TS_InMemorySigner_set_funding_key(uint64_t this_ptr, int8_tArray val) {
23979 LDKInMemorySigner this_ptr_conv;
23980 this_ptr_conv.inner = untag_ptr(this_ptr);
23981 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23982 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23983 this_ptr_conv.is_owned = false;
23984 LDKSecretKey val_ref;
23985 CHECK(val->arr_len == 32);
23986 memcpy(val_ref.bytes, val->elems, 32); FREE(val);
23987 InMemorySigner_set_funding_key(&this_ptr_conv, val_ref);
23990 int8_tArray __attribute__((export_name("TS_InMemorySigner_get_revocation_base_key"))) TS_InMemorySigner_get_revocation_base_key(uint64_t this_ptr) {
23991 LDKInMemorySigner this_ptr_conv;
23992 this_ptr_conv.inner = untag_ptr(this_ptr);
23993 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23994 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23995 this_ptr_conv.is_owned = false;
23996 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
23997 memcpy(ret_arr->elems, *InMemorySigner_get_revocation_base_key(&this_ptr_conv), 32);
24001 void __attribute__((export_name("TS_InMemorySigner_set_revocation_base_key"))) TS_InMemorySigner_set_revocation_base_key(uint64_t this_ptr, int8_tArray val) {
24002 LDKInMemorySigner this_ptr_conv;
24003 this_ptr_conv.inner = untag_ptr(this_ptr);
24004 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24005 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24006 this_ptr_conv.is_owned = false;
24007 LDKSecretKey val_ref;
24008 CHECK(val->arr_len == 32);
24009 memcpy(val_ref.bytes, val->elems, 32); FREE(val);
24010 InMemorySigner_set_revocation_base_key(&this_ptr_conv, val_ref);
24013 int8_tArray __attribute__((export_name("TS_InMemorySigner_get_payment_key"))) TS_InMemorySigner_get_payment_key(uint64_t this_ptr) {
24014 LDKInMemorySigner this_ptr_conv;
24015 this_ptr_conv.inner = untag_ptr(this_ptr);
24016 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24017 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24018 this_ptr_conv.is_owned = false;
24019 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
24020 memcpy(ret_arr->elems, *InMemorySigner_get_payment_key(&this_ptr_conv), 32);
24024 void __attribute__((export_name("TS_InMemorySigner_set_payment_key"))) TS_InMemorySigner_set_payment_key(uint64_t this_ptr, int8_tArray val) {
24025 LDKInMemorySigner this_ptr_conv;
24026 this_ptr_conv.inner = untag_ptr(this_ptr);
24027 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24028 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24029 this_ptr_conv.is_owned = false;
24030 LDKSecretKey val_ref;
24031 CHECK(val->arr_len == 32);
24032 memcpy(val_ref.bytes, val->elems, 32); FREE(val);
24033 InMemorySigner_set_payment_key(&this_ptr_conv, val_ref);
24036 int8_tArray __attribute__((export_name("TS_InMemorySigner_get_delayed_payment_base_key"))) TS_InMemorySigner_get_delayed_payment_base_key(uint64_t this_ptr) {
24037 LDKInMemorySigner this_ptr_conv;
24038 this_ptr_conv.inner = untag_ptr(this_ptr);
24039 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24040 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24041 this_ptr_conv.is_owned = false;
24042 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
24043 memcpy(ret_arr->elems, *InMemorySigner_get_delayed_payment_base_key(&this_ptr_conv), 32);
24047 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) {
24048 LDKInMemorySigner this_ptr_conv;
24049 this_ptr_conv.inner = untag_ptr(this_ptr);
24050 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24051 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24052 this_ptr_conv.is_owned = false;
24053 LDKSecretKey val_ref;
24054 CHECK(val->arr_len == 32);
24055 memcpy(val_ref.bytes, val->elems, 32); FREE(val);
24056 InMemorySigner_set_delayed_payment_base_key(&this_ptr_conv, val_ref);
24059 int8_tArray __attribute__((export_name("TS_InMemorySigner_get_htlc_base_key"))) TS_InMemorySigner_get_htlc_base_key(uint64_t this_ptr) {
24060 LDKInMemorySigner this_ptr_conv;
24061 this_ptr_conv.inner = untag_ptr(this_ptr);
24062 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24063 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24064 this_ptr_conv.is_owned = false;
24065 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
24066 memcpy(ret_arr->elems, *InMemorySigner_get_htlc_base_key(&this_ptr_conv), 32);
24070 void __attribute__((export_name("TS_InMemorySigner_set_htlc_base_key"))) TS_InMemorySigner_set_htlc_base_key(uint64_t this_ptr, int8_tArray val) {
24071 LDKInMemorySigner this_ptr_conv;
24072 this_ptr_conv.inner = untag_ptr(this_ptr);
24073 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24074 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24075 this_ptr_conv.is_owned = false;
24076 LDKSecretKey val_ref;
24077 CHECK(val->arr_len == 32);
24078 memcpy(val_ref.bytes, val->elems, 32); FREE(val);
24079 InMemorySigner_set_htlc_base_key(&this_ptr_conv, val_ref);
24082 int8_tArray __attribute__((export_name("TS_InMemorySigner_get_commitment_seed"))) TS_InMemorySigner_get_commitment_seed(uint64_t this_ptr) {
24083 LDKInMemorySigner this_ptr_conv;
24084 this_ptr_conv.inner = untag_ptr(this_ptr);
24085 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24086 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24087 this_ptr_conv.is_owned = false;
24088 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
24089 memcpy(ret_arr->elems, *InMemorySigner_get_commitment_seed(&this_ptr_conv), 32);
24093 void __attribute__((export_name("TS_InMemorySigner_set_commitment_seed"))) TS_InMemorySigner_set_commitment_seed(uint64_t this_ptr, int8_tArray val) {
24094 LDKInMemorySigner this_ptr_conv;
24095 this_ptr_conv.inner = untag_ptr(this_ptr);
24096 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24097 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24098 this_ptr_conv.is_owned = false;
24099 LDKThirtyTwoBytes val_ref;
24100 CHECK(val->arr_len == 32);
24101 memcpy(val_ref.data, val->elems, 32); FREE(val);
24102 InMemorySigner_set_commitment_seed(&this_ptr_conv, val_ref);
24105 static inline uint64_t InMemorySigner_clone_ptr(LDKInMemorySigner *NONNULL_PTR arg) {
24106 LDKInMemorySigner ret_var = InMemorySigner_clone(arg);
24107 uint64_t ret_ref = 0;
24108 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24109 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24112 int64_t __attribute__((export_name("TS_InMemorySigner_clone_ptr"))) TS_InMemorySigner_clone_ptr(uint64_t arg) {
24113 LDKInMemorySigner arg_conv;
24114 arg_conv.inner = untag_ptr(arg);
24115 arg_conv.is_owned = ptr_is_owned(arg);
24116 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
24117 arg_conv.is_owned = false;
24118 int64_t ret_conv = InMemorySigner_clone_ptr(&arg_conv);
24122 uint64_t __attribute__((export_name("TS_InMemorySigner_clone"))) TS_InMemorySigner_clone(uint64_t orig) {
24123 LDKInMemorySigner orig_conv;
24124 orig_conv.inner = untag_ptr(orig);
24125 orig_conv.is_owned = ptr_is_owned(orig);
24126 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
24127 orig_conv.is_owned = false;
24128 LDKInMemorySigner ret_var = InMemorySigner_clone(&orig_conv);
24129 uint64_t ret_ref = 0;
24130 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24131 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24135 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) {
24136 LDKSecretKey node_secret_ref;
24137 CHECK(node_secret->arr_len == 32);
24138 memcpy(node_secret_ref.bytes, node_secret->elems, 32); FREE(node_secret);
24139 LDKSecretKey funding_key_ref;
24140 CHECK(funding_key->arr_len == 32);
24141 memcpy(funding_key_ref.bytes, funding_key->elems, 32); FREE(funding_key);
24142 LDKSecretKey revocation_base_key_ref;
24143 CHECK(revocation_base_key->arr_len == 32);
24144 memcpy(revocation_base_key_ref.bytes, revocation_base_key->elems, 32); FREE(revocation_base_key);
24145 LDKSecretKey payment_key_ref;
24146 CHECK(payment_key->arr_len == 32);
24147 memcpy(payment_key_ref.bytes, payment_key->elems, 32); FREE(payment_key);
24148 LDKSecretKey delayed_payment_base_key_ref;
24149 CHECK(delayed_payment_base_key->arr_len == 32);
24150 memcpy(delayed_payment_base_key_ref.bytes, delayed_payment_base_key->elems, 32); FREE(delayed_payment_base_key);
24151 LDKSecretKey htlc_base_key_ref;
24152 CHECK(htlc_base_key->arr_len == 32);
24153 memcpy(htlc_base_key_ref.bytes, htlc_base_key->elems, 32); FREE(htlc_base_key);
24154 LDKThirtyTwoBytes commitment_seed_ref;
24155 CHECK(commitment_seed->arr_len == 32);
24156 memcpy(commitment_seed_ref.data, commitment_seed->elems, 32); FREE(commitment_seed);
24157 LDKThirtyTwoBytes channel_keys_id_ref;
24158 CHECK(channel_keys_id->arr_len == 32);
24159 memcpy(channel_keys_id_ref.data, channel_keys_id->elems, 32); FREE(channel_keys_id);
24160 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);
24161 uint64_t ret_ref = 0;
24162 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24163 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24167 uint64_t __attribute__((export_name("TS_InMemorySigner_counterparty_pubkeys"))) TS_InMemorySigner_counterparty_pubkeys(uint64_t this_arg) {
24168 LDKInMemorySigner this_arg_conv;
24169 this_arg_conv.inner = untag_ptr(this_arg);
24170 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24171 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24172 this_arg_conv.is_owned = false;
24173 LDKChannelPublicKeys ret_var = InMemorySigner_counterparty_pubkeys(&this_arg_conv);
24174 uint64_t ret_ref = 0;
24175 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24176 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24180 int16_t __attribute__((export_name("TS_InMemorySigner_counterparty_selected_contest_delay"))) TS_InMemorySigner_counterparty_selected_contest_delay(uint64_t this_arg) {
24181 LDKInMemorySigner this_arg_conv;
24182 this_arg_conv.inner = untag_ptr(this_arg);
24183 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24184 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24185 this_arg_conv.is_owned = false;
24186 int16_t ret_conv = InMemorySigner_counterparty_selected_contest_delay(&this_arg_conv);
24190 int16_t __attribute__((export_name("TS_InMemorySigner_holder_selected_contest_delay"))) TS_InMemorySigner_holder_selected_contest_delay(uint64_t this_arg) {
24191 LDKInMemorySigner this_arg_conv;
24192 this_arg_conv.inner = untag_ptr(this_arg);
24193 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24194 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24195 this_arg_conv.is_owned = false;
24196 int16_t ret_conv = InMemorySigner_holder_selected_contest_delay(&this_arg_conv);
24200 jboolean __attribute__((export_name("TS_InMemorySigner_is_outbound"))) TS_InMemorySigner_is_outbound(uint64_t this_arg) {
24201 LDKInMemorySigner this_arg_conv;
24202 this_arg_conv.inner = untag_ptr(this_arg);
24203 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24204 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24205 this_arg_conv.is_owned = false;
24206 jboolean ret_conv = InMemorySigner_is_outbound(&this_arg_conv);
24210 uint64_t __attribute__((export_name("TS_InMemorySigner_funding_outpoint"))) TS_InMemorySigner_funding_outpoint(uint64_t this_arg) {
24211 LDKInMemorySigner this_arg_conv;
24212 this_arg_conv.inner = untag_ptr(this_arg);
24213 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24214 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24215 this_arg_conv.is_owned = false;
24216 LDKOutPoint ret_var = InMemorySigner_funding_outpoint(&this_arg_conv);
24217 uint64_t ret_ref = 0;
24218 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24219 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24223 uint64_t __attribute__((export_name("TS_InMemorySigner_get_channel_parameters"))) TS_InMemorySigner_get_channel_parameters(uint64_t this_arg) {
24224 LDKInMemorySigner this_arg_conv;
24225 this_arg_conv.inner = untag_ptr(this_arg);
24226 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24227 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24228 this_arg_conv.is_owned = false;
24229 LDKChannelTransactionParameters ret_var = InMemorySigner_get_channel_parameters(&this_arg_conv);
24230 uint64_t ret_ref = 0;
24231 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24232 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24236 jboolean __attribute__((export_name("TS_InMemorySigner_opt_anchors"))) TS_InMemorySigner_opt_anchors(uint64_t this_arg) {
24237 LDKInMemorySigner this_arg_conv;
24238 this_arg_conv.inner = untag_ptr(this_arg);
24239 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24240 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24241 this_arg_conv.is_owned = false;
24242 jboolean ret_conv = InMemorySigner_opt_anchors(&this_arg_conv);
24246 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) {
24247 LDKInMemorySigner this_arg_conv;
24248 this_arg_conv.inner = untag_ptr(this_arg);
24249 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24250 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24251 this_arg_conv.is_owned = false;
24252 LDKTransaction spend_tx_ref;
24253 spend_tx_ref.datalen = spend_tx->arr_len;
24254 spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes");
24255 memcpy(spend_tx_ref.data, spend_tx->elems, spend_tx_ref.datalen); FREE(spend_tx);
24256 spend_tx_ref.data_is_owned = true;
24257 LDKStaticPaymentOutputDescriptor descriptor_conv;
24258 descriptor_conv.inner = untag_ptr(descriptor);
24259 descriptor_conv.is_owned = ptr_is_owned(descriptor);
24260 CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv);
24261 descriptor_conv.is_owned = false;
24262 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
24263 *ret_conv = InMemorySigner_sign_counterparty_payment_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv);
24264 return tag_ptr(ret_conv, true);
24267 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) {
24268 LDKInMemorySigner this_arg_conv;
24269 this_arg_conv.inner = untag_ptr(this_arg);
24270 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24271 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24272 this_arg_conv.is_owned = false;
24273 LDKTransaction spend_tx_ref;
24274 spend_tx_ref.datalen = spend_tx->arr_len;
24275 spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes");
24276 memcpy(spend_tx_ref.data, spend_tx->elems, spend_tx_ref.datalen); FREE(spend_tx);
24277 spend_tx_ref.data_is_owned = true;
24278 LDKDelayedPaymentOutputDescriptor descriptor_conv;
24279 descriptor_conv.inner = untag_ptr(descriptor);
24280 descriptor_conv.is_owned = ptr_is_owned(descriptor);
24281 CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv);
24282 descriptor_conv.is_owned = false;
24283 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
24284 *ret_conv = InMemorySigner_sign_dynamic_p2wsh_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv);
24285 return tag_ptr(ret_conv, true);
24288 uint64_t __attribute__((export_name("TS_InMemorySigner_as_BaseSign"))) TS_InMemorySigner_as_BaseSign(uint64_t this_arg) {
24289 LDKInMemorySigner this_arg_conv;
24290 this_arg_conv.inner = untag_ptr(this_arg);
24291 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24292 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24293 this_arg_conv.is_owned = false;
24294 LDKBaseSign* ret_ret = MALLOC(sizeof(LDKBaseSign), "LDKBaseSign");
24295 *ret_ret = InMemorySigner_as_BaseSign(&this_arg_conv);
24296 return tag_ptr(ret_ret, true);
24299 uint64_t __attribute__((export_name("TS_InMemorySigner_as_Sign"))) TS_InMemorySigner_as_Sign(uint64_t this_arg) {
24300 LDKInMemorySigner this_arg_conv;
24301 this_arg_conv.inner = untag_ptr(this_arg);
24302 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24303 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24304 this_arg_conv.is_owned = false;
24305 LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
24306 *ret_ret = InMemorySigner_as_Sign(&this_arg_conv);
24307 return tag_ptr(ret_ret, true);
24310 int8_tArray __attribute__((export_name("TS_InMemorySigner_write"))) TS_InMemorySigner_write(uint64_t obj) {
24311 LDKInMemorySigner obj_conv;
24312 obj_conv.inner = untag_ptr(obj);
24313 obj_conv.is_owned = ptr_is_owned(obj);
24314 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
24315 obj_conv.is_owned = false;
24316 LDKCVec_u8Z ret_var = InMemorySigner_write(&obj_conv);
24317 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
24318 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
24319 CVec_u8Z_free(ret_var);
24323 uint64_t __attribute__((export_name("TS_InMemorySigner_read"))) TS_InMemorySigner_read(int8_tArray ser, int8_tArray arg) {
24324 LDKu8slice ser_ref;
24325 ser_ref.datalen = ser->arr_len;
24326 ser_ref.data = ser->elems;
24327 LDKSecretKey arg_ref;
24328 CHECK(arg->arr_len == 32);
24329 memcpy(arg_ref.bytes, arg->elems, 32); FREE(arg);
24330 LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
24331 *ret_conv = InMemorySigner_read(ser_ref, arg_ref);
24333 return tag_ptr(ret_conv, true);
24336 void __attribute__((export_name("TS_KeysManager_free"))) TS_KeysManager_free(uint64_t this_obj) {
24337 LDKKeysManager this_obj_conv;
24338 this_obj_conv.inner = untag_ptr(this_obj);
24339 this_obj_conv.is_owned = ptr_is_owned(this_obj);
24340 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
24341 KeysManager_free(this_obj_conv);
24344 uint64_t __attribute__((export_name("TS_KeysManager_new"))) TS_KeysManager_new(int8_tArray seed, int64_t starting_time_secs, int32_t starting_time_nanos) {
24345 unsigned char seed_arr[32];
24346 CHECK(seed->arr_len == 32);
24347 memcpy(seed_arr, seed->elems, 32); FREE(seed);
24348 unsigned char (*seed_ref)[32] = &seed_arr;
24349 LDKKeysManager ret_var = KeysManager_new(seed_ref, starting_time_secs, starting_time_nanos);
24350 uint64_t ret_ref = 0;
24351 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24352 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24356 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) {
24357 LDKKeysManager this_arg_conv;
24358 this_arg_conv.inner = untag_ptr(this_arg);
24359 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24360 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24361 this_arg_conv.is_owned = false;
24362 unsigned char params_arr[32];
24363 CHECK(params->arr_len == 32);
24364 memcpy(params_arr, params->elems, 32); FREE(params);
24365 unsigned char (*params_ref)[32] = ¶ms_arr;
24366 LDKInMemorySigner ret_var = KeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_ref);
24367 uint64_t ret_ref = 0;
24368 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24369 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24373 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) {
24374 LDKKeysManager this_arg_conv;
24375 this_arg_conv.inner = untag_ptr(this_arg);
24376 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24377 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24378 this_arg_conv.is_owned = false;
24379 LDKCVec_SpendableOutputDescriptorZ descriptors_constr;
24380 descriptors_constr.datalen = descriptors->arr_len;
24381 if (descriptors_constr.datalen > 0)
24382 descriptors_constr.data = MALLOC(descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
24384 descriptors_constr.data = NULL;
24385 uint64_t* descriptors_vals = descriptors->elems;
24386 for (size_t b = 0; b < descriptors_constr.datalen; b++) {
24387 uint64_t descriptors_conv_27 = descriptors_vals[b];
24388 void* descriptors_conv_27_ptr = untag_ptr(descriptors_conv_27);
24389 CHECK_ACCESS(descriptors_conv_27_ptr);
24390 LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(descriptors_conv_27_ptr);
24391 descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(descriptors_conv_27));
24392 descriptors_constr.data[b] = descriptors_conv_27_conv;
24395 LDKCVec_TxOutZ outputs_constr;
24396 outputs_constr.datalen = outputs->arr_len;
24397 if (outputs_constr.datalen > 0)
24398 outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements");
24400 outputs_constr.data = NULL;
24401 uint64_t* outputs_vals = outputs->elems;
24402 for (size_t h = 0; h < outputs_constr.datalen; h++) {
24403 uint64_t outputs_conv_7 = outputs_vals[h];
24404 void* outputs_conv_7_ptr = untag_ptr(outputs_conv_7);
24405 CHECK_ACCESS(outputs_conv_7_ptr);
24406 LDKTxOut outputs_conv_7_conv = *(LDKTxOut*)(outputs_conv_7_ptr);
24407 outputs_conv_7_conv = TxOut_clone((LDKTxOut*)untag_ptr(outputs_conv_7));
24408 outputs_constr.data[h] = outputs_conv_7_conv;
24411 LDKCVec_u8Z change_destination_script_ref;
24412 change_destination_script_ref.datalen = change_destination_script->arr_len;
24413 change_destination_script_ref.data = MALLOC(change_destination_script_ref.datalen, "LDKCVec_u8Z Bytes");
24414 memcpy(change_destination_script_ref.data, change_destination_script->elems, change_destination_script_ref.datalen); FREE(change_destination_script);
24415 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
24416 *ret_conv = KeysManager_spend_spendable_outputs(&this_arg_conv, descriptors_constr, outputs_constr, change_destination_script_ref, feerate_sat_per_1000_weight);
24417 return tag_ptr(ret_conv, true);
24420 uint64_t __attribute__((export_name("TS_KeysManager_as_KeysInterface"))) TS_KeysManager_as_KeysInterface(uint64_t this_arg) {
24421 LDKKeysManager this_arg_conv;
24422 this_arg_conv.inner = untag_ptr(this_arg);
24423 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24424 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24425 this_arg_conv.is_owned = false;
24426 LDKKeysInterface* ret_ret = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
24427 *ret_ret = KeysManager_as_KeysInterface(&this_arg_conv);
24428 return tag_ptr(ret_ret, true);
24431 void __attribute__((export_name("TS_PhantomKeysManager_free"))) TS_PhantomKeysManager_free(uint64_t this_obj) {
24432 LDKPhantomKeysManager this_obj_conv;
24433 this_obj_conv.inner = untag_ptr(this_obj);
24434 this_obj_conv.is_owned = ptr_is_owned(this_obj);
24435 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
24436 PhantomKeysManager_free(this_obj_conv);
24439 uint64_t __attribute__((export_name("TS_PhantomKeysManager_as_KeysInterface"))) TS_PhantomKeysManager_as_KeysInterface(uint64_t this_arg) {
24440 LDKPhantomKeysManager this_arg_conv;
24441 this_arg_conv.inner = untag_ptr(this_arg);
24442 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24443 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24444 this_arg_conv.is_owned = false;
24445 LDKKeysInterface* ret_ret = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
24446 *ret_ret = PhantomKeysManager_as_KeysInterface(&this_arg_conv);
24447 return tag_ptr(ret_ret, true);
24450 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) {
24451 unsigned char seed_arr[32];
24452 CHECK(seed->arr_len == 32);
24453 memcpy(seed_arr, seed->elems, 32); FREE(seed);
24454 unsigned char (*seed_ref)[32] = &seed_arr;
24455 unsigned char cross_node_seed_arr[32];
24456 CHECK(cross_node_seed->arr_len == 32);
24457 memcpy(cross_node_seed_arr, cross_node_seed->elems, 32); FREE(cross_node_seed);
24458 unsigned char (*cross_node_seed_ref)[32] = &cross_node_seed_arr;
24459 LDKPhantomKeysManager ret_var = PhantomKeysManager_new(seed_ref, starting_time_secs, starting_time_nanos, cross_node_seed_ref);
24460 uint64_t ret_ref = 0;
24461 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24462 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24466 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) {
24467 LDKPhantomKeysManager this_arg_conv;
24468 this_arg_conv.inner = untag_ptr(this_arg);
24469 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24470 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24471 this_arg_conv.is_owned = false;
24472 LDKCVec_SpendableOutputDescriptorZ descriptors_constr;
24473 descriptors_constr.datalen = descriptors->arr_len;
24474 if (descriptors_constr.datalen > 0)
24475 descriptors_constr.data = MALLOC(descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
24477 descriptors_constr.data = NULL;
24478 uint64_t* descriptors_vals = descriptors->elems;
24479 for (size_t b = 0; b < descriptors_constr.datalen; b++) {
24480 uint64_t descriptors_conv_27 = descriptors_vals[b];
24481 void* descriptors_conv_27_ptr = untag_ptr(descriptors_conv_27);
24482 CHECK_ACCESS(descriptors_conv_27_ptr);
24483 LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(descriptors_conv_27_ptr);
24484 descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(descriptors_conv_27));
24485 descriptors_constr.data[b] = descriptors_conv_27_conv;
24488 LDKCVec_TxOutZ outputs_constr;
24489 outputs_constr.datalen = outputs->arr_len;
24490 if (outputs_constr.datalen > 0)
24491 outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements");
24493 outputs_constr.data = NULL;
24494 uint64_t* outputs_vals = outputs->elems;
24495 for (size_t h = 0; h < outputs_constr.datalen; h++) {
24496 uint64_t outputs_conv_7 = outputs_vals[h];
24497 void* outputs_conv_7_ptr = untag_ptr(outputs_conv_7);
24498 CHECK_ACCESS(outputs_conv_7_ptr);
24499 LDKTxOut outputs_conv_7_conv = *(LDKTxOut*)(outputs_conv_7_ptr);
24500 outputs_conv_7_conv = TxOut_clone((LDKTxOut*)untag_ptr(outputs_conv_7));
24501 outputs_constr.data[h] = outputs_conv_7_conv;
24504 LDKCVec_u8Z change_destination_script_ref;
24505 change_destination_script_ref.datalen = change_destination_script->arr_len;
24506 change_destination_script_ref.data = MALLOC(change_destination_script_ref.datalen, "LDKCVec_u8Z Bytes");
24507 memcpy(change_destination_script_ref.data, change_destination_script->elems, change_destination_script_ref.datalen); FREE(change_destination_script);
24508 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
24509 *ret_conv = PhantomKeysManager_spend_spendable_outputs(&this_arg_conv, descriptors_constr, outputs_constr, change_destination_script_ref, feerate_sat_per_1000_weight);
24510 return tag_ptr(ret_conv, true);
24513 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) {
24514 LDKPhantomKeysManager this_arg_conv;
24515 this_arg_conv.inner = untag_ptr(this_arg);
24516 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24517 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24518 this_arg_conv.is_owned = false;
24519 unsigned char params_arr[32];
24520 CHECK(params->arr_len == 32);
24521 memcpy(params_arr, params->elems, 32); FREE(params);
24522 unsigned char (*params_ref)[32] = ¶ms_arr;
24523 LDKInMemorySigner ret_var = PhantomKeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_ref);
24524 uint64_t ret_ref = 0;
24525 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24526 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24530 void __attribute__((export_name("TS_ChannelManager_free"))) TS_ChannelManager_free(uint64_t this_obj) {
24531 LDKChannelManager this_obj_conv;
24532 this_obj_conv.inner = untag_ptr(this_obj);
24533 this_obj_conv.is_owned = ptr_is_owned(this_obj);
24534 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
24535 ChannelManager_free(this_obj_conv);
24538 void __attribute__((export_name("TS_ChainParameters_free"))) TS_ChainParameters_free(uint64_t this_obj) {
24539 LDKChainParameters this_obj_conv;
24540 this_obj_conv.inner = untag_ptr(this_obj);
24541 this_obj_conv.is_owned = ptr_is_owned(this_obj);
24542 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
24543 ChainParameters_free(this_obj_conv);
24546 uint32_t __attribute__((export_name("TS_ChainParameters_get_network"))) TS_ChainParameters_get_network(uint64_t this_ptr) {
24547 LDKChainParameters this_ptr_conv;
24548 this_ptr_conv.inner = untag_ptr(this_ptr);
24549 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24550 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24551 this_ptr_conv.is_owned = false;
24552 uint32_t ret_conv = LDKNetwork_to_js(ChainParameters_get_network(&this_ptr_conv));
24556 void __attribute__((export_name("TS_ChainParameters_set_network"))) TS_ChainParameters_set_network(uint64_t this_ptr, uint32_t val) {
24557 LDKChainParameters this_ptr_conv;
24558 this_ptr_conv.inner = untag_ptr(this_ptr);
24559 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24560 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24561 this_ptr_conv.is_owned = false;
24562 LDKNetwork val_conv = LDKNetwork_from_js(val);
24563 ChainParameters_set_network(&this_ptr_conv, val_conv);
24566 uint64_t __attribute__((export_name("TS_ChainParameters_get_best_block"))) TS_ChainParameters_get_best_block(uint64_t this_ptr) {
24567 LDKChainParameters this_ptr_conv;
24568 this_ptr_conv.inner = untag_ptr(this_ptr);
24569 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24570 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24571 this_ptr_conv.is_owned = false;
24572 LDKBestBlock ret_var = ChainParameters_get_best_block(&this_ptr_conv);
24573 uint64_t ret_ref = 0;
24574 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24575 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24579 void __attribute__((export_name("TS_ChainParameters_set_best_block"))) TS_ChainParameters_set_best_block(uint64_t this_ptr, uint64_t val) {
24580 LDKChainParameters this_ptr_conv;
24581 this_ptr_conv.inner = untag_ptr(this_ptr);
24582 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24583 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24584 this_ptr_conv.is_owned = false;
24585 LDKBestBlock val_conv;
24586 val_conv.inner = untag_ptr(val);
24587 val_conv.is_owned = ptr_is_owned(val);
24588 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
24589 val_conv = BestBlock_clone(&val_conv);
24590 ChainParameters_set_best_block(&this_ptr_conv, val_conv);
24593 uint64_t __attribute__((export_name("TS_ChainParameters_new"))) TS_ChainParameters_new(uint32_t network_arg, uint64_t best_block_arg) {
24594 LDKNetwork network_arg_conv = LDKNetwork_from_js(network_arg);
24595 LDKBestBlock best_block_arg_conv;
24596 best_block_arg_conv.inner = untag_ptr(best_block_arg);
24597 best_block_arg_conv.is_owned = ptr_is_owned(best_block_arg);
24598 CHECK_INNER_FIELD_ACCESS_OR_NULL(best_block_arg_conv);
24599 best_block_arg_conv = BestBlock_clone(&best_block_arg_conv);
24600 LDKChainParameters ret_var = ChainParameters_new(network_arg_conv, best_block_arg_conv);
24601 uint64_t ret_ref = 0;
24602 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24603 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24607 static inline uint64_t ChainParameters_clone_ptr(LDKChainParameters *NONNULL_PTR arg) {
24608 LDKChainParameters ret_var = ChainParameters_clone(arg);
24609 uint64_t ret_ref = 0;
24610 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24611 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24614 int64_t __attribute__((export_name("TS_ChainParameters_clone_ptr"))) TS_ChainParameters_clone_ptr(uint64_t arg) {
24615 LDKChainParameters arg_conv;
24616 arg_conv.inner = untag_ptr(arg);
24617 arg_conv.is_owned = ptr_is_owned(arg);
24618 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
24619 arg_conv.is_owned = false;
24620 int64_t ret_conv = ChainParameters_clone_ptr(&arg_conv);
24624 uint64_t __attribute__((export_name("TS_ChainParameters_clone"))) TS_ChainParameters_clone(uint64_t orig) {
24625 LDKChainParameters orig_conv;
24626 orig_conv.inner = untag_ptr(orig);
24627 orig_conv.is_owned = ptr_is_owned(orig);
24628 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
24629 orig_conv.is_owned = false;
24630 LDKChainParameters ret_var = ChainParameters_clone(&orig_conv);
24631 uint64_t ret_ref = 0;
24632 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24633 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24637 void __attribute__((export_name("TS_CounterpartyForwardingInfo_free"))) TS_CounterpartyForwardingInfo_free(uint64_t this_obj) {
24638 LDKCounterpartyForwardingInfo this_obj_conv;
24639 this_obj_conv.inner = untag_ptr(this_obj);
24640 this_obj_conv.is_owned = ptr_is_owned(this_obj);
24641 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
24642 CounterpartyForwardingInfo_free(this_obj_conv);
24645 int32_t __attribute__((export_name("TS_CounterpartyForwardingInfo_get_fee_base_msat"))) TS_CounterpartyForwardingInfo_get_fee_base_msat(uint64_t this_ptr) {
24646 LDKCounterpartyForwardingInfo this_ptr_conv;
24647 this_ptr_conv.inner = untag_ptr(this_ptr);
24648 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24649 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24650 this_ptr_conv.is_owned = false;
24651 int32_t ret_conv = CounterpartyForwardingInfo_get_fee_base_msat(&this_ptr_conv);
24655 void __attribute__((export_name("TS_CounterpartyForwardingInfo_set_fee_base_msat"))) TS_CounterpartyForwardingInfo_set_fee_base_msat(uint64_t this_ptr, int32_t val) {
24656 LDKCounterpartyForwardingInfo this_ptr_conv;
24657 this_ptr_conv.inner = untag_ptr(this_ptr);
24658 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24659 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24660 this_ptr_conv.is_owned = false;
24661 CounterpartyForwardingInfo_set_fee_base_msat(&this_ptr_conv, val);
24664 int32_t __attribute__((export_name("TS_CounterpartyForwardingInfo_get_fee_proportional_millionths"))) TS_CounterpartyForwardingInfo_get_fee_proportional_millionths(uint64_t this_ptr) {
24665 LDKCounterpartyForwardingInfo this_ptr_conv;
24666 this_ptr_conv.inner = untag_ptr(this_ptr);
24667 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24668 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24669 this_ptr_conv.is_owned = false;
24670 int32_t ret_conv = CounterpartyForwardingInfo_get_fee_proportional_millionths(&this_ptr_conv);
24674 void __attribute__((export_name("TS_CounterpartyForwardingInfo_set_fee_proportional_millionths"))) TS_CounterpartyForwardingInfo_set_fee_proportional_millionths(uint64_t this_ptr, int32_t val) {
24675 LDKCounterpartyForwardingInfo this_ptr_conv;
24676 this_ptr_conv.inner = untag_ptr(this_ptr);
24677 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24678 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24679 this_ptr_conv.is_owned = false;
24680 CounterpartyForwardingInfo_set_fee_proportional_millionths(&this_ptr_conv, val);
24683 int16_t __attribute__((export_name("TS_CounterpartyForwardingInfo_get_cltv_expiry_delta"))) TS_CounterpartyForwardingInfo_get_cltv_expiry_delta(uint64_t this_ptr) {
24684 LDKCounterpartyForwardingInfo this_ptr_conv;
24685 this_ptr_conv.inner = untag_ptr(this_ptr);
24686 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24687 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24688 this_ptr_conv.is_owned = false;
24689 int16_t ret_conv = CounterpartyForwardingInfo_get_cltv_expiry_delta(&this_ptr_conv);
24693 void __attribute__((export_name("TS_CounterpartyForwardingInfo_set_cltv_expiry_delta"))) TS_CounterpartyForwardingInfo_set_cltv_expiry_delta(uint64_t this_ptr, int16_t val) {
24694 LDKCounterpartyForwardingInfo this_ptr_conv;
24695 this_ptr_conv.inner = untag_ptr(this_ptr);
24696 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24697 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24698 this_ptr_conv.is_owned = false;
24699 CounterpartyForwardingInfo_set_cltv_expiry_delta(&this_ptr_conv, val);
24702 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) {
24703 LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_new(fee_base_msat_arg, fee_proportional_millionths_arg, cltv_expiry_delta_arg);
24704 uint64_t ret_ref = 0;
24705 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24706 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24710 static inline uint64_t CounterpartyForwardingInfo_clone_ptr(LDKCounterpartyForwardingInfo *NONNULL_PTR arg) {
24711 LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(arg);
24712 uint64_t ret_ref = 0;
24713 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24714 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24717 int64_t __attribute__((export_name("TS_CounterpartyForwardingInfo_clone_ptr"))) TS_CounterpartyForwardingInfo_clone_ptr(uint64_t arg) {
24718 LDKCounterpartyForwardingInfo arg_conv;
24719 arg_conv.inner = untag_ptr(arg);
24720 arg_conv.is_owned = ptr_is_owned(arg);
24721 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
24722 arg_conv.is_owned = false;
24723 int64_t ret_conv = CounterpartyForwardingInfo_clone_ptr(&arg_conv);
24727 uint64_t __attribute__((export_name("TS_CounterpartyForwardingInfo_clone"))) TS_CounterpartyForwardingInfo_clone(uint64_t orig) {
24728 LDKCounterpartyForwardingInfo orig_conv;
24729 orig_conv.inner = untag_ptr(orig);
24730 orig_conv.is_owned = ptr_is_owned(orig);
24731 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
24732 orig_conv.is_owned = false;
24733 LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(&orig_conv);
24734 uint64_t ret_ref = 0;
24735 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24736 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24740 void __attribute__((export_name("TS_ChannelCounterparty_free"))) TS_ChannelCounterparty_free(uint64_t this_obj) {
24741 LDKChannelCounterparty this_obj_conv;
24742 this_obj_conv.inner = untag_ptr(this_obj);
24743 this_obj_conv.is_owned = ptr_is_owned(this_obj);
24744 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
24745 ChannelCounterparty_free(this_obj_conv);
24748 int8_tArray __attribute__((export_name("TS_ChannelCounterparty_get_node_id"))) TS_ChannelCounterparty_get_node_id(uint64_t this_ptr) {
24749 LDKChannelCounterparty this_ptr_conv;
24750 this_ptr_conv.inner = untag_ptr(this_ptr);
24751 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24752 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24753 this_ptr_conv.is_owned = false;
24754 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
24755 memcpy(ret_arr->elems, ChannelCounterparty_get_node_id(&this_ptr_conv).compressed_form, 33);
24759 void __attribute__((export_name("TS_ChannelCounterparty_set_node_id"))) TS_ChannelCounterparty_set_node_id(uint64_t this_ptr, int8_tArray val) {
24760 LDKChannelCounterparty this_ptr_conv;
24761 this_ptr_conv.inner = untag_ptr(this_ptr);
24762 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24763 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24764 this_ptr_conv.is_owned = false;
24765 LDKPublicKey val_ref;
24766 CHECK(val->arr_len == 33);
24767 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
24768 ChannelCounterparty_set_node_id(&this_ptr_conv, val_ref);
24771 uint64_t __attribute__((export_name("TS_ChannelCounterparty_get_features"))) TS_ChannelCounterparty_get_features(uint64_t this_ptr) {
24772 LDKChannelCounterparty this_ptr_conv;
24773 this_ptr_conv.inner = untag_ptr(this_ptr);
24774 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24775 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24776 this_ptr_conv.is_owned = false;
24777 LDKInitFeatures ret_var = ChannelCounterparty_get_features(&this_ptr_conv);
24778 uint64_t ret_ref = 0;
24779 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24780 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24784 void __attribute__((export_name("TS_ChannelCounterparty_set_features"))) TS_ChannelCounterparty_set_features(uint64_t this_ptr, uint64_t val) {
24785 LDKChannelCounterparty this_ptr_conv;
24786 this_ptr_conv.inner = untag_ptr(this_ptr);
24787 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24788 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24789 this_ptr_conv.is_owned = false;
24790 LDKInitFeatures val_conv;
24791 val_conv.inner = untag_ptr(val);
24792 val_conv.is_owned = ptr_is_owned(val);
24793 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
24794 val_conv = InitFeatures_clone(&val_conv);
24795 ChannelCounterparty_set_features(&this_ptr_conv, val_conv);
24798 int64_t __attribute__((export_name("TS_ChannelCounterparty_get_unspendable_punishment_reserve"))) TS_ChannelCounterparty_get_unspendable_punishment_reserve(uint64_t this_ptr) {
24799 LDKChannelCounterparty this_ptr_conv;
24800 this_ptr_conv.inner = untag_ptr(this_ptr);
24801 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24802 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24803 this_ptr_conv.is_owned = false;
24804 int64_t ret_conv = ChannelCounterparty_get_unspendable_punishment_reserve(&this_ptr_conv);
24808 void __attribute__((export_name("TS_ChannelCounterparty_set_unspendable_punishment_reserve"))) TS_ChannelCounterparty_set_unspendable_punishment_reserve(uint64_t this_ptr, int64_t val) {
24809 LDKChannelCounterparty this_ptr_conv;
24810 this_ptr_conv.inner = untag_ptr(this_ptr);
24811 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24812 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24813 this_ptr_conv.is_owned = false;
24814 ChannelCounterparty_set_unspendable_punishment_reserve(&this_ptr_conv, val);
24817 uint64_t __attribute__((export_name("TS_ChannelCounterparty_get_forwarding_info"))) TS_ChannelCounterparty_get_forwarding_info(uint64_t this_ptr) {
24818 LDKChannelCounterparty this_ptr_conv;
24819 this_ptr_conv.inner = untag_ptr(this_ptr);
24820 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24821 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24822 this_ptr_conv.is_owned = false;
24823 LDKCounterpartyForwardingInfo ret_var = ChannelCounterparty_get_forwarding_info(&this_ptr_conv);
24824 uint64_t ret_ref = 0;
24825 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24826 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24830 void __attribute__((export_name("TS_ChannelCounterparty_set_forwarding_info"))) TS_ChannelCounterparty_set_forwarding_info(uint64_t this_ptr, uint64_t val) {
24831 LDKChannelCounterparty this_ptr_conv;
24832 this_ptr_conv.inner = untag_ptr(this_ptr);
24833 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24834 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24835 this_ptr_conv.is_owned = false;
24836 LDKCounterpartyForwardingInfo val_conv;
24837 val_conv.inner = untag_ptr(val);
24838 val_conv.is_owned = ptr_is_owned(val);
24839 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
24840 val_conv = CounterpartyForwardingInfo_clone(&val_conv);
24841 ChannelCounterparty_set_forwarding_info(&this_ptr_conv, val_conv);
24844 uint64_t __attribute__((export_name("TS_ChannelCounterparty_get_outbound_htlc_minimum_msat"))) TS_ChannelCounterparty_get_outbound_htlc_minimum_msat(uint64_t this_ptr) {
24845 LDKChannelCounterparty this_ptr_conv;
24846 this_ptr_conv.inner = untag_ptr(this_ptr);
24847 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24848 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24849 this_ptr_conv.is_owned = false;
24850 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
24851 *ret_copy = ChannelCounterparty_get_outbound_htlc_minimum_msat(&this_ptr_conv);
24852 uint64_t ret_ref = tag_ptr(ret_copy, true);
24856 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) {
24857 LDKChannelCounterparty this_ptr_conv;
24858 this_ptr_conv.inner = untag_ptr(this_ptr);
24859 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24860 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24861 this_ptr_conv.is_owned = false;
24862 void* val_ptr = untag_ptr(val);
24863 CHECK_ACCESS(val_ptr);
24864 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
24865 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
24866 ChannelCounterparty_set_outbound_htlc_minimum_msat(&this_ptr_conv, val_conv);
24869 uint64_t __attribute__((export_name("TS_ChannelCounterparty_get_outbound_htlc_maximum_msat"))) TS_ChannelCounterparty_get_outbound_htlc_maximum_msat(uint64_t this_ptr) {
24870 LDKChannelCounterparty this_ptr_conv;
24871 this_ptr_conv.inner = untag_ptr(this_ptr);
24872 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24873 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24874 this_ptr_conv.is_owned = false;
24875 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
24876 *ret_copy = ChannelCounterparty_get_outbound_htlc_maximum_msat(&this_ptr_conv);
24877 uint64_t ret_ref = tag_ptr(ret_copy, true);
24881 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) {
24882 LDKChannelCounterparty this_ptr_conv;
24883 this_ptr_conv.inner = untag_ptr(this_ptr);
24884 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24885 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24886 this_ptr_conv.is_owned = false;
24887 void* val_ptr = untag_ptr(val);
24888 CHECK_ACCESS(val_ptr);
24889 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
24890 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
24891 ChannelCounterparty_set_outbound_htlc_maximum_msat(&this_ptr_conv, val_conv);
24894 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) {
24895 LDKPublicKey node_id_arg_ref;
24896 CHECK(node_id_arg->arr_len == 33);
24897 memcpy(node_id_arg_ref.compressed_form, node_id_arg->elems, 33); FREE(node_id_arg);
24898 LDKInitFeatures features_arg_conv;
24899 features_arg_conv.inner = untag_ptr(features_arg);
24900 features_arg_conv.is_owned = ptr_is_owned(features_arg);
24901 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv);
24902 features_arg_conv = InitFeatures_clone(&features_arg_conv);
24903 LDKCounterpartyForwardingInfo forwarding_info_arg_conv;
24904 forwarding_info_arg_conv.inner = untag_ptr(forwarding_info_arg);
24905 forwarding_info_arg_conv.is_owned = ptr_is_owned(forwarding_info_arg);
24906 CHECK_INNER_FIELD_ACCESS_OR_NULL(forwarding_info_arg_conv);
24907 forwarding_info_arg_conv = CounterpartyForwardingInfo_clone(&forwarding_info_arg_conv);
24908 void* outbound_htlc_minimum_msat_arg_ptr = untag_ptr(outbound_htlc_minimum_msat_arg);
24909 CHECK_ACCESS(outbound_htlc_minimum_msat_arg_ptr);
24910 LDKCOption_u64Z outbound_htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(outbound_htlc_minimum_msat_arg_ptr);
24911 outbound_htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_htlc_minimum_msat_arg));
24912 void* outbound_htlc_maximum_msat_arg_ptr = untag_ptr(outbound_htlc_maximum_msat_arg);
24913 CHECK_ACCESS(outbound_htlc_maximum_msat_arg_ptr);
24914 LDKCOption_u64Z outbound_htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(outbound_htlc_maximum_msat_arg_ptr);
24915 outbound_htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_htlc_maximum_msat_arg));
24916 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);
24917 uint64_t ret_ref = 0;
24918 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24919 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24923 static inline uint64_t ChannelCounterparty_clone_ptr(LDKChannelCounterparty *NONNULL_PTR arg) {
24924 LDKChannelCounterparty ret_var = ChannelCounterparty_clone(arg);
24925 uint64_t ret_ref = 0;
24926 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24927 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24930 int64_t __attribute__((export_name("TS_ChannelCounterparty_clone_ptr"))) TS_ChannelCounterparty_clone_ptr(uint64_t arg) {
24931 LDKChannelCounterparty arg_conv;
24932 arg_conv.inner = untag_ptr(arg);
24933 arg_conv.is_owned = ptr_is_owned(arg);
24934 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
24935 arg_conv.is_owned = false;
24936 int64_t ret_conv = ChannelCounterparty_clone_ptr(&arg_conv);
24940 uint64_t __attribute__((export_name("TS_ChannelCounterparty_clone"))) TS_ChannelCounterparty_clone(uint64_t orig) {
24941 LDKChannelCounterparty orig_conv;
24942 orig_conv.inner = untag_ptr(orig);
24943 orig_conv.is_owned = ptr_is_owned(orig);
24944 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
24945 orig_conv.is_owned = false;
24946 LDKChannelCounterparty ret_var = ChannelCounterparty_clone(&orig_conv);
24947 uint64_t ret_ref = 0;
24948 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24949 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24953 void __attribute__((export_name("TS_ChannelDetails_free"))) TS_ChannelDetails_free(uint64_t this_obj) {
24954 LDKChannelDetails this_obj_conv;
24955 this_obj_conv.inner = untag_ptr(this_obj);
24956 this_obj_conv.is_owned = ptr_is_owned(this_obj);
24957 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
24958 ChannelDetails_free(this_obj_conv);
24961 int8_tArray __attribute__((export_name("TS_ChannelDetails_get_channel_id"))) TS_ChannelDetails_get_channel_id(uint64_t this_ptr) {
24962 LDKChannelDetails this_ptr_conv;
24963 this_ptr_conv.inner = untag_ptr(this_ptr);
24964 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24965 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24966 this_ptr_conv.is_owned = false;
24967 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
24968 memcpy(ret_arr->elems, *ChannelDetails_get_channel_id(&this_ptr_conv), 32);
24972 void __attribute__((export_name("TS_ChannelDetails_set_channel_id"))) TS_ChannelDetails_set_channel_id(uint64_t this_ptr, int8_tArray val) {
24973 LDKChannelDetails this_ptr_conv;
24974 this_ptr_conv.inner = untag_ptr(this_ptr);
24975 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24976 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24977 this_ptr_conv.is_owned = false;
24978 LDKThirtyTwoBytes val_ref;
24979 CHECK(val->arr_len == 32);
24980 memcpy(val_ref.data, val->elems, 32); FREE(val);
24981 ChannelDetails_set_channel_id(&this_ptr_conv, val_ref);
24984 uint64_t __attribute__((export_name("TS_ChannelDetails_get_counterparty"))) TS_ChannelDetails_get_counterparty(uint64_t this_ptr) {
24985 LDKChannelDetails this_ptr_conv;
24986 this_ptr_conv.inner = untag_ptr(this_ptr);
24987 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24988 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24989 this_ptr_conv.is_owned = false;
24990 LDKChannelCounterparty ret_var = ChannelDetails_get_counterparty(&this_ptr_conv);
24991 uint64_t ret_ref = 0;
24992 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24993 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24997 void __attribute__((export_name("TS_ChannelDetails_set_counterparty"))) TS_ChannelDetails_set_counterparty(uint64_t this_ptr, uint64_t val) {
24998 LDKChannelDetails this_ptr_conv;
24999 this_ptr_conv.inner = untag_ptr(this_ptr);
25000 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25001 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25002 this_ptr_conv.is_owned = false;
25003 LDKChannelCounterparty val_conv;
25004 val_conv.inner = untag_ptr(val);
25005 val_conv.is_owned = ptr_is_owned(val);
25006 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
25007 val_conv = ChannelCounterparty_clone(&val_conv);
25008 ChannelDetails_set_counterparty(&this_ptr_conv, val_conv);
25011 uint64_t __attribute__((export_name("TS_ChannelDetails_get_funding_txo"))) TS_ChannelDetails_get_funding_txo(uint64_t this_ptr) {
25012 LDKChannelDetails this_ptr_conv;
25013 this_ptr_conv.inner = untag_ptr(this_ptr);
25014 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25015 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25016 this_ptr_conv.is_owned = false;
25017 LDKOutPoint ret_var = ChannelDetails_get_funding_txo(&this_ptr_conv);
25018 uint64_t ret_ref = 0;
25019 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25020 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25024 void __attribute__((export_name("TS_ChannelDetails_set_funding_txo"))) TS_ChannelDetails_set_funding_txo(uint64_t this_ptr, uint64_t val) {
25025 LDKChannelDetails this_ptr_conv;
25026 this_ptr_conv.inner = untag_ptr(this_ptr);
25027 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25028 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25029 this_ptr_conv.is_owned = false;
25030 LDKOutPoint val_conv;
25031 val_conv.inner = untag_ptr(val);
25032 val_conv.is_owned = ptr_is_owned(val);
25033 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
25034 val_conv = OutPoint_clone(&val_conv);
25035 ChannelDetails_set_funding_txo(&this_ptr_conv, val_conv);
25038 uint64_t __attribute__((export_name("TS_ChannelDetails_get_channel_type"))) TS_ChannelDetails_get_channel_type(uint64_t this_ptr) {
25039 LDKChannelDetails this_ptr_conv;
25040 this_ptr_conv.inner = untag_ptr(this_ptr);
25041 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25042 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25043 this_ptr_conv.is_owned = false;
25044 LDKChannelTypeFeatures ret_var = ChannelDetails_get_channel_type(&this_ptr_conv);
25045 uint64_t ret_ref = 0;
25046 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25047 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25051 void __attribute__((export_name("TS_ChannelDetails_set_channel_type"))) TS_ChannelDetails_set_channel_type(uint64_t this_ptr, uint64_t val) {
25052 LDKChannelDetails this_ptr_conv;
25053 this_ptr_conv.inner = untag_ptr(this_ptr);
25054 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25055 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25056 this_ptr_conv.is_owned = false;
25057 LDKChannelTypeFeatures val_conv;
25058 val_conv.inner = untag_ptr(val);
25059 val_conv.is_owned = ptr_is_owned(val);
25060 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
25061 val_conv = ChannelTypeFeatures_clone(&val_conv);
25062 ChannelDetails_set_channel_type(&this_ptr_conv, val_conv);
25065 uint64_t __attribute__((export_name("TS_ChannelDetails_get_short_channel_id"))) TS_ChannelDetails_get_short_channel_id(uint64_t this_ptr) {
25066 LDKChannelDetails this_ptr_conv;
25067 this_ptr_conv.inner = untag_ptr(this_ptr);
25068 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25069 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25070 this_ptr_conv.is_owned = false;
25071 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
25072 *ret_copy = ChannelDetails_get_short_channel_id(&this_ptr_conv);
25073 uint64_t ret_ref = tag_ptr(ret_copy, true);
25077 void __attribute__((export_name("TS_ChannelDetails_set_short_channel_id"))) TS_ChannelDetails_set_short_channel_id(uint64_t this_ptr, uint64_t val) {
25078 LDKChannelDetails this_ptr_conv;
25079 this_ptr_conv.inner = untag_ptr(this_ptr);
25080 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25081 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25082 this_ptr_conv.is_owned = false;
25083 void* val_ptr = untag_ptr(val);
25084 CHECK_ACCESS(val_ptr);
25085 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
25086 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
25087 ChannelDetails_set_short_channel_id(&this_ptr_conv, val_conv);
25090 uint64_t __attribute__((export_name("TS_ChannelDetails_get_outbound_scid_alias"))) TS_ChannelDetails_get_outbound_scid_alias(uint64_t this_ptr) {
25091 LDKChannelDetails this_ptr_conv;
25092 this_ptr_conv.inner = untag_ptr(this_ptr);
25093 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25094 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25095 this_ptr_conv.is_owned = false;
25096 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
25097 *ret_copy = ChannelDetails_get_outbound_scid_alias(&this_ptr_conv);
25098 uint64_t ret_ref = tag_ptr(ret_copy, true);
25102 void __attribute__((export_name("TS_ChannelDetails_set_outbound_scid_alias"))) TS_ChannelDetails_set_outbound_scid_alias(uint64_t this_ptr, uint64_t val) {
25103 LDKChannelDetails this_ptr_conv;
25104 this_ptr_conv.inner = untag_ptr(this_ptr);
25105 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25106 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25107 this_ptr_conv.is_owned = false;
25108 void* val_ptr = untag_ptr(val);
25109 CHECK_ACCESS(val_ptr);
25110 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
25111 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
25112 ChannelDetails_set_outbound_scid_alias(&this_ptr_conv, val_conv);
25115 uint64_t __attribute__((export_name("TS_ChannelDetails_get_inbound_scid_alias"))) TS_ChannelDetails_get_inbound_scid_alias(uint64_t this_ptr) {
25116 LDKChannelDetails this_ptr_conv;
25117 this_ptr_conv.inner = untag_ptr(this_ptr);
25118 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25119 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25120 this_ptr_conv.is_owned = false;
25121 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
25122 *ret_copy = ChannelDetails_get_inbound_scid_alias(&this_ptr_conv);
25123 uint64_t ret_ref = tag_ptr(ret_copy, true);
25127 void __attribute__((export_name("TS_ChannelDetails_set_inbound_scid_alias"))) TS_ChannelDetails_set_inbound_scid_alias(uint64_t this_ptr, uint64_t val) {
25128 LDKChannelDetails this_ptr_conv;
25129 this_ptr_conv.inner = untag_ptr(this_ptr);
25130 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25131 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25132 this_ptr_conv.is_owned = false;
25133 void* val_ptr = untag_ptr(val);
25134 CHECK_ACCESS(val_ptr);
25135 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
25136 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
25137 ChannelDetails_set_inbound_scid_alias(&this_ptr_conv, val_conv);
25140 int64_t __attribute__((export_name("TS_ChannelDetails_get_channel_value_satoshis"))) TS_ChannelDetails_get_channel_value_satoshis(uint64_t this_ptr) {
25141 LDKChannelDetails this_ptr_conv;
25142 this_ptr_conv.inner = untag_ptr(this_ptr);
25143 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25144 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25145 this_ptr_conv.is_owned = false;
25146 int64_t ret_conv = ChannelDetails_get_channel_value_satoshis(&this_ptr_conv);
25150 void __attribute__((export_name("TS_ChannelDetails_set_channel_value_satoshis"))) TS_ChannelDetails_set_channel_value_satoshis(uint64_t this_ptr, int64_t val) {
25151 LDKChannelDetails this_ptr_conv;
25152 this_ptr_conv.inner = untag_ptr(this_ptr);
25153 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25154 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25155 this_ptr_conv.is_owned = false;
25156 ChannelDetails_set_channel_value_satoshis(&this_ptr_conv, val);
25159 uint64_t __attribute__((export_name("TS_ChannelDetails_get_unspendable_punishment_reserve"))) TS_ChannelDetails_get_unspendable_punishment_reserve(uint64_t this_ptr) {
25160 LDKChannelDetails this_ptr_conv;
25161 this_ptr_conv.inner = untag_ptr(this_ptr);
25162 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25163 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25164 this_ptr_conv.is_owned = false;
25165 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
25166 *ret_copy = ChannelDetails_get_unspendable_punishment_reserve(&this_ptr_conv);
25167 uint64_t ret_ref = tag_ptr(ret_copy, true);
25171 void __attribute__((export_name("TS_ChannelDetails_set_unspendable_punishment_reserve"))) TS_ChannelDetails_set_unspendable_punishment_reserve(uint64_t this_ptr, uint64_t val) {
25172 LDKChannelDetails this_ptr_conv;
25173 this_ptr_conv.inner = untag_ptr(this_ptr);
25174 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25175 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25176 this_ptr_conv.is_owned = false;
25177 void* val_ptr = untag_ptr(val);
25178 CHECK_ACCESS(val_ptr);
25179 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
25180 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
25181 ChannelDetails_set_unspendable_punishment_reserve(&this_ptr_conv, val_conv);
25184 int64_t __attribute__((export_name("TS_ChannelDetails_get_user_channel_id"))) TS_ChannelDetails_get_user_channel_id(uint64_t this_ptr) {
25185 LDKChannelDetails this_ptr_conv;
25186 this_ptr_conv.inner = untag_ptr(this_ptr);
25187 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25188 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25189 this_ptr_conv.is_owned = false;
25190 int64_t ret_conv = ChannelDetails_get_user_channel_id(&this_ptr_conv);
25194 void __attribute__((export_name("TS_ChannelDetails_set_user_channel_id"))) TS_ChannelDetails_set_user_channel_id(uint64_t this_ptr, int64_t val) {
25195 LDKChannelDetails this_ptr_conv;
25196 this_ptr_conv.inner = untag_ptr(this_ptr);
25197 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25198 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25199 this_ptr_conv.is_owned = false;
25200 ChannelDetails_set_user_channel_id(&this_ptr_conv, val);
25203 int64_t __attribute__((export_name("TS_ChannelDetails_get_balance_msat"))) TS_ChannelDetails_get_balance_msat(uint64_t this_ptr) {
25204 LDKChannelDetails this_ptr_conv;
25205 this_ptr_conv.inner = untag_ptr(this_ptr);
25206 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25207 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25208 this_ptr_conv.is_owned = false;
25209 int64_t ret_conv = ChannelDetails_get_balance_msat(&this_ptr_conv);
25213 void __attribute__((export_name("TS_ChannelDetails_set_balance_msat"))) TS_ChannelDetails_set_balance_msat(uint64_t this_ptr, int64_t val) {
25214 LDKChannelDetails this_ptr_conv;
25215 this_ptr_conv.inner = untag_ptr(this_ptr);
25216 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25217 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25218 this_ptr_conv.is_owned = false;
25219 ChannelDetails_set_balance_msat(&this_ptr_conv, val);
25222 int64_t __attribute__((export_name("TS_ChannelDetails_get_outbound_capacity_msat"))) TS_ChannelDetails_get_outbound_capacity_msat(uint64_t this_ptr) {
25223 LDKChannelDetails this_ptr_conv;
25224 this_ptr_conv.inner = untag_ptr(this_ptr);
25225 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25226 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25227 this_ptr_conv.is_owned = false;
25228 int64_t ret_conv = ChannelDetails_get_outbound_capacity_msat(&this_ptr_conv);
25232 void __attribute__((export_name("TS_ChannelDetails_set_outbound_capacity_msat"))) TS_ChannelDetails_set_outbound_capacity_msat(uint64_t this_ptr, int64_t val) {
25233 LDKChannelDetails this_ptr_conv;
25234 this_ptr_conv.inner = untag_ptr(this_ptr);
25235 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25236 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25237 this_ptr_conv.is_owned = false;
25238 ChannelDetails_set_outbound_capacity_msat(&this_ptr_conv, val);
25241 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) {
25242 LDKChannelDetails this_ptr_conv;
25243 this_ptr_conv.inner = untag_ptr(this_ptr);
25244 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25245 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25246 this_ptr_conv.is_owned = false;
25247 int64_t ret_conv = ChannelDetails_get_next_outbound_htlc_limit_msat(&this_ptr_conv);
25251 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) {
25252 LDKChannelDetails this_ptr_conv;
25253 this_ptr_conv.inner = untag_ptr(this_ptr);
25254 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25255 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25256 this_ptr_conv.is_owned = false;
25257 ChannelDetails_set_next_outbound_htlc_limit_msat(&this_ptr_conv, val);
25260 int64_t __attribute__((export_name("TS_ChannelDetails_get_inbound_capacity_msat"))) TS_ChannelDetails_get_inbound_capacity_msat(uint64_t this_ptr) {
25261 LDKChannelDetails this_ptr_conv;
25262 this_ptr_conv.inner = untag_ptr(this_ptr);
25263 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25264 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25265 this_ptr_conv.is_owned = false;
25266 int64_t ret_conv = ChannelDetails_get_inbound_capacity_msat(&this_ptr_conv);
25270 void __attribute__((export_name("TS_ChannelDetails_set_inbound_capacity_msat"))) TS_ChannelDetails_set_inbound_capacity_msat(uint64_t this_ptr, int64_t val) {
25271 LDKChannelDetails this_ptr_conv;
25272 this_ptr_conv.inner = untag_ptr(this_ptr);
25273 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25274 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25275 this_ptr_conv.is_owned = false;
25276 ChannelDetails_set_inbound_capacity_msat(&this_ptr_conv, val);
25279 uint64_t __attribute__((export_name("TS_ChannelDetails_get_confirmations_required"))) TS_ChannelDetails_get_confirmations_required(uint64_t this_ptr) {
25280 LDKChannelDetails this_ptr_conv;
25281 this_ptr_conv.inner = untag_ptr(this_ptr);
25282 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25283 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25284 this_ptr_conv.is_owned = false;
25285 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
25286 *ret_copy = ChannelDetails_get_confirmations_required(&this_ptr_conv);
25287 uint64_t ret_ref = tag_ptr(ret_copy, true);
25291 void __attribute__((export_name("TS_ChannelDetails_set_confirmations_required"))) TS_ChannelDetails_set_confirmations_required(uint64_t this_ptr, uint64_t val) {
25292 LDKChannelDetails this_ptr_conv;
25293 this_ptr_conv.inner = untag_ptr(this_ptr);
25294 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25295 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25296 this_ptr_conv.is_owned = false;
25297 void* val_ptr = untag_ptr(val);
25298 CHECK_ACCESS(val_ptr);
25299 LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr);
25300 val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val));
25301 ChannelDetails_set_confirmations_required(&this_ptr_conv, val_conv);
25304 uint64_t __attribute__((export_name("TS_ChannelDetails_get_force_close_spend_delay"))) TS_ChannelDetails_get_force_close_spend_delay(uint64_t this_ptr) {
25305 LDKChannelDetails this_ptr_conv;
25306 this_ptr_conv.inner = untag_ptr(this_ptr);
25307 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25308 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25309 this_ptr_conv.is_owned = false;
25310 LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
25311 *ret_copy = ChannelDetails_get_force_close_spend_delay(&this_ptr_conv);
25312 uint64_t ret_ref = tag_ptr(ret_copy, true);
25316 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) {
25317 LDKChannelDetails this_ptr_conv;
25318 this_ptr_conv.inner = untag_ptr(this_ptr);
25319 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25320 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25321 this_ptr_conv.is_owned = false;
25322 void* val_ptr = untag_ptr(val);
25323 CHECK_ACCESS(val_ptr);
25324 LDKCOption_u16Z val_conv = *(LDKCOption_u16Z*)(val_ptr);
25325 val_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(val));
25326 ChannelDetails_set_force_close_spend_delay(&this_ptr_conv, val_conv);
25329 jboolean __attribute__((export_name("TS_ChannelDetails_get_is_outbound"))) TS_ChannelDetails_get_is_outbound(uint64_t this_ptr) {
25330 LDKChannelDetails this_ptr_conv;
25331 this_ptr_conv.inner = untag_ptr(this_ptr);
25332 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25333 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25334 this_ptr_conv.is_owned = false;
25335 jboolean ret_conv = ChannelDetails_get_is_outbound(&this_ptr_conv);
25339 void __attribute__((export_name("TS_ChannelDetails_set_is_outbound"))) TS_ChannelDetails_set_is_outbound(uint64_t this_ptr, jboolean val) {
25340 LDKChannelDetails this_ptr_conv;
25341 this_ptr_conv.inner = untag_ptr(this_ptr);
25342 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25343 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25344 this_ptr_conv.is_owned = false;
25345 ChannelDetails_set_is_outbound(&this_ptr_conv, val);
25348 jboolean __attribute__((export_name("TS_ChannelDetails_get_is_channel_ready"))) TS_ChannelDetails_get_is_channel_ready(uint64_t this_ptr) {
25349 LDKChannelDetails this_ptr_conv;
25350 this_ptr_conv.inner = untag_ptr(this_ptr);
25351 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25352 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25353 this_ptr_conv.is_owned = false;
25354 jboolean ret_conv = ChannelDetails_get_is_channel_ready(&this_ptr_conv);
25358 void __attribute__((export_name("TS_ChannelDetails_set_is_channel_ready"))) TS_ChannelDetails_set_is_channel_ready(uint64_t this_ptr, jboolean val) {
25359 LDKChannelDetails this_ptr_conv;
25360 this_ptr_conv.inner = untag_ptr(this_ptr);
25361 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25362 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25363 this_ptr_conv.is_owned = false;
25364 ChannelDetails_set_is_channel_ready(&this_ptr_conv, val);
25367 jboolean __attribute__((export_name("TS_ChannelDetails_get_is_usable"))) TS_ChannelDetails_get_is_usable(uint64_t this_ptr) {
25368 LDKChannelDetails this_ptr_conv;
25369 this_ptr_conv.inner = untag_ptr(this_ptr);
25370 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25371 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25372 this_ptr_conv.is_owned = false;
25373 jboolean ret_conv = ChannelDetails_get_is_usable(&this_ptr_conv);
25377 void __attribute__((export_name("TS_ChannelDetails_set_is_usable"))) TS_ChannelDetails_set_is_usable(uint64_t this_ptr, jboolean val) {
25378 LDKChannelDetails this_ptr_conv;
25379 this_ptr_conv.inner = untag_ptr(this_ptr);
25380 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25381 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25382 this_ptr_conv.is_owned = false;
25383 ChannelDetails_set_is_usable(&this_ptr_conv, val);
25386 jboolean __attribute__((export_name("TS_ChannelDetails_get_is_public"))) TS_ChannelDetails_get_is_public(uint64_t this_ptr) {
25387 LDKChannelDetails this_ptr_conv;
25388 this_ptr_conv.inner = untag_ptr(this_ptr);
25389 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25390 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25391 this_ptr_conv.is_owned = false;
25392 jboolean ret_conv = ChannelDetails_get_is_public(&this_ptr_conv);
25396 void __attribute__((export_name("TS_ChannelDetails_set_is_public"))) TS_ChannelDetails_set_is_public(uint64_t this_ptr, jboolean val) {
25397 LDKChannelDetails this_ptr_conv;
25398 this_ptr_conv.inner = untag_ptr(this_ptr);
25399 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25400 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25401 this_ptr_conv.is_owned = false;
25402 ChannelDetails_set_is_public(&this_ptr_conv, val);
25405 uint64_t __attribute__((export_name("TS_ChannelDetails_get_inbound_htlc_minimum_msat"))) TS_ChannelDetails_get_inbound_htlc_minimum_msat(uint64_t this_ptr) {
25406 LDKChannelDetails this_ptr_conv;
25407 this_ptr_conv.inner = untag_ptr(this_ptr);
25408 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25409 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25410 this_ptr_conv.is_owned = false;
25411 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
25412 *ret_copy = ChannelDetails_get_inbound_htlc_minimum_msat(&this_ptr_conv);
25413 uint64_t ret_ref = tag_ptr(ret_copy, true);
25417 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) {
25418 LDKChannelDetails this_ptr_conv;
25419 this_ptr_conv.inner = untag_ptr(this_ptr);
25420 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25421 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25422 this_ptr_conv.is_owned = false;
25423 void* val_ptr = untag_ptr(val);
25424 CHECK_ACCESS(val_ptr);
25425 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
25426 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
25427 ChannelDetails_set_inbound_htlc_minimum_msat(&this_ptr_conv, val_conv);
25430 uint64_t __attribute__((export_name("TS_ChannelDetails_get_inbound_htlc_maximum_msat"))) TS_ChannelDetails_get_inbound_htlc_maximum_msat(uint64_t this_ptr) {
25431 LDKChannelDetails this_ptr_conv;
25432 this_ptr_conv.inner = untag_ptr(this_ptr);
25433 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25434 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25435 this_ptr_conv.is_owned = false;
25436 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
25437 *ret_copy = ChannelDetails_get_inbound_htlc_maximum_msat(&this_ptr_conv);
25438 uint64_t ret_ref = tag_ptr(ret_copy, true);
25442 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) {
25443 LDKChannelDetails this_ptr_conv;
25444 this_ptr_conv.inner = untag_ptr(this_ptr);
25445 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25446 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25447 this_ptr_conv.is_owned = false;
25448 void* val_ptr = untag_ptr(val);
25449 CHECK_ACCESS(val_ptr);
25450 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
25451 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
25452 ChannelDetails_set_inbound_htlc_maximum_msat(&this_ptr_conv, val_conv);
25455 uint64_t __attribute__((export_name("TS_ChannelDetails_get_config"))) TS_ChannelDetails_get_config(uint64_t this_ptr) {
25456 LDKChannelDetails this_ptr_conv;
25457 this_ptr_conv.inner = untag_ptr(this_ptr);
25458 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25459 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25460 this_ptr_conv.is_owned = false;
25461 LDKChannelConfig ret_var = ChannelDetails_get_config(&this_ptr_conv);
25462 uint64_t ret_ref = 0;
25463 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25464 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25468 void __attribute__((export_name("TS_ChannelDetails_set_config"))) TS_ChannelDetails_set_config(uint64_t this_ptr, uint64_t val) {
25469 LDKChannelDetails this_ptr_conv;
25470 this_ptr_conv.inner = untag_ptr(this_ptr);
25471 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25472 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25473 this_ptr_conv.is_owned = false;
25474 LDKChannelConfig val_conv;
25475 val_conv.inner = untag_ptr(val);
25476 val_conv.is_owned = ptr_is_owned(val);
25477 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
25478 val_conv = ChannelConfig_clone(&val_conv);
25479 ChannelDetails_set_config(&this_ptr_conv, val_conv);
25482 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) {
25483 LDKThirtyTwoBytes channel_id_arg_ref;
25484 CHECK(channel_id_arg->arr_len == 32);
25485 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
25486 LDKChannelCounterparty counterparty_arg_conv;
25487 counterparty_arg_conv.inner = untag_ptr(counterparty_arg);
25488 counterparty_arg_conv.is_owned = ptr_is_owned(counterparty_arg);
25489 CHECK_INNER_FIELD_ACCESS_OR_NULL(counterparty_arg_conv);
25490 counterparty_arg_conv = ChannelCounterparty_clone(&counterparty_arg_conv);
25491 LDKOutPoint funding_txo_arg_conv;
25492 funding_txo_arg_conv.inner = untag_ptr(funding_txo_arg);
25493 funding_txo_arg_conv.is_owned = ptr_is_owned(funding_txo_arg);
25494 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_arg_conv);
25495 funding_txo_arg_conv = OutPoint_clone(&funding_txo_arg_conv);
25496 LDKChannelTypeFeatures channel_type_arg_conv;
25497 channel_type_arg_conv.inner = untag_ptr(channel_type_arg);
25498 channel_type_arg_conv.is_owned = ptr_is_owned(channel_type_arg);
25499 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_arg_conv);
25500 channel_type_arg_conv = ChannelTypeFeatures_clone(&channel_type_arg_conv);
25501 void* short_channel_id_arg_ptr = untag_ptr(short_channel_id_arg);
25502 CHECK_ACCESS(short_channel_id_arg_ptr);
25503 LDKCOption_u64Z short_channel_id_arg_conv = *(LDKCOption_u64Z*)(short_channel_id_arg_ptr);
25504 short_channel_id_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id_arg));
25505 void* outbound_scid_alias_arg_ptr = untag_ptr(outbound_scid_alias_arg);
25506 CHECK_ACCESS(outbound_scid_alias_arg_ptr);
25507 LDKCOption_u64Z outbound_scid_alias_arg_conv = *(LDKCOption_u64Z*)(outbound_scid_alias_arg_ptr);
25508 outbound_scid_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_scid_alias_arg));
25509 void* inbound_scid_alias_arg_ptr = untag_ptr(inbound_scid_alias_arg);
25510 CHECK_ACCESS(inbound_scid_alias_arg_ptr);
25511 LDKCOption_u64Z inbound_scid_alias_arg_conv = *(LDKCOption_u64Z*)(inbound_scid_alias_arg_ptr);
25512 inbound_scid_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(inbound_scid_alias_arg));
25513 void* unspendable_punishment_reserve_arg_ptr = untag_ptr(unspendable_punishment_reserve_arg);
25514 CHECK_ACCESS(unspendable_punishment_reserve_arg_ptr);
25515 LDKCOption_u64Z unspendable_punishment_reserve_arg_conv = *(LDKCOption_u64Z*)(unspendable_punishment_reserve_arg_ptr);
25516 void* confirmations_required_arg_ptr = untag_ptr(confirmations_required_arg);
25517 CHECK_ACCESS(confirmations_required_arg_ptr);
25518 LDKCOption_u32Z confirmations_required_arg_conv = *(LDKCOption_u32Z*)(confirmations_required_arg_ptr);
25519 confirmations_required_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(confirmations_required_arg));
25520 void* force_close_spend_delay_arg_ptr = untag_ptr(force_close_spend_delay_arg);
25521 CHECK_ACCESS(force_close_spend_delay_arg_ptr);
25522 LDKCOption_u16Z force_close_spend_delay_arg_conv = *(LDKCOption_u16Z*)(force_close_spend_delay_arg_ptr);
25523 force_close_spend_delay_arg_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(force_close_spend_delay_arg));
25524 void* inbound_htlc_minimum_msat_arg_ptr = untag_ptr(inbound_htlc_minimum_msat_arg);
25525 CHECK_ACCESS(inbound_htlc_minimum_msat_arg_ptr);
25526 LDKCOption_u64Z inbound_htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(inbound_htlc_minimum_msat_arg_ptr);
25527 inbound_htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(inbound_htlc_minimum_msat_arg));
25528 void* inbound_htlc_maximum_msat_arg_ptr = untag_ptr(inbound_htlc_maximum_msat_arg);
25529 CHECK_ACCESS(inbound_htlc_maximum_msat_arg_ptr);
25530 LDKCOption_u64Z inbound_htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(inbound_htlc_maximum_msat_arg_ptr);
25531 inbound_htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(inbound_htlc_maximum_msat_arg));
25532 LDKChannelConfig config_arg_conv;
25533 config_arg_conv.inner = untag_ptr(config_arg);
25534 config_arg_conv.is_owned = ptr_is_owned(config_arg);
25535 CHECK_INNER_FIELD_ACCESS_OR_NULL(config_arg_conv);
25536 config_arg_conv = ChannelConfig_clone(&config_arg_conv);
25537 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);
25538 uint64_t ret_ref = 0;
25539 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25540 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25544 static inline uint64_t ChannelDetails_clone_ptr(LDKChannelDetails *NONNULL_PTR arg) {
25545 LDKChannelDetails ret_var = ChannelDetails_clone(arg);
25546 uint64_t ret_ref = 0;
25547 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25548 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25551 int64_t __attribute__((export_name("TS_ChannelDetails_clone_ptr"))) TS_ChannelDetails_clone_ptr(uint64_t arg) {
25552 LDKChannelDetails arg_conv;
25553 arg_conv.inner = untag_ptr(arg);
25554 arg_conv.is_owned = ptr_is_owned(arg);
25555 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
25556 arg_conv.is_owned = false;
25557 int64_t ret_conv = ChannelDetails_clone_ptr(&arg_conv);
25561 uint64_t __attribute__((export_name("TS_ChannelDetails_clone"))) TS_ChannelDetails_clone(uint64_t orig) {
25562 LDKChannelDetails orig_conv;
25563 orig_conv.inner = untag_ptr(orig);
25564 orig_conv.is_owned = ptr_is_owned(orig);
25565 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
25566 orig_conv.is_owned = false;
25567 LDKChannelDetails ret_var = ChannelDetails_clone(&orig_conv);
25568 uint64_t ret_ref = 0;
25569 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25570 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25574 uint64_t __attribute__((export_name("TS_ChannelDetails_get_inbound_payment_scid"))) TS_ChannelDetails_get_inbound_payment_scid(uint64_t this_arg) {
25575 LDKChannelDetails this_arg_conv;
25576 this_arg_conv.inner = untag_ptr(this_arg);
25577 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25578 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25579 this_arg_conv.is_owned = false;
25580 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
25581 *ret_copy = ChannelDetails_get_inbound_payment_scid(&this_arg_conv);
25582 uint64_t ret_ref = tag_ptr(ret_copy, true);
25586 uint64_t __attribute__((export_name("TS_ChannelDetails_get_outbound_payment_scid"))) TS_ChannelDetails_get_outbound_payment_scid(uint64_t this_arg) {
25587 LDKChannelDetails this_arg_conv;
25588 this_arg_conv.inner = untag_ptr(this_arg);
25589 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25590 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25591 this_arg_conv.is_owned = false;
25592 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
25593 *ret_copy = ChannelDetails_get_outbound_payment_scid(&this_arg_conv);
25594 uint64_t ret_ref = tag_ptr(ret_copy, true);
25598 void __attribute__((export_name("TS_PaymentSendFailure_free"))) TS_PaymentSendFailure_free(uint64_t this_ptr) {
25599 if (!ptr_is_owned(this_ptr)) return;
25600 void* this_ptr_ptr = untag_ptr(this_ptr);
25601 CHECK_ACCESS(this_ptr_ptr);
25602 LDKPaymentSendFailure this_ptr_conv = *(LDKPaymentSendFailure*)(this_ptr_ptr);
25603 FREE(untag_ptr(this_ptr));
25604 PaymentSendFailure_free(this_ptr_conv);
25607 static inline uint64_t PaymentSendFailure_clone_ptr(LDKPaymentSendFailure *NONNULL_PTR arg) {
25608 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
25609 *ret_copy = PaymentSendFailure_clone(arg);
25610 uint64_t ret_ref = tag_ptr(ret_copy, true);
25613 int64_t __attribute__((export_name("TS_PaymentSendFailure_clone_ptr"))) TS_PaymentSendFailure_clone_ptr(uint64_t arg) {
25614 LDKPaymentSendFailure* arg_conv = (LDKPaymentSendFailure*)untag_ptr(arg);
25615 int64_t ret_conv = PaymentSendFailure_clone_ptr(arg_conv);
25619 uint64_t __attribute__((export_name("TS_PaymentSendFailure_clone"))) TS_PaymentSendFailure_clone(uint64_t orig) {
25620 LDKPaymentSendFailure* orig_conv = (LDKPaymentSendFailure*)untag_ptr(orig);
25621 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
25622 *ret_copy = PaymentSendFailure_clone(orig_conv);
25623 uint64_t ret_ref = tag_ptr(ret_copy, true);
25627 uint64_t __attribute__((export_name("TS_PaymentSendFailure_parameter_error"))) TS_PaymentSendFailure_parameter_error(uint64_t a) {
25628 void* a_ptr = untag_ptr(a);
25629 CHECK_ACCESS(a_ptr);
25630 LDKAPIError a_conv = *(LDKAPIError*)(a_ptr);
25631 a_conv = APIError_clone((LDKAPIError*)untag_ptr(a));
25632 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
25633 *ret_copy = PaymentSendFailure_parameter_error(a_conv);
25634 uint64_t ret_ref = tag_ptr(ret_copy, true);
25638 uint64_t __attribute__((export_name("TS_PaymentSendFailure_path_parameter_error"))) TS_PaymentSendFailure_path_parameter_error(uint64_tArray a) {
25639 LDKCVec_CResult_NoneAPIErrorZZ a_constr;
25640 a_constr.datalen = a->arr_len;
25641 if (a_constr.datalen > 0)
25642 a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
25644 a_constr.data = NULL;
25645 uint64_t* a_vals = a->elems;
25646 for (size_t w = 0; w < a_constr.datalen; w++) {
25647 uint64_t a_conv_22 = a_vals[w];
25648 void* a_conv_22_ptr = untag_ptr(a_conv_22);
25649 CHECK_ACCESS(a_conv_22_ptr);
25650 LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(a_conv_22_ptr);
25651 a_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)untag_ptr(a_conv_22));
25652 a_constr.data[w] = a_conv_22_conv;
25655 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
25656 *ret_copy = PaymentSendFailure_path_parameter_error(a_constr);
25657 uint64_t ret_ref = tag_ptr(ret_copy, true);
25661 uint64_t __attribute__((export_name("TS_PaymentSendFailure_all_failed_retry_safe"))) TS_PaymentSendFailure_all_failed_retry_safe(uint64_tArray a) {
25662 LDKCVec_APIErrorZ a_constr;
25663 a_constr.datalen = a->arr_len;
25664 if (a_constr.datalen > 0)
25665 a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKAPIError), "LDKCVec_APIErrorZ Elements");
25667 a_constr.data = NULL;
25668 uint64_t* a_vals = a->elems;
25669 for (size_t k = 0; k < a_constr.datalen; k++) {
25670 uint64_t a_conv_10 = a_vals[k];
25671 void* a_conv_10_ptr = untag_ptr(a_conv_10);
25672 CHECK_ACCESS(a_conv_10_ptr);
25673 LDKAPIError a_conv_10_conv = *(LDKAPIError*)(a_conv_10_ptr);
25674 a_conv_10_conv = APIError_clone((LDKAPIError*)untag_ptr(a_conv_10));
25675 a_constr.data[k] = a_conv_10_conv;
25678 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
25679 *ret_copy = PaymentSendFailure_all_failed_retry_safe(a_constr);
25680 uint64_t ret_ref = tag_ptr(ret_copy, true);
25684 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) {
25685 LDKCVec_CResult_NoneAPIErrorZZ results_constr;
25686 results_constr.datalen = results->arr_len;
25687 if (results_constr.datalen > 0)
25688 results_constr.data = MALLOC(results_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
25690 results_constr.data = NULL;
25691 uint64_t* results_vals = results->elems;
25692 for (size_t w = 0; w < results_constr.datalen; w++) {
25693 uint64_t results_conv_22 = results_vals[w];
25694 void* results_conv_22_ptr = untag_ptr(results_conv_22);
25695 CHECK_ACCESS(results_conv_22_ptr);
25696 LDKCResult_NoneAPIErrorZ results_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(results_conv_22_ptr);
25697 results_constr.data[w] = results_conv_22_conv;
25700 LDKRouteParameters failed_paths_retry_conv;
25701 failed_paths_retry_conv.inner = untag_ptr(failed_paths_retry);
25702 failed_paths_retry_conv.is_owned = ptr_is_owned(failed_paths_retry);
25703 CHECK_INNER_FIELD_ACCESS_OR_NULL(failed_paths_retry_conv);
25704 failed_paths_retry_conv = RouteParameters_clone(&failed_paths_retry_conv);
25705 LDKThirtyTwoBytes payment_id_ref;
25706 CHECK(payment_id->arr_len == 32);
25707 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
25708 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
25709 *ret_copy = PaymentSendFailure_partial_failure(results_constr, failed_paths_retry_conv, payment_id_ref);
25710 uint64_t ret_ref = tag_ptr(ret_copy, true);
25714 void __attribute__((export_name("TS_PhantomRouteHints_free"))) TS_PhantomRouteHints_free(uint64_t this_obj) {
25715 LDKPhantomRouteHints this_obj_conv;
25716 this_obj_conv.inner = untag_ptr(this_obj);
25717 this_obj_conv.is_owned = ptr_is_owned(this_obj);
25718 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
25719 PhantomRouteHints_free(this_obj_conv);
25722 uint64_tArray __attribute__((export_name("TS_PhantomRouteHints_get_channels"))) TS_PhantomRouteHints_get_channels(uint64_t this_ptr) {
25723 LDKPhantomRouteHints this_ptr_conv;
25724 this_ptr_conv.inner = untag_ptr(this_ptr);
25725 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25726 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25727 this_ptr_conv.is_owned = false;
25728 LDKCVec_ChannelDetailsZ ret_var = PhantomRouteHints_get_channels(&this_ptr_conv);
25729 uint64_tArray ret_arr = NULL;
25730 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
25731 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
25732 for (size_t q = 0; q < ret_var.datalen; q++) {
25733 LDKChannelDetails ret_conv_16_var = ret_var.data[q];
25734 uint64_t ret_conv_16_ref = 0;
25735 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
25736 ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned);
25737 ret_arr_ptr[q] = ret_conv_16_ref;
25740 FREE(ret_var.data);
25744 void __attribute__((export_name("TS_PhantomRouteHints_set_channels"))) TS_PhantomRouteHints_set_channels(uint64_t this_ptr, uint64_tArray val) {
25745 LDKPhantomRouteHints this_ptr_conv;
25746 this_ptr_conv.inner = untag_ptr(this_ptr);
25747 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25748 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25749 this_ptr_conv.is_owned = false;
25750 LDKCVec_ChannelDetailsZ val_constr;
25751 val_constr.datalen = val->arr_len;
25752 if (val_constr.datalen > 0)
25753 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
25755 val_constr.data = NULL;
25756 uint64_t* val_vals = val->elems;
25757 for (size_t q = 0; q < val_constr.datalen; q++) {
25758 uint64_t val_conv_16 = val_vals[q];
25759 LDKChannelDetails val_conv_16_conv;
25760 val_conv_16_conv.inner = untag_ptr(val_conv_16);
25761 val_conv_16_conv.is_owned = ptr_is_owned(val_conv_16);
25762 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_16_conv);
25763 val_conv_16_conv = ChannelDetails_clone(&val_conv_16_conv);
25764 val_constr.data[q] = val_conv_16_conv;
25767 PhantomRouteHints_set_channels(&this_ptr_conv, val_constr);
25770 int64_t __attribute__((export_name("TS_PhantomRouteHints_get_phantom_scid"))) TS_PhantomRouteHints_get_phantom_scid(uint64_t this_ptr) {
25771 LDKPhantomRouteHints this_ptr_conv;
25772 this_ptr_conv.inner = untag_ptr(this_ptr);
25773 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25774 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25775 this_ptr_conv.is_owned = false;
25776 int64_t ret_conv = PhantomRouteHints_get_phantom_scid(&this_ptr_conv);
25780 void __attribute__((export_name("TS_PhantomRouteHints_set_phantom_scid"))) TS_PhantomRouteHints_set_phantom_scid(uint64_t this_ptr, int64_t val) {
25781 LDKPhantomRouteHints this_ptr_conv;
25782 this_ptr_conv.inner = untag_ptr(this_ptr);
25783 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25784 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25785 this_ptr_conv.is_owned = false;
25786 PhantomRouteHints_set_phantom_scid(&this_ptr_conv, val);
25789 int8_tArray __attribute__((export_name("TS_PhantomRouteHints_get_real_node_pubkey"))) TS_PhantomRouteHints_get_real_node_pubkey(uint64_t this_ptr) {
25790 LDKPhantomRouteHints this_ptr_conv;
25791 this_ptr_conv.inner = untag_ptr(this_ptr);
25792 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25793 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25794 this_ptr_conv.is_owned = false;
25795 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
25796 memcpy(ret_arr->elems, PhantomRouteHints_get_real_node_pubkey(&this_ptr_conv).compressed_form, 33);
25800 void __attribute__((export_name("TS_PhantomRouteHints_set_real_node_pubkey"))) TS_PhantomRouteHints_set_real_node_pubkey(uint64_t this_ptr, int8_tArray val) {
25801 LDKPhantomRouteHints this_ptr_conv;
25802 this_ptr_conv.inner = untag_ptr(this_ptr);
25803 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25804 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25805 this_ptr_conv.is_owned = false;
25806 LDKPublicKey val_ref;
25807 CHECK(val->arr_len == 33);
25808 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
25809 PhantomRouteHints_set_real_node_pubkey(&this_ptr_conv, val_ref);
25812 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) {
25813 LDKCVec_ChannelDetailsZ channels_arg_constr;
25814 channels_arg_constr.datalen = channels_arg->arr_len;
25815 if (channels_arg_constr.datalen > 0)
25816 channels_arg_constr.data = MALLOC(channels_arg_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
25818 channels_arg_constr.data = NULL;
25819 uint64_t* channels_arg_vals = channels_arg->elems;
25820 for (size_t q = 0; q < channels_arg_constr.datalen; q++) {
25821 uint64_t channels_arg_conv_16 = channels_arg_vals[q];
25822 LDKChannelDetails channels_arg_conv_16_conv;
25823 channels_arg_conv_16_conv.inner = untag_ptr(channels_arg_conv_16);
25824 channels_arg_conv_16_conv.is_owned = ptr_is_owned(channels_arg_conv_16);
25825 CHECK_INNER_FIELD_ACCESS_OR_NULL(channels_arg_conv_16_conv);
25826 channels_arg_conv_16_conv = ChannelDetails_clone(&channels_arg_conv_16_conv);
25827 channels_arg_constr.data[q] = channels_arg_conv_16_conv;
25829 FREE(channels_arg);
25830 LDKPublicKey real_node_pubkey_arg_ref;
25831 CHECK(real_node_pubkey_arg->arr_len == 33);
25832 memcpy(real_node_pubkey_arg_ref.compressed_form, real_node_pubkey_arg->elems, 33); FREE(real_node_pubkey_arg);
25833 LDKPhantomRouteHints ret_var = PhantomRouteHints_new(channels_arg_constr, phantom_scid_arg, real_node_pubkey_arg_ref);
25834 uint64_t ret_ref = 0;
25835 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25836 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25840 static inline uint64_t PhantomRouteHints_clone_ptr(LDKPhantomRouteHints *NONNULL_PTR arg) {
25841 LDKPhantomRouteHints ret_var = PhantomRouteHints_clone(arg);
25842 uint64_t ret_ref = 0;
25843 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25844 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25847 int64_t __attribute__((export_name("TS_PhantomRouteHints_clone_ptr"))) TS_PhantomRouteHints_clone_ptr(uint64_t arg) {
25848 LDKPhantomRouteHints arg_conv;
25849 arg_conv.inner = untag_ptr(arg);
25850 arg_conv.is_owned = ptr_is_owned(arg);
25851 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
25852 arg_conv.is_owned = false;
25853 int64_t ret_conv = PhantomRouteHints_clone_ptr(&arg_conv);
25857 uint64_t __attribute__((export_name("TS_PhantomRouteHints_clone"))) TS_PhantomRouteHints_clone(uint64_t orig) {
25858 LDKPhantomRouteHints orig_conv;
25859 orig_conv.inner = untag_ptr(orig);
25860 orig_conv.is_owned = ptr_is_owned(orig);
25861 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
25862 orig_conv.is_owned = false;
25863 LDKPhantomRouteHints ret_var = PhantomRouteHints_clone(&orig_conv);
25864 uint64_t ret_ref = 0;
25865 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25866 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25870 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) {
25871 void* fee_est_ptr = untag_ptr(fee_est);
25872 CHECK_ACCESS(fee_est_ptr);
25873 LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)(fee_est_ptr);
25874 if (fee_est_conv.free == LDKFeeEstimator_JCalls_free) {
25875 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
25876 LDKFeeEstimator_JCalls_cloned(&fee_est_conv);
25878 void* chain_monitor_ptr = untag_ptr(chain_monitor);
25879 CHECK_ACCESS(chain_monitor_ptr);
25880 LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr);
25881 if (chain_monitor_conv.free == LDKWatch_JCalls_free) {
25882 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
25883 LDKWatch_JCalls_cloned(&chain_monitor_conv);
25885 void* tx_broadcaster_ptr = untag_ptr(tx_broadcaster);
25886 CHECK_ACCESS(tx_broadcaster_ptr);
25887 LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr);
25888 if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
25889 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
25890 LDKBroadcasterInterface_JCalls_cloned(&tx_broadcaster_conv);
25892 void* logger_ptr = untag_ptr(logger);
25893 CHECK_ACCESS(logger_ptr);
25894 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
25895 if (logger_conv.free == LDKLogger_JCalls_free) {
25896 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
25897 LDKLogger_JCalls_cloned(&logger_conv);
25899 void* keys_manager_ptr = untag_ptr(keys_manager);
25900 CHECK_ACCESS(keys_manager_ptr);
25901 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
25902 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
25903 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
25904 LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
25906 LDKUserConfig config_conv;
25907 config_conv.inner = untag_ptr(config);
25908 config_conv.is_owned = ptr_is_owned(config);
25909 CHECK_INNER_FIELD_ACCESS_OR_NULL(config_conv);
25910 config_conv = UserConfig_clone(&config_conv);
25911 LDKChainParameters params_conv;
25912 params_conv.inner = untag_ptr(params);
25913 params_conv.is_owned = ptr_is_owned(params);
25914 CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv);
25915 params_conv = ChainParameters_clone(¶ms_conv);
25916 LDKChannelManager ret_var = ChannelManager_new(fee_est_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, keys_manager_conv, config_conv, params_conv);
25917 uint64_t ret_ref = 0;
25918 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25919 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25923 uint64_t __attribute__((export_name("TS_ChannelManager_get_current_default_configuration"))) TS_ChannelManager_get_current_default_configuration(uint64_t this_arg) {
25924 LDKChannelManager this_arg_conv;
25925 this_arg_conv.inner = untag_ptr(this_arg);
25926 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25927 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25928 this_arg_conv.is_owned = false;
25929 LDKUserConfig ret_var = ChannelManager_get_current_default_configuration(&this_arg_conv);
25930 uint64_t ret_ref = 0;
25931 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25932 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25936 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) {
25937 LDKChannelManager this_arg_conv;
25938 this_arg_conv.inner = untag_ptr(this_arg);
25939 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25940 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25941 this_arg_conv.is_owned = false;
25942 LDKPublicKey their_network_key_ref;
25943 CHECK(their_network_key->arr_len == 33);
25944 memcpy(their_network_key_ref.compressed_form, their_network_key->elems, 33); FREE(their_network_key);
25945 LDKUserConfig override_config_conv;
25946 override_config_conv.inner = untag_ptr(override_config);
25947 override_config_conv.is_owned = ptr_is_owned(override_config);
25948 CHECK_INNER_FIELD_ACCESS_OR_NULL(override_config_conv);
25949 override_config_conv = UserConfig_clone(&override_config_conv);
25950 LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
25951 *ret_conv = ChannelManager_create_channel(&this_arg_conv, their_network_key_ref, channel_value_satoshis, push_msat, user_channel_id, override_config_conv);
25952 return tag_ptr(ret_conv, true);
25955 uint64_tArray __attribute__((export_name("TS_ChannelManager_list_channels"))) TS_ChannelManager_list_channels(uint64_t this_arg) {
25956 LDKChannelManager this_arg_conv;
25957 this_arg_conv.inner = untag_ptr(this_arg);
25958 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25959 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25960 this_arg_conv.is_owned = false;
25961 LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_channels(&this_arg_conv);
25962 uint64_tArray ret_arr = NULL;
25963 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
25964 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
25965 for (size_t q = 0; q < ret_var.datalen; q++) {
25966 LDKChannelDetails ret_conv_16_var = ret_var.data[q];
25967 uint64_t ret_conv_16_ref = 0;
25968 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
25969 ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned);
25970 ret_arr_ptr[q] = ret_conv_16_ref;
25973 FREE(ret_var.data);
25977 uint64_tArray __attribute__((export_name("TS_ChannelManager_list_usable_channels"))) TS_ChannelManager_list_usable_channels(uint64_t this_arg) {
25978 LDKChannelManager this_arg_conv;
25979 this_arg_conv.inner = untag_ptr(this_arg);
25980 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25981 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25982 this_arg_conv.is_owned = false;
25983 LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_usable_channels(&this_arg_conv);
25984 uint64_tArray ret_arr = NULL;
25985 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
25986 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
25987 for (size_t q = 0; q < ret_var.datalen; q++) {
25988 LDKChannelDetails ret_conv_16_var = ret_var.data[q];
25989 uint64_t ret_conv_16_ref = 0;
25990 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
25991 ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned);
25992 ret_arr_ptr[q] = ret_conv_16_ref;
25995 FREE(ret_var.data);
25999 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) {
26000 LDKChannelManager this_arg_conv;
26001 this_arg_conv.inner = untag_ptr(this_arg);
26002 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26003 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26004 this_arg_conv.is_owned = false;
26005 unsigned char channel_id_arr[32];
26006 CHECK(channel_id->arr_len == 32);
26007 memcpy(channel_id_arr, channel_id->elems, 32); FREE(channel_id);
26008 unsigned char (*channel_id_ref)[32] = &channel_id_arr;
26009 LDKPublicKey counterparty_node_id_ref;
26010 CHECK(counterparty_node_id->arr_len == 33);
26011 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
26012 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
26013 *ret_conv = ChannelManager_close_channel(&this_arg_conv, channel_id_ref, counterparty_node_id_ref);
26014 return tag_ptr(ret_conv, true);
26017 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) {
26018 LDKChannelManager this_arg_conv;
26019 this_arg_conv.inner = untag_ptr(this_arg);
26020 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26021 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26022 this_arg_conv.is_owned = false;
26023 unsigned char channel_id_arr[32];
26024 CHECK(channel_id->arr_len == 32);
26025 memcpy(channel_id_arr, channel_id->elems, 32); FREE(channel_id);
26026 unsigned char (*channel_id_ref)[32] = &channel_id_arr;
26027 LDKPublicKey counterparty_node_id_ref;
26028 CHECK(counterparty_node_id->arr_len == 33);
26029 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
26030 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
26031 *ret_conv = ChannelManager_close_channel_with_target_feerate(&this_arg_conv, channel_id_ref, counterparty_node_id_ref, target_feerate_sats_per_1000_weight);
26032 return tag_ptr(ret_conv, true);
26035 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) {
26036 LDKChannelManager this_arg_conv;
26037 this_arg_conv.inner = untag_ptr(this_arg);
26038 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26039 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26040 this_arg_conv.is_owned = false;
26041 unsigned char channel_id_arr[32];
26042 CHECK(channel_id->arr_len == 32);
26043 memcpy(channel_id_arr, channel_id->elems, 32); FREE(channel_id);
26044 unsigned char (*channel_id_ref)[32] = &channel_id_arr;
26045 LDKPublicKey counterparty_node_id_ref;
26046 CHECK(counterparty_node_id->arr_len == 33);
26047 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
26048 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
26049 *ret_conv = ChannelManager_force_close_broadcasting_latest_txn(&this_arg_conv, channel_id_ref, counterparty_node_id_ref);
26050 return tag_ptr(ret_conv, true);
26053 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) {
26054 LDKChannelManager this_arg_conv;
26055 this_arg_conv.inner = untag_ptr(this_arg);
26056 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26057 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26058 this_arg_conv.is_owned = false;
26059 unsigned char channel_id_arr[32];
26060 CHECK(channel_id->arr_len == 32);
26061 memcpy(channel_id_arr, channel_id->elems, 32); FREE(channel_id);
26062 unsigned char (*channel_id_ref)[32] = &channel_id_arr;
26063 LDKPublicKey counterparty_node_id_ref;
26064 CHECK(counterparty_node_id->arr_len == 33);
26065 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
26066 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
26067 *ret_conv = ChannelManager_force_close_without_broadcasting_txn(&this_arg_conv, channel_id_ref, counterparty_node_id_ref);
26068 return tag_ptr(ret_conv, true);
26071 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) {
26072 LDKChannelManager this_arg_conv;
26073 this_arg_conv.inner = untag_ptr(this_arg);
26074 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26075 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26076 this_arg_conv.is_owned = false;
26077 ChannelManager_force_close_all_channels_broadcasting_latest_txn(&this_arg_conv);
26080 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) {
26081 LDKChannelManager this_arg_conv;
26082 this_arg_conv.inner = untag_ptr(this_arg);
26083 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26084 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26085 this_arg_conv.is_owned = false;
26086 ChannelManager_force_close_all_channels_without_broadcasting_txn(&this_arg_conv);
26089 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) {
26090 LDKChannelManager this_arg_conv;
26091 this_arg_conv.inner = untag_ptr(this_arg);
26092 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26093 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26094 this_arg_conv.is_owned = false;
26095 LDKRoute route_conv;
26096 route_conv.inner = untag_ptr(route);
26097 route_conv.is_owned = ptr_is_owned(route);
26098 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
26099 route_conv.is_owned = false;
26100 LDKThirtyTwoBytes payment_hash_ref;
26101 CHECK(payment_hash->arr_len == 32);
26102 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
26103 LDKThirtyTwoBytes payment_secret_ref;
26104 CHECK(payment_secret->arr_len == 32);
26105 memcpy(payment_secret_ref.data, payment_secret->elems, 32); FREE(payment_secret);
26106 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
26107 *ret_conv = ChannelManager_send_payment(&this_arg_conv, &route_conv, payment_hash_ref, payment_secret_ref);
26108 return tag_ptr(ret_conv, true);
26111 uint64_t __attribute__((export_name("TS_ChannelManager_retry_payment"))) TS_ChannelManager_retry_payment(uint64_t this_arg, uint64_t route, int8_tArray payment_id) {
26112 LDKChannelManager this_arg_conv;
26113 this_arg_conv.inner = untag_ptr(this_arg);
26114 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26115 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26116 this_arg_conv.is_owned = false;
26117 LDKRoute route_conv;
26118 route_conv.inner = untag_ptr(route);
26119 route_conv.is_owned = ptr_is_owned(route);
26120 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
26121 route_conv.is_owned = false;
26122 LDKThirtyTwoBytes payment_id_ref;
26123 CHECK(payment_id->arr_len == 32);
26124 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
26125 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
26126 *ret_conv = ChannelManager_retry_payment(&this_arg_conv, &route_conv, payment_id_ref);
26127 return tag_ptr(ret_conv, true);
26130 void __attribute__((export_name("TS_ChannelManager_abandon_payment"))) TS_ChannelManager_abandon_payment(uint64_t this_arg, int8_tArray payment_id) {
26131 LDKChannelManager this_arg_conv;
26132 this_arg_conv.inner = untag_ptr(this_arg);
26133 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26134 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26135 this_arg_conv.is_owned = false;
26136 LDKThirtyTwoBytes payment_id_ref;
26137 CHECK(payment_id->arr_len == 32);
26138 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
26139 ChannelManager_abandon_payment(&this_arg_conv, payment_id_ref);
26142 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) {
26143 LDKChannelManager this_arg_conv;
26144 this_arg_conv.inner = untag_ptr(this_arg);
26145 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26146 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26147 this_arg_conv.is_owned = false;
26148 LDKRoute route_conv;
26149 route_conv.inner = untag_ptr(route);
26150 route_conv.is_owned = ptr_is_owned(route);
26151 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
26152 route_conv.is_owned = false;
26153 LDKThirtyTwoBytes payment_preimage_ref;
26154 CHECK(payment_preimage->arr_len == 32);
26155 memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage);
26156 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
26157 *ret_conv = ChannelManager_send_spontaneous_payment(&this_arg_conv, &route_conv, payment_preimage_ref);
26158 return tag_ptr(ret_conv, true);
26161 uint64_t __attribute__((export_name("TS_ChannelManager_send_probe"))) TS_ChannelManager_send_probe(uint64_t this_arg, uint64_tArray hops) {
26162 LDKChannelManager this_arg_conv;
26163 this_arg_conv.inner = untag_ptr(this_arg);
26164 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26165 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26166 this_arg_conv.is_owned = false;
26167 LDKCVec_RouteHopZ hops_constr;
26168 hops_constr.datalen = hops->arr_len;
26169 if (hops_constr.datalen > 0)
26170 hops_constr.data = MALLOC(hops_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
26172 hops_constr.data = NULL;
26173 uint64_t* hops_vals = hops->elems;
26174 for (size_t k = 0; k < hops_constr.datalen; k++) {
26175 uint64_t hops_conv_10 = hops_vals[k];
26176 LDKRouteHop hops_conv_10_conv;
26177 hops_conv_10_conv.inner = untag_ptr(hops_conv_10);
26178 hops_conv_10_conv.is_owned = ptr_is_owned(hops_conv_10);
26179 CHECK_INNER_FIELD_ACCESS_OR_NULL(hops_conv_10_conv);
26180 hops_conv_10_conv = RouteHop_clone(&hops_conv_10_conv);
26181 hops_constr.data[k] = hops_conv_10_conv;
26184 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
26185 *ret_conv = ChannelManager_send_probe(&this_arg_conv, hops_constr);
26186 return tag_ptr(ret_conv, true);
26189 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) {
26190 LDKChannelManager this_arg_conv;
26191 this_arg_conv.inner = untag_ptr(this_arg);
26192 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26193 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26194 this_arg_conv.is_owned = false;
26195 unsigned char temporary_channel_id_arr[32];
26196 CHECK(temporary_channel_id->arr_len == 32);
26197 memcpy(temporary_channel_id_arr, temporary_channel_id->elems, 32); FREE(temporary_channel_id);
26198 unsigned char (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr;
26199 LDKPublicKey counterparty_node_id_ref;
26200 CHECK(counterparty_node_id->arr_len == 33);
26201 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
26202 LDKTransaction funding_transaction_ref;
26203 funding_transaction_ref.datalen = funding_transaction->arr_len;
26204 funding_transaction_ref.data = MALLOC(funding_transaction_ref.datalen, "LDKTransaction Bytes");
26205 memcpy(funding_transaction_ref.data, funding_transaction->elems, funding_transaction_ref.datalen); FREE(funding_transaction);
26206 funding_transaction_ref.data_is_owned = true;
26207 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
26208 *ret_conv = ChannelManager_funding_transaction_generated(&this_arg_conv, temporary_channel_id_ref, counterparty_node_id_ref, funding_transaction_ref);
26209 return tag_ptr(ret_conv, true);
26212 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) {
26213 LDKChannelManager this_arg_conv;
26214 this_arg_conv.inner = untag_ptr(this_arg);
26215 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26216 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26217 this_arg_conv.is_owned = false;
26218 LDKThreeBytes rgb_ref;
26219 CHECK(rgb->arr_len == 3);
26220 memcpy(rgb_ref.data, rgb->elems, 3); FREE(rgb);
26221 LDKThirtyTwoBytes alias_ref;
26222 CHECK(alias->arr_len == 32);
26223 memcpy(alias_ref.data, alias->elems, 32); FREE(alias);
26224 LDKCVec_NetAddressZ addresses_constr;
26225 addresses_constr.datalen = addresses->arr_len;
26226 if (addresses_constr.datalen > 0)
26227 addresses_constr.data = MALLOC(addresses_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
26229 addresses_constr.data = NULL;
26230 uint64_t* addresses_vals = addresses->elems;
26231 for (size_t m = 0; m < addresses_constr.datalen; m++) {
26232 uint64_t addresses_conv_12 = addresses_vals[m];
26233 void* addresses_conv_12_ptr = untag_ptr(addresses_conv_12);
26234 CHECK_ACCESS(addresses_conv_12_ptr);
26235 LDKNetAddress addresses_conv_12_conv = *(LDKNetAddress*)(addresses_conv_12_ptr);
26236 addresses_constr.data[m] = addresses_conv_12_conv;
26239 ChannelManager_broadcast_node_announcement(&this_arg_conv, rgb_ref, alias_ref, addresses_constr);
26242 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) {
26243 LDKChannelManager this_arg_conv;
26244 this_arg_conv.inner = untag_ptr(this_arg);
26245 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26246 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26247 this_arg_conv.is_owned = false;
26248 LDKPublicKey counterparty_node_id_ref;
26249 CHECK(counterparty_node_id->arr_len == 33);
26250 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
26251 LDKCVec_ThirtyTwoBytesZ channel_ids_constr;
26252 channel_ids_constr.datalen = channel_ids->arr_len;
26253 if (channel_ids_constr.datalen > 0)
26254 channel_ids_constr.data = MALLOC(channel_ids_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_ThirtyTwoBytesZ Elements");
26256 channel_ids_constr.data = NULL;
26257 int8_tArray* channel_ids_vals = (void*) channel_ids->elems;
26258 for (size_t m = 0; m < channel_ids_constr.datalen; m++) {
26259 int8_tArray channel_ids_conv_12 = channel_ids_vals[m];
26260 LDKThirtyTwoBytes channel_ids_conv_12_ref;
26261 CHECK(channel_ids_conv_12->arr_len == 32);
26262 memcpy(channel_ids_conv_12_ref.data, channel_ids_conv_12->elems, 32); FREE(channel_ids_conv_12);
26263 channel_ids_constr.data[m] = channel_ids_conv_12_ref;
26266 LDKChannelConfig config_conv;
26267 config_conv.inner = untag_ptr(config);
26268 config_conv.is_owned = ptr_is_owned(config);
26269 CHECK_INNER_FIELD_ACCESS_OR_NULL(config_conv);
26270 config_conv.is_owned = false;
26271 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
26272 *ret_conv = ChannelManager_update_channel_config(&this_arg_conv, counterparty_node_id_ref, channel_ids_constr, &config_conv);
26273 return tag_ptr(ret_conv, true);
26276 void __attribute__((export_name("TS_ChannelManager_process_pending_htlc_forwards"))) TS_ChannelManager_process_pending_htlc_forwards(uint64_t this_arg) {
26277 LDKChannelManager this_arg_conv;
26278 this_arg_conv.inner = untag_ptr(this_arg);
26279 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26280 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26281 this_arg_conv.is_owned = false;
26282 ChannelManager_process_pending_htlc_forwards(&this_arg_conv);
26285 void __attribute__((export_name("TS_ChannelManager_timer_tick_occurred"))) TS_ChannelManager_timer_tick_occurred(uint64_t this_arg) {
26286 LDKChannelManager this_arg_conv;
26287 this_arg_conv.inner = untag_ptr(this_arg);
26288 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26289 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26290 this_arg_conv.is_owned = false;
26291 ChannelManager_timer_tick_occurred(&this_arg_conv);
26294 void __attribute__((export_name("TS_ChannelManager_fail_htlc_backwards"))) TS_ChannelManager_fail_htlc_backwards(uint64_t this_arg, int8_tArray payment_hash) {
26295 LDKChannelManager this_arg_conv;
26296 this_arg_conv.inner = untag_ptr(this_arg);
26297 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26298 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26299 this_arg_conv.is_owned = false;
26300 unsigned char payment_hash_arr[32];
26301 CHECK(payment_hash->arr_len == 32);
26302 memcpy(payment_hash_arr, payment_hash->elems, 32); FREE(payment_hash);
26303 unsigned char (*payment_hash_ref)[32] = &payment_hash_arr;
26304 ChannelManager_fail_htlc_backwards(&this_arg_conv, payment_hash_ref);
26307 void __attribute__((export_name("TS_ChannelManager_claim_funds"))) TS_ChannelManager_claim_funds(uint64_t this_arg, int8_tArray payment_preimage) {
26308 LDKChannelManager this_arg_conv;
26309 this_arg_conv.inner = untag_ptr(this_arg);
26310 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26311 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26312 this_arg_conv.is_owned = false;
26313 LDKThirtyTwoBytes payment_preimage_ref;
26314 CHECK(payment_preimage->arr_len == 32);
26315 memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage);
26316 ChannelManager_claim_funds(&this_arg_conv, payment_preimage_ref);
26319 int8_tArray __attribute__((export_name("TS_ChannelManager_get_our_node_id"))) TS_ChannelManager_get_our_node_id(uint64_t this_arg) {
26320 LDKChannelManager this_arg_conv;
26321 this_arg_conv.inner = untag_ptr(this_arg);
26322 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26323 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26324 this_arg_conv.is_owned = false;
26325 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
26326 memcpy(ret_arr->elems, ChannelManager_get_our_node_id(&this_arg_conv).compressed_form, 33);
26330 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) {
26331 LDKChannelManager this_arg_conv;
26332 this_arg_conv.inner = untag_ptr(this_arg);
26333 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26334 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26335 this_arg_conv.is_owned = false;
26336 unsigned char temporary_channel_id_arr[32];
26337 CHECK(temporary_channel_id->arr_len == 32);
26338 memcpy(temporary_channel_id_arr, temporary_channel_id->elems, 32); FREE(temporary_channel_id);
26339 unsigned char (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr;
26340 LDKPublicKey counterparty_node_id_ref;
26341 CHECK(counterparty_node_id->arr_len == 33);
26342 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
26343 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
26344 *ret_conv = ChannelManager_accept_inbound_channel(&this_arg_conv, temporary_channel_id_ref, counterparty_node_id_ref, user_channel_id);
26345 return tag_ptr(ret_conv, true);
26348 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) {
26349 LDKChannelManager this_arg_conv;
26350 this_arg_conv.inner = untag_ptr(this_arg);
26351 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26352 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26353 this_arg_conv.is_owned = false;
26354 unsigned char temporary_channel_id_arr[32];
26355 CHECK(temporary_channel_id->arr_len == 32);
26356 memcpy(temporary_channel_id_arr, temporary_channel_id->elems, 32); FREE(temporary_channel_id);
26357 unsigned char (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr;
26358 LDKPublicKey counterparty_node_id_ref;
26359 CHECK(counterparty_node_id->arr_len == 33);
26360 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
26361 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
26362 *ret_conv = ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(&this_arg_conv, temporary_channel_id_ref, counterparty_node_id_ref, user_channel_id);
26363 return tag_ptr(ret_conv, true);
26366 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) {
26367 LDKChannelManager this_arg_conv;
26368 this_arg_conv.inner = untag_ptr(this_arg);
26369 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26370 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26371 this_arg_conv.is_owned = false;
26372 void* min_value_msat_ptr = untag_ptr(min_value_msat);
26373 CHECK_ACCESS(min_value_msat_ptr);
26374 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
26375 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
26376 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
26377 *ret_conv = ChannelManager_create_inbound_payment(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs);
26378 return tag_ptr(ret_conv, true);
26381 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) {
26382 LDKChannelManager this_arg_conv;
26383 this_arg_conv.inner = untag_ptr(this_arg);
26384 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26385 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26386 this_arg_conv.is_owned = false;
26387 void* min_value_msat_ptr = untag_ptr(min_value_msat);
26388 CHECK_ACCESS(min_value_msat_ptr);
26389 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
26390 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
26391 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
26392 *ret_conv = ChannelManager_create_inbound_payment_legacy(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs);
26393 return tag_ptr(ret_conv, true);
26396 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) {
26397 LDKChannelManager this_arg_conv;
26398 this_arg_conv.inner = untag_ptr(this_arg);
26399 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26400 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26401 this_arg_conv.is_owned = false;
26402 LDKThirtyTwoBytes payment_hash_ref;
26403 CHECK(payment_hash->arr_len == 32);
26404 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
26405 void* min_value_msat_ptr = untag_ptr(min_value_msat);
26406 CHECK_ACCESS(min_value_msat_ptr);
26407 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
26408 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
26409 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
26410 *ret_conv = ChannelManager_create_inbound_payment_for_hash(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs);
26411 return tag_ptr(ret_conv, true);
26414 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) {
26415 LDKChannelManager this_arg_conv;
26416 this_arg_conv.inner = untag_ptr(this_arg);
26417 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26418 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26419 this_arg_conv.is_owned = false;
26420 LDKThirtyTwoBytes payment_hash_ref;
26421 CHECK(payment_hash->arr_len == 32);
26422 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
26423 void* min_value_msat_ptr = untag_ptr(min_value_msat);
26424 CHECK_ACCESS(min_value_msat_ptr);
26425 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
26426 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
26427 LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
26428 *ret_conv = ChannelManager_create_inbound_payment_for_hash_legacy(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs);
26429 return tag_ptr(ret_conv, true);
26432 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) {
26433 LDKChannelManager this_arg_conv;
26434 this_arg_conv.inner = untag_ptr(this_arg);
26435 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26436 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26437 this_arg_conv.is_owned = false;
26438 LDKThirtyTwoBytes payment_hash_ref;
26439 CHECK(payment_hash->arr_len == 32);
26440 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
26441 LDKThirtyTwoBytes payment_secret_ref;
26442 CHECK(payment_secret->arr_len == 32);
26443 memcpy(payment_secret_ref.data, payment_secret->elems, 32); FREE(payment_secret);
26444 LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
26445 *ret_conv = ChannelManager_get_payment_preimage(&this_arg_conv, payment_hash_ref, payment_secret_ref);
26446 return tag_ptr(ret_conv, true);
26449 int64_t __attribute__((export_name("TS_ChannelManager_get_phantom_scid"))) TS_ChannelManager_get_phantom_scid(uint64_t this_arg) {
26450 LDKChannelManager this_arg_conv;
26451 this_arg_conv.inner = untag_ptr(this_arg);
26452 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26453 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26454 this_arg_conv.is_owned = false;
26455 int64_t ret_conv = ChannelManager_get_phantom_scid(&this_arg_conv);
26459 uint64_t __attribute__((export_name("TS_ChannelManager_get_phantom_route_hints"))) TS_ChannelManager_get_phantom_route_hints(uint64_t this_arg) {
26460 LDKChannelManager this_arg_conv;
26461 this_arg_conv.inner = untag_ptr(this_arg);
26462 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26463 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26464 this_arg_conv.is_owned = false;
26465 LDKPhantomRouteHints ret_var = ChannelManager_get_phantom_route_hints(&this_arg_conv);
26466 uint64_t ret_ref = 0;
26467 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26468 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26472 uint64_t __attribute__((export_name("TS_ChannelManager_as_MessageSendEventsProvider"))) TS_ChannelManager_as_MessageSendEventsProvider(uint64_t this_arg) {
26473 LDKChannelManager this_arg_conv;
26474 this_arg_conv.inner = untag_ptr(this_arg);
26475 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26476 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26477 this_arg_conv.is_owned = false;
26478 LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
26479 *ret_ret = ChannelManager_as_MessageSendEventsProvider(&this_arg_conv);
26480 return tag_ptr(ret_ret, true);
26483 uint64_t __attribute__((export_name("TS_ChannelManager_as_EventsProvider"))) TS_ChannelManager_as_EventsProvider(uint64_t this_arg) {
26484 LDKChannelManager this_arg_conv;
26485 this_arg_conv.inner = untag_ptr(this_arg);
26486 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26487 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26488 this_arg_conv.is_owned = false;
26489 LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
26490 *ret_ret = ChannelManager_as_EventsProvider(&this_arg_conv);
26491 return tag_ptr(ret_ret, true);
26494 uint64_t __attribute__((export_name("TS_ChannelManager_as_Listen"))) TS_ChannelManager_as_Listen(uint64_t this_arg) {
26495 LDKChannelManager this_arg_conv;
26496 this_arg_conv.inner = untag_ptr(this_arg);
26497 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26498 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26499 this_arg_conv.is_owned = false;
26500 LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen");
26501 *ret_ret = ChannelManager_as_Listen(&this_arg_conv);
26502 return tag_ptr(ret_ret, true);
26505 uint64_t __attribute__((export_name("TS_ChannelManager_as_Confirm"))) TS_ChannelManager_as_Confirm(uint64_t this_arg) {
26506 LDKChannelManager this_arg_conv;
26507 this_arg_conv.inner = untag_ptr(this_arg);
26508 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26509 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26510 this_arg_conv.is_owned = false;
26511 LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm");
26512 *ret_ret = ChannelManager_as_Confirm(&this_arg_conv);
26513 return tag_ptr(ret_ret, true);
26516 void __attribute__((export_name("TS_ChannelManager_await_persistable_update"))) TS_ChannelManager_await_persistable_update(uint64_t this_arg) {
26517 LDKChannelManager this_arg_conv;
26518 this_arg_conv.inner = untag_ptr(this_arg);
26519 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26520 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26521 this_arg_conv.is_owned = false;
26522 ChannelManager_await_persistable_update(&this_arg_conv);
26525 uint64_t __attribute__((export_name("TS_ChannelManager_current_best_block"))) TS_ChannelManager_current_best_block(uint64_t this_arg) {
26526 LDKChannelManager this_arg_conv;
26527 this_arg_conv.inner = untag_ptr(this_arg);
26528 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26529 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26530 this_arg_conv.is_owned = false;
26531 LDKBestBlock ret_var = ChannelManager_current_best_block(&this_arg_conv);
26532 uint64_t ret_ref = 0;
26533 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26534 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26538 uint64_t __attribute__((export_name("TS_ChannelManager_as_ChannelMessageHandler"))) TS_ChannelManager_as_ChannelMessageHandler(uint64_t this_arg) {
26539 LDKChannelManager this_arg_conv;
26540 this_arg_conv.inner = untag_ptr(this_arg);
26541 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26542 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26543 this_arg_conv.is_owned = false;
26544 LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
26545 *ret_ret = ChannelManager_as_ChannelMessageHandler(&this_arg_conv);
26546 return tag_ptr(ret_ret, true);
26549 int8_tArray __attribute__((export_name("TS_CounterpartyForwardingInfo_write"))) TS_CounterpartyForwardingInfo_write(uint64_t obj) {
26550 LDKCounterpartyForwardingInfo obj_conv;
26551 obj_conv.inner = untag_ptr(obj);
26552 obj_conv.is_owned = ptr_is_owned(obj);
26553 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
26554 obj_conv.is_owned = false;
26555 LDKCVec_u8Z ret_var = CounterpartyForwardingInfo_write(&obj_conv);
26556 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
26557 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
26558 CVec_u8Z_free(ret_var);
26562 uint64_t __attribute__((export_name("TS_CounterpartyForwardingInfo_read"))) TS_CounterpartyForwardingInfo_read(int8_tArray ser) {
26563 LDKu8slice ser_ref;
26564 ser_ref.datalen = ser->arr_len;
26565 ser_ref.data = ser->elems;
26566 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
26567 *ret_conv = CounterpartyForwardingInfo_read(ser_ref);
26569 return tag_ptr(ret_conv, true);
26572 int8_tArray __attribute__((export_name("TS_ChannelCounterparty_write"))) TS_ChannelCounterparty_write(uint64_t obj) {
26573 LDKChannelCounterparty obj_conv;
26574 obj_conv.inner = untag_ptr(obj);
26575 obj_conv.is_owned = ptr_is_owned(obj);
26576 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
26577 obj_conv.is_owned = false;
26578 LDKCVec_u8Z ret_var = ChannelCounterparty_write(&obj_conv);
26579 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
26580 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
26581 CVec_u8Z_free(ret_var);
26585 uint64_t __attribute__((export_name("TS_ChannelCounterparty_read"))) TS_ChannelCounterparty_read(int8_tArray ser) {
26586 LDKu8slice ser_ref;
26587 ser_ref.datalen = ser->arr_len;
26588 ser_ref.data = ser->elems;
26589 LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
26590 *ret_conv = ChannelCounterparty_read(ser_ref);
26592 return tag_ptr(ret_conv, true);
26595 int8_tArray __attribute__((export_name("TS_ChannelDetails_write"))) TS_ChannelDetails_write(uint64_t obj) {
26596 LDKChannelDetails obj_conv;
26597 obj_conv.inner = untag_ptr(obj);
26598 obj_conv.is_owned = ptr_is_owned(obj);
26599 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
26600 obj_conv.is_owned = false;
26601 LDKCVec_u8Z ret_var = ChannelDetails_write(&obj_conv);
26602 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
26603 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
26604 CVec_u8Z_free(ret_var);
26608 uint64_t __attribute__((export_name("TS_ChannelDetails_read"))) TS_ChannelDetails_read(int8_tArray ser) {
26609 LDKu8slice ser_ref;
26610 ser_ref.datalen = ser->arr_len;
26611 ser_ref.data = ser->elems;
26612 LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
26613 *ret_conv = ChannelDetails_read(ser_ref);
26615 return tag_ptr(ret_conv, true);
26618 int8_tArray __attribute__((export_name("TS_PhantomRouteHints_write"))) TS_PhantomRouteHints_write(uint64_t obj) {
26619 LDKPhantomRouteHints obj_conv;
26620 obj_conv.inner = untag_ptr(obj);
26621 obj_conv.is_owned = ptr_is_owned(obj);
26622 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
26623 obj_conv.is_owned = false;
26624 LDKCVec_u8Z ret_var = PhantomRouteHints_write(&obj_conv);
26625 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
26626 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
26627 CVec_u8Z_free(ret_var);
26631 uint64_t __attribute__((export_name("TS_PhantomRouteHints_read"))) TS_PhantomRouteHints_read(int8_tArray ser) {
26632 LDKu8slice ser_ref;
26633 ser_ref.datalen = ser->arr_len;
26634 ser_ref.data = ser->elems;
26635 LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
26636 *ret_conv = PhantomRouteHints_read(ser_ref);
26638 return tag_ptr(ret_conv, true);
26641 int8_tArray __attribute__((export_name("TS_ChannelManager_write"))) TS_ChannelManager_write(uint64_t obj) {
26642 LDKChannelManager obj_conv;
26643 obj_conv.inner = untag_ptr(obj);
26644 obj_conv.is_owned = ptr_is_owned(obj);
26645 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
26646 obj_conv.is_owned = false;
26647 LDKCVec_u8Z ret_var = ChannelManager_write(&obj_conv);
26648 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
26649 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
26650 CVec_u8Z_free(ret_var);
26654 void __attribute__((export_name("TS_ChannelManagerReadArgs_free"))) TS_ChannelManagerReadArgs_free(uint64_t this_obj) {
26655 LDKChannelManagerReadArgs this_obj_conv;
26656 this_obj_conv.inner = untag_ptr(this_obj);
26657 this_obj_conv.is_owned = ptr_is_owned(this_obj);
26658 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
26659 ChannelManagerReadArgs_free(this_obj_conv);
26662 uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_keys_manager"))) TS_ChannelManagerReadArgs_get_keys_manager(uint64_t this_ptr) {
26663 LDKChannelManagerReadArgs this_ptr_conv;
26664 this_ptr_conv.inner = untag_ptr(this_ptr);
26665 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26666 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26667 this_ptr_conv.is_owned = false;
26668 // WARNING: This object doesn't live past this scope, needs clone!
26669 uint64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_keys_manager(&this_ptr_conv), false);
26673 void __attribute__((export_name("TS_ChannelManagerReadArgs_set_keys_manager"))) TS_ChannelManagerReadArgs_set_keys_manager(uint64_t this_ptr, uint64_t val) {
26674 LDKChannelManagerReadArgs this_ptr_conv;
26675 this_ptr_conv.inner = untag_ptr(this_ptr);
26676 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26677 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26678 this_ptr_conv.is_owned = false;
26679 void* val_ptr = untag_ptr(val);
26680 CHECK_ACCESS(val_ptr);
26681 LDKKeysInterface val_conv = *(LDKKeysInterface*)(val_ptr);
26682 if (val_conv.free == LDKKeysInterface_JCalls_free) {
26683 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26684 LDKKeysInterface_JCalls_cloned(&val_conv);
26686 ChannelManagerReadArgs_set_keys_manager(&this_ptr_conv, val_conv);
26689 uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_fee_estimator"))) TS_ChannelManagerReadArgs_get_fee_estimator(uint64_t this_ptr) {
26690 LDKChannelManagerReadArgs this_ptr_conv;
26691 this_ptr_conv.inner = untag_ptr(this_ptr);
26692 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26693 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26694 this_ptr_conv.is_owned = false;
26695 // WARNING: This object doesn't live past this scope, needs clone!
26696 uint64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_fee_estimator(&this_ptr_conv), false);
26700 void __attribute__((export_name("TS_ChannelManagerReadArgs_set_fee_estimator"))) TS_ChannelManagerReadArgs_set_fee_estimator(uint64_t this_ptr, uint64_t val) {
26701 LDKChannelManagerReadArgs this_ptr_conv;
26702 this_ptr_conv.inner = untag_ptr(this_ptr);
26703 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26704 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26705 this_ptr_conv.is_owned = false;
26706 void* val_ptr = untag_ptr(val);
26707 CHECK_ACCESS(val_ptr);
26708 LDKFeeEstimator val_conv = *(LDKFeeEstimator*)(val_ptr);
26709 if (val_conv.free == LDKFeeEstimator_JCalls_free) {
26710 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26711 LDKFeeEstimator_JCalls_cloned(&val_conv);
26713 ChannelManagerReadArgs_set_fee_estimator(&this_ptr_conv, val_conv);
26716 uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_chain_monitor"))) TS_ChannelManagerReadArgs_get_chain_monitor(uint64_t this_ptr) {
26717 LDKChannelManagerReadArgs this_ptr_conv;
26718 this_ptr_conv.inner = untag_ptr(this_ptr);
26719 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26720 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26721 this_ptr_conv.is_owned = false;
26722 // WARNING: This object doesn't live past this scope, needs clone!
26723 uint64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_chain_monitor(&this_ptr_conv), false);
26727 void __attribute__((export_name("TS_ChannelManagerReadArgs_set_chain_monitor"))) TS_ChannelManagerReadArgs_set_chain_monitor(uint64_t this_ptr, uint64_t val) {
26728 LDKChannelManagerReadArgs this_ptr_conv;
26729 this_ptr_conv.inner = untag_ptr(this_ptr);
26730 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26731 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26732 this_ptr_conv.is_owned = false;
26733 void* val_ptr = untag_ptr(val);
26734 CHECK_ACCESS(val_ptr);
26735 LDKWatch val_conv = *(LDKWatch*)(val_ptr);
26736 if (val_conv.free == LDKWatch_JCalls_free) {
26737 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26738 LDKWatch_JCalls_cloned(&val_conv);
26740 ChannelManagerReadArgs_set_chain_monitor(&this_ptr_conv, val_conv);
26743 uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_tx_broadcaster"))) TS_ChannelManagerReadArgs_get_tx_broadcaster(uint64_t this_ptr) {
26744 LDKChannelManagerReadArgs this_ptr_conv;
26745 this_ptr_conv.inner = untag_ptr(this_ptr);
26746 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26747 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26748 this_ptr_conv.is_owned = false;
26749 // WARNING: This object doesn't live past this scope, needs clone!
26750 uint64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_tx_broadcaster(&this_ptr_conv), false);
26754 void __attribute__((export_name("TS_ChannelManagerReadArgs_set_tx_broadcaster"))) TS_ChannelManagerReadArgs_set_tx_broadcaster(uint64_t this_ptr, uint64_t val) {
26755 LDKChannelManagerReadArgs this_ptr_conv;
26756 this_ptr_conv.inner = untag_ptr(this_ptr);
26757 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26758 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26759 this_ptr_conv.is_owned = false;
26760 void* val_ptr = untag_ptr(val);
26761 CHECK_ACCESS(val_ptr);
26762 LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)(val_ptr);
26763 if (val_conv.free == LDKBroadcasterInterface_JCalls_free) {
26764 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26765 LDKBroadcasterInterface_JCalls_cloned(&val_conv);
26767 ChannelManagerReadArgs_set_tx_broadcaster(&this_ptr_conv, val_conv);
26770 uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_logger"))) TS_ChannelManagerReadArgs_get_logger(uint64_t this_ptr) {
26771 LDKChannelManagerReadArgs this_ptr_conv;
26772 this_ptr_conv.inner = untag_ptr(this_ptr);
26773 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26774 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26775 this_ptr_conv.is_owned = false;
26776 // WARNING: This object doesn't live past this scope, needs clone!
26777 uint64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_logger(&this_ptr_conv), false);
26781 void __attribute__((export_name("TS_ChannelManagerReadArgs_set_logger"))) TS_ChannelManagerReadArgs_set_logger(uint64_t this_ptr, uint64_t val) {
26782 LDKChannelManagerReadArgs this_ptr_conv;
26783 this_ptr_conv.inner = untag_ptr(this_ptr);
26784 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26785 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26786 this_ptr_conv.is_owned = false;
26787 void* val_ptr = untag_ptr(val);
26788 CHECK_ACCESS(val_ptr);
26789 LDKLogger val_conv = *(LDKLogger*)(val_ptr);
26790 if (val_conv.free == LDKLogger_JCalls_free) {
26791 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26792 LDKLogger_JCalls_cloned(&val_conv);
26794 ChannelManagerReadArgs_set_logger(&this_ptr_conv, val_conv);
26797 uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_default_config"))) TS_ChannelManagerReadArgs_get_default_config(uint64_t this_ptr) {
26798 LDKChannelManagerReadArgs this_ptr_conv;
26799 this_ptr_conv.inner = untag_ptr(this_ptr);
26800 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26801 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26802 this_ptr_conv.is_owned = false;
26803 LDKUserConfig ret_var = ChannelManagerReadArgs_get_default_config(&this_ptr_conv);
26804 uint64_t ret_ref = 0;
26805 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26806 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26810 void __attribute__((export_name("TS_ChannelManagerReadArgs_set_default_config"))) TS_ChannelManagerReadArgs_set_default_config(uint64_t this_ptr, uint64_t val) {
26811 LDKChannelManagerReadArgs this_ptr_conv;
26812 this_ptr_conv.inner = untag_ptr(this_ptr);
26813 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26814 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26815 this_ptr_conv.is_owned = false;
26816 LDKUserConfig val_conv;
26817 val_conv.inner = untag_ptr(val);
26818 val_conv.is_owned = ptr_is_owned(val);
26819 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
26820 val_conv = UserConfig_clone(&val_conv);
26821 ChannelManagerReadArgs_set_default_config(&this_ptr_conv, val_conv);
26824 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) {
26825 void* keys_manager_ptr = untag_ptr(keys_manager);
26826 CHECK_ACCESS(keys_manager_ptr);
26827 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
26828 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
26829 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26830 LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
26832 void* fee_estimator_ptr = untag_ptr(fee_estimator);
26833 CHECK_ACCESS(fee_estimator_ptr);
26834 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
26835 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
26836 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26837 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
26839 void* chain_monitor_ptr = untag_ptr(chain_monitor);
26840 CHECK_ACCESS(chain_monitor_ptr);
26841 LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr);
26842 if (chain_monitor_conv.free == LDKWatch_JCalls_free) {
26843 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26844 LDKWatch_JCalls_cloned(&chain_monitor_conv);
26846 void* tx_broadcaster_ptr = untag_ptr(tx_broadcaster);
26847 CHECK_ACCESS(tx_broadcaster_ptr);
26848 LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr);
26849 if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
26850 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26851 LDKBroadcasterInterface_JCalls_cloned(&tx_broadcaster_conv);
26853 void* logger_ptr = untag_ptr(logger);
26854 CHECK_ACCESS(logger_ptr);
26855 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
26856 if (logger_conv.free == LDKLogger_JCalls_free) {
26857 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26858 LDKLogger_JCalls_cloned(&logger_conv);
26860 LDKUserConfig default_config_conv;
26861 default_config_conv.inner = untag_ptr(default_config);
26862 default_config_conv.is_owned = ptr_is_owned(default_config);
26863 CHECK_INNER_FIELD_ACCESS_OR_NULL(default_config_conv);
26864 default_config_conv = UserConfig_clone(&default_config_conv);
26865 LDKCVec_ChannelMonitorZ channel_monitors_constr;
26866 channel_monitors_constr.datalen = channel_monitors->arr_len;
26867 if (channel_monitors_constr.datalen > 0)
26868 channel_monitors_constr.data = MALLOC(channel_monitors_constr.datalen * sizeof(LDKChannelMonitor), "LDKCVec_ChannelMonitorZ Elements");
26870 channel_monitors_constr.data = NULL;
26871 uint64_t* channel_monitors_vals = channel_monitors->elems;
26872 for (size_t q = 0; q < channel_monitors_constr.datalen; q++) {
26873 uint64_t channel_monitors_conv_16 = channel_monitors_vals[q];
26874 LDKChannelMonitor channel_monitors_conv_16_conv;
26875 channel_monitors_conv_16_conv.inner = untag_ptr(channel_monitors_conv_16);
26876 channel_monitors_conv_16_conv.is_owned = ptr_is_owned(channel_monitors_conv_16);
26877 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_monitors_conv_16_conv);
26878 channel_monitors_conv_16_conv.is_owned = false;
26879 channel_monitors_constr.data[q] = channel_monitors_conv_16_conv;
26881 FREE(channel_monitors);
26882 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);
26883 uint64_t ret_ref = 0;
26884 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26885 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26889 uint64_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelManagerZ_read"))) TS_C2Tuple_BlockHashChannelManagerZ_read(int8_tArray ser, uint64_t arg) {
26890 LDKu8slice ser_ref;
26891 ser_ref.datalen = ser->arr_len;
26892 ser_ref.data = ser->elems;
26893 LDKChannelManagerReadArgs arg_conv;
26894 arg_conv.inner = untag_ptr(arg);
26895 arg_conv.is_owned = ptr_is_owned(arg);
26896 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
26897 // WARNING: we need a move here but no clone is available for LDKChannelManagerReadArgs
26899 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ");
26900 *ret_conv = C2Tuple_BlockHashChannelManagerZ_read(ser_ref, arg_conv);
26902 return tag_ptr(ret_conv, true);
26905 void __attribute__((export_name("TS_ExpandedKey_free"))) TS_ExpandedKey_free(uint64_t this_obj) {
26906 LDKExpandedKey this_obj_conv;
26907 this_obj_conv.inner = untag_ptr(this_obj);
26908 this_obj_conv.is_owned = ptr_is_owned(this_obj);
26909 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
26910 ExpandedKey_free(this_obj_conv);
26913 uint64_t __attribute__((export_name("TS_ExpandedKey_new"))) TS_ExpandedKey_new(int8_tArray key_material) {
26914 unsigned char key_material_arr[32];
26915 CHECK(key_material->arr_len == 32);
26916 memcpy(key_material_arr, key_material->elems, 32); FREE(key_material);
26917 unsigned char (*key_material_ref)[32] = &key_material_arr;
26918 LDKExpandedKey ret_var = ExpandedKey_new(key_material_ref);
26919 uint64_t ret_ref = 0;
26920 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26921 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26925 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) {
26926 LDKExpandedKey keys_conv;
26927 keys_conv.inner = untag_ptr(keys);
26928 keys_conv.is_owned = ptr_is_owned(keys);
26929 CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv);
26930 keys_conv.is_owned = false;
26931 void* min_value_msat_ptr = untag_ptr(min_value_msat);
26932 CHECK_ACCESS(min_value_msat_ptr);
26933 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
26934 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
26935 void* keys_manager_ptr = untag_ptr(keys_manager);
26936 if (ptr_is_owned(keys_manager)) { CHECK_ACCESS(keys_manager_ptr); }
26937 LDKKeysInterface* keys_manager_conv = (LDKKeysInterface*)keys_manager_ptr;
26938 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
26939 *ret_conv = create(&keys_conv, min_value_msat_conv, invoice_expiry_delta_secs, keys_manager_conv, current_time);
26940 return tag_ptr(ret_conv, true);
26943 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) {
26944 LDKExpandedKey keys_conv;
26945 keys_conv.inner = untag_ptr(keys);
26946 keys_conv.is_owned = ptr_is_owned(keys);
26947 CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv);
26948 keys_conv.is_owned = false;
26949 void* min_value_msat_ptr = untag_ptr(min_value_msat);
26950 CHECK_ACCESS(min_value_msat_ptr);
26951 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
26952 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
26953 LDKThirtyTwoBytes payment_hash_ref;
26954 CHECK(payment_hash->arr_len == 32);
26955 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
26956 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
26957 *ret_conv = create_from_hash(&keys_conv, min_value_msat_conv, payment_hash_ref, invoice_expiry_delta_secs, current_time);
26958 return tag_ptr(ret_conv, true);
26961 void __attribute__((export_name("TS_DecodeError_free"))) TS_DecodeError_free(uint64_t this_obj) {
26962 LDKDecodeError this_obj_conv;
26963 this_obj_conv.inner = untag_ptr(this_obj);
26964 this_obj_conv.is_owned = ptr_is_owned(this_obj);
26965 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
26966 DecodeError_free(this_obj_conv);
26969 static inline uint64_t DecodeError_clone_ptr(LDKDecodeError *NONNULL_PTR arg) {
26970 LDKDecodeError ret_var = DecodeError_clone(arg);
26971 uint64_t ret_ref = 0;
26972 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26973 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26976 int64_t __attribute__((export_name("TS_DecodeError_clone_ptr"))) TS_DecodeError_clone_ptr(uint64_t arg) {
26977 LDKDecodeError arg_conv;
26978 arg_conv.inner = untag_ptr(arg);
26979 arg_conv.is_owned = ptr_is_owned(arg);
26980 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
26981 arg_conv.is_owned = false;
26982 int64_t ret_conv = DecodeError_clone_ptr(&arg_conv);
26986 uint64_t __attribute__((export_name("TS_DecodeError_clone"))) TS_DecodeError_clone(uint64_t orig) {
26987 LDKDecodeError orig_conv;
26988 orig_conv.inner = untag_ptr(orig);
26989 orig_conv.is_owned = ptr_is_owned(orig);
26990 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
26991 orig_conv.is_owned = false;
26992 LDKDecodeError ret_var = DecodeError_clone(&orig_conv);
26993 uint64_t ret_ref = 0;
26994 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26995 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26999 void __attribute__((export_name("TS_Init_free"))) TS_Init_free(uint64_t this_obj) {
27000 LDKInit this_obj_conv;
27001 this_obj_conv.inner = untag_ptr(this_obj);
27002 this_obj_conv.is_owned = ptr_is_owned(this_obj);
27003 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
27004 Init_free(this_obj_conv);
27007 uint64_t __attribute__((export_name("TS_Init_get_features"))) TS_Init_get_features(uint64_t this_ptr) {
27008 LDKInit this_ptr_conv;
27009 this_ptr_conv.inner = untag_ptr(this_ptr);
27010 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27011 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27012 this_ptr_conv.is_owned = false;
27013 LDKInitFeatures ret_var = Init_get_features(&this_ptr_conv);
27014 uint64_t ret_ref = 0;
27015 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27016 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27020 void __attribute__((export_name("TS_Init_set_features"))) TS_Init_set_features(uint64_t this_ptr, uint64_t val) {
27021 LDKInit this_ptr_conv;
27022 this_ptr_conv.inner = untag_ptr(this_ptr);
27023 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27024 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27025 this_ptr_conv.is_owned = false;
27026 LDKInitFeatures val_conv;
27027 val_conv.inner = untag_ptr(val);
27028 val_conv.is_owned = ptr_is_owned(val);
27029 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
27030 val_conv = InitFeatures_clone(&val_conv);
27031 Init_set_features(&this_ptr_conv, val_conv);
27034 uint64_t __attribute__((export_name("TS_Init_get_remote_network_address"))) TS_Init_get_remote_network_address(uint64_t this_ptr) {
27035 LDKInit this_ptr_conv;
27036 this_ptr_conv.inner = untag_ptr(this_ptr);
27037 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27038 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27039 this_ptr_conv.is_owned = false;
27040 LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
27041 *ret_copy = Init_get_remote_network_address(&this_ptr_conv);
27042 uint64_t ret_ref = tag_ptr(ret_copy, true);
27046 void __attribute__((export_name("TS_Init_set_remote_network_address"))) TS_Init_set_remote_network_address(uint64_t this_ptr, uint64_t val) {
27047 LDKInit this_ptr_conv;
27048 this_ptr_conv.inner = untag_ptr(this_ptr);
27049 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27050 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27051 this_ptr_conv.is_owned = false;
27052 void* val_ptr = untag_ptr(val);
27053 CHECK_ACCESS(val_ptr);
27054 LDKCOption_NetAddressZ val_conv = *(LDKCOption_NetAddressZ*)(val_ptr);
27055 val_conv = COption_NetAddressZ_clone((LDKCOption_NetAddressZ*)untag_ptr(val));
27056 Init_set_remote_network_address(&this_ptr_conv, val_conv);
27059 uint64_t __attribute__((export_name("TS_Init_new"))) TS_Init_new(uint64_t features_arg, uint64_t remote_network_address_arg) {
27060 LDKInitFeatures features_arg_conv;
27061 features_arg_conv.inner = untag_ptr(features_arg);
27062 features_arg_conv.is_owned = ptr_is_owned(features_arg);
27063 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv);
27064 features_arg_conv = InitFeatures_clone(&features_arg_conv);
27065 void* remote_network_address_arg_ptr = untag_ptr(remote_network_address_arg);
27066 CHECK_ACCESS(remote_network_address_arg_ptr);
27067 LDKCOption_NetAddressZ remote_network_address_arg_conv = *(LDKCOption_NetAddressZ*)(remote_network_address_arg_ptr);
27068 LDKInit ret_var = Init_new(features_arg_conv, remote_network_address_arg_conv);
27069 uint64_t ret_ref = 0;
27070 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27071 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27075 static inline uint64_t Init_clone_ptr(LDKInit *NONNULL_PTR arg) {
27076 LDKInit ret_var = Init_clone(arg);
27077 uint64_t ret_ref = 0;
27078 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27079 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27082 int64_t __attribute__((export_name("TS_Init_clone_ptr"))) TS_Init_clone_ptr(uint64_t arg) {
27084 arg_conv.inner = untag_ptr(arg);
27085 arg_conv.is_owned = ptr_is_owned(arg);
27086 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
27087 arg_conv.is_owned = false;
27088 int64_t ret_conv = Init_clone_ptr(&arg_conv);
27092 uint64_t __attribute__((export_name("TS_Init_clone"))) TS_Init_clone(uint64_t orig) {
27094 orig_conv.inner = untag_ptr(orig);
27095 orig_conv.is_owned = ptr_is_owned(orig);
27096 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
27097 orig_conv.is_owned = false;
27098 LDKInit ret_var = Init_clone(&orig_conv);
27099 uint64_t ret_ref = 0;
27100 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27101 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27105 void __attribute__((export_name("TS_ErrorMessage_free"))) TS_ErrorMessage_free(uint64_t this_obj) {
27106 LDKErrorMessage this_obj_conv;
27107 this_obj_conv.inner = untag_ptr(this_obj);
27108 this_obj_conv.is_owned = ptr_is_owned(this_obj);
27109 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
27110 ErrorMessage_free(this_obj_conv);
27113 int8_tArray __attribute__((export_name("TS_ErrorMessage_get_channel_id"))) TS_ErrorMessage_get_channel_id(uint64_t this_ptr) {
27114 LDKErrorMessage this_ptr_conv;
27115 this_ptr_conv.inner = untag_ptr(this_ptr);
27116 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27117 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27118 this_ptr_conv.is_owned = false;
27119 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
27120 memcpy(ret_arr->elems, *ErrorMessage_get_channel_id(&this_ptr_conv), 32);
27124 void __attribute__((export_name("TS_ErrorMessage_set_channel_id"))) TS_ErrorMessage_set_channel_id(uint64_t this_ptr, int8_tArray val) {
27125 LDKErrorMessage this_ptr_conv;
27126 this_ptr_conv.inner = untag_ptr(this_ptr);
27127 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27128 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27129 this_ptr_conv.is_owned = false;
27130 LDKThirtyTwoBytes val_ref;
27131 CHECK(val->arr_len == 32);
27132 memcpy(val_ref.data, val->elems, 32); FREE(val);
27133 ErrorMessage_set_channel_id(&this_ptr_conv, val_ref);
27136 jstring __attribute__((export_name("TS_ErrorMessage_get_data"))) TS_ErrorMessage_get_data(uint64_t this_ptr) {
27137 LDKErrorMessage this_ptr_conv;
27138 this_ptr_conv.inner = untag_ptr(this_ptr);
27139 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27140 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27141 this_ptr_conv.is_owned = false;
27142 LDKStr ret_str = ErrorMessage_get_data(&this_ptr_conv);
27143 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
27148 void __attribute__((export_name("TS_ErrorMessage_set_data"))) TS_ErrorMessage_set_data(uint64_t this_ptr, jstring val) {
27149 LDKErrorMessage this_ptr_conv;
27150 this_ptr_conv.inner = untag_ptr(this_ptr);
27151 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27152 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27153 this_ptr_conv.is_owned = false;
27154 LDKStr val_conv = str_ref_to_owned_c(val);
27155 ErrorMessage_set_data(&this_ptr_conv, val_conv);
27158 uint64_t __attribute__((export_name("TS_ErrorMessage_new"))) TS_ErrorMessage_new(int8_tArray channel_id_arg, jstring data_arg) {
27159 LDKThirtyTwoBytes channel_id_arg_ref;
27160 CHECK(channel_id_arg->arr_len == 32);
27161 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
27162 LDKStr data_arg_conv = str_ref_to_owned_c(data_arg);
27163 LDKErrorMessage ret_var = ErrorMessage_new(channel_id_arg_ref, data_arg_conv);
27164 uint64_t ret_ref = 0;
27165 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27166 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27170 static inline uint64_t ErrorMessage_clone_ptr(LDKErrorMessage *NONNULL_PTR arg) {
27171 LDKErrorMessage ret_var = ErrorMessage_clone(arg);
27172 uint64_t ret_ref = 0;
27173 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27174 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27177 int64_t __attribute__((export_name("TS_ErrorMessage_clone_ptr"))) TS_ErrorMessage_clone_ptr(uint64_t arg) {
27178 LDKErrorMessage arg_conv;
27179 arg_conv.inner = untag_ptr(arg);
27180 arg_conv.is_owned = ptr_is_owned(arg);
27181 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
27182 arg_conv.is_owned = false;
27183 int64_t ret_conv = ErrorMessage_clone_ptr(&arg_conv);
27187 uint64_t __attribute__((export_name("TS_ErrorMessage_clone"))) TS_ErrorMessage_clone(uint64_t orig) {
27188 LDKErrorMessage orig_conv;
27189 orig_conv.inner = untag_ptr(orig);
27190 orig_conv.is_owned = ptr_is_owned(orig);
27191 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
27192 orig_conv.is_owned = false;
27193 LDKErrorMessage ret_var = ErrorMessage_clone(&orig_conv);
27194 uint64_t ret_ref = 0;
27195 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27196 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27200 void __attribute__((export_name("TS_WarningMessage_free"))) TS_WarningMessage_free(uint64_t this_obj) {
27201 LDKWarningMessage this_obj_conv;
27202 this_obj_conv.inner = untag_ptr(this_obj);
27203 this_obj_conv.is_owned = ptr_is_owned(this_obj);
27204 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
27205 WarningMessage_free(this_obj_conv);
27208 int8_tArray __attribute__((export_name("TS_WarningMessage_get_channel_id"))) TS_WarningMessage_get_channel_id(uint64_t this_ptr) {
27209 LDKWarningMessage this_ptr_conv;
27210 this_ptr_conv.inner = untag_ptr(this_ptr);
27211 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27212 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27213 this_ptr_conv.is_owned = false;
27214 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
27215 memcpy(ret_arr->elems, *WarningMessage_get_channel_id(&this_ptr_conv), 32);
27219 void __attribute__((export_name("TS_WarningMessage_set_channel_id"))) TS_WarningMessage_set_channel_id(uint64_t this_ptr, int8_tArray val) {
27220 LDKWarningMessage this_ptr_conv;
27221 this_ptr_conv.inner = untag_ptr(this_ptr);
27222 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27223 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27224 this_ptr_conv.is_owned = false;
27225 LDKThirtyTwoBytes val_ref;
27226 CHECK(val->arr_len == 32);
27227 memcpy(val_ref.data, val->elems, 32); FREE(val);
27228 WarningMessage_set_channel_id(&this_ptr_conv, val_ref);
27231 jstring __attribute__((export_name("TS_WarningMessage_get_data"))) TS_WarningMessage_get_data(uint64_t this_ptr) {
27232 LDKWarningMessage this_ptr_conv;
27233 this_ptr_conv.inner = untag_ptr(this_ptr);
27234 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27235 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27236 this_ptr_conv.is_owned = false;
27237 LDKStr ret_str = WarningMessage_get_data(&this_ptr_conv);
27238 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
27243 void __attribute__((export_name("TS_WarningMessage_set_data"))) TS_WarningMessage_set_data(uint64_t this_ptr, jstring val) {
27244 LDKWarningMessage this_ptr_conv;
27245 this_ptr_conv.inner = untag_ptr(this_ptr);
27246 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27247 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27248 this_ptr_conv.is_owned = false;
27249 LDKStr val_conv = str_ref_to_owned_c(val);
27250 WarningMessage_set_data(&this_ptr_conv, val_conv);
27253 uint64_t __attribute__((export_name("TS_WarningMessage_new"))) TS_WarningMessage_new(int8_tArray channel_id_arg, jstring data_arg) {
27254 LDKThirtyTwoBytes channel_id_arg_ref;
27255 CHECK(channel_id_arg->arr_len == 32);
27256 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
27257 LDKStr data_arg_conv = str_ref_to_owned_c(data_arg);
27258 LDKWarningMessage ret_var = WarningMessage_new(channel_id_arg_ref, data_arg_conv);
27259 uint64_t ret_ref = 0;
27260 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27261 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27265 static inline uint64_t WarningMessage_clone_ptr(LDKWarningMessage *NONNULL_PTR arg) {
27266 LDKWarningMessage ret_var = WarningMessage_clone(arg);
27267 uint64_t ret_ref = 0;
27268 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27269 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27272 int64_t __attribute__((export_name("TS_WarningMessage_clone_ptr"))) TS_WarningMessage_clone_ptr(uint64_t arg) {
27273 LDKWarningMessage arg_conv;
27274 arg_conv.inner = untag_ptr(arg);
27275 arg_conv.is_owned = ptr_is_owned(arg);
27276 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
27277 arg_conv.is_owned = false;
27278 int64_t ret_conv = WarningMessage_clone_ptr(&arg_conv);
27282 uint64_t __attribute__((export_name("TS_WarningMessage_clone"))) TS_WarningMessage_clone(uint64_t orig) {
27283 LDKWarningMessage orig_conv;
27284 orig_conv.inner = untag_ptr(orig);
27285 orig_conv.is_owned = ptr_is_owned(orig);
27286 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
27287 orig_conv.is_owned = false;
27288 LDKWarningMessage ret_var = WarningMessage_clone(&orig_conv);
27289 uint64_t ret_ref = 0;
27290 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27291 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27295 void __attribute__((export_name("TS_Ping_free"))) TS_Ping_free(uint64_t this_obj) {
27296 LDKPing this_obj_conv;
27297 this_obj_conv.inner = untag_ptr(this_obj);
27298 this_obj_conv.is_owned = ptr_is_owned(this_obj);
27299 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
27300 Ping_free(this_obj_conv);
27303 int16_t __attribute__((export_name("TS_Ping_get_ponglen"))) TS_Ping_get_ponglen(uint64_t this_ptr) {
27304 LDKPing this_ptr_conv;
27305 this_ptr_conv.inner = untag_ptr(this_ptr);
27306 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27307 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27308 this_ptr_conv.is_owned = false;
27309 int16_t ret_conv = Ping_get_ponglen(&this_ptr_conv);
27313 void __attribute__((export_name("TS_Ping_set_ponglen"))) TS_Ping_set_ponglen(uint64_t this_ptr, int16_t val) {
27314 LDKPing this_ptr_conv;
27315 this_ptr_conv.inner = untag_ptr(this_ptr);
27316 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27317 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27318 this_ptr_conv.is_owned = false;
27319 Ping_set_ponglen(&this_ptr_conv, val);
27322 int16_t __attribute__((export_name("TS_Ping_get_byteslen"))) TS_Ping_get_byteslen(uint64_t this_ptr) {
27323 LDKPing this_ptr_conv;
27324 this_ptr_conv.inner = untag_ptr(this_ptr);
27325 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27326 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27327 this_ptr_conv.is_owned = false;
27328 int16_t ret_conv = Ping_get_byteslen(&this_ptr_conv);
27332 void __attribute__((export_name("TS_Ping_set_byteslen"))) TS_Ping_set_byteslen(uint64_t this_ptr, int16_t val) {
27333 LDKPing this_ptr_conv;
27334 this_ptr_conv.inner = untag_ptr(this_ptr);
27335 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27336 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27337 this_ptr_conv.is_owned = false;
27338 Ping_set_byteslen(&this_ptr_conv, val);
27341 uint64_t __attribute__((export_name("TS_Ping_new"))) TS_Ping_new(int16_t ponglen_arg, int16_t byteslen_arg) {
27342 LDKPing ret_var = Ping_new(ponglen_arg, byteslen_arg);
27343 uint64_t ret_ref = 0;
27344 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27345 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27349 static inline uint64_t Ping_clone_ptr(LDKPing *NONNULL_PTR arg) {
27350 LDKPing ret_var = Ping_clone(arg);
27351 uint64_t ret_ref = 0;
27352 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27353 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27356 int64_t __attribute__((export_name("TS_Ping_clone_ptr"))) TS_Ping_clone_ptr(uint64_t arg) {
27358 arg_conv.inner = untag_ptr(arg);
27359 arg_conv.is_owned = ptr_is_owned(arg);
27360 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
27361 arg_conv.is_owned = false;
27362 int64_t ret_conv = Ping_clone_ptr(&arg_conv);
27366 uint64_t __attribute__((export_name("TS_Ping_clone"))) TS_Ping_clone(uint64_t orig) {
27368 orig_conv.inner = untag_ptr(orig);
27369 orig_conv.is_owned = ptr_is_owned(orig);
27370 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
27371 orig_conv.is_owned = false;
27372 LDKPing ret_var = Ping_clone(&orig_conv);
27373 uint64_t ret_ref = 0;
27374 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27375 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27379 void __attribute__((export_name("TS_Pong_free"))) TS_Pong_free(uint64_t this_obj) {
27380 LDKPong this_obj_conv;
27381 this_obj_conv.inner = untag_ptr(this_obj);
27382 this_obj_conv.is_owned = ptr_is_owned(this_obj);
27383 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
27384 Pong_free(this_obj_conv);
27387 int16_t __attribute__((export_name("TS_Pong_get_byteslen"))) TS_Pong_get_byteslen(uint64_t this_ptr) {
27388 LDKPong this_ptr_conv;
27389 this_ptr_conv.inner = untag_ptr(this_ptr);
27390 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27391 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27392 this_ptr_conv.is_owned = false;
27393 int16_t ret_conv = Pong_get_byteslen(&this_ptr_conv);
27397 void __attribute__((export_name("TS_Pong_set_byteslen"))) TS_Pong_set_byteslen(uint64_t this_ptr, int16_t val) {
27398 LDKPong this_ptr_conv;
27399 this_ptr_conv.inner = untag_ptr(this_ptr);
27400 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27401 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27402 this_ptr_conv.is_owned = false;
27403 Pong_set_byteslen(&this_ptr_conv, val);
27406 uint64_t __attribute__((export_name("TS_Pong_new"))) TS_Pong_new(int16_t byteslen_arg) {
27407 LDKPong ret_var = Pong_new(byteslen_arg);
27408 uint64_t ret_ref = 0;
27409 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27410 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27414 static inline uint64_t Pong_clone_ptr(LDKPong *NONNULL_PTR arg) {
27415 LDKPong ret_var = Pong_clone(arg);
27416 uint64_t ret_ref = 0;
27417 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27418 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27421 int64_t __attribute__((export_name("TS_Pong_clone_ptr"))) TS_Pong_clone_ptr(uint64_t arg) {
27423 arg_conv.inner = untag_ptr(arg);
27424 arg_conv.is_owned = ptr_is_owned(arg);
27425 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
27426 arg_conv.is_owned = false;
27427 int64_t ret_conv = Pong_clone_ptr(&arg_conv);
27431 uint64_t __attribute__((export_name("TS_Pong_clone"))) TS_Pong_clone(uint64_t orig) {
27433 orig_conv.inner = untag_ptr(orig);
27434 orig_conv.is_owned = ptr_is_owned(orig);
27435 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
27436 orig_conv.is_owned = false;
27437 LDKPong ret_var = Pong_clone(&orig_conv);
27438 uint64_t ret_ref = 0;
27439 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27440 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27444 void __attribute__((export_name("TS_OpenChannel_free"))) TS_OpenChannel_free(uint64_t this_obj) {
27445 LDKOpenChannel this_obj_conv;
27446 this_obj_conv.inner = untag_ptr(this_obj);
27447 this_obj_conv.is_owned = ptr_is_owned(this_obj);
27448 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
27449 OpenChannel_free(this_obj_conv);
27452 int8_tArray __attribute__((export_name("TS_OpenChannel_get_chain_hash"))) TS_OpenChannel_get_chain_hash(uint64_t this_ptr) {
27453 LDKOpenChannel this_ptr_conv;
27454 this_ptr_conv.inner = untag_ptr(this_ptr);
27455 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27456 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27457 this_ptr_conv.is_owned = false;
27458 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
27459 memcpy(ret_arr->elems, *OpenChannel_get_chain_hash(&this_ptr_conv), 32);
27463 void __attribute__((export_name("TS_OpenChannel_set_chain_hash"))) TS_OpenChannel_set_chain_hash(uint64_t this_ptr, int8_tArray val) {
27464 LDKOpenChannel this_ptr_conv;
27465 this_ptr_conv.inner = untag_ptr(this_ptr);
27466 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27467 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27468 this_ptr_conv.is_owned = false;
27469 LDKThirtyTwoBytes val_ref;
27470 CHECK(val->arr_len == 32);
27471 memcpy(val_ref.data, val->elems, 32); FREE(val);
27472 OpenChannel_set_chain_hash(&this_ptr_conv, val_ref);
27475 int8_tArray __attribute__((export_name("TS_OpenChannel_get_temporary_channel_id"))) TS_OpenChannel_get_temporary_channel_id(uint64_t this_ptr) {
27476 LDKOpenChannel this_ptr_conv;
27477 this_ptr_conv.inner = untag_ptr(this_ptr);
27478 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27479 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27480 this_ptr_conv.is_owned = false;
27481 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
27482 memcpy(ret_arr->elems, *OpenChannel_get_temporary_channel_id(&this_ptr_conv), 32);
27486 void __attribute__((export_name("TS_OpenChannel_set_temporary_channel_id"))) TS_OpenChannel_set_temporary_channel_id(uint64_t this_ptr, int8_tArray val) {
27487 LDKOpenChannel this_ptr_conv;
27488 this_ptr_conv.inner = untag_ptr(this_ptr);
27489 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27490 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27491 this_ptr_conv.is_owned = false;
27492 LDKThirtyTwoBytes val_ref;
27493 CHECK(val->arr_len == 32);
27494 memcpy(val_ref.data, val->elems, 32); FREE(val);
27495 OpenChannel_set_temporary_channel_id(&this_ptr_conv, val_ref);
27498 int64_t __attribute__((export_name("TS_OpenChannel_get_funding_satoshis"))) TS_OpenChannel_get_funding_satoshis(uint64_t this_ptr) {
27499 LDKOpenChannel this_ptr_conv;
27500 this_ptr_conv.inner = untag_ptr(this_ptr);
27501 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27502 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27503 this_ptr_conv.is_owned = false;
27504 int64_t ret_conv = OpenChannel_get_funding_satoshis(&this_ptr_conv);
27508 void __attribute__((export_name("TS_OpenChannel_set_funding_satoshis"))) TS_OpenChannel_set_funding_satoshis(uint64_t this_ptr, int64_t val) {
27509 LDKOpenChannel this_ptr_conv;
27510 this_ptr_conv.inner = untag_ptr(this_ptr);
27511 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27512 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27513 this_ptr_conv.is_owned = false;
27514 OpenChannel_set_funding_satoshis(&this_ptr_conv, val);
27517 int64_t __attribute__((export_name("TS_OpenChannel_get_push_msat"))) TS_OpenChannel_get_push_msat(uint64_t this_ptr) {
27518 LDKOpenChannel this_ptr_conv;
27519 this_ptr_conv.inner = untag_ptr(this_ptr);
27520 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27521 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27522 this_ptr_conv.is_owned = false;
27523 int64_t ret_conv = OpenChannel_get_push_msat(&this_ptr_conv);
27527 void __attribute__((export_name("TS_OpenChannel_set_push_msat"))) TS_OpenChannel_set_push_msat(uint64_t this_ptr, int64_t val) {
27528 LDKOpenChannel this_ptr_conv;
27529 this_ptr_conv.inner = untag_ptr(this_ptr);
27530 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27531 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27532 this_ptr_conv.is_owned = false;
27533 OpenChannel_set_push_msat(&this_ptr_conv, val);
27536 int64_t __attribute__((export_name("TS_OpenChannel_get_dust_limit_satoshis"))) TS_OpenChannel_get_dust_limit_satoshis(uint64_t this_ptr) {
27537 LDKOpenChannel this_ptr_conv;
27538 this_ptr_conv.inner = untag_ptr(this_ptr);
27539 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27540 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27541 this_ptr_conv.is_owned = false;
27542 int64_t ret_conv = OpenChannel_get_dust_limit_satoshis(&this_ptr_conv);
27546 void __attribute__((export_name("TS_OpenChannel_set_dust_limit_satoshis"))) TS_OpenChannel_set_dust_limit_satoshis(uint64_t this_ptr, int64_t val) {
27547 LDKOpenChannel this_ptr_conv;
27548 this_ptr_conv.inner = untag_ptr(this_ptr);
27549 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27550 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27551 this_ptr_conv.is_owned = false;
27552 OpenChannel_set_dust_limit_satoshis(&this_ptr_conv, val);
27555 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) {
27556 LDKOpenChannel this_ptr_conv;
27557 this_ptr_conv.inner = untag_ptr(this_ptr);
27558 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27559 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27560 this_ptr_conv.is_owned = false;
27561 int64_t ret_conv = OpenChannel_get_max_htlc_value_in_flight_msat(&this_ptr_conv);
27565 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) {
27566 LDKOpenChannel this_ptr_conv;
27567 this_ptr_conv.inner = untag_ptr(this_ptr);
27568 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27569 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27570 this_ptr_conv.is_owned = false;
27571 OpenChannel_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val);
27574 int64_t __attribute__((export_name("TS_OpenChannel_get_channel_reserve_satoshis"))) TS_OpenChannel_get_channel_reserve_satoshis(uint64_t this_ptr) {
27575 LDKOpenChannel this_ptr_conv;
27576 this_ptr_conv.inner = untag_ptr(this_ptr);
27577 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27578 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27579 this_ptr_conv.is_owned = false;
27580 int64_t ret_conv = OpenChannel_get_channel_reserve_satoshis(&this_ptr_conv);
27584 void __attribute__((export_name("TS_OpenChannel_set_channel_reserve_satoshis"))) TS_OpenChannel_set_channel_reserve_satoshis(uint64_t this_ptr, int64_t val) {
27585 LDKOpenChannel this_ptr_conv;
27586 this_ptr_conv.inner = untag_ptr(this_ptr);
27587 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27588 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27589 this_ptr_conv.is_owned = false;
27590 OpenChannel_set_channel_reserve_satoshis(&this_ptr_conv, val);
27593 int64_t __attribute__((export_name("TS_OpenChannel_get_htlc_minimum_msat"))) TS_OpenChannel_get_htlc_minimum_msat(uint64_t this_ptr) {
27594 LDKOpenChannel this_ptr_conv;
27595 this_ptr_conv.inner = untag_ptr(this_ptr);
27596 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27597 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27598 this_ptr_conv.is_owned = false;
27599 int64_t ret_conv = OpenChannel_get_htlc_minimum_msat(&this_ptr_conv);
27603 void __attribute__((export_name("TS_OpenChannel_set_htlc_minimum_msat"))) TS_OpenChannel_set_htlc_minimum_msat(uint64_t this_ptr, int64_t val) {
27604 LDKOpenChannel this_ptr_conv;
27605 this_ptr_conv.inner = untag_ptr(this_ptr);
27606 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27607 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27608 this_ptr_conv.is_owned = false;
27609 OpenChannel_set_htlc_minimum_msat(&this_ptr_conv, val);
27612 int32_t __attribute__((export_name("TS_OpenChannel_get_feerate_per_kw"))) TS_OpenChannel_get_feerate_per_kw(uint64_t this_ptr) {
27613 LDKOpenChannel this_ptr_conv;
27614 this_ptr_conv.inner = untag_ptr(this_ptr);
27615 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27616 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27617 this_ptr_conv.is_owned = false;
27618 int32_t ret_conv = OpenChannel_get_feerate_per_kw(&this_ptr_conv);
27622 void __attribute__((export_name("TS_OpenChannel_set_feerate_per_kw"))) TS_OpenChannel_set_feerate_per_kw(uint64_t this_ptr, int32_t val) {
27623 LDKOpenChannel this_ptr_conv;
27624 this_ptr_conv.inner = untag_ptr(this_ptr);
27625 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27626 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27627 this_ptr_conv.is_owned = false;
27628 OpenChannel_set_feerate_per_kw(&this_ptr_conv, val);
27631 int16_t __attribute__((export_name("TS_OpenChannel_get_to_self_delay"))) TS_OpenChannel_get_to_self_delay(uint64_t this_ptr) {
27632 LDKOpenChannel this_ptr_conv;
27633 this_ptr_conv.inner = untag_ptr(this_ptr);
27634 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27635 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27636 this_ptr_conv.is_owned = false;
27637 int16_t ret_conv = OpenChannel_get_to_self_delay(&this_ptr_conv);
27641 void __attribute__((export_name("TS_OpenChannel_set_to_self_delay"))) TS_OpenChannel_set_to_self_delay(uint64_t this_ptr, int16_t val) {
27642 LDKOpenChannel this_ptr_conv;
27643 this_ptr_conv.inner = untag_ptr(this_ptr);
27644 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27645 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27646 this_ptr_conv.is_owned = false;
27647 OpenChannel_set_to_self_delay(&this_ptr_conv, val);
27650 int16_t __attribute__((export_name("TS_OpenChannel_get_max_accepted_htlcs"))) TS_OpenChannel_get_max_accepted_htlcs(uint64_t this_ptr) {
27651 LDKOpenChannel this_ptr_conv;
27652 this_ptr_conv.inner = untag_ptr(this_ptr);
27653 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27654 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27655 this_ptr_conv.is_owned = false;
27656 int16_t ret_conv = OpenChannel_get_max_accepted_htlcs(&this_ptr_conv);
27660 void __attribute__((export_name("TS_OpenChannel_set_max_accepted_htlcs"))) TS_OpenChannel_set_max_accepted_htlcs(uint64_t this_ptr, int16_t val) {
27661 LDKOpenChannel this_ptr_conv;
27662 this_ptr_conv.inner = untag_ptr(this_ptr);
27663 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27664 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27665 this_ptr_conv.is_owned = false;
27666 OpenChannel_set_max_accepted_htlcs(&this_ptr_conv, val);
27669 int8_tArray __attribute__((export_name("TS_OpenChannel_get_funding_pubkey"))) TS_OpenChannel_get_funding_pubkey(uint64_t this_ptr) {
27670 LDKOpenChannel this_ptr_conv;
27671 this_ptr_conv.inner = untag_ptr(this_ptr);
27672 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27673 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27674 this_ptr_conv.is_owned = false;
27675 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
27676 memcpy(ret_arr->elems, OpenChannel_get_funding_pubkey(&this_ptr_conv).compressed_form, 33);
27680 void __attribute__((export_name("TS_OpenChannel_set_funding_pubkey"))) TS_OpenChannel_set_funding_pubkey(uint64_t this_ptr, int8_tArray val) {
27681 LDKOpenChannel this_ptr_conv;
27682 this_ptr_conv.inner = untag_ptr(this_ptr);
27683 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27684 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27685 this_ptr_conv.is_owned = false;
27686 LDKPublicKey val_ref;
27687 CHECK(val->arr_len == 33);
27688 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
27689 OpenChannel_set_funding_pubkey(&this_ptr_conv, val_ref);
27692 int8_tArray __attribute__((export_name("TS_OpenChannel_get_revocation_basepoint"))) TS_OpenChannel_get_revocation_basepoint(uint64_t this_ptr) {
27693 LDKOpenChannel this_ptr_conv;
27694 this_ptr_conv.inner = untag_ptr(this_ptr);
27695 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27696 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27697 this_ptr_conv.is_owned = false;
27698 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
27699 memcpy(ret_arr->elems, OpenChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form, 33);
27703 void __attribute__((export_name("TS_OpenChannel_set_revocation_basepoint"))) TS_OpenChannel_set_revocation_basepoint(uint64_t this_ptr, int8_tArray val) {
27704 LDKOpenChannel this_ptr_conv;
27705 this_ptr_conv.inner = untag_ptr(this_ptr);
27706 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27707 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27708 this_ptr_conv.is_owned = false;
27709 LDKPublicKey val_ref;
27710 CHECK(val->arr_len == 33);
27711 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
27712 OpenChannel_set_revocation_basepoint(&this_ptr_conv, val_ref);
27715 int8_tArray __attribute__((export_name("TS_OpenChannel_get_payment_point"))) TS_OpenChannel_get_payment_point(uint64_t this_ptr) {
27716 LDKOpenChannel this_ptr_conv;
27717 this_ptr_conv.inner = untag_ptr(this_ptr);
27718 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27719 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27720 this_ptr_conv.is_owned = false;
27721 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
27722 memcpy(ret_arr->elems, OpenChannel_get_payment_point(&this_ptr_conv).compressed_form, 33);
27726 void __attribute__((export_name("TS_OpenChannel_set_payment_point"))) TS_OpenChannel_set_payment_point(uint64_t this_ptr, int8_tArray val) {
27727 LDKOpenChannel this_ptr_conv;
27728 this_ptr_conv.inner = untag_ptr(this_ptr);
27729 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27730 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27731 this_ptr_conv.is_owned = false;
27732 LDKPublicKey val_ref;
27733 CHECK(val->arr_len == 33);
27734 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
27735 OpenChannel_set_payment_point(&this_ptr_conv, val_ref);
27738 int8_tArray __attribute__((export_name("TS_OpenChannel_get_delayed_payment_basepoint"))) TS_OpenChannel_get_delayed_payment_basepoint(uint64_t this_ptr) {
27739 LDKOpenChannel this_ptr_conv;
27740 this_ptr_conv.inner = untag_ptr(this_ptr);
27741 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27742 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27743 this_ptr_conv.is_owned = false;
27744 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
27745 memcpy(ret_arr->elems, OpenChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33);
27749 void __attribute__((export_name("TS_OpenChannel_set_delayed_payment_basepoint"))) TS_OpenChannel_set_delayed_payment_basepoint(uint64_t this_ptr, int8_tArray val) {
27750 LDKOpenChannel this_ptr_conv;
27751 this_ptr_conv.inner = untag_ptr(this_ptr);
27752 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27753 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27754 this_ptr_conv.is_owned = false;
27755 LDKPublicKey val_ref;
27756 CHECK(val->arr_len == 33);
27757 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
27758 OpenChannel_set_delayed_payment_basepoint(&this_ptr_conv, val_ref);
27761 int8_tArray __attribute__((export_name("TS_OpenChannel_get_htlc_basepoint"))) TS_OpenChannel_get_htlc_basepoint(uint64_t this_ptr) {
27762 LDKOpenChannel this_ptr_conv;
27763 this_ptr_conv.inner = untag_ptr(this_ptr);
27764 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27765 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27766 this_ptr_conv.is_owned = false;
27767 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
27768 memcpy(ret_arr->elems, OpenChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form, 33);
27772 void __attribute__((export_name("TS_OpenChannel_set_htlc_basepoint"))) TS_OpenChannel_set_htlc_basepoint(uint64_t this_ptr, int8_tArray val) {
27773 LDKOpenChannel this_ptr_conv;
27774 this_ptr_conv.inner = untag_ptr(this_ptr);
27775 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27776 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27777 this_ptr_conv.is_owned = false;
27778 LDKPublicKey val_ref;
27779 CHECK(val->arr_len == 33);
27780 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
27781 OpenChannel_set_htlc_basepoint(&this_ptr_conv, val_ref);
27784 int8_tArray __attribute__((export_name("TS_OpenChannel_get_first_per_commitment_point"))) TS_OpenChannel_get_first_per_commitment_point(uint64_t this_ptr) {
27785 LDKOpenChannel this_ptr_conv;
27786 this_ptr_conv.inner = untag_ptr(this_ptr);
27787 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27788 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27789 this_ptr_conv.is_owned = false;
27790 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
27791 memcpy(ret_arr->elems, OpenChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form, 33);
27795 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) {
27796 LDKOpenChannel this_ptr_conv;
27797 this_ptr_conv.inner = untag_ptr(this_ptr);
27798 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27799 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27800 this_ptr_conv.is_owned = false;
27801 LDKPublicKey val_ref;
27802 CHECK(val->arr_len == 33);
27803 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
27804 OpenChannel_set_first_per_commitment_point(&this_ptr_conv, val_ref);
27807 int8_t __attribute__((export_name("TS_OpenChannel_get_channel_flags"))) TS_OpenChannel_get_channel_flags(uint64_t this_ptr) {
27808 LDKOpenChannel this_ptr_conv;
27809 this_ptr_conv.inner = untag_ptr(this_ptr);
27810 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27811 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27812 this_ptr_conv.is_owned = false;
27813 int8_t ret_conv = OpenChannel_get_channel_flags(&this_ptr_conv);
27817 void __attribute__((export_name("TS_OpenChannel_set_channel_flags"))) TS_OpenChannel_set_channel_flags(uint64_t this_ptr, int8_t val) {
27818 LDKOpenChannel this_ptr_conv;
27819 this_ptr_conv.inner = untag_ptr(this_ptr);
27820 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27821 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27822 this_ptr_conv.is_owned = false;
27823 OpenChannel_set_channel_flags(&this_ptr_conv, val);
27826 uint64_t __attribute__((export_name("TS_OpenChannel_get_channel_type"))) TS_OpenChannel_get_channel_type(uint64_t this_ptr) {
27827 LDKOpenChannel this_ptr_conv;
27828 this_ptr_conv.inner = untag_ptr(this_ptr);
27829 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27830 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27831 this_ptr_conv.is_owned = false;
27832 LDKChannelTypeFeatures ret_var = OpenChannel_get_channel_type(&this_ptr_conv);
27833 uint64_t ret_ref = 0;
27834 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27835 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27839 void __attribute__((export_name("TS_OpenChannel_set_channel_type"))) TS_OpenChannel_set_channel_type(uint64_t this_ptr, uint64_t val) {
27840 LDKOpenChannel this_ptr_conv;
27841 this_ptr_conv.inner = untag_ptr(this_ptr);
27842 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27843 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27844 this_ptr_conv.is_owned = false;
27845 LDKChannelTypeFeatures val_conv;
27846 val_conv.inner = untag_ptr(val);
27847 val_conv.is_owned = ptr_is_owned(val);
27848 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
27849 val_conv = ChannelTypeFeatures_clone(&val_conv);
27850 OpenChannel_set_channel_type(&this_ptr_conv, val_conv);
27853 static inline uint64_t OpenChannel_clone_ptr(LDKOpenChannel *NONNULL_PTR arg) {
27854 LDKOpenChannel ret_var = OpenChannel_clone(arg);
27855 uint64_t ret_ref = 0;
27856 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27857 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27860 int64_t __attribute__((export_name("TS_OpenChannel_clone_ptr"))) TS_OpenChannel_clone_ptr(uint64_t arg) {
27861 LDKOpenChannel arg_conv;
27862 arg_conv.inner = untag_ptr(arg);
27863 arg_conv.is_owned = ptr_is_owned(arg);
27864 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
27865 arg_conv.is_owned = false;
27866 int64_t ret_conv = OpenChannel_clone_ptr(&arg_conv);
27870 uint64_t __attribute__((export_name("TS_OpenChannel_clone"))) TS_OpenChannel_clone(uint64_t orig) {
27871 LDKOpenChannel orig_conv;
27872 orig_conv.inner = untag_ptr(orig);
27873 orig_conv.is_owned = ptr_is_owned(orig);
27874 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
27875 orig_conv.is_owned = false;
27876 LDKOpenChannel ret_var = OpenChannel_clone(&orig_conv);
27877 uint64_t ret_ref = 0;
27878 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27879 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27883 void __attribute__((export_name("TS_AcceptChannel_free"))) TS_AcceptChannel_free(uint64_t this_obj) {
27884 LDKAcceptChannel this_obj_conv;
27885 this_obj_conv.inner = untag_ptr(this_obj);
27886 this_obj_conv.is_owned = ptr_is_owned(this_obj);
27887 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
27888 AcceptChannel_free(this_obj_conv);
27891 int8_tArray __attribute__((export_name("TS_AcceptChannel_get_temporary_channel_id"))) TS_AcceptChannel_get_temporary_channel_id(uint64_t this_ptr) {
27892 LDKAcceptChannel this_ptr_conv;
27893 this_ptr_conv.inner = untag_ptr(this_ptr);
27894 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27895 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27896 this_ptr_conv.is_owned = false;
27897 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
27898 memcpy(ret_arr->elems, *AcceptChannel_get_temporary_channel_id(&this_ptr_conv), 32);
27902 void __attribute__((export_name("TS_AcceptChannel_set_temporary_channel_id"))) TS_AcceptChannel_set_temporary_channel_id(uint64_t this_ptr, int8_tArray val) {
27903 LDKAcceptChannel this_ptr_conv;
27904 this_ptr_conv.inner = untag_ptr(this_ptr);
27905 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27906 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27907 this_ptr_conv.is_owned = false;
27908 LDKThirtyTwoBytes val_ref;
27909 CHECK(val->arr_len == 32);
27910 memcpy(val_ref.data, val->elems, 32); FREE(val);
27911 AcceptChannel_set_temporary_channel_id(&this_ptr_conv, val_ref);
27914 int64_t __attribute__((export_name("TS_AcceptChannel_get_dust_limit_satoshis"))) TS_AcceptChannel_get_dust_limit_satoshis(uint64_t this_ptr) {
27915 LDKAcceptChannel this_ptr_conv;
27916 this_ptr_conv.inner = untag_ptr(this_ptr);
27917 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27918 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27919 this_ptr_conv.is_owned = false;
27920 int64_t ret_conv = AcceptChannel_get_dust_limit_satoshis(&this_ptr_conv);
27924 void __attribute__((export_name("TS_AcceptChannel_set_dust_limit_satoshis"))) TS_AcceptChannel_set_dust_limit_satoshis(uint64_t this_ptr, int64_t val) {
27925 LDKAcceptChannel this_ptr_conv;
27926 this_ptr_conv.inner = untag_ptr(this_ptr);
27927 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27928 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27929 this_ptr_conv.is_owned = false;
27930 AcceptChannel_set_dust_limit_satoshis(&this_ptr_conv, val);
27933 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) {
27934 LDKAcceptChannel this_ptr_conv;
27935 this_ptr_conv.inner = untag_ptr(this_ptr);
27936 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27937 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27938 this_ptr_conv.is_owned = false;
27939 int64_t ret_conv = AcceptChannel_get_max_htlc_value_in_flight_msat(&this_ptr_conv);
27943 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) {
27944 LDKAcceptChannel this_ptr_conv;
27945 this_ptr_conv.inner = untag_ptr(this_ptr);
27946 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27947 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27948 this_ptr_conv.is_owned = false;
27949 AcceptChannel_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val);
27952 int64_t __attribute__((export_name("TS_AcceptChannel_get_channel_reserve_satoshis"))) TS_AcceptChannel_get_channel_reserve_satoshis(uint64_t this_ptr) {
27953 LDKAcceptChannel this_ptr_conv;
27954 this_ptr_conv.inner = untag_ptr(this_ptr);
27955 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27956 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27957 this_ptr_conv.is_owned = false;
27958 int64_t ret_conv = AcceptChannel_get_channel_reserve_satoshis(&this_ptr_conv);
27962 void __attribute__((export_name("TS_AcceptChannel_set_channel_reserve_satoshis"))) TS_AcceptChannel_set_channel_reserve_satoshis(uint64_t this_ptr, int64_t val) {
27963 LDKAcceptChannel this_ptr_conv;
27964 this_ptr_conv.inner = untag_ptr(this_ptr);
27965 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27966 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27967 this_ptr_conv.is_owned = false;
27968 AcceptChannel_set_channel_reserve_satoshis(&this_ptr_conv, val);
27971 int64_t __attribute__((export_name("TS_AcceptChannel_get_htlc_minimum_msat"))) TS_AcceptChannel_get_htlc_minimum_msat(uint64_t this_ptr) {
27972 LDKAcceptChannel this_ptr_conv;
27973 this_ptr_conv.inner = untag_ptr(this_ptr);
27974 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27975 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27976 this_ptr_conv.is_owned = false;
27977 int64_t ret_conv = AcceptChannel_get_htlc_minimum_msat(&this_ptr_conv);
27981 void __attribute__((export_name("TS_AcceptChannel_set_htlc_minimum_msat"))) TS_AcceptChannel_set_htlc_minimum_msat(uint64_t this_ptr, int64_t val) {
27982 LDKAcceptChannel this_ptr_conv;
27983 this_ptr_conv.inner = untag_ptr(this_ptr);
27984 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27985 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27986 this_ptr_conv.is_owned = false;
27987 AcceptChannel_set_htlc_minimum_msat(&this_ptr_conv, val);
27990 int32_t __attribute__((export_name("TS_AcceptChannel_get_minimum_depth"))) TS_AcceptChannel_get_minimum_depth(uint64_t this_ptr) {
27991 LDKAcceptChannel this_ptr_conv;
27992 this_ptr_conv.inner = untag_ptr(this_ptr);
27993 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27994 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27995 this_ptr_conv.is_owned = false;
27996 int32_t ret_conv = AcceptChannel_get_minimum_depth(&this_ptr_conv);
28000 void __attribute__((export_name("TS_AcceptChannel_set_minimum_depth"))) TS_AcceptChannel_set_minimum_depth(uint64_t this_ptr, int32_t val) {
28001 LDKAcceptChannel this_ptr_conv;
28002 this_ptr_conv.inner = untag_ptr(this_ptr);
28003 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28004 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28005 this_ptr_conv.is_owned = false;
28006 AcceptChannel_set_minimum_depth(&this_ptr_conv, val);
28009 int16_t __attribute__((export_name("TS_AcceptChannel_get_to_self_delay"))) TS_AcceptChannel_get_to_self_delay(uint64_t this_ptr) {
28010 LDKAcceptChannel this_ptr_conv;
28011 this_ptr_conv.inner = untag_ptr(this_ptr);
28012 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28013 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28014 this_ptr_conv.is_owned = false;
28015 int16_t ret_conv = AcceptChannel_get_to_self_delay(&this_ptr_conv);
28019 void __attribute__((export_name("TS_AcceptChannel_set_to_self_delay"))) TS_AcceptChannel_set_to_self_delay(uint64_t this_ptr, int16_t val) {
28020 LDKAcceptChannel this_ptr_conv;
28021 this_ptr_conv.inner = untag_ptr(this_ptr);
28022 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28023 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28024 this_ptr_conv.is_owned = false;
28025 AcceptChannel_set_to_self_delay(&this_ptr_conv, val);
28028 int16_t __attribute__((export_name("TS_AcceptChannel_get_max_accepted_htlcs"))) TS_AcceptChannel_get_max_accepted_htlcs(uint64_t this_ptr) {
28029 LDKAcceptChannel this_ptr_conv;
28030 this_ptr_conv.inner = untag_ptr(this_ptr);
28031 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28032 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28033 this_ptr_conv.is_owned = false;
28034 int16_t ret_conv = AcceptChannel_get_max_accepted_htlcs(&this_ptr_conv);
28038 void __attribute__((export_name("TS_AcceptChannel_set_max_accepted_htlcs"))) TS_AcceptChannel_set_max_accepted_htlcs(uint64_t this_ptr, int16_t val) {
28039 LDKAcceptChannel this_ptr_conv;
28040 this_ptr_conv.inner = untag_ptr(this_ptr);
28041 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28042 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28043 this_ptr_conv.is_owned = false;
28044 AcceptChannel_set_max_accepted_htlcs(&this_ptr_conv, val);
28047 int8_tArray __attribute__((export_name("TS_AcceptChannel_get_funding_pubkey"))) TS_AcceptChannel_get_funding_pubkey(uint64_t this_ptr) {
28048 LDKAcceptChannel this_ptr_conv;
28049 this_ptr_conv.inner = untag_ptr(this_ptr);
28050 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28051 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28052 this_ptr_conv.is_owned = false;
28053 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
28054 memcpy(ret_arr->elems, AcceptChannel_get_funding_pubkey(&this_ptr_conv).compressed_form, 33);
28058 void __attribute__((export_name("TS_AcceptChannel_set_funding_pubkey"))) TS_AcceptChannel_set_funding_pubkey(uint64_t this_ptr, int8_tArray val) {
28059 LDKAcceptChannel this_ptr_conv;
28060 this_ptr_conv.inner = untag_ptr(this_ptr);
28061 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28062 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28063 this_ptr_conv.is_owned = false;
28064 LDKPublicKey val_ref;
28065 CHECK(val->arr_len == 33);
28066 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
28067 AcceptChannel_set_funding_pubkey(&this_ptr_conv, val_ref);
28070 int8_tArray __attribute__((export_name("TS_AcceptChannel_get_revocation_basepoint"))) TS_AcceptChannel_get_revocation_basepoint(uint64_t this_ptr) {
28071 LDKAcceptChannel this_ptr_conv;
28072 this_ptr_conv.inner = untag_ptr(this_ptr);
28073 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28074 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28075 this_ptr_conv.is_owned = false;
28076 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
28077 memcpy(ret_arr->elems, AcceptChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form, 33);
28081 void __attribute__((export_name("TS_AcceptChannel_set_revocation_basepoint"))) TS_AcceptChannel_set_revocation_basepoint(uint64_t this_ptr, int8_tArray val) {
28082 LDKAcceptChannel this_ptr_conv;
28083 this_ptr_conv.inner = untag_ptr(this_ptr);
28084 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28085 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28086 this_ptr_conv.is_owned = false;
28087 LDKPublicKey val_ref;
28088 CHECK(val->arr_len == 33);
28089 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
28090 AcceptChannel_set_revocation_basepoint(&this_ptr_conv, val_ref);
28093 int8_tArray __attribute__((export_name("TS_AcceptChannel_get_payment_point"))) TS_AcceptChannel_get_payment_point(uint64_t this_ptr) {
28094 LDKAcceptChannel this_ptr_conv;
28095 this_ptr_conv.inner = untag_ptr(this_ptr);
28096 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28097 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28098 this_ptr_conv.is_owned = false;
28099 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
28100 memcpy(ret_arr->elems, AcceptChannel_get_payment_point(&this_ptr_conv).compressed_form, 33);
28104 void __attribute__((export_name("TS_AcceptChannel_set_payment_point"))) TS_AcceptChannel_set_payment_point(uint64_t this_ptr, int8_tArray val) {
28105 LDKAcceptChannel this_ptr_conv;
28106 this_ptr_conv.inner = untag_ptr(this_ptr);
28107 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28108 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28109 this_ptr_conv.is_owned = false;
28110 LDKPublicKey val_ref;
28111 CHECK(val->arr_len == 33);
28112 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
28113 AcceptChannel_set_payment_point(&this_ptr_conv, val_ref);
28116 int8_tArray __attribute__((export_name("TS_AcceptChannel_get_delayed_payment_basepoint"))) TS_AcceptChannel_get_delayed_payment_basepoint(uint64_t this_ptr) {
28117 LDKAcceptChannel this_ptr_conv;
28118 this_ptr_conv.inner = untag_ptr(this_ptr);
28119 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28120 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28121 this_ptr_conv.is_owned = false;
28122 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
28123 memcpy(ret_arr->elems, AcceptChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33);
28127 void __attribute__((export_name("TS_AcceptChannel_set_delayed_payment_basepoint"))) TS_AcceptChannel_set_delayed_payment_basepoint(uint64_t this_ptr, int8_tArray val) {
28128 LDKAcceptChannel this_ptr_conv;
28129 this_ptr_conv.inner = untag_ptr(this_ptr);
28130 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28131 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28132 this_ptr_conv.is_owned = false;
28133 LDKPublicKey val_ref;
28134 CHECK(val->arr_len == 33);
28135 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
28136 AcceptChannel_set_delayed_payment_basepoint(&this_ptr_conv, val_ref);
28139 int8_tArray __attribute__((export_name("TS_AcceptChannel_get_htlc_basepoint"))) TS_AcceptChannel_get_htlc_basepoint(uint64_t this_ptr) {
28140 LDKAcceptChannel this_ptr_conv;
28141 this_ptr_conv.inner = untag_ptr(this_ptr);
28142 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28143 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28144 this_ptr_conv.is_owned = false;
28145 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
28146 memcpy(ret_arr->elems, AcceptChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form, 33);
28150 void __attribute__((export_name("TS_AcceptChannel_set_htlc_basepoint"))) TS_AcceptChannel_set_htlc_basepoint(uint64_t this_ptr, int8_tArray val) {
28151 LDKAcceptChannel this_ptr_conv;
28152 this_ptr_conv.inner = untag_ptr(this_ptr);
28153 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28154 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28155 this_ptr_conv.is_owned = false;
28156 LDKPublicKey val_ref;
28157 CHECK(val->arr_len == 33);
28158 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
28159 AcceptChannel_set_htlc_basepoint(&this_ptr_conv, val_ref);
28162 int8_tArray __attribute__((export_name("TS_AcceptChannel_get_first_per_commitment_point"))) TS_AcceptChannel_get_first_per_commitment_point(uint64_t this_ptr) {
28163 LDKAcceptChannel this_ptr_conv;
28164 this_ptr_conv.inner = untag_ptr(this_ptr);
28165 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28166 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28167 this_ptr_conv.is_owned = false;
28168 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
28169 memcpy(ret_arr->elems, AcceptChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form, 33);
28173 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) {
28174 LDKAcceptChannel this_ptr_conv;
28175 this_ptr_conv.inner = untag_ptr(this_ptr);
28176 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28177 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28178 this_ptr_conv.is_owned = false;
28179 LDKPublicKey val_ref;
28180 CHECK(val->arr_len == 33);
28181 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
28182 AcceptChannel_set_first_per_commitment_point(&this_ptr_conv, val_ref);
28185 uint64_t __attribute__((export_name("TS_AcceptChannel_get_channel_type"))) TS_AcceptChannel_get_channel_type(uint64_t this_ptr) {
28186 LDKAcceptChannel this_ptr_conv;
28187 this_ptr_conv.inner = untag_ptr(this_ptr);
28188 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28189 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28190 this_ptr_conv.is_owned = false;
28191 LDKChannelTypeFeatures ret_var = AcceptChannel_get_channel_type(&this_ptr_conv);
28192 uint64_t ret_ref = 0;
28193 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28194 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28198 void __attribute__((export_name("TS_AcceptChannel_set_channel_type"))) TS_AcceptChannel_set_channel_type(uint64_t this_ptr, uint64_t val) {
28199 LDKAcceptChannel this_ptr_conv;
28200 this_ptr_conv.inner = untag_ptr(this_ptr);
28201 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28202 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28203 this_ptr_conv.is_owned = false;
28204 LDKChannelTypeFeatures val_conv;
28205 val_conv.inner = untag_ptr(val);
28206 val_conv.is_owned = ptr_is_owned(val);
28207 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
28208 val_conv = ChannelTypeFeatures_clone(&val_conv);
28209 AcceptChannel_set_channel_type(&this_ptr_conv, val_conv);
28212 static inline uint64_t AcceptChannel_clone_ptr(LDKAcceptChannel *NONNULL_PTR arg) {
28213 LDKAcceptChannel ret_var = AcceptChannel_clone(arg);
28214 uint64_t ret_ref = 0;
28215 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28216 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28219 int64_t __attribute__((export_name("TS_AcceptChannel_clone_ptr"))) TS_AcceptChannel_clone_ptr(uint64_t arg) {
28220 LDKAcceptChannel arg_conv;
28221 arg_conv.inner = untag_ptr(arg);
28222 arg_conv.is_owned = ptr_is_owned(arg);
28223 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28224 arg_conv.is_owned = false;
28225 int64_t ret_conv = AcceptChannel_clone_ptr(&arg_conv);
28229 uint64_t __attribute__((export_name("TS_AcceptChannel_clone"))) TS_AcceptChannel_clone(uint64_t orig) {
28230 LDKAcceptChannel orig_conv;
28231 orig_conv.inner = untag_ptr(orig);
28232 orig_conv.is_owned = ptr_is_owned(orig);
28233 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28234 orig_conv.is_owned = false;
28235 LDKAcceptChannel ret_var = AcceptChannel_clone(&orig_conv);
28236 uint64_t ret_ref = 0;
28237 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28238 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28242 void __attribute__((export_name("TS_FundingCreated_free"))) TS_FundingCreated_free(uint64_t this_obj) {
28243 LDKFundingCreated this_obj_conv;
28244 this_obj_conv.inner = untag_ptr(this_obj);
28245 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28246 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28247 FundingCreated_free(this_obj_conv);
28250 int8_tArray __attribute__((export_name("TS_FundingCreated_get_temporary_channel_id"))) TS_FundingCreated_get_temporary_channel_id(uint64_t this_ptr) {
28251 LDKFundingCreated this_ptr_conv;
28252 this_ptr_conv.inner = untag_ptr(this_ptr);
28253 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28254 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28255 this_ptr_conv.is_owned = false;
28256 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
28257 memcpy(ret_arr->elems, *FundingCreated_get_temporary_channel_id(&this_ptr_conv), 32);
28261 void __attribute__((export_name("TS_FundingCreated_set_temporary_channel_id"))) TS_FundingCreated_set_temporary_channel_id(uint64_t this_ptr, int8_tArray val) {
28262 LDKFundingCreated this_ptr_conv;
28263 this_ptr_conv.inner = untag_ptr(this_ptr);
28264 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28265 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28266 this_ptr_conv.is_owned = false;
28267 LDKThirtyTwoBytes val_ref;
28268 CHECK(val->arr_len == 32);
28269 memcpy(val_ref.data, val->elems, 32); FREE(val);
28270 FundingCreated_set_temporary_channel_id(&this_ptr_conv, val_ref);
28273 int8_tArray __attribute__((export_name("TS_FundingCreated_get_funding_txid"))) TS_FundingCreated_get_funding_txid(uint64_t this_ptr) {
28274 LDKFundingCreated this_ptr_conv;
28275 this_ptr_conv.inner = untag_ptr(this_ptr);
28276 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28277 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28278 this_ptr_conv.is_owned = false;
28279 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
28280 memcpy(ret_arr->elems, *FundingCreated_get_funding_txid(&this_ptr_conv), 32);
28284 void __attribute__((export_name("TS_FundingCreated_set_funding_txid"))) TS_FundingCreated_set_funding_txid(uint64_t this_ptr, int8_tArray val) {
28285 LDKFundingCreated this_ptr_conv;
28286 this_ptr_conv.inner = untag_ptr(this_ptr);
28287 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28288 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28289 this_ptr_conv.is_owned = false;
28290 LDKThirtyTwoBytes val_ref;
28291 CHECK(val->arr_len == 32);
28292 memcpy(val_ref.data, val->elems, 32); FREE(val);
28293 FundingCreated_set_funding_txid(&this_ptr_conv, val_ref);
28296 int16_t __attribute__((export_name("TS_FundingCreated_get_funding_output_index"))) TS_FundingCreated_get_funding_output_index(uint64_t this_ptr) {
28297 LDKFundingCreated this_ptr_conv;
28298 this_ptr_conv.inner = untag_ptr(this_ptr);
28299 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28300 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28301 this_ptr_conv.is_owned = false;
28302 int16_t ret_conv = FundingCreated_get_funding_output_index(&this_ptr_conv);
28306 void __attribute__((export_name("TS_FundingCreated_set_funding_output_index"))) TS_FundingCreated_set_funding_output_index(uint64_t this_ptr, int16_t val) {
28307 LDKFundingCreated this_ptr_conv;
28308 this_ptr_conv.inner = untag_ptr(this_ptr);
28309 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28310 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28311 this_ptr_conv.is_owned = false;
28312 FundingCreated_set_funding_output_index(&this_ptr_conv, val);
28315 int8_tArray __attribute__((export_name("TS_FundingCreated_get_signature"))) TS_FundingCreated_get_signature(uint64_t this_ptr) {
28316 LDKFundingCreated this_ptr_conv;
28317 this_ptr_conv.inner = untag_ptr(this_ptr);
28318 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28319 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28320 this_ptr_conv.is_owned = false;
28321 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
28322 memcpy(ret_arr->elems, FundingCreated_get_signature(&this_ptr_conv).compact_form, 64);
28326 void __attribute__((export_name("TS_FundingCreated_set_signature"))) TS_FundingCreated_set_signature(uint64_t this_ptr, int8_tArray val) {
28327 LDKFundingCreated this_ptr_conv;
28328 this_ptr_conv.inner = untag_ptr(this_ptr);
28329 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28330 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28331 this_ptr_conv.is_owned = false;
28332 LDKSignature val_ref;
28333 CHECK(val->arr_len == 64);
28334 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
28335 FundingCreated_set_signature(&this_ptr_conv, val_ref);
28338 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) {
28339 LDKThirtyTwoBytes temporary_channel_id_arg_ref;
28340 CHECK(temporary_channel_id_arg->arr_len == 32);
28341 memcpy(temporary_channel_id_arg_ref.data, temporary_channel_id_arg->elems, 32); FREE(temporary_channel_id_arg);
28342 LDKThirtyTwoBytes funding_txid_arg_ref;
28343 CHECK(funding_txid_arg->arr_len == 32);
28344 memcpy(funding_txid_arg_ref.data, funding_txid_arg->elems, 32); FREE(funding_txid_arg);
28345 LDKSignature signature_arg_ref;
28346 CHECK(signature_arg->arr_len == 64);
28347 memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg);
28348 LDKFundingCreated ret_var = FundingCreated_new(temporary_channel_id_arg_ref, funding_txid_arg_ref, funding_output_index_arg, signature_arg_ref);
28349 uint64_t ret_ref = 0;
28350 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28351 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28355 static inline uint64_t FundingCreated_clone_ptr(LDKFundingCreated *NONNULL_PTR arg) {
28356 LDKFundingCreated ret_var = FundingCreated_clone(arg);
28357 uint64_t ret_ref = 0;
28358 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28359 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28362 int64_t __attribute__((export_name("TS_FundingCreated_clone_ptr"))) TS_FundingCreated_clone_ptr(uint64_t arg) {
28363 LDKFundingCreated arg_conv;
28364 arg_conv.inner = untag_ptr(arg);
28365 arg_conv.is_owned = ptr_is_owned(arg);
28366 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28367 arg_conv.is_owned = false;
28368 int64_t ret_conv = FundingCreated_clone_ptr(&arg_conv);
28372 uint64_t __attribute__((export_name("TS_FundingCreated_clone"))) TS_FundingCreated_clone(uint64_t orig) {
28373 LDKFundingCreated orig_conv;
28374 orig_conv.inner = untag_ptr(orig);
28375 orig_conv.is_owned = ptr_is_owned(orig);
28376 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28377 orig_conv.is_owned = false;
28378 LDKFundingCreated ret_var = FundingCreated_clone(&orig_conv);
28379 uint64_t ret_ref = 0;
28380 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28381 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28385 void __attribute__((export_name("TS_FundingSigned_free"))) TS_FundingSigned_free(uint64_t this_obj) {
28386 LDKFundingSigned this_obj_conv;
28387 this_obj_conv.inner = untag_ptr(this_obj);
28388 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28389 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28390 FundingSigned_free(this_obj_conv);
28393 int8_tArray __attribute__((export_name("TS_FundingSigned_get_channel_id"))) TS_FundingSigned_get_channel_id(uint64_t this_ptr) {
28394 LDKFundingSigned this_ptr_conv;
28395 this_ptr_conv.inner = untag_ptr(this_ptr);
28396 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28397 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28398 this_ptr_conv.is_owned = false;
28399 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
28400 memcpy(ret_arr->elems, *FundingSigned_get_channel_id(&this_ptr_conv), 32);
28404 void __attribute__((export_name("TS_FundingSigned_set_channel_id"))) TS_FundingSigned_set_channel_id(uint64_t this_ptr, int8_tArray val) {
28405 LDKFundingSigned this_ptr_conv;
28406 this_ptr_conv.inner = untag_ptr(this_ptr);
28407 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28408 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28409 this_ptr_conv.is_owned = false;
28410 LDKThirtyTwoBytes val_ref;
28411 CHECK(val->arr_len == 32);
28412 memcpy(val_ref.data, val->elems, 32); FREE(val);
28413 FundingSigned_set_channel_id(&this_ptr_conv, val_ref);
28416 int8_tArray __attribute__((export_name("TS_FundingSigned_get_signature"))) TS_FundingSigned_get_signature(uint64_t this_ptr) {
28417 LDKFundingSigned this_ptr_conv;
28418 this_ptr_conv.inner = untag_ptr(this_ptr);
28419 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28420 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28421 this_ptr_conv.is_owned = false;
28422 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
28423 memcpy(ret_arr->elems, FundingSigned_get_signature(&this_ptr_conv).compact_form, 64);
28427 void __attribute__((export_name("TS_FundingSigned_set_signature"))) TS_FundingSigned_set_signature(uint64_t this_ptr, int8_tArray val) {
28428 LDKFundingSigned this_ptr_conv;
28429 this_ptr_conv.inner = untag_ptr(this_ptr);
28430 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28431 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28432 this_ptr_conv.is_owned = false;
28433 LDKSignature val_ref;
28434 CHECK(val->arr_len == 64);
28435 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
28436 FundingSigned_set_signature(&this_ptr_conv, val_ref);
28439 uint64_t __attribute__((export_name("TS_FundingSigned_new"))) TS_FundingSigned_new(int8_tArray channel_id_arg, int8_tArray signature_arg) {
28440 LDKThirtyTwoBytes channel_id_arg_ref;
28441 CHECK(channel_id_arg->arr_len == 32);
28442 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
28443 LDKSignature signature_arg_ref;
28444 CHECK(signature_arg->arr_len == 64);
28445 memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg);
28446 LDKFundingSigned ret_var = FundingSigned_new(channel_id_arg_ref, signature_arg_ref);
28447 uint64_t ret_ref = 0;
28448 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28449 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28453 static inline uint64_t FundingSigned_clone_ptr(LDKFundingSigned *NONNULL_PTR arg) {
28454 LDKFundingSigned ret_var = FundingSigned_clone(arg);
28455 uint64_t ret_ref = 0;
28456 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28457 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28460 int64_t __attribute__((export_name("TS_FundingSigned_clone_ptr"))) TS_FundingSigned_clone_ptr(uint64_t arg) {
28461 LDKFundingSigned arg_conv;
28462 arg_conv.inner = untag_ptr(arg);
28463 arg_conv.is_owned = ptr_is_owned(arg);
28464 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28465 arg_conv.is_owned = false;
28466 int64_t ret_conv = FundingSigned_clone_ptr(&arg_conv);
28470 uint64_t __attribute__((export_name("TS_FundingSigned_clone"))) TS_FundingSigned_clone(uint64_t orig) {
28471 LDKFundingSigned orig_conv;
28472 orig_conv.inner = untag_ptr(orig);
28473 orig_conv.is_owned = ptr_is_owned(orig);
28474 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28475 orig_conv.is_owned = false;
28476 LDKFundingSigned ret_var = FundingSigned_clone(&orig_conv);
28477 uint64_t ret_ref = 0;
28478 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28479 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28483 void __attribute__((export_name("TS_ChannelReady_free"))) TS_ChannelReady_free(uint64_t this_obj) {
28484 LDKChannelReady this_obj_conv;
28485 this_obj_conv.inner = untag_ptr(this_obj);
28486 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28487 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28488 ChannelReady_free(this_obj_conv);
28491 int8_tArray __attribute__((export_name("TS_ChannelReady_get_channel_id"))) TS_ChannelReady_get_channel_id(uint64_t this_ptr) {
28492 LDKChannelReady this_ptr_conv;
28493 this_ptr_conv.inner = untag_ptr(this_ptr);
28494 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28495 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28496 this_ptr_conv.is_owned = false;
28497 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
28498 memcpy(ret_arr->elems, *ChannelReady_get_channel_id(&this_ptr_conv), 32);
28502 void __attribute__((export_name("TS_ChannelReady_set_channel_id"))) TS_ChannelReady_set_channel_id(uint64_t this_ptr, int8_tArray val) {
28503 LDKChannelReady this_ptr_conv;
28504 this_ptr_conv.inner = untag_ptr(this_ptr);
28505 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28506 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28507 this_ptr_conv.is_owned = false;
28508 LDKThirtyTwoBytes val_ref;
28509 CHECK(val->arr_len == 32);
28510 memcpy(val_ref.data, val->elems, 32); FREE(val);
28511 ChannelReady_set_channel_id(&this_ptr_conv, val_ref);
28514 int8_tArray __attribute__((export_name("TS_ChannelReady_get_next_per_commitment_point"))) TS_ChannelReady_get_next_per_commitment_point(uint64_t this_ptr) {
28515 LDKChannelReady this_ptr_conv;
28516 this_ptr_conv.inner = untag_ptr(this_ptr);
28517 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28518 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28519 this_ptr_conv.is_owned = false;
28520 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
28521 memcpy(ret_arr->elems, ChannelReady_get_next_per_commitment_point(&this_ptr_conv).compressed_form, 33);
28525 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) {
28526 LDKChannelReady this_ptr_conv;
28527 this_ptr_conv.inner = untag_ptr(this_ptr);
28528 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28529 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28530 this_ptr_conv.is_owned = false;
28531 LDKPublicKey val_ref;
28532 CHECK(val->arr_len == 33);
28533 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
28534 ChannelReady_set_next_per_commitment_point(&this_ptr_conv, val_ref);
28537 uint64_t __attribute__((export_name("TS_ChannelReady_get_short_channel_id_alias"))) TS_ChannelReady_get_short_channel_id_alias(uint64_t this_ptr) {
28538 LDKChannelReady this_ptr_conv;
28539 this_ptr_conv.inner = untag_ptr(this_ptr);
28540 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28541 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28542 this_ptr_conv.is_owned = false;
28543 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
28544 *ret_copy = ChannelReady_get_short_channel_id_alias(&this_ptr_conv);
28545 uint64_t ret_ref = tag_ptr(ret_copy, true);
28549 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) {
28550 LDKChannelReady this_ptr_conv;
28551 this_ptr_conv.inner = untag_ptr(this_ptr);
28552 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28553 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28554 this_ptr_conv.is_owned = false;
28555 void* val_ptr = untag_ptr(val);
28556 CHECK_ACCESS(val_ptr);
28557 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
28558 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
28559 ChannelReady_set_short_channel_id_alias(&this_ptr_conv, val_conv);
28562 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) {
28563 LDKThirtyTwoBytes channel_id_arg_ref;
28564 CHECK(channel_id_arg->arr_len == 32);
28565 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
28566 LDKPublicKey next_per_commitment_point_arg_ref;
28567 CHECK(next_per_commitment_point_arg->arr_len == 33);
28568 memcpy(next_per_commitment_point_arg_ref.compressed_form, next_per_commitment_point_arg->elems, 33); FREE(next_per_commitment_point_arg);
28569 void* short_channel_id_alias_arg_ptr = untag_ptr(short_channel_id_alias_arg);
28570 CHECK_ACCESS(short_channel_id_alias_arg_ptr);
28571 LDKCOption_u64Z short_channel_id_alias_arg_conv = *(LDKCOption_u64Z*)(short_channel_id_alias_arg_ptr);
28572 short_channel_id_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id_alias_arg));
28573 LDKChannelReady ret_var = ChannelReady_new(channel_id_arg_ref, next_per_commitment_point_arg_ref, short_channel_id_alias_arg_conv);
28574 uint64_t ret_ref = 0;
28575 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28576 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28580 static inline uint64_t ChannelReady_clone_ptr(LDKChannelReady *NONNULL_PTR arg) {
28581 LDKChannelReady ret_var = ChannelReady_clone(arg);
28582 uint64_t ret_ref = 0;
28583 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28584 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28587 int64_t __attribute__((export_name("TS_ChannelReady_clone_ptr"))) TS_ChannelReady_clone_ptr(uint64_t arg) {
28588 LDKChannelReady arg_conv;
28589 arg_conv.inner = untag_ptr(arg);
28590 arg_conv.is_owned = ptr_is_owned(arg);
28591 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28592 arg_conv.is_owned = false;
28593 int64_t ret_conv = ChannelReady_clone_ptr(&arg_conv);
28597 uint64_t __attribute__((export_name("TS_ChannelReady_clone"))) TS_ChannelReady_clone(uint64_t orig) {
28598 LDKChannelReady orig_conv;
28599 orig_conv.inner = untag_ptr(orig);
28600 orig_conv.is_owned = ptr_is_owned(orig);
28601 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28602 orig_conv.is_owned = false;
28603 LDKChannelReady ret_var = ChannelReady_clone(&orig_conv);
28604 uint64_t ret_ref = 0;
28605 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28606 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28610 void __attribute__((export_name("TS_Shutdown_free"))) TS_Shutdown_free(uint64_t this_obj) {
28611 LDKShutdown this_obj_conv;
28612 this_obj_conv.inner = untag_ptr(this_obj);
28613 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28614 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28615 Shutdown_free(this_obj_conv);
28618 int8_tArray __attribute__((export_name("TS_Shutdown_get_channel_id"))) TS_Shutdown_get_channel_id(uint64_t this_ptr) {
28619 LDKShutdown this_ptr_conv;
28620 this_ptr_conv.inner = untag_ptr(this_ptr);
28621 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28622 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28623 this_ptr_conv.is_owned = false;
28624 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
28625 memcpy(ret_arr->elems, *Shutdown_get_channel_id(&this_ptr_conv), 32);
28629 void __attribute__((export_name("TS_Shutdown_set_channel_id"))) TS_Shutdown_set_channel_id(uint64_t this_ptr, int8_tArray val) {
28630 LDKShutdown this_ptr_conv;
28631 this_ptr_conv.inner = untag_ptr(this_ptr);
28632 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28633 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28634 this_ptr_conv.is_owned = false;
28635 LDKThirtyTwoBytes val_ref;
28636 CHECK(val->arr_len == 32);
28637 memcpy(val_ref.data, val->elems, 32); FREE(val);
28638 Shutdown_set_channel_id(&this_ptr_conv, val_ref);
28641 int8_tArray __attribute__((export_name("TS_Shutdown_get_scriptpubkey"))) TS_Shutdown_get_scriptpubkey(uint64_t this_ptr) {
28642 LDKShutdown this_ptr_conv;
28643 this_ptr_conv.inner = untag_ptr(this_ptr);
28644 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28645 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28646 this_ptr_conv.is_owned = false;
28647 LDKu8slice ret_var = Shutdown_get_scriptpubkey(&this_ptr_conv);
28648 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
28649 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
28653 void __attribute__((export_name("TS_Shutdown_set_scriptpubkey"))) TS_Shutdown_set_scriptpubkey(uint64_t this_ptr, int8_tArray val) {
28654 LDKShutdown this_ptr_conv;
28655 this_ptr_conv.inner = untag_ptr(this_ptr);
28656 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28657 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28658 this_ptr_conv.is_owned = false;
28659 LDKCVec_u8Z val_ref;
28660 val_ref.datalen = val->arr_len;
28661 val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes");
28662 memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val);
28663 Shutdown_set_scriptpubkey(&this_ptr_conv, val_ref);
28666 uint64_t __attribute__((export_name("TS_Shutdown_new"))) TS_Shutdown_new(int8_tArray channel_id_arg, int8_tArray scriptpubkey_arg) {
28667 LDKThirtyTwoBytes channel_id_arg_ref;
28668 CHECK(channel_id_arg->arr_len == 32);
28669 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
28670 LDKCVec_u8Z scriptpubkey_arg_ref;
28671 scriptpubkey_arg_ref.datalen = scriptpubkey_arg->arr_len;
28672 scriptpubkey_arg_ref.data = MALLOC(scriptpubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes");
28673 memcpy(scriptpubkey_arg_ref.data, scriptpubkey_arg->elems, scriptpubkey_arg_ref.datalen); FREE(scriptpubkey_arg);
28674 LDKShutdown ret_var = Shutdown_new(channel_id_arg_ref, scriptpubkey_arg_ref);
28675 uint64_t ret_ref = 0;
28676 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28677 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28681 static inline uint64_t Shutdown_clone_ptr(LDKShutdown *NONNULL_PTR arg) {
28682 LDKShutdown ret_var = Shutdown_clone(arg);
28683 uint64_t ret_ref = 0;
28684 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28685 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28688 int64_t __attribute__((export_name("TS_Shutdown_clone_ptr"))) TS_Shutdown_clone_ptr(uint64_t arg) {
28689 LDKShutdown arg_conv;
28690 arg_conv.inner = untag_ptr(arg);
28691 arg_conv.is_owned = ptr_is_owned(arg);
28692 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28693 arg_conv.is_owned = false;
28694 int64_t ret_conv = Shutdown_clone_ptr(&arg_conv);
28698 uint64_t __attribute__((export_name("TS_Shutdown_clone"))) TS_Shutdown_clone(uint64_t orig) {
28699 LDKShutdown orig_conv;
28700 orig_conv.inner = untag_ptr(orig);
28701 orig_conv.is_owned = ptr_is_owned(orig);
28702 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28703 orig_conv.is_owned = false;
28704 LDKShutdown ret_var = Shutdown_clone(&orig_conv);
28705 uint64_t ret_ref = 0;
28706 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28707 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28711 void __attribute__((export_name("TS_ClosingSignedFeeRange_free"))) TS_ClosingSignedFeeRange_free(uint64_t this_obj) {
28712 LDKClosingSignedFeeRange this_obj_conv;
28713 this_obj_conv.inner = untag_ptr(this_obj);
28714 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28715 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28716 ClosingSignedFeeRange_free(this_obj_conv);
28719 int64_t __attribute__((export_name("TS_ClosingSignedFeeRange_get_min_fee_satoshis"))) TS_ClosingSignedFeeRange_get_min_fee_satoshis(uint64_t this_ptr) {
28720 LDKClosingSignedFeeRange this_ptr_conv;
28721 this_ptr_conv.inner = untag_ptr(this_ptr);
28722 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28723 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28724 this_ptr_conv.is_owned = false;
28725 int64_t ret_conv = ClosingSignedFeeRange_get_min_fee_satoshis(&this_ptr_conv);
28729 void __attribute__((export_name("TS_ClosingSignedFeeRange_set_min_fee_satoshis"))) TS_ClosingSignedFeeRange_set_min_fee_satoshis(uint64_t this_ptr, int64_t val) {
28730 LDKClosingSignedFeeRange this_ptr_conv;
28731 this_ptr_conv.inner = untag_ptr(this_ptr);
28732 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28733 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28734 this_ptr_conv.is_owned = false;
28735 ClosingSignedFeeRange_set_min_fee_satoshis(&this_ptr_conv, val);
28738 int64_t __attribute__((export_name("TS_ClosingSignedFeeRange_get_max_fee_satoshis"))) TS_ClosingSignedFeeRange_get_max_fee_satoshis(uint64_t this_ptr) {
28739 LDKClosingSignedFeeRange this_ptr_conv;
28740 this_ptr_conv.inner = untag_ptr(this_ptr);
28741 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28742 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28743 this_ptr_conv.is_owned = false;
28744 int64_t ret_conv = ClosingSignedFeeRange_get_max_fee_satoshis(&this_ptr_conv);
28748 void __attribute__((export_name("TS_ClosingSignedFeeRange_set_max_fee_satoshis"))) TS_ClosingSignedFeeRange_set_max_fee_satoshis(uint64_t this_ptr, int64_t val) {
28749 LDKClosingSignedFeeRange this_ptr_conv;
28750 this_ptr_conv.inner = untag_ptr(this_ptr);
28751 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28752 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28753 this_ptr_conv.is_owned = false;
28754 ClosingSignedFeeRange_set_max_fee_satoshis(&this_ptr_conv, val);
28757 uint64_t __attribute__((export_name("TS_ClosingSignedFeeRange_new"))) TS_ClosingSignedFeeRange_new(int64_t min_fee_satoshis_arg, int64_t max_fee_satoshis_arg) {
28758 LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_new(min_fee_satoshis_arg, max_fee_satoshis_arg);
28759 uint64_t ret_ref = 0;
28760 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28761 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28765 static inline uint64_t ClosingSignedFeeRange_clone_ptr(LDKClosingSignedFeeRange *NONNULL_PTR arg) {
28766 LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_clone(arg);
28767 uint64_t ret_ref = 0;
28768 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28769 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28772 int64_t __attribute__((export_name("TS_ClosingSignedFeeRange_clone_ptr"))) TS_ClosingSignedFeeRange_clone_ptr(uint64_t arg) {
28773 LDKClosingSignedFeeRange arg_conv;
28774 arg_conv.inner = untag_ptr(arg);
28775 arg_conv.is_owned = ptr_is_owned(arg);
28776 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28777 arg_conv.is_owned = false;
28778 int64_t ret_conv = ClosingSignedFeeRange_clone_ptr(&arg_conv);
28782 uint64_t __attribute__((export_name("TS_ClosingSignedFeeRange_clone"))) TS_ClosingSignedFeeRange_clone(uint64_t orig) {
28783 LDKClosingSignedFeeRange orig_conv;
28784 orig_conv.inner = untag_ptr(orig);
28785 orig_conv.is_owned = ptr_is_owned(orig);
28786 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28787 orig_conv.is_owned = false;
28788 LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_clone(&orig_conv);
28789 uint64_t ret_ref = 0;
28790 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28791 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28795 void __attribute__((export_name("TS_ClosingSigned_free"))) TS_ClosingSigned_free(uint64_t this_obj) {
28796 LDKClosingSigned this_obj_conv;
28797 this_obj_conv.inner = untag_ptr(this_obj);
28798 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28799 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28800 ClosingSigned_free(this_obj_conv);
28803 int8_tArray __attribute__((export_name("TS_ClosingSigned_get_channel_id"))) TS_ClosingSigned_get_channel_id(uint64_t this_ptr) {
28804 LDKClosingSigned this_ptr_conv;
28805 this_ptr_conv.inner = untag_ptr(this_ptr);
28806 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28807 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28808 this_ptr_conv.is_owned = false;
28809 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
28810 memcpy(ret_arr->elems, *ClosingSigned_get_channel_id(&this_ptr_conv), 32);
28814 void __attribute__((export_name("TS_ClosingSigned_set_channel_id"))) TS_ClosingSigned_set_channel_id(uint64_t this_ptr, int8_tArray val) {
28815 LDKClosingSigned this_ptr_conv;
28816 this_ptr_conv.inner = untag_ptr(this_ptr);
28817 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28818 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28819 this_ptr_conv.is_owned = false;
28820 LDKThirtyTwoBytes val_ref;
28821 CHECK(val->arr_len == 32);
28822 memcpy(val_ref.data, val->elems, 32); FREE(val);
28823 ClosingSigned_set_channel_id(&this_ptr_conv, val_ref);
28826 int64_t __attribute__((export_name("TS_ClosingSigned_get_fee_satoshis"))) TS_ClosingSigned_get_fee_satoshis(uint64_t this_ptr) {
28827 LDKClosingSigned this_ptr_conv;
28828 this_ptr_conv.inner = untag_ptr(this_ptr);
28829 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28830 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28831 this_ptr_conv.is_owned = false;
28832 int64_t ret_conv = ClosingSigned_get_fee_satoshis(&this_ptr_conv);
28836 void __attribute__((export_name("TS_ClosingSigned_set_fee_satoshis"))) TS_ClosingSigned_set_fee_satoshis(uint64_t this_ptr, int64_t val) {
28837 LDKClosingSigned this_ptr_conv;
28838 this_ptr_conv.inner = untag_ptr(this_ptr);
28839 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28840 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28841 this_ptr_conv.is_owned = false;
28842 ClosingSigned_set_fee_satoshis(&this_ptr_conv, val);
28845 int8_tArray __attribute__((export_name("TS_ClosingSigned_get_signature"))) TS_ClosingSigned_get_signature(uint64_t this_ptr) {
28846 LDKClosingSigned this_ptr_conv;
28847 this_ptr_conv.inner = untag_ptr(this_ptr);
28848 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28849 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28850 this_ptr_conv.is_owned = false;
28851 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
28852 memcpy(ret_arr->elems, ClosingSigned_get_signature(&this_ptr_conv).compact_form, 64);
28856 void __attribute__((export_name("TS_ClosingSigned_set_signature"))) TS_ClosingSigned_set_signature(uint64_t this_ptr, int8_tArray val) {
28857 LDKClosingSigned this_ptr_conv;
28858 this_ptr_conv.inner = untag_ptr(this_ptr);
28859 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28860 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28861 this_ptr_conv.is_owned = false;
28862 LDKSignature val_ref;
28863 CHECK(val->arr_len == 64);
28864 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
28865 ClosingSigned_set_signature(&this_ptr_conv, val_ref);
28868 uint64_t __attribute__((export_name("TS_ClosingSigned_get_fee_range"))) TS_ClosingSigned_get_fee_range(uint64_t this_ptr) {
28869 LDKClosingSigned this_ptr_conv;
28870 this_ptr_conv.inner = untag_ptr(this_ptr);
28871 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28872 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28873 this_ptr_conv.is_owned = false;
28874 LDKClosingSignedFeeRange ret_var = ClosingSigned_get_fee_range(&this_ptr_conv);
28875 uint64_t ret_ref = 0;
28876 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28877 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28881 void __attribute__((export_name("TS_ClosingSigned_set_fee_range"))) TS_ClosingSigned_set_fee_range(uint64_t this_ptr, uint64_t val) {
28882 LDKClosingSigned this_ptr_conv;
28883 this_ptr_conv.inner = untag_ptr(this_ptr);
28884 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28885 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28886 this_ptr_conv.is_owned = false;
28887 LDKClosingSignedFeeRange val_conv;
28888 val_conv.inner = untag_ptr(val);
28889 val_conv.is_owned = ptr_is_owned(val);
28890 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
28891 val_conv = ClosingSignedFeeRange_clone(&val_conv);
28892 ClosingSigned_set_fee_range(&this_ptr_conv, val_conv);
28895 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) {
28896 LDKThirtyTwoBytes channel_id_arg_ref;
28897 CHECK(channel_id_arg->arr_len == 32);
28898 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
28899 LDKSignature signature_arg_ref;
28900 CHECK(signature_arg->arr_len == 64);
28901 memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg);
28902 LDKClosingSignedFeeRange fee_range_arg_conv;
28903 fee_range_arg_conv.inner = untag_ptr(fee_range_arg);
28904 fee_range_arg_conv.is_owned = ptr_is_owned(fee_range_arg);
28905 CHECK_INNER_FIELD_ACCESS_OR_NULL(fee_range_arg_conv);
28906 fee_range_arg_conv = ClosingSignedFeeRange_clone(&fee_range_arg_conv);
28907 LDKClosingSigned ret_var = ClosingSigned_new(channel_id_arg_ref, fee_satoshis_arg, signature_arg_ref, fee_range_arg_conv);
28908 uint64_t ret_ref = 0;
28909 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28910 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28914 static inline uint64_t ClosingSigned_clone_ptr(LDKClosingSigned *NONNULL_PTR arg) {
28915 LDKClosingSigned ret_var = ClosingSigned_clone(arg);
28916 uint64_t ret_ref = 0;
28917 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28918 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28921 int64_t __attribute__((export_name("TS_ClosingSigned_clone_ptr"))) TS_ClosingSigned_clone_ptr(uint64_t arg) {
28922 LDKClosingSigned arg_conv;
28923 arg_conv.inner = untag_ptr(arg);
28924 arg_conv.is_owned = ptr_is_owned(arg);
28925 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28926 arg_conv.is_owned = false;
28927 int64_t ret_conv = ClosingSigned_clone_ptr(&arg_conv);
28931 uint64_t __attribute__((export_name("TS_ClosingSigned_clone"))) TS_ClosingSigned_clone(uint64_t orig) {
28932 LDKClosingSigned orig_conv;
28933 orig_conv.inner = untag_ptr(orig);
28934 orig_conv.is_owned = ptr_is_owned(orig);
28935 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28936 orig_conv.is_owned = false;
28937 LDKClosingSigned ret_var = ClosingSigned_clone(&orig_conv);
28938 uint64_t ret_ref = 0;
28939 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28940 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28944 void __attribute__((export_name("TS_UpdateAddHTLC_free"))) TS_UpdateAddHTLC_free(uint64_t this_obj) {
28945 LDKUpdateAddHTLC this_obj_conv;
28946 this_obj_conv.inner = untag_ptr(this_obj);
28947 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28948 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28949 UpdateAddHTLC_free(this_obj_conv);
28952 int8_tArray __attribute__((export_name("TS_UpdateAddHTLC_get_channel_id"))) TS_UpdateAddHTLC_get_channel_id(uint64_t this_ptr) {
28953 LDKUpdateAddHTLC this_ptr_conv;
28954 this_ptr_conv.inner = untag_ptr(this_ptr);
28955 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28956 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28957 this_ptr_conv.is_owned = false;
28958 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
28959 memcpy(ret_arr->elems, *UpdateAddHTLC_get_channel_id(&this_ptr_conv), 32);
28963 void __attribute__((export_name("TS_UpdateAddHTLC_set_channel_id"))) TS_UpdateAddHTLC_set_channel_id(uint64_t this_ptr, int8_tArray val) {
28964 LDKUpdateAddHTLC this_ptr_conv;
28965 this_ptr_conv.inner = untag_ptr(this_ptr);
28966 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28967 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28968 this_ptr_conv.is_owned = false;
28969 LDKThirtyTwoBytes val_ref;
28970 CHECK(val->arr_len == 32);
28971 memcpy(val_ref.data, val->elems, 32); FREE(val);
28972 UpdateAddHTLC_set_channel_id(&this_ptr_conv, val_ref);
28975 int64_t __attribute__((export_name("TS_UpdateAddHTLC_get_htlc_id"))) TS_UpdateAddHTLC_get_htlc_id(uint64_t this_ptr) {
28976 LDKUpdateAddHTLC this_ptr_conv;
28977 this_ptr_conv.inner = untag_ptr(this_ptr);
28978 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28979 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28980 this_ptr_conv.is_owned = false;
28981 int64_t ret_conv = UpdateAddHTLC_get_htlc_id(&this_ptr_conv);
28985 void __attribute__((export_name("TS_UpdateAddHTLC_set_htlc_id"))) TS_UpdateAddHTLC_set_htlc_id(uint64_t this_ptr, int64_t val) {
28986 LDKUpdateAddHTLC this_ptr_conv;
28987 this_ptr_conv.inner = untag_ptr(this_ptr);
28988 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28989 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28990 this_ptr_conv.is_owned = false;
28991 UpdateAddHTLC_set_htlc_id(&this_ptr_conv, val);
28994 int64_t __attribute__((export_name("TS_UpdateAddHTLC_get_amount_msat"))) TS_UpdateAddHTLC_get_amount_msat(uint64_t this_ptr) {
28995 LDKUpdateAddHTLC this_ptr_conv;
28996 this_ptr_conv.inner = untag_ptr(this_ptr);
28997 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28998 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28999 this_ptr_conv.is_owned = false;
29000 int64_t ret_conv = UpdateAddHTLC_get_amount_msat(&this_ptr_conv);
29004 void __attribute__((export_name("TS_UpdateAddHTLC_set_amount_msat"))) TS_UpdateAddHTLC_set_amount_msat(uint64_t this_ptr, int64_t val) {
29005 LDKUpdateAddHTLC this_ptr_conv;
29006 this_ptr_conv.inner = untag_ptr(this_ptr);
29007 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29008 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29009 this_ptr_conv.is_owned = false;
29010 UpdateAddHTLC_set_amount_msat(&this_ptr_conv, val);
29013 int8_tArray __attribute__((export_name("TS_UpdateAddHTLC_get_payment_hash"))) TS_UpdateAddHTLC_get_payment_hash(uint64_t this_ptr) {
29014 LDKUpdateAddHTLC this_ptr_conv;
29015 this_ptr_conv.inner = untag_ptr(this_ptr);
29016 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29017 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29018 this_ptr_conv.is_owned = false;
29019 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
29020 memcpy(ret_arr->elems, *UpdateAddHTLC_get_payment_hash(&this_ptr_conv), 32);
29024 void __attribute__((export_name("TS_UpdateAddHTLC_set_payment_hash"))) TS_UpdateAddHTLC_set_payment_hash(uint64_t this_ptr, int8_tArray val) {
29025 LDKUpdateAddHTLC this_ptr_conv;
29026 this_ptr_conv.inner = untag_ptr(this_ptr);
29027 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29028 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29029 this_ptr_conv.is_owned = false;
29030 LDKThirtyTwoBytes val_ref;
29031 CHECK(val->arr_len == 32);
29032 memcpy(val_ref.data, val->elems, 32); FREE(val);
29033 UpdateAddHTLC_set_payment_hash(&this_ptr_conv, val_ref);
29036 int32_t __attribute__((export_name("TS_UpdateAddHTLC_get_cltv_expiry"))) TS_UpdateAddHTLC_get_cltv_expiry(uint64_t this_ptr) {
29037 LDKUpdateAddHTLC this_ptr_conv;
29038 this_ptr_conv.inner = untag_ptr(this_ptr);
29039 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29040 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29041 this_ptr_conv.is_owned = false;
29042 int32_t ret_conv = UpdateAddHTLC_get_cltv_expiry(&this_ptr_conv);
29046 void __attribute__((export_name("TS_UpdateAddHTLC_set_cltv_expiry"))) TS_UpdateAddHTLC_set_cltv_expiry(uint64_t this_ptr, int32_t val) {
29047 LDKUpdateAddHTLC this_ptr_conv;
29048 this_ptr_conv.inner = untag_ptr(this_ptr);
29049 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29050 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29051 this_ptr_conv.is_owned = false;
29052 UpdateAddHTLC_set_cltv_expiry(&this_ptr_conv, val);
29055 static inline uint64_t UpdateAddHTLC_clone_ptr(LDKUpdateAddHTLC *NONNULL_PTR arg) {
29056 LDKUpdateAddHTLC ret_var = UpdateAddHTLC_clone(arg);
29057 uint64_t ret_ref = 0;
29058 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29059 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29062 int64_t __attribute__((export_name("TS_UpdateAddHTLC_clone_ptr"))) TS_UpdateAddHTLC_clone_ptr(uint64_t arg) {
29063 LDKUpdateAddHTLC arg_conv;
29064 arg_conv.inner = untag_ptr(arg);
29065 arg_conv.is_owned = ptr_is_owned(arg);
29066 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29067 arg_conv.is_owned = false;
29068 int64_t ret_conv = UpdateAddHTLC_clone_ptr(&arg_conv);
29072 uint64_t __attribute__((export_name("TS_UpdateAddHTLC_clone"))) TS_UpdateAddHTLC_clone(uint64_t orig) {
29073 LDKUpdateAddHTLC orig_conv;
29074 orig_conv.inner = untag_ptr(orig);
29075 orig_conv.is_owned = ptr_is_owned(orig);
29076 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29077 orig_conv.is_owned = false;
29078 LDKUpdateAddHTLC ret_var = UpdateAddHTLC_clone(&orig_conv);
29079 uint64_t ret_ref = 0;
29080 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29081 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29085 void __attribute__((export_name("TS_UpdateFulfillHTLC_free"))) TS_UpdateFulfillHTLC_free(uint64_t this_obj) {
29086 LDKUpdateFulfillHTLC this_obj_conv;
29087 this_obj_conv.inner = untag_ptr(this_obj);
29088 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29089 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29090 UpdateFulfillHTLC_free(this_obj_conv);
29093 int8_tArray __attribute__((export_name("TS_UpdateFulfillHTLC_get_channel_id"))) TS_UpdateFulfillHTLC_get_channel_id(uint64_t this_ptr) {
29094 LDKUpdateFulfillHTLC this_ptr_conv;
29095 this_ptr_conv.inner = untag_ptr(this_ptr);
29096 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29097 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29098 this_ptr_conv.is_owned = false;
29099 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
29100 memcpy(ret_arr->elems, *UpdateFulfillHTLC_get_channel_id(&this_ptr_conv), 32);
29104 void __attribute__((export_name("TS_UpdateFulfillHTLC_set_channel_id"))) TS_UpdateFulfillHTLC_set_channel_id(uint64_t this_ptr, int8_tArray val) {
29105 LDKUpdateFulfillHTLC this_ptr_conv;
29106 this_ptr_conv.inner = untag_ptr(this_ptr);
29107 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29108 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29109 this_ptr_conv.is_owned = false;
29110 LDKThirtyTwoBytes val_ref;
29111 CHECK(val->arr_len == 32);
29112 memcpy(val_ref.data, val->elems, 32); FREE(val);
29113 UpdateFulfillHTLC_set_channel_id(&this_ptr_conv, val_ref);
29116 int64_t __attribute__((export_name("TS_UpdateFulfillHTLC_get_htlc_id"))) TS_UpdateFulfillHTLC_get_htlc_id(uint64_t this_ptr) {
29117 LDKUpdateFulfillHTLC this_ptr_conv;
29118 this_ptr_conv.inner = untag_ptr(this_ptr);
29119 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29120 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29121 this_ptr_conv.is_owned = false;
29122 int64_t ret_conv = UpdateFulfillHTLC_get_htlc_id(&this_ptr_conv);
29126 void __attribute__((export_name("TS_UpdateFulfillHTLC_set_htlc_id"))) TS_UpdateFulfillHTLC_set_htlc_id(uint64_t this_ptr, int64_t val) {
29127 LDKUpdateFulfillHTLC this_ptr_conv;
29128 this_ptr_conv.inner = untag_ptr(this_ptr);
29129 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29130 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29131 this_ptr_conv.is_owned = false;
29132 UpdateFulfillHTLC_set_htlc_id(&this_ptr_conv, val);
29135 int8_tArray __attribute__((export_name("TS_UpdateFulfillHTLC_get_payment_preimage"))) TS_UpdateFulfillHTLC_get_payment_preimage(uint64_t this_ptr) {
29136 LDKUpdateFulfillHTLC this_ptr_conv;
29137 this_ptr_conv.inner = untag_ptr(this_ptr);
29138 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29139 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29140 this_ptr_conv.is_owned = false;
29141 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
29142 memcpy(ret_arr->elems, *UpdateFulfillHTLC_get_payment_preimage(&this_ptr_conv), 32);
29146 void __attribute__((export_name("TS_UpdateFulfillHTLC_set_payment_preimage"))) TS_UpdateFulfillHTLC_set_payment_preimage(uint64_t this_ptr, int8_tArray val) {
29147 LDKUpdateFulfillHTLC this_ptr_conv;
29148 this_ptr_conv.inner = untag_ptr(this_ptr);
29149 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29150 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29151 this_ptr_conv.is_owned = false;
29152 LDKThirtyTwoBytes val_ref;
29153 CHECK(val->arr_len == 32);
29154 memcpy(val_ref.data, val->elems, 32); FREE(val);
29155 UpdateFulfillHTLC_set_payment_preimage(&this_ptr_conv, val_ref);
29158 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) {
29159 LDKThirtyTwoBytes channel_id_arg_ref;
29160 CHECK(channel_id_arg->arr_len == 32);
29161 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
29162 LDKThirtyTwoBytes payment_preimage_arg_ref;
29163 CHECK(payment_preimage_arg->arr_len == 32);
29164 memcpy(payment_preimage_arg_ref.data, payment_preimage_arg->elems, 32); FREE(payment_preimage_arg);
29165 LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_new(channel_id_arg_ref, htlc_id_arg, payment_preimage_arg_ref);
29166 uint64_t ret_ref = 0;
29167 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29168 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29172 static inline uint64_t UpdateFulfillHTLC_clone_ptr(LDKUpdateFulfillHTLC *NONNULL_PTR arg) {
29173 LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_clone(arg);
29174 uint64_t ret_ref = 0;
29175 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29176 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29179 int64_t __attribute__((export_name("TS_UpdateFulfillHTLC_clone_ptr"))) TS_UpdateFulfillHTLC_clone_ptr(uint64_t arg) {
29180 LDKUpdateFulfillHTLC arg_conv;
29181 arg_conv.inner = untag_ptr(arg);
29182 arg_conv.is_owned = ptr_is_owned(arg);
29183 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29184 arg_conv.is_owned = false;
29185 int64_t ret_conv = UpdateFulfillHTLC_clone_ptr(&arg_conv);
29189 uint64_t __attribute__((export_name("TS_UpdateFulfillHTLC_clone"))) TS_UpdateFulfillHTLC_clone(uint64_t orig) {
29190 LDKUpdateFulfillHTLC orig_conv;
29191 orig_conv.inner = untag_ptr(orig);
29192 orig_conv.is_owned = ptr_is_owned(orig);
29193 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29194 orig_conv.is_owned = false;
29195 LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_clone(&orig_conv);
29196 uint64_t ret_ref = 0;
29197 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29198 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29202 void __attribute__((export_name("TS_UpdateFailHTLC_free"))) TS_UpdateFailHTLC_free(uint64_t this_obj) {
29203 LDKUpdateFailHTLC this_obj_conv;
29204 this_obj_conv.inner = untag_ptr(this_obj);
29205 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29206 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29207 UpdateFailHTLC_free(this_obj_conv);
29210 int8_tArray __attribute__((export_name("TS_UpdateFailHTLC_get_channel_id"))) TS_UpdateFailHTLC_get_channel_id(uint64_t this_ptr) {
29211 LDKUpdateFailHTLC this_ptr_conv;
29212 this_ptr_conv.inner = untag_ptr(this_ptr);
29213 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29214 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29215 this_ptr_conv.is_owned = false;
29216 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
29217 memcpy(ret_arr->elems, *UpdateFailHTLC_get_channel_id(&this_ptr_conv), 32);
29221 void __attribute__((export_name("TS_UpdateFailHTLC_set_channel_id"))) TS_UpdateFailHTLC_set_channel_id(uint64_t this_ptr, int8_tArray val) {
29222 LDKUpdateFailHTLC this_ptr_conv;
29223 this_ptr_conv.inner = untag_ptr(this_ptr);
29224 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29225 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29226 this_ptr_conv.is_owned = false;
29227 LDKThirtyTwoBytes val_ref;
29228 CHECK(val->arr_len == 32);
29229 memcpy(val_ref.data, val->elems, 32); FREE(val);
29230 UpdateFailHTLC_set_channel_id(&this_ptr_conv, val_ref);
29233 int64_t __attribute__((export_name("TS_UpdateFailHTLC_get_htlc_id"))) TS_UpdateFailHTLC_get_htlc_id(uint64_t this_ptr) {
29234 LDKUpdateFailHTLC this_ptr_conv;
29235 this_ptr_conv.inner = untag_ptr(this_ptr);
29236 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29237 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29238 this_ptr_conv.is_owned = false;
29239 int64_t ret_conv = UpdateFailHTLC_get_htlc_id(&this_ptr_conv);
29243 void __attribute__((export_name("TS_UpdateFailHTLC_set_htlc_id"))) TS_UpdateFailHTLC_set_htlc_id(uint64_t this_ptr, int64_t val) {
29244 LDKUpdateFailHTLC this_ptr_conv;
29245 this_ptr_conv.inner = untag_ptr(this_ptr);
29246 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29247 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29248 this_ptr_conv.is_owned = false;
29249 UpdateFailHTLC_set_htlc_id(&this_ptr_conv, val);
29252 static inline uint64_t UpdateFailHTLC_clone_ptr(LDKUpdateFailHTLC *NONNULL_PTR arg) {
29253 LDKUpdateFailHTLC ret_var = UpdateFailHTLC_clone(arg);
29254 uint64_t ret_ref = 0;
29255 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29256 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29259 int64_t __attribute__((export_name("TS_UpdateFailHTLC_clone_ptr"))) TS_UpdateFailHTLC_clone_ptr(uint64_t arg) {
29260 LDKUpdateFailHTLC arg_conv;
29261 arg_conv.inner = untag_ptr(arg);
29262 arg_conv.is_owned = ptr_is_owned(arg);
29263 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29264 arg_conv.is_owned = false;
29265 int64_t ret_conv = UpdateFailHTLC_clone_ptr(&arg_conv);
29269 uint64_t __attribute__((export_name("TS_UpdateFailHTLC_clone"))) TS_UpdateFailHTLC_clone(uint64_t orig) {
29270 LDKUpdateFailHTLC orig_conv;
29271 orig_conv.inner = untag_ptr(orig);
29272 orig_conv.is_owned = ptr_is_owned(orig);
29273 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29274 orig_conv.is_owned = false;
29275 LDKUpdateFailHTLC ret_var = UpdateFailHTLC_clone(&orig_conv);
29276 uint64_t ret_ref = 0;
29277 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29278 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29282 void __attribute__((export_name("TS_UpdateFailMalformedHTLC_free"))) TS_UpdateFailMalformedHTLC_free(uint64_t this_obj) {
29283 LDKUpdateFailMalformedHTLC this_obj_conv;
29284 this_obj_conv.inner = untag_ptr(this_obj);
29285 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29286 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29287 UpdateFailMalformedHTLC_free(this_obj_conv);
29290 int8_tArray __attribute__((export_name("TS_UpdateFailMalformedHTLC_get_channel_id"))) TS_UpdateFailMalformedHTLC_get_channel_id(uint64_t this_ptr) {
29291 LDKUpdateFailMalformedHTLC this_ptr_conv;
29292 this_ptr_conv.inner = untag_ptr(this_ptr);
29293 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29294 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29295 this_ptr_conv.is_owned = false;
29296 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
29297 memcpy(ret_arr->elems, *UpdateFailMalformedHTLC_get_channel_id(&this_ptr_conv), 32);
29301 void __attribute__((export_name("TS_UpdateFailMalformedHTLC_set_channel_id"))) TS_UpdateFailMalformedHTLC_set_channel_id(uint64_t this_ptr, int8_tArray val) {
29302 LDKUpdateFailMalformedHTLC this_ptr_conv;
29303 this_ptr_conv.inner = untag_ptr(this_ptr);
29304 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29305 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29306 this_ptr_conv.is_owned = false;
29307 LDKThirtyTwoBytes val_ref;
29308 CHECK(val->arr_len == 32);
29309 memcpy(val_ref.data, val->elems, 32); FREE(val);
29310 UpdateFailMalformedHTLC_set_channel_id(&this_ptr_conv, val_ref);
29313 int64_t __attribute__((export_name("TS_UpdateFailMalformedHTLC_get_htlc_id"))) TS_UpdateFailMalformedHTLC_get_htlc_id(uint64_t this_ptr) {
29314 LDKUpdateFailMalformedHTLC this_ptr_conv;
29315 this_ptr_conv.inner = untag_ptr(this_ptr);
29316 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29317 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29318 this_ptr_conv.is_owned = false;
29319 int64_t ret_conv = UpdateFailMalformedHTLC_get_htlc_id(&this_ptr_conv);
29323 void __attribute__((export_name("TS_UpdateFailMalformedHTLC_set_htlc_id"))) TS_UpdateFailMalformedHTLC_set_htlc_id(uint64_t this_ptr, int64_t val) {
29324 LDKUpdateFailMalformedHTLC this_ptr_conv;
29325 this_ptr_conv.inner = untag_ptr(this_ptr);
29326 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29327 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29328 this_ptr_conv.is_owned = false;
29329 UpdateFailMalformedHTLC_set_htlc_id(&this_ptr_conv, val);
29332 int16_t __attribute__((export_name("TS_UpdateFailMalformedHTLC_get_failure_code"))) TS_UpdateFailMalformedHTLC_get_failure_code(uint64_t this_ptr) {
29333 LDKUpdateFailMalformedHTLC this_ptr_conv;
29334 this_ptr_conv.inner = untag_ptr(this_ptr);
29335 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29336 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29337 this_ptr_conv.is_owned = false;
29338 int16_t ret_conv = UpdateFailMalformedHTLC_get_failure_code(&this_ptr_conv);
29342 void __attribute__((export_name("TS_UpdateFailMalformedHTLC_set_failure_code"))) TS_UpdateFailMalformedHTLC_set_failure_code(uint64_t this_ptr, int16_t val) {
29343 LDKUpdateFailMalformedHTLC this_ptr_conv;
29344 this_ptr_conv.inner = untag_ptr(this_ptr);
29345 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29346 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29347 this_ptr_conv.is_owned = false;
29348 UpdateFailMalformedHTLC_set_failure_code(&this_ptr_conv, val);
29351 static inline uint64_t UpdateFailMalformedHTLC_clone_ptr(LDKUpdateFailMalformedHTLC *NONNULL_PTR arg) {
29352 LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_clone(arg);
29353 uint64_t ret_ref = 0;
29354 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29355 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29358 int64_t __attribute__((export_name("TS_UpdateFailMalformedHTLC_clone_ptr"))) TS_UpdateFailMalformedHTLC_clone_ptr(uint64_t arg) {
29359 LDKUpdateFailMalformedHTLC arg_conv;
29360 arg_conv.inner = untag_ptr(arg);
29361 arg_conv.is_owned = ptr_is_owned(arg);
29362 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29363 arg_conv.is_owned = false;
29364 int64_t ret_conv = UpdateFailMalformedHTLC_clone_ptr(&arg_conv);
29368 uint64_t __attribute__((export_name("TS_UpdateFailMalformedHTLC_clone"))) TS_UpdateFailMalformedHTLC_clone(uint64_t orig) {
29369 LDKUpdateFailMalformedHTLC orig_conv;
29370 orig_conv.inner = untag_ptr(orig);
29371 orig_conv.is_owned = ptr_is_owned(orig);
29372 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29373 orig_conv.is_owned = false;
29374 LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_clone(&orig_conv);
29375 uint64_t ret_ref = 0;
29376 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29377 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29381 void __attribute__((export_name("TS_CommitmentSigned_free"))) TS_CommitmentSigned_free(uint64_t this_obj) {
29382 LDKCommitmentSigned this_obj_conv;
29383 this_obj_conv.inner = untag_ptr(this_obj);
29384 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29385 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29386 CommitmentSigned_free(this_obj_conv);
29389 int8_tArray __attribute__((export_name("TS_CommitmentSigned_get_channel_id"))) TS_CommitmentSigned_get_channel_id(uint64_t this_ptr) {
29390 LDKCommitmentSigned this_ptr_conv;
29391 this_ptr_conv.inner = untag_ptr(this_ptr);
29392 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29393 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29394 this_ptr_conv.is_owned = false;
29395 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
29396 memcpy(ret_arr->elems, *CommitmentSigned_get_channel_id(&this_ptr_conv), 32);
29400 void __attribute__((export_name("TS_CommitmentSigned_set_channel_id"))) TS_CommitmentSigned_set_channel_id(uint64_t this_ptr, int8_tArray val) {
29401 LDKCommitmentSigned this_ptr_conv;
29402 this_ptr_conv.inner = untag_ptr(this_ptr);
29403 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29404 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29405 this_ptr_conv.is_owned = false;
29406 LDKThirtyTwoBytes val_ref;
29407 CHECK(val->arr_len == 32);
29408 memcpy(val_ref.data, val->elems, 32); FREE(val);
29409 CommitmentSigned_set_channel_id(&this_ptr_conv, val_ref);
29412 int8_tArray __attribute__((export_name("TS_CommitmentSigned_get_signature"))) TS_CommitmentSigned_get_signature(uint64_t this_ptr) {
29413 LDKCommitmentSigned this_ptr_conv;
29414 this_ptr_conv.inner = untag_ptr(this_ptr);
29415 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29416 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29417 this_ptr_conv.is_owned = false;
29418 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
29419 memcpy(ret_arr->elems, CommitmentSigned_get_signature(&this_ptr_conv).compact_form, 64);
29423 void __attribute__((export_name("TS_CommitmentSigned_set_signature"))) TS_CommitmentSigned_set_signature(uint64_t this_ptr, int8_tArray val) {
29424 LDKCommitmentSigned this_ptr_conv;
29425 this_ptr_conv.inner = untag_ptr(this_ptr);
29426 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29427 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29428 this_ptr_conv.is_owned = false;
29429 LDKSignature val_ref;
29430 CHECK(val->arr_len == 64);
29431 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
29432 CommitmentSigned_set_signature(&this_ptr_conv, val_ref);
29435 ptrArray __attribute__((export_name("TS_CommitmentSigned_get_htlc_signatures"))) TS_CommitmentSigned_get_htlc_signatures(uint64_t this_ptr) {
29436 LDKCommitmentSigned this_ptr_conv;
29437 this_ptr_conv.inner = untag_ptr(this_ptr);
29438 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29439 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29440 this_ptr_conv.is_owned = false;
29441 LDKCVec_SignatureZ ret_var = CommitmentSigned_get_htlc_signatures(&this_ptr_conv);
29442 ptrArray ret_arr = NULL;
29443 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
29444 int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8);
29445 for (size_t m = 0; m < ret_var.datalen; m++) {
29446 int8_tArray ret_conv_12_arr = init_int8_tArray(64, __LINE__);
29447 memcpy(ret_conv_12_arr->elems, ret_var.data[m].compact_form, 64);
29448 ret_arr_ptr[m] = ret_conv_12_arr;
29451 FREE(ret_var.data);
29455 void __attribute__((export_name("TS_CommitmentSigned_set_htlc_signatures"))) TS_CommitmentSigned_set_htlc_signatures(uint64_t this_ptr, ptrArray val) {
29456 LDKCommitmentSigned this_ptr_conv;
29457 this_ptr_conv.inner = untag_ptr(this_ptr);
29458 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29459 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29460 this_ptr_conv.is_owned = false;
29461 LDKCVec_SignatureZ val_constr;
29462 val_constr.datalen = val->arr_len;
29463 if (val_constr.datalen > 0)
29464 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
29466 val_constr.data = NULL;
29467 int8_tArray* val_vals = (void*) val->elems;
29468 for (size_t m = 0; m < val_constr.datalen; m++) {
29469 int8_tArray val_conv_12 = val_vals[m];
29470 LDKSignature val_conv_12_ref;
29471 CHECK(val_conv_12->arr_len == 64);
29472 memcpy(val_conv_12_ref.compact_form, val_conv_12->elems, 64); FREE(val_conv_12);
29473 val_constr.data[m] = val_conv_12_ref;
29476 CommitmentSigned_set_htlc_signatures(&this_ptr_conv, val_constr);
29479 uint64_t __attribute__((export_name("TS_CommitmentSigned_new"))) TS_CommitmentSigned_new(int8_tArray channel_id_arg, int8_tArray signature_arg, ptrArray htlc_signatures_arg) {
29480 LDKThirtyTwoBytes channel_id_arg_ref;
29481 CHECK(channel_id_arg->arr_len == 32);
29482 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
29483 LDKSignature signature_arg_ref;
29484 CHECK(signature_arg->arr_len == 64);
29485 memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg);
29486 LDKCVec_SignatureZ htlc_signatures_arg_constr;
29487 htlc_signatures_arg_constr.datalen = htlc_signatures_arg->arr_len;
29488 if (htlc_signatures_arg_constr.datalen > 0)
29489 htlc_signatures_arg_constr.data = MALLOC(htlc_signatures_arg_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
29491 htlc_signatures_arg_constr.data = NULL;
29492 int8_tArray* htlc_signatures_arg_vals = (void*) htlc_signatures_arg->elems;
29493 for (size_t m = 0; m < htlc_signatures_arg_constr.datalen; m++) {
29494 int8_tArray htlc_signatures_arg_conv_12 = htlc_signatures_arg_vals[m];
29495 LDKSignature htlc_signatures_arg_conv_12_ref;
29496 CHECK(htlc_signatures_arg_conv_12->arr_len == 64);
29497 memcpy(htlc_signatures_arg_conv_12_ref.compact_form, htlc_signatures_arg_conv_12->elems, 64); FREE(htlc_signatures_arg_conv_12);
29498 htlc_signatures_arg_constr.data[m] = htlc_signatures_arg_conv_12_ref;
29500 FREE(htlc_signatures_arg);
29501 LDKCommitmentSigned ret_var = CommitmentSigned_new(channel_id_arg_ref, signature_arg_ref, htlc_signatures_arg_constr);
29502 uint64_t ret_ref = 0;
29503 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29504 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29508 static inline uint64_t CommitmentSigned_clone_ptr(LDKCommitmentSigned *NONNULL_PTR arg) {
29509 LDKCommitmentSigned ret_var = CommitmentSigned_clone(arg);
29510 uint64_t ret_ref = 0;
29511 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29512 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29515 int64_t __attribute__((export_name("TS_CommitmentSigned_clone_ptr"))) TS_CommitmentSigned_clone_ptr(uint64_t arg) {
29516 LDKCommitmentSigned arg_conv;
29517 arg_conv.inner = untag_ptr(arg);
29518 arg_conv.is_owned = ptr_is_owned(arg);
29519 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29520 arg_conv.is_owned = false;
29521 int64_t ret_conv = CommitmentSigned_clone_ptr(&arg_conv);
29525 uint64_t __attribute__((export_name("TS_CommitmentSigned_clone"))) TS_CommitmentSigned_clone(uint64_t orig) {
29526 LDKCommitmentSigned orig_conv;
29527 orig_conv.inner = untag_ptr(orig);
29528 orig_conv.is_owned = ptr_is_owned(orig);
29529 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29530 orig_conv.is_owned = false;
29531 LDKCommitmentSigned ret_var = CommitmentSigned_clone(&orig_conv);
29532 uint64_t ret_ref = 0;
29533 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29534 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29538 void __attribute__((export_name("TS_RevokeAndACK_free"))) TS_RevokeAndACK_free(uint64_t this_obj) {
29539 LDKRevokeAndACK this_obj_conv;
29540 this_obj_conv.inner = untag_ptr(this_obj);
29541 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29542 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29543 RevokeAndACK_free(this_obj_conv);
29546 int8_tArray __attribute__((export_name("TS_RevokeAndACK_get_channel_id"))) TS_RevokeAndACK_get_channel_id(uint64_t this_ptr) {
29547 LDKRevokeAndACK this_ptr_conv;
29548 this_ptr_conv.inner = untag_ptr(this_ptr);
29549 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29550 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29551 this_ptr_conv.is_owned = false;
29552 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
29553 memcpy(ret_arr->elems, *RevokeAndACK_get_channel_id(&this_ptr_conv), 32);
29557 void __attribute__((export_name("TS_RevokeAndACK_set_channel_id"))) TS_RevokeAndACK_set_channel_id(uint64_t this_ptr, int8_tArray val) {
29558 LDKRevokeAndACK this_ptr_conv;
29559 this_ptr_conv.inner = untag_ptr(this_ptr);
29560 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29561 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29562 this_ptr_conv.is_owned = false;
29563 LDKThirtyTwoBytes val_ref;
29564 CHECK(val->arr_len == 32);
29565 memcpy(val_ref.data, val->elems, 32); FREE(val);
29566 RevokeAndACK_set_channel_id(&this_ptr_conv, val_ref);
29569 int8_tArray __attribute__((export_name("TS_RevokeAndACK_get_per_commitment_secret"))) TS_RevokeAndACK_get_per_commitment_secret(uint64_t this_ptr) {
29570 LDKRevokeAndACK this_ptr_conv;
29571 this_ptr_conv.inner = untag_ptr(this_ptr);
29572 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29573 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29574 this_ptr_conv.is_owned = false;
29575 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
29576 memcpy(ret_arr->elems, *RevokeAndACK_get_per_commitment_secret(&this_ptr_conv), 32);
29580 void __attribute__((export_name("TS_RevokeAndACK_set_per_commitment_secret"))) TS_RevokeAndACK_set_per_commitment_secret(uint64_t this_ptr, int8_tArray val) {
29581 LDKRevokeAndACK this_ptr_conv;
29582 this_ptr_conv.inner = untag_ptr(this_ptr);
29583 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29584 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29585 this_ptr_conv.is_owned = false;
29586 LDKThirtyTwoBytes val_ref;
29587 CHECK(val->arr_len == 32);
29588 memcpy(val_ref.data, val->elems, 32); FREE(val);
29589 RevokeAndACK_set_per_commitment_secret(&this_ptr_conv, val_ref);
29592 int8_tArray __attribute__((export_name("TS_RevokeAndACK_get_next_per_commitment_point"))) TS_RevokeAndACK_get_next_per_commitment_point(uint64_t this_ptr) {
29593 LDKRevokeAndACK this_ptr_conv;
29594 this_ptr_conv.inner = untag_ptr(this_ptr);
29595 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29596 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29597 this_ptr_conv.is_owned = false;
29598 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
29599 memcpy(ret_arr->elems, RevokeAndACK_get_next_per_commitment_point(&this_ptr_conv).compressed_form, 33);
29603 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) {
29604 LDKRevokeAndACK this_ptr_conv;
29605 this_ptr_conv.inner = untag_ptr(this_ptr);
29606 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29607 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29608 this_ptr_conv.is_owned = false;
29609 LDKPublicKey val_ref;
29610 CHECK(val->arr_len == 33);
29611 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
29612 RevokeAndACK_set_next_per_commitment_point(&this_ptr_conv, val_ref);
29615 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) {
29616 LDKThirtyTwoBytes channel_id_arg_ref;
29617 CHECK(channel_id_arg->arr_len == 32);
29618 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
29619 LDKThirtyTwoBytes per_commitment_secret_arg_ref;
29620 CHECK(per_commitment_secret_arg->arr_len == 32);
29621 memcpy(per_commitment_secret_arg_ref.data, per_commitment_secret_arg->elems, 32); FREE(per_commitment_secret_arg);
29622 LDKPublicKey next_per_commitment_point_arg_ref;
29623 CHECK(next_per_commitment_point_arg->arr_len == 33);
29624 memcpy(next_per_commitment_point_arg_ref.compressed_form, next_per_commitment_point_arg->elems, 33); FREE(next_per_commitment_point_arg);
29625 LDKRevokeAndACK ret_var = RevokeAndACK_new(channel_id_arg_ref, per_commitment_secret_arg_ref, next_per_commitment_point_arg_ref);
29626 uint64_t ret_ref = 0;
29627 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29628 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29632 static inline uint64_t RevokeAndACK_clone_ptr(LDKRevokeAndACK *NONNULL_PTR arg) {
29633 LDKRevokeAndACK ret_var = RevokeAndACK_clone(arg);
29634 uint64_t ret_ref = 0;
29635 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29636 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29639 int64_t __attribute__((export_name("TS_RevokeAndACK_clone_ptr"))) TS_RevokeAndACK_clone_ptr(uint64_t arg) {
29640 LDKRevokeAndACK arg_conv;
29641 arg_conv.inner = untag_ptr(arg);
29642 arg_conv.is_owned = ptr_is_owned(arg);
29643 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29644 arg_conv.is_owned = false;
29645 int64_t ret_conv = RevokeAndACK_clone_ptr(&arg_conv);
29649 uint64_t __attribute__((export_name("TS_RevokeAndACK_clone"))) TS_RevokeAndACK_clone(uint64_t orig) {
29650 LDKRevokeAndACK orig_conv;
29651 orig_conv.inner = untag_ptr(orig);
29652 orig_conv.is_owned = ptr_is_owned(orig);
29653 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29654 orig_conv.is_owned = false;
29655 LDKRevokeAndACK ret_var = RevokeAndACK_clone(&orig_conv);
29656 uint64_t ret_ref = 0;
29657 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29658 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29662 void __attribute__((export_name("TS_UpdateFee_free"))) TS_UpdateFee_free(uint64_t this_obj) {
29663 LDKUpdateFee this_obj_conv;
29664 this_obj_conv.inner = untag_ptr(this_obj);
29665 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29666 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29667 UpdateFee_free(this_obj_conv);
29670 int8_tArray __attribute__((export_name("TS_UpdateFee_get_channel_id"))) TS_UpdateFee_get_channel_id(uint64_t this_ptr) {
29671 LDKUpdateFee this_ptr_conv;
29672 this_ptr_conv.inner = untag_ptr(this_ptr);
29673 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29674 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29675 this_ptr_conv.is_owned = false;
29676 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
29677 memcpy(ret_arr->elems, *UpdateFee_get_channel_id(&this_ptr_conv), 32);
29681 void __attribute__((export_name("TS_UpdateFee_set_channel_id"))) TS_UpdateFee_set_channel_id(uint64_t this_ptr, int8_tArray val) {
29682 LDKUpdateFee this_ptr_conv;
29683 this_ptr_conv.inner = untag_ptr(this_ptr);
29684 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29685 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29686 this_ptr_conv.is_owned = false;
29687 LDKThirtyTwoBytes val_ref;
29688 CHECK(val->arr_len == 32);
29689 memcpy(val_ref.data, val->elems, 32); FREE(val);
29690 UpdateFee_set_channel_id(&this_ptr_conv, val_ref);
29693 int32_t __attribute__((export_name("TS_UpdateFee_get_feerate_per_kw"))) TS_UpdateFee_get_feerate_per_kw(uint64_t this_ptr) {
29694 LDKUpdateFee this_ptr_conv;
29695 this_ptr_conv.inner = untag_ptr(this_ptr);
29696 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29697 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29698 this_ptr_conv.is_owned = false;
29699 int32_t ret_conv = UpdateFee_get_feerate_per_kw(&this_ptr_conv);
29703 void __attribute__((export_name("TS_UpdateFee_set_feerate_per_kw"))) TS_UpdateFee_set_feerate_per_kw(uint64_t this_ptr, int32_t val) {
29704 LDKUpdateFee this_ptr_conv;
29705 this_ptr_conv.inner = untag_ptr(this_ptr);
29706 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29707 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29708 this_ptr_conv.is_owned = false;
29709 UpdateFee_set_feerate_per_kw(&this_ptr_conv, val);
29712 uint64_t __attribute__((export_name("TS_UpdateFee_new"))) TS_UpdateFee_new(int8_tArray channel_id_arg, int32_t feerate_per_kw_arg) {
29713 LDKThirtyTwoBytes channel_id_arg_ref;
29714 CHECK(channel_id_arg->arr_len == 32);
29715 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
29716 LDKUpdateFee ret_var = UpdateFee_new(channel_id_arg_ref, feerate_per_kw_arg);
29717 uint64_t ret_ref = 0;
29718 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29719 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29723 static inline uint64_t UpdateFee_clone_ptr(LDKUpdateFee *NONNULL_PTR arg) {
29724 LDKUpdateFee ret_var = UpdateFee_clone(arg);
29725 uint64_t ret_ref = 0;
29726 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29727 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29730 int64_t __attribute__((export_name("TS_UpdateFee_clone_ptr"))) TS_UpdateFee_clone_ptr(uint64_t arg) {
29731 LDKUpdateFee arg_conv;
29732 arg_conv.inner = untag_ptr(arg);
29733 arg_conv.is_owned = ptr_is_owned(arg);
29734 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29735 arg_conv.is_owned = false;
29736 int64_t ret_conv = UpdateFee_clone_ptr(&arg_conv);
29740 uint64_t __attribute__((export_name("TS_UpdateFee_clone"))) TS_UpdateFee_clone(uint64_t orig) {
29741 LDKUpdateFee orig_conv;
29742 orig_conv.inner = untag_ptr(orig);
29743 orig_conv.is_owned = ptr_is_owned(orig);
29744 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29745 orig_conv.is_owned = false;
29746 LDKUpdateFee ret_var = UpdateFee_clone(&orig_conv);
29747 uint64_t ret_ref = 0;
29748 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29749 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29753 void __attribute__((export_name("TS_DataLossProtect_free"))) TS_DataLossProtect_free(uint64_t this_obj) {
29754 LDKDataLossProtect this_obj_conv;
29755 this_obj_conv.inner = untag_ptr(this_obj);
29756 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29757 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29758 DataLossProtect_free(this_obj_conv);
29761 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) {
29762 LDKDataLossProtect this_ptr_conv;
29763 this_ptr_conv.inner = untag_ptr(this_ptr);
29764 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29765 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29766 this_ptr_conv.is_owned = false;
29767 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
29768 memcpy(ret_arr->elems, *DataLossProtect_get_your_last_per_commitment_secret(&this_ptr_conv), 32);
29772 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) {
29773 LDKDataLossProtect this_ptr_conv;
29774 this_ptr_conv.inner = untag_ptr(this_ptr);
29775 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29776 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29777 this_ptr_conv.is_owned = false;
29778 LDKThirtyTwoBytes val_ref;
29779 CHECK(val->arr_len == 32);
29780 memcpy(val_ref.data, val->elems, 32); FREE(val);
29781 DataLossProtect_set_your_last_per_commitment_secret(&this_ptr_conv, val_ref);
29784 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) {
29785 LDKDataLossProtect this_ptr_conv;
29786 this_ptr_conv.inner = untag_ptr(this_ptr);
29787 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29788 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29789 this_ptr_conv.is_owned = false;
29790 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
29791 memcpy(ret_arr->elems, DataLossProtect_get_my_current_per_commitment_point(&this_ptr_conv).compressed_form, 33);
29795 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) {
29796 LDKDataLossProtect this_ptr_conv;
29797 this_ptr_conv.inner = untag_ptr(this_ptr);
29798 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29799 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29800 this_ptr_conv.is_owned = false;
29801 LDKPublicKey val_ref;
29802 CHECK(val->arr_len == 33);
29803 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
29804 DataLossProtect_set_my_current_per_commitment_point(&this_ptr_conv, val_ref);
29807 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) {
29808 LDKThirtyTwoBytes your_last_per_commitment_secret_arg_ref;
29809 CHECK(your_last_per_commitment_secret_arg->arr_len == 32);
29810 memcpy(your_last_per_commitment_secret_arg_ref.data, your_last_per_commitment_secret_arg->elems, 32); FREE(your_last_per_commitment_secret_arg);
29811 LDKPublicKey my_current_per_commitment_point_arg_ref;
29812 CHECK(my_current_per_commitment_point_arg->arr_len == 33);
29813 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);
29814 LDKDataLossProtect ret_var = DataLossProtect_new(your_last_per_commitment_secret_arg_ref, my_current_per_commitment_point_arg_ref);
29815 uint64_t ret_ref = 0;
29816 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29817 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29821 static inline uint64_t DataLossProtect_clone_ptr(LDKDataLossProtect *NONNULL_PTR arg) {
29822 LDKDataLossProtect ret_var = DataLossProtect_clone(arg);
29823 uint64_t ret_ref = 0;
29824 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29825 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29828 int64_t __attribute__((export_name("TS_DataLossProtect_clone_ptr"))) TS_DataLossProtect_clone_ptr(uint64_t arg) {
29829 LDKDataLossProtect arg_conv;
29830 arg_conv.inner = untag_ptr(arg);
29831 arg_conv.is_owned = ptr_is_owned(arg);
29832 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29833 arg_conv.is_owned = false;
29834 int64_t ret_conv = DataLossProtect_clone_ptr(&arg_conv);
29838 uint64_t __attribute__((export_name("TS_DataLossProtect_clone"))) TS_DataLossProtect_clone(uint64_t orig) {
29839 LDKDataLossProtect orig_conv;
29840 orig_conv.inner = untag_ptr(orig);
29841 orig_conv.is_owned = ptr_is_owned(orig);
29842 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29843 orig_conv.is_owned = false;
29844 LDKDataLossProtect ret_var = DataLossProtect_clone(&orig_conv);
29845 uint64_t ret_ref = 0;
29846 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29847 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29851 void __attribute__((export_name("TS_ChannelReestablish_free"))) TS_ChannelReestablish_free(uint64_t this_obj) {
29852 LDKChannelReestablish this_obj_conv;
29853 this_obj_conv.inner = untag_ptr(this_obj);
29854 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29855 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29856 ChannelReestablish_free(this_obj_conv);
29859 int8_tArray __attribute__((export_name("TS_ChannelReestablish_get_channel_id"))) TS_ChannelReestablish_get_channel_id(uint64_t this_ptr) {
29860 LDKChannelReestablish this_ptr_conv;
29861 this_ptr_conv.inner = untag_ptr(this_ptr);
29862 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29863 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29864 this_ptr_conv.is_owned = false;
29865 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
29866 memcpy(ret_arr->elems, *ChannelReestablish_get_channel_id(&this_ptr_conv), 32);
29870 void __attribute__((export_name("TS_ChannelReestablish_set_channel_id"))) TS_ChannelReestablish_set_channel_id(uint64_t this_ptr, int8_tArray val) {
29871 LDKChannelReestablish this_ptr_conv;
29872 this_ptr_conv.inner = untag_ptr(this_ptr);
29873 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29874 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29875 this_ptr_conv.is_owned = false;
29876 LDKThirtyTwoBytes val_ref;
29877 CHECK(val->arr_len == 32);
29878 memcpy(val_ref.data, val->elems, 32); FREE(val);
29879 ChannelReestablish_set_channel_id(&this_ptr_conv, val_ref);
29882 int64_t __attribute__((export_name("TS_ChannelReestablish_get_next_local_commitment_number"))) TS_ChannelReestablish_get_next_local_commitment_number(uint64_t this_ptr) {
29883 LDKChannelReestablish this_ptr_conv;
29884 this_ptr_conv.inner = untag_ptr(this_ptr);
29885 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29886 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29887 this_ptr_conv.is_owned = false;
29888 int64_t ret_conv = ChannelReestablish_get_next_local_commitment_number(&this_ptr_conv);
29892 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) {
29893 LDKChannelReestablish this_ptr_conv;
29894 this_ptr_conv.inner = untag_ptr(this_ptr);
29895 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29896 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29897 this_ptr_conv.is_owned = false;
29898 ChannelReestablish_set_next_local_commitment_number(&this_ptr_conv, val);
29901 int64_t __attribute__((export_name("TS_ChannelReestablish_get_next_remote_commitment_number"))) TS_ChannelReestablish_get_next_remote_commitment_number(uint64_t this_ptr) {
29902 LDKChannelReestablish this_ptr_conv;
29903 this_ptr_conv.inner = untag_ptr(this_ptr);
29904 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29905 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29906 this_ptr_conv.is_owned = false;
29907 int64_t ret_conv = ChannelReestablish_get_next_remote_commitment_number(&this_ptr_conv);
29911 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) {
29912 LDKChannelReestablish this_ptr_conv;
29913 this_ptr_conv.inner = untag_ptr(this_ptr);
29914 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29915 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29916 this_ptr_conv.is_owned = false;
29917 ChannelReestablish_set_next_remote_commitment_number(&this_ptr_conv, val);
29920 static inline uint64_t ChannelReestablish_clone_ptr(LDKChannelReestablish *NONNULL_PTR arg) {
29921 LDKChannelReestablish ret_var = ChannelReestablish_clone(arg);
29922 uint64_t ret_ref = 0;
29923 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29924 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29927 int64_t __attribute__((export_name("TS_ChannelReestablish_clone_ptr"))) TS_ChannelReestablish_clone_ptr(uint64_t arg) {
29928 LDKChannelReestablish arg_conv;
29929 arg_conv.inner = untag_ptr(arg);
29930 arg_conv.is_owned = ptr_is_owned(arg);
29931 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29932 arg_conv.is_owned = false;
29933 int64_t ret_conv = ChannelReestablish_clone_ptr(&arg_conv);
29937 uint64_t __attribute__((export_name("TS_ChannelReestablish_clone"))) TS_ChannelReestablish_clone(uint64_t orig) {
29938 LDKChannelReestablish orig_conv;
29939 orig_conv.inner = untag_ptr(orig);
29940 orig_conv.is_owned = ptr_is_owned(orig);
29941 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29942 orig_conv.is_owned = false;
29943 LDKChannelReestablish ret_var = ChannelReestablish_clone(&orig_conv);
29944 uint64_t ret_ref = 0;
29945 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29946 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29950 void __attribute__((export_name("TS_AnnouncementSignatures_free"))) TS_AnnouncementSignatures_free(uint64_t this_obj) {
29951 LDKAnnouncementSignatures this_obj_conv;
29952 this_obj_conv.inner = untag_ptr(this_obj);
29953 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29954 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29955 AnnouncementSignatures_free(this_obj_conv);
29958 int8_tArray __attribute__((export_name("TS_AnnouncementSignatures_get_channel_id"))) TS_AnnouncementSignatures_get_channel_id(uint64_t this_ptr) {
29959 LDKAnnouncementSignatures this_ptr_conv;
29960 this_ptr_conv.inner = untag_ptr(this_ptr);
29961 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29962 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29963 this_ptr_conv.is_owned = false;
29964 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
29965 memcpy(ret_arr->elems, *AnnouncementSignatures_get_channel_id(&this_ptr_conv), 32);
29969 void __attribute__((export_name("TS_AnnouncementSignatures_set_channel_id"))) TS_AnnouncementSignatures_set_channel_id(uint64_t this_ptr, int8_tArray val) {
29970 LDKAnnouncementSignatures this_ptr_conv;
29971 this_ptr_conv.inner = untag_ptr(this_ptr);
29972 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29973 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29974 this_ptr_conv.is_owned = false;
29975 LDKThirtyTwoBytes val_ref;
29976 CHECK(val->arr_len == 32);
29977 memcpy(val_ref.data, val->elems, 32); FREE(val);
29978 AnnouncementSignatures_set_channel_id(&this_ptr_conv, val_ref);
29981 int64_t __attribute__((export_name("TS_AnnouncementSignatures_get_short_channel_id"))) TS_AnnouncementSignatures_get_short_channel_id(uint64_t this_ptr) {
29982 LDKAnnouncementSignatures this_ptr_conv;
29983 this_ptr_conv.inner = untag_ptr(this_ptr);
29984 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29985 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29986 this_ptr_conv.is_owned = false;
29987 int64_t ret_conv = AnnouncementSignatures_get_short_channel_id(&this_ptr_conv);
29991 void __attribute__((export_name("TS_AnnouncementSignatures_set_short_channel_id"))) TS_AnnouncementSignatures_set_short_channel_id(uint64_t this_ptr, int64_t val) {
29992 LDKAnnouncementSignatures this_ptr_conv;
29993 this_ptr_conv.inner = untag_ptr(this_ptr);
29994 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29995 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29996 this_ptr_conv.is_owned = false;
29997 AnnouncementSignatures_set_short_channel_id(&this_ptr_conv, val);
30000 int8_tArray __attribute__((export_name("TS_AnnouncementSignatures_get_node_signature"))) TS_AnnouncementSignatures_get_node_signature(uint64_t this_ptr) {
30001 LDKAnnouncementSignatures this_ptr_conv;
30002 this_ptr_conv.inner = untag_ptr(this_ptr);
30003 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30004 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30005 this_ptr_conv.is_owned = false;
30006 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
30007 memcpy(ret_arr->elems, AnnouncementSignatures_get_node_signature(&this_ptr_conv).compact_form, 64);
30011 void __attribute__((export_name("TS_AnnouncementSignatures_set_node_signature"))) TS_AnnouncementSignatures_set_node_signature(uint64_t this_ptr, int8_tArray val) {
30012 LDKAnnouncementSignatures this_ptr_conv;
30013 this_ptr_conv.inner = untag_ptr(this_ptr);
30014 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30015 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30016 this_ptr_conv.is_owned = false;
30017 LDKSignature val_ref;
30018 CHECK(val->arr_len == 64);
30019 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
30020 AnnouncementSignatures_set_node_signature(&this_ptr_conv, val_ref);
30023 int8_tArray __attribute__((export_name("TS_AnnouncementSignatures_get_bitcoin_signature"))) TS_AnnouncementSignatures_get_bitcoin_signature(uint64_t this_ptr) {
30024 LDKAnnouncementSignatures this_ptr_conv;
30025 this_ptr_conv.inner = untag_ptr(this_ptr);
30026 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30027 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30028 this_ptr_conv.is_owned = false;
30029 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
30030 memcpy(ret_arr->elems, AnnouncementSignatures_get_bitcoin_signature(&this_ptr_conv).compact_form, 64);
30034 void __attribute__((export_name("TS_AnnouncementSignatures_set_bitcoin_signature"))) TS_AnnouncementSignatures_set_bitcoin_signature(uint64_t this_ptr, int8_tArray val) {
30035 LDKAnnouncementSignatures this_ptr_conv;
30036 this_ptr_conv.inner = untag_ptr(this_ptr);
30037 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30038 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30039 this_ptr_conv.is_owned = false;
30040 LDKSignature val_ref;
30041 CHECK(val->arr_len == 64);
30042 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
30043 AnnouncementSignatures_set_bitcoin_signature(&this_ptr_conv, val_ref);
30046 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) {
30047 LDKThirtyTwoBytes channel_id_arg_ref;
30048 CHECK(channel_id_arg->arr_len == 32);
30049 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
30050 LDKSignature node_signature_arg_ref;
30051 CHECK(node_signature_arg->arr_len == 64);
30052 memcpy(node_signature_arg_ref.compact_form, node_signature_arg->elems, 64); FREE(node_signature_arg);
30053 LDKSignature bitcoin_signature_arg_ref;
30054 CHECK(bitcoin_signature_arg->arr_len == 64);
30055 memcpy(bitcoin_signature_arg_ref.compact_form, bitcoin_signature_arg->elems, 64); FREE(bitcoin_signature_arg);
30056 LDKAnnouncementSignatures ret_var = AnnouncementSignatures_new(channel_id_arg_ref, short_channel_id_arg, node_signature_arg_ref, bitcoin_signature_arg_ref);
30057 uint64_t ret_ref = 0;
30058 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30059 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30063 static inline uint64_t AnnouncementSignatures_clone_ptr(LDKAnnouncementSignatures *NONNULL_PTR arg) {
30064 LDKAnnouncementSignatures ret_var = AnnouncementSignatures_clone(arg);
30065 uint64_t ret_ref = 0;
30066 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30067 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30070 int64_t __attribute__((export_name("TS_AnnouncementSignatures_clone_ptr"))) TS_AnnouncementSignatures_clone_ptr(uint64_t arg) {
30071 LDKAnnouncementSignatures arg_conv;
30072 arg_conv.inner = untag_ptr(arg);
30073 arg_conv.is_owned = ptr_is_owned(arg);
30074 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
30075 arg_conv.is_owned = false;
30076 int64_t ret_conv = AnnouncementSignatures_clone_ptr(&arg_conv);
30080 uint64_t __attribute__((export_name("TS_AnnouncementSignatures_clone"))) TS_AnnouncementSignatures_clone(uint64_t orig) {
30081 LDKAnnouncementSignatures orig_conv;
30082 orig_conv.inner = untag_ptr(orig);
30083 orig_conv.is_owned = ptr_is_owned(orig);
30084 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
30085 orig_conv.is_owned = false;
30086 LDKAnnouncementSignatures ret_var = AnnouncementSignatures_clone(&orig_conv);
30087 uint64_t ret_ref = 0;
30088 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30089 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30093 void __attribute__((export_name("TS_NetAddress_free"))) TS_NetAddress_free(uint64_t this_ptr) {
30094 if (!ptr_is_owned(this_ptr)) return;
30095 void* this_ptr_ptr = untag_ptr(this_ptr);
30096 CHECK_ACCESS(this_ptr_ptr);
30097 LDKNetAddress this_ptr_conv = *(LDKNetAddress*)(this_ptr_ptr);
30098 FREE(untag_ptr(this_ptr));
30099 NetAddress_free(this_ptr_conv);
30102 static inline uint64_t NetAddress_clone_ptr(LDKNetAddress *NONNULL_PTR arg) {
30103 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
30104 *ret_copy = NetAddress_clone(arg);
30105 uint64_t ret_ref = tag_ptr(ret_copy, true);
30108 int64_t __attribute__((export_name("TS_NetAddress_clone_ptr"))) TS_NetAddress_clone_ptr(uint64_t arg) {
30109 LDKNetAddress* arg_conv = (LDKNetAddress*)untag_ptr(arg);
30110 int64_t ret_conv = NetAddress_clone_ptr(arg_conv);
30114 uint64_t __attribute__((export_name("TS_NetAddress_clone"))) TS_NetAddress_clone(uint64_t orig) {
30115 LDKNetAddress* orig_conv = (LDKNetAddress*)untag_ptr(orig);
30116 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
30117 *ret_copy = NetAddress_clone(orig_conv);
30118 uint64_t ret_ref = tag_ptr(ret_copy, true);
30122 uint64_t __attribute__((export_name("TS_NetAddress_ipv4"))) TS_NetAddress_ipv4(int8_tArray addr, int16_t port) {
30123 LDKFourBytes addr_ref;
30124 CHECK(addr->arr_len == 4);
30125 memcpy(addr_ref.data, addr->elems, 4); FREE(addr);
30126 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
30127 *ret_copy = NetAddress_ipv4(addr_ref, port);
30128 uint64_t ret_ref = tag_ptr(ret_copy, true);
30132 uint64_t __attribute__((export_name("TS_NetAddress_ipv6"))) TS_NetAddress_ipv6(int8_tArray addr, int16_t port) {
30133 LDKSixteenBytes addr_ref;
30134 CHECK(addr->arr_len == 16);
30135 memcpy(addr_ref.data, addr->elems, 16); FREE(addr);
30136 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
30137 *ret_copy = NetAddress_ipv6(addr_ref, port);
30138 uint64_t ret_ref = tag_ptr(ret_copy, true);
30142 uint64_t __attribute__((export_name("TS_NetAddress_onion_v2"))) TS_NetAddress_onion_v2(int8_tArray a) {
30143 LDKTwelveBytes a_ref;
30144 CHECK(a->arr_len == 12);
30145 memcpy(a_ref.data, a->elems, 12); FREE(a);
30146 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
30147 *ret_copy = NetAddress_onion_v2(a_ref);
30148 uint64_t ret_ref = tag_ptr(ret_copy, true);
30152 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) {
30153 LDKThirtyTwoBytes ed25519_pubkey_ref;
30154 CHECK(ed25519_pubkey->arr_len == 32);
30155 memcpy(ed25519_pubkey_ref.data, ed25519_pubkey->elems, 32); FREE(ed25519_pubkey);
30156 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
30157 *ret_copy = NetAddress_onion_v3(ed25519_pubkey_ref, checksum, version, port);
30158 uint64_t ret_ref = tag_ptr(ret_copy, true);
30162 uint64_t __attribute__((export_name("TS_NetAddress_hostname"))) TS_NetAddress_hostname(uint64_t hostname, int16_t port) {
30163 LDKHostname hostname_conv;
30164 hostname_conv.inner = untag_ptr(hostname);
30165 hostname_conv.is_owned = ptr_is_owned(hostname);
30166 CHECK_INNER_FIELD_ACCESS_OR_NULL(hostname_conv);
30167 hostname_conv = Hostname_clone(&hostname_conv);
30168 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
30169 *ret_copy = NetAddress_hostname(hostname_conv, port);
30170 uint64_t ret_ref = tag_ptr(ret_copy, true);
30174 int8_tArray __attribute__((export_name("TS_NetAddress_write"))) TS_NetAddress_write(uint64_t obj) {
30175 LDKNetAddress* obj_conv = (LDKNetAddress*)untag_ptr(obj);
30176 LDKCVec_u8Z ret_var = NetAddress_write(obj_conv);
30177 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
30178 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
30179 CVec_u8Z_free(ret_var);
30183 uint64_t __attribute__((export_name("TS_NetAddress_read"))) TS_NetAddress_read(int8_tArray ser) {
30184 LDKu8slice ser_ref;
30185 ser_ref.datalen = ser->arr_len;
30186 ser_ref.data = ser->elems;
30187 LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
30188 *ret_conv = NetAddress_read(ser_ref);
30190 return tag_ptr(ret_conv, true);
30193 void __attribute__((export_name("TS_UnsignedNodeAnnouncement_free"))) TS_UnsignedNodeAnnouncement_free(uint64_t this_obj) {
30194 LDKUnsignedNodeAnnouncement this_obj_conv;
30195 this_obj_conv.inner = untag_ptr(this_obj);
30196 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30197 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30198 UnsignedNodeAnnouncement_free(this_obj_conv);
30201 uint64_t __attribute__((export_name("TS_UnsignedNodeAnnouncement_get_features"))) TS_UnsignedNodeAnnouncement_get_features(uint64_t this_ptr) {
30202 LDKUnsignedNodeAnnouncement this_ptr_conv;
30203 this_ptr_conv.inner = untag_ptr(this_ptr);
30204 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30205 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30206 this_ptr_conv.is_owned = false;
30207 LDKNodeFeatures ret_var = UnsignedNodeAnnouncement_get_features(&this_ptr_conv);
30208 uint64_t ret_ref = 0;
30209 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30210 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30214 void __attribute__((export_name("TS_UnsignedNodeAnnouncement_set_features"))) TS_UnsignedNodeAnnouncement_set_features(uint64_t this_ptr, uint64_t val) {
30215 LDKUnsignedNodeAnnouncement this_ptr_conv;
30216 this_ptr_conv.inner = untag_ptr(this_ptr);
30217 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30218 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30219 this_ptr_conv.is_owned = false;
30220 LDKNodeFeatures val_conv;
30221 val_conv.inner = untag_ptr(val);
30222 val_conv.is_owned = ptr_is_owned(val);
30223 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
30224 val_conv = NodeFeatures_clone(&val_conv);
30225 UnsignedNodeAnnouncement_set_features(&this_ptr_conv, val_conv);
30228 int32_t __attribute__((export_name("TS_UnsignedNodeAnnouncement_get_timestamp"))) TS_UnsignedNodeAnnouncement_get_timestamp(uint64_t this_ptr) {
30229 LDKUnsignedNodeAnnouncement this_ptr_conv;
30230 this_ptr_conv.inner = untag_ptr(this_ptr);
30231 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30232 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30233 this_ptr_conv.is_owned = false;
30234 int32_t ret_conv = UnsignedNodeAnnouncement_get_timestamp(&this_ptr_conv);
30238 void __attribute__((export_name("TS_UnsignedNodeAnnouncement_set_timestamp"))) TS_UnsignedNodeAnnouncement_set_timestamp(uint64_t this_ptr, int32_t val) {
30239 LDKUnsignedNodeAnnouncement this_ptr_conv;
30240 this_ptr_conv.inner = untag_ptr(this_ptr);
30241 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30242 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30243 this_ptr_conv.is_owned = false;
30244 UnsignedNodeAnnouncement_set_timestamp(&this_ptr_conv, val);
30247 int8_tArray __attribute__((export_name("TS_UnsignedNodeAnnouncement_get_node_id"))) TS_UnsignedNodeAnnouncement_get_node_id(uint64_t this_ptr) {
30248 LDKUnsignedNodeAnnouncement this_ptr_conv;
30249 this_ptr_conv.inner = untag_ptr(this_ptr);
30250 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30251 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30252 this_ptr_conv.is_owned = false;
30253 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
30254 memcpy(ret_arr->elems, UnsignedNodeAnnouncement_get_node_id(&this_ptr_conv).compressed_form, 33);
30258 void __attribute__((export_name("TS_UnsignedNodeAnnouncement_set_node_id"))) TS_UnsignedNodeAnnouncement_set_node_id(uint64_t this_ptr, int8_tArray val) {
30259 LDKUnsignedNodeAnnouncement this_ptr_conv;
30260 this_ptr_conv.inner = untag_ptr(this_ptr);
30261 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30262 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30263 this_ptr_conv.is_owned = false;
30264 LDKPublicKey val_ref;
30265 CHECK(val->arr_len == 33);
30266 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
30267 UnsignedNodeAnnouncement_set_node_id(&this_ptr_conv, val_ref);
30270 int8_tArray __attribute__((export_name("TS_UnsignedNodeAnnouncement_get_rgb"))) TS_UnsignedNodeAnnouncement_get_rgb(uint64_t this_ptr) {
30271 LDKUnsignedNodeAnnouncement this_ptr_conv;
30272 this_ptr_conv.inner = untag_ptr(this_ptr);
30273 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30274 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30275 this_ptr_conv.is_owned = false;
30276 int8_tArray ret_arr = init_int8_tArray(3, __LINE__);
30277 memcpy(ret_arr->elems, *UnsignedNodeAnnouncement_get_rgb(&this_ptr_conv), 3);
30281 void __attribute__((export_name("TS_UnsignedNodeAnnouncement_set_rgb"))) TS_UnsignedNodeAnnouncement_set_rgb(uint64_t this_ptr, int8_tArray val) {
30282 LDKUnsignedNodeAnnouncement this_ptr_conv;
30283 this_ptr_conv.inner = untag_ptr(this_ptr);
30284 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30285 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30286 this_ptr_conv.is_owned = false;
30287 LDKThreeBytes val_ref;
30288 CHECK(val->arr_len == 3);
30289 memcpy(val_ref.data, val->elems, 3); FREE(val);
30290 UnsignedNodeAnnouncement_set_rgb(&this_ptr_conv, val_ref);
30293 int8_tArray __attribute__((export_name("TS_UnsignedNodeAnnouncement_get_alias"))) TS_UnsignedNodeAnnouncement_get_alias(uint64_t this_ptr) {
30294 LDKUnsignedNodeAnnouncement this_ptr_conv;
30295 this_ptr_conv.inner = untag_ptr(this_ptr);
30296 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30297 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30298 this_ptr_conv.is_owned = false;
30299 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
30300 memcpy(ret_arr->elems, *UnsignedNodeAnnouncement_get_alias(&this_ptr_conv), 32);
30304 void __attribute__((export_name("TS_UnsignedNodeAnnouncement_set_alias"))) TS_UnsignedNodeAnnouncement_set_alias(uint64_t this_ptr, int8_tArray val) {
30305 LDKUnsignedNodeAnnouncement this_ptr_conv;
30306 this_ptr_conv.inner = untag_ptr(this_ptr);
30307 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30308 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30309 this_ptr_conv.is_owned = false;
30310 LDKThirtyTwoBytes val_ref;
30311 CHECK(val->arr_len == 32);
30312 memcpy(val_ref.data, val->elems, 32); FREE(val);
30313 UnsignedNodeAnnouncement_set_alias(&this_ptr_conv, val_ref);
30316 uint64_tArray __attribute__((export_name("TS_UnsignedNodeAnnouncement_get_addresses"))) TS_UnsignedNodeAnnouncement_get_addresses(uint64_t this_ptr) {
30317 LDKUnsignedNodeAnnouncement this_ptr_conv;
30318 this_ptr_conv.inner = untag_ptr(this_ptr);
30319 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30320 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30321 this_ptr_conv.is_owned = false;
30322 LDKCVec_NetAddressZ ret_var = UnsignedNodeAnnouncement_get_addresses(&this_ptr_conv);
30323 uint64_tArray ret_arr = NULL;
30324 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
30325 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
30326 for (size_t m = 0; m < ret_var.datalen; m++) {
30327 LDKNetAddress *ret_conv_12_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
30328 *ret_conv_12_copy = ret_var.data[m];
30329 uint64_t ret_conv_12_ref = tag_ptr(ret_conv_12_copy, true);
30330 ret_arr_ptr[m] = ret_conv_12_ref;
30333 FREE(ret_var.data);
30337 void __attribute__((export_name("TS_UnsignedNodeAnnouncement_set_addresses"))) TS_UnsignedNodeAnnouncement_set_addresses(uint64_t this_ptr, uint64_tArray val) {
30338 LDKUnsignedNodeAnnouncement this_ptr_conv;
30339 this_ptr_conv.inner = untag_ptr(this_ptr);
30340 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30341 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30342 this_ptr_conv.is_owned = false;
30343 LDKCVec_NetAddressZ val_constr;
30344 val_constr.datalen = val->arr_len;
30345 if (val_constr.datalen > 0)
30346 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
30348 val_constr.data = NULL;
30349 uint64_t* val_vals = val->elems;
30350 for (size_t m = 0; m < val_constr.datalen; m++) {
30351 uint64_t val_conv_12 = val_vals[m];
30352 void* val_conv_12_ptr = untag_ptr(val_conv_12);
30353 CHECK_ACCESS(val_conv_12_ptr);
30354 LDKNetAddress val_conv_12_conv = *(LDKNetAddress*)(val_conv_12_ptr);
30355 val_conv_12_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(val_conv_12));
30356 val_constr.data[m] = val_conv_12_conv;
30359 UnsignedNodeAnnouncement_set_addresses(&this_ptr_conv, val_constr);
30362 static inline uint64_t UnsignedNodeAnnouncement_clone_ptr(LDKUnsignedNodeAnnouncement *NONNULL_PTR arg) {
30363 LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_clone(arg);
30364 uint64_t ret_ref = 0;
30365 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30366 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30369 int64_t __attribute__((export_name("TS_UnsignedNodeAnnouncement_clone_ptr"))) TS_UnsignedNodeAnnouncement_clone_ptr(uint64_t arg) {
30370 LDKUnsignedNodeAnnouncement arg_conv;
30371 arg_conv.inner = untag_ptr(arg);
30372 arg_conv.is_owned = ptr_is_owned(arg);
30373 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
30374 arg_conv.is_owned = false;
30375 int64_t ret_conv = UnsignedNodeAnnouncement_clone_ptr(&arg_conv);
30379 uint64_t __attribute__((export_name("TS_UnsignedNodeAnnouncement_clone"))) TS_UnsignedNodeAnnouncement_clone(uint64_t orig) {
30380 LDKUnsignedNodeAnnouncement orig_conv;
30381 orig_conv.inner = untag_ptr(orig);
30382 orig_conv.is_owned = ptr_is_owned(orig);
30383 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
30384 orig_conv.is_owned = false;
30385 LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_clone(&orig_conv);
30386 uint64_t ret_ref = 0;
30387 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30388 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30392 void __attribute__((export_name("TS_NodeAnnouncement_free"))) TS_NodeAnnouncement_free(uint64_t this_obj) {
30393 LDKNodeAnnouncement this_obj_conv;
30394 this_obj_conv.inner = untag_ptr(this_obj);
30395 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30396 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30397 NodeAnnouncement_free(this_obj_conv);
30400 int8_tArray __attribute__((export_name("TS_NodeAnnouncement_get_signature"))) TS_NodeAnnouncement_get_signature(uint64_t this_ptr) {
30401 LDKNodeAnnouncement this_ptr_conv;
30402 this_ptr_conv.inner = untag_ptr(this_ptr);
30403 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30404 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30405 this_ptr_conv.is_owned = false;
30406 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
30407 memcpy(ret_arr->elems, NodeAnnouncement_get_signature(&this_ptr_conv).compact_form, 64);
30411 void __attribute__((export_name("TS_NodeAnnouncement_set_signature"))) TS_NodeAnnouncement_set_signature(uint64_t this_ptr, int8_tArray val) {
30412 LDKNodeAnnouncement this_ptr_conv;
30413 this_ptr_conv.inner = untag_ptr(this_ptr);
30414 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30415 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30416 this_ptr_conv.is_owned = false;
30417 LDKSignature val_ref;
30418 CHECK(val->arr_len == 64);
30419 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
30420 NodeAnnouncement_set_signature(&this_ptr_conv, val_ref);
30423 uint64_t __attribute__((export_name("TS_NodeAnnouncement_get_contents"))) TS_NodeAnnouncement_get_contents(uint64_t this_ptr) {
30424 LDKNodeAnnouncement this_ptr_conv;
30425 this_ptr_conv.inner = untag_ptr(this_ptr);
30426 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30427 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30428 this_ptr_conv.is_owned = false;
30429 LDKUnsignedNodeAnnouncement ret_var = NodeAnnouncement_get_contents(&this_ptr_conv);
30430 uint64_t ret_ref = 0;
30431 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30432 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30436 void __attribute__((export_name("TS_NodeAnnouncement_set_contents"))) TS_NodeAnnouncement_set_contents(uint64_t this_ptr, uint64_t val) {
30437 LDKNodeAnnouncement this_ptr_conv;
30438 this_ptr_conv.inner = untag_ptr(this_ptr);
30439 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30440 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30441 this_ptr_conv.is_owned = false;
30442 LDKUnsignedNodeAnnouncement val_conv;
30443 val_conv.inner = untag_ptr(val);
30444 val_conv.is_owned = ptr_is_owned(val);
30445 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
30446 val_conv = UnsignedNodeAnnouncement_clone(&val_conv);
30447 NodeAnnouncement_set_contents(&this_ptr_conv, val_conv);
30450 uint64_t __attribute__((export_name("TS_NodeAnnouncement_new"))) TS_NodeAnnouncement_new(int8_tArray signature_arg, uint64_t contents_arg) {
30451 LDKSignature signature_arg_ref;
30452 CHECK(signature_arg->arr_len == 64);
30453 memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg);
30454 LDKUnsignedNodeAnnouncement contents_arg_conv;
30455 contents_arg_conv.inner = untag_ptr(contents_arg);
30456 contents_arg_conv.is_owned = ptr_is_owned(contents_arg);
30457 CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv);
30458 contents_arg_conv = UnsignedNodeAnnouncement_clone(&contents_arg_conv);
30459 LDKNodeAnnouncement ret_var = NodeAnnouncement_new(signature_arg_ref, contents_arg_conv);
30460 uint64_t ret_ref = 0;
30461 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30462 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30466 static inline uint64_t NodeAnnouncement_clone_ptr(LDKNodeAnnouncement *NONNULL_PTR arg) {
30467 LDKNodeAnnouncement ret_var = NodeAnnouncement_clone(arg);
30468 uint64_t ret_ref = 0;
30469 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30470 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30473 int64_t __attribute__((export_name("TS_NodeAnnouncement_clone_ptr"))) TS_NodeAnnouncement_clone_ptr(uint64_t arg) {
30474 LDKNodeAnnouncement arg_conv;
30475 arg_conv.inner = untag_ptr(arg);
30476 arg_conv.is_owned = ptr_is_owned(arg);
30477 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
30478 arg_conv.is_owned = false;
30479 int64_t ret_conv = NodeAnnouncement_clone_ptr(&arg_conv);
30483 uint64_t __attribute__((export_name("TS_NodeAnnouncement_clone"))) TS_NodeAnnouncement_clone(uint64_t orig) {
30484 LDKNodeAnnouncement orig_conv;
30485 orig_conv.inner = untag_ptr(orig);
30486 orig_conv.is_owned = ptr_is_owned(orig);
30487 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
30488 orig_conv.is_owned = false;
30489 LDKNodeAnnouncement ret_var = NodeAnnouncement_clone(&orig_conv);
30490 uint64_t ret_ref = 0;
30491 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30492 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30496 void __attribute__((export_name("TS_UnsignedChannelAnnouncement_free"))) TS_UnsignedChannelAnnouncement_free(uint64_t this_obj) {
30497 LDKUnsignedChannelAnnouncement this_obj_conv;
30498 this_obj_conv.inner = untag_ptr(this_obj);
30499 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30500 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30501 UnsignedChannelAnnouncement_free(this_obj_conv);
30504 uint64_t __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_features"))) TS_UnsignedChannelAnnouncement_get_features(uint64_t this_ptr) {
30505 LDKUnsignedChannelAnnouncement this_ptr_conv;
30506 this_ptr_conv.inner = untag_ptr(this_ptr);
30507 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30508 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30509 this_ptr_conv.is_owned = false;
30510 LDKChannelFeatures ret_var = UnsignedChannelAnnouncement_get_features(&this_ptr_conv);
30511 uint64_t ret_ref = 0;
30512 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30513 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30517 void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_features"))) TS_UnsignedChannelAnnouncement_set_features(uint64_t this_ptr, uint64_t val) {
30518 LDKUnsignedChannelAnnouncement this_ptr_conv;
30519 this_ptr_conv.inner = untag_ptr(this_ptr);
30520 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30521 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30522 this_ptr_conv.is_owned = false;
30523 LDKChannelFeatures val_conv;
30524 val_conv.inner = untag_ptr(val);
30525 val_conv.is_owned = ptr_is_owned(val);
30526 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
30527 val_conv = ChannelFeatures_clone(&val_conv);
30528 UnsignedChannelAnnouncement_set_features(&this_ptr_conv, val_conv);
30531 int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_chain_hash"))) TS_UnsignedChannelAnnouncement_get_chain_hash(uint64_t this_ptr) {
30532 LDKUnsignedChannelAnnouncement this_ptr_conv;
30533 this_ptr_conv.inner = untag_ptr(this_ptr);
30534 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30535 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30536 this_ptr_conv.is_owned = false;
30537 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
30538 memcpy(ret_arr->elems, *UnsignedChannelAnnouncement_get_chain_hash(&this_ptr_conv), 32);
30542 void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_chain_hash"))) TS_UnsignedChannelAnnouncement_set_chain_hash(uint64_t this_ptr, int8_tArray val) {
30543 LDKUnsignedChannelAnnouncement this_ptr_conv;
30544 this_ptr_conv.inner = untag_ptr(this_ptr);
30545 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30546 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30547 this_ptr_conv.is_owned = false;
30548 LDKThirtyTwoBytes val_ref;
30549 CHECK(val->arr_len == 32);
30550 memcpy(val_ref.data, val->elems, 32); FREE(val);
30551 UnsignedChannelAnnouncement_set_chain_hash(&this_ptr_conv, val_ref);
30554 int64_t __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_short_channel_id"))) TS_UnsignedChannelAnnouncement_get_short_channel_id(uint64_t this_ptr) {
30555 LDKUnsignedChannelAnnouncement this_ptr_conv;
30556 this_ptr_conv.inner = untag_ptr(this_ptr);
30557 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30558 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30559 this_ptr_conv.is_owned = false;
30560 int64_t ret_conv = UnsignedChannelAnnouncement_get_short_channel_id(&this_ptr_conv);
30564 void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_short_channel_id"))) TS_UnsignedChannelAnnouncement_set_short_channel_id(uint64_t this_ptr, int64_t val) {
30565 LDKUnsignedChannelAnnouncement this_ptr_conv;
30566 this_ptr_conv.inner = untag_ptr(this_ptr);
30567 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30568 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30569 this_ptr_conv.is_owned = false;
30570 UnsignedChannelAnnouncement_set_short_channel_id(&this_ptr_conv, val);
30573 int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_node_id_1"))) TS_UnsignedChannelAnnouncement_get_node_id_1(uint64_t this_ptr) {
30574 LDKUnsignedChannelAnnouncement this_ptr_conv;
30575 this_ptr_conv.inner = untag_ptr(this_ptr);
30576 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30577 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30578 this_ptr_conv.is_owned = false;
30579 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
30580 memcpy(ret_arr->elems, UnsignedChannelAnnouncement_get_node_id_1(&this_ptr_conv).compressed_form, 33);
30584 void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_node_id_1"))) TS_UnsignedChannelAnnouncement_set_node_id_1(uint64_t this_ptr, int8_tArray val) {
30585 LDKUnsignedChannelAnnouncement this_ptr_conv;
30586 this_ptr_conv.inner = untag_ptr(this_ptr);
30587 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30588 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30589 this_ptr_conv.is_owned = false;
30590 LDKPublicKey val_ref;
30591 CHECK(val->arr_len == 33);
30592 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
30593 UnsignedChannelAnnouncement_set_node_id_1(&this_ptr_conv, val_ref);
30596 int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_node_id_2"))) TS_UnsignedChannelAnnouncement_get_node_id_2(uint64_t this_ptr) {
30597 LDKUnsignedChannelAnnouncement this_ptr_conv;
30598 this_ptr_conv.inner = untag_ptr(this_ptr);
30599 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30600 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30601 this_ptr_conv.is_owned = false;
30602 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
30603 memcpy(ret_arr->elems, UnsignedChannelAnnouncement_get_node_id_2(&this_ptr_conv).compressed_form, 33);
30607 void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_node_id_2"))) TS_UnsignedChannelAnnouncement_set_node_id_2(uint64_t this_ptr, int8_tArray val) {
30608 LDKUnsignedChannelAnnouncement this_ptr_conv;
30609 this_ptr_conv.inner = untag_ptr(this_ptr);
30610 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30611 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30612 this_ptr_conv.is_owned = false;
30613 LDKPublicKey val_ref;
30614 CHECK(val->arr_len == 33);
30615 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
30616 UnsignedChannelAnnouncement_set_node_id_2(&this_ptr_conv, val_ref);
30619 int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_bitcoin_key_1"))) TS_UnsignedChannelAnnouncement_get_bitcoin_key_1(uint64_t this_ptr) {
30620 LDKUnsignedChannelAnnouncement this_ptr_conv;
30621 this_ptr_conv.inner = untag_ptr(this_ptr);
30622 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30623 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30624 this_ptr_conv.is_owned = false;
30625 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
30626 memcpy(ret_arr->elems, UnsignedChannelAnnouncement_get_bitcoin_key_1(&this_ptr_conv).compressed_form, 33);
30630 void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_bitcoin_key_1"))) TS_UnsignedChannelAnnouncement_set_bitcoin_key_1(uint64_t this_ptr, int8_tArray val) {
30631 LDKUnsignedChannelAnnouncement this_ptr_conv;
30632 this_ptr_conv.inner = untag_ptr(this_ptr);
30633 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30634 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30635 this_ptr_conv.is_owned = false;
30636 LDKPublicKey val_ref;
30637 CHECK(val->arr_len == 33);
30638 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
30639 UnsignedChannelAnnouncement_set_bitcoin_key_1(&this_ptr_conv, val_ref);
30642 int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_bitcoin_key_2"))) TS_UnsignedChannelAnnouncement_get_bitcoin_key_2(uint64_t this_ptr) {
30643 LDKUnsignedChannelAnnouncement this_ptr_conv;
30644 this_ptr_conv.inner = untag_ptr(this_ptr);
30645 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30646 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30647 this_ptr_conv.is_owned = false;
30648 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
30649 memcpy(ret_arr->elems, UnsignedChannelAnnouncement_get_bitcoin_key_2(&this_ptr_conv).compressed_form, 33);
30653 void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_bitcoin_key_2"))) TS_UnsignedChannelAnnouncement_set_bitcoin_key_2(uint64_t this_ptr, int8_tArray val) {
30654 LDKUnsignedChannelAnnouncement this_ptr_conv;
30655 this_ptr_conv.inner = untag_ptr(this_ptr);
30656 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30657 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30658 this_ptr_conv.is_owned = false;
30659 LDKPublicKey val_ref;
30660 CHECK(val->arr_len == 33);
30661 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
30662 UnsignedChannelAnnouncement_set_bitcoin_key_2(&this_ptr_conv, val_ref);
30665 static inline uint64_t UnsignedChannelAnnouncement_clone_ptr(LDKUnsignedChannelAnnouncement *NONNULL_PTR arg) {
30666 LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_clone(arg);
30667 uint64_t ret_ref = 0;
30668 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30669 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30672 int64_t __attribute__((export_name("TS_UnsignedChannelAnnouncement_clone_ptr"))) TS_UnsignedChannelAnnouncement_clone_ptr(uint64_t arg) {
30673 LDKUnsignedChannelAnnouncement arg_conv;
30674 arg_conv.inner = untag_ptr(arg);
30675 arg_conv.is_owned = ptr_is_owned(arg);
30676 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
30677 arg_conv.is_owned = false;
30678 int64_t ret_conv = UnsignedChannelAnnouncement_clone_ptr(&arg_conv);
30682 uint64_t __attribute__((export_name("TS_UnsignedChannelAnnouncement_clone"))) TS_UnsignedChannelAnnouncement_clone(uint64_t orig) {
30683 LDKUnsignedChannelAnnouncement orig_conv;
30684 orig_conv.inner = untag_ptr(orig);
30685 orig_conv.is_owned = ptr_is_owned(orig);
30686 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
30687 orig_conv.is_owned = false;
30688 LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_clone(&orig_conv);
30689 uint64_t ret_ref = 0;
30690 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30691 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30695 void __attribute__((export_name("TS_ChannelAnnouncement_free"))) TS_ChannelAnnouncement_free(uint64_t this_obj) {
30696 LDKChannelAnnouncement this_obj_conv;
30697 this_obj_conv.inner = untag_ptr(this_obj);
30698 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30699 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30700 ChannelAnnouncement_free(this_obj_conv);
30703 int8_tArray __attribute__((export_name("TS_ChannelAnnouncement_get_node_signature_1"))) TS_ChannelAnnouncement_get_node_signature_1(uint64_t this_ptr) {
30704 LDKChannelAnnouncement this_ptr_conv;
30705 this_ptr_conv.inner = untag_ptr(this_ptr);
30706 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30707 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30708 this_ptr_conv.is_owned = false;
30709 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
30710 memcpy(ret_arr->elems, ChannelAnnouncement_get_node_signature_1(&this_ptr_conv).compact_form, 64);
30714 void __attribute__((export_name("TS_ChannelAnnouncement_set_node_signature_1"))) TS_ChannelAnnouncement_set_node_signature_1(uint64_t this_ptr, int8_tArray val) {
30715 LDKChannelAnnouncement this_ptr_conv;
30716 this_ptr_conv.inner = untag_ptr(this_ptr);
30717 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30718 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30719 this_ptr_conv.is_owned = false;
30720 LDKSignature val_ref;
30721 CHECK(val->arr_len == 64);
30722 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
30723 ChannelAnnouncement_set_node_signature_1(&this_ptr_conv, val_ref);
30726 int8_tArray __attribute__((export_name("TS_ChannelAnnouncement_get_node_signature_2"))) TS_ChannelAnnouncement_get_node_signature_2(uint64_t this_ptr) {
30727 LDKChannelAnnouncement this_ptr_conv;
30728 this_ptr_conv.inner = untag_ptr(this_ptr);
30729 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30730 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30731 this_ptr_conv.is_owned = false;
30732 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
30733 memcpy(ret_arr->elems, ChannelAnnouncement_get_node_signature_2(&this_ptr_conv).compact_form, 64);
30737 void __attribute__((export_name("TS_ChannelAnnouncement_set_node_signature_2"))) TS_ChannelAnnouncement_set_node_signature_2(uint64_t this_ptr, int8_tArray val) {
30738 LDKChannelAnnouncement this_ptr_conv;
30739 this_ptr_conv.inner = untag_ptr(this_ptr);
30740 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30741 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30742 this_ptr_conv.is_owned = false;
30743 LDKSignature val_ref;
30744 CHECK(val->arr_len == 64);
30745 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
30746 ChannelAnnouncement_set_node_signature_2(&this_ptr_conv, val_ref);
30749 int8_tArray __attribute__((export_name("TS_ChannelAnnouncement_get_bitcoin_signature_1"))) TS_ChannelAnnouncement_get_bitcoin_signature_1(uint64_t this_ptr) {
30750 LDKChannelAnnouncement this_ptr_conv;
30751 this_ptr_conv.inner = untag_ptr(this_ptr);
30752 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30753 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30754 this_ptr_conv.is_owned = false;
30755 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
30756 memcpy(ret_arr->elems, ChannelAnnouncement_get_bitcoin_signature_1(&this_ptr_conv).compact_form, 64);
30760 void __attribute__((export_name("TS_ChannelAnnouncement_set_bitcoin_signature_1"))) TS_ChannelAnnouncement_set_bitcoin_signature_1(uint64_t this_ptr, int8_tArray val) {
30761 LDKChannelAnnouncement this_ptr_conv;
30762 this_ptr_conv.inner = untag_ptr(this_ptr);
30763 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30764 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30765 this_ptr_conv.is_owned = false;
30766 LDKSignature val_ref;
30767 CHECK(val->arr_len == 64);
30768 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
30769 ChannelAnnouncement_set_bitcoin_signature_1(&this_ptr_conv, val_ref);
30772 int8_tArray __attribute__((export_name("TS_ChannelAnnouncement_get_bitcoin_signature_2"))) TS_ChannelAnnouncement_get_bitcoin_signature_2(uint64_t this_ptr) {
30773 LDKChannelAnnouncement this_ptr_conv;
30774 this_ptr_conv.inner = untag_ptr(this_ptr);
30775 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30776 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30777 this_ptr_conv.is_owned = false;
30778 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
30779 memcpy(ret_arr->elems, ChannelAnnouncement_get_bitcoin_signature_2(&this_ptr_conv).compact_form, 64);
30783 void __attribute__((export_name("TS_ChannelAnnouncement_set_bitcoin_signature_2"))) TS_ChannelAnnouncement_set_bitcoin_signature_2(uint64_t this_ptr, int8_tArray val) {
30784 LDKChannelAnnouncement this_ptr_conv;
30785 this_ptr_conv.inner = untag_ptr(this_ptr);
30786 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30787 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30788 this_ptr_conv.is_owned = false;
30789 LDKSignature val_ref;
30790 CHECK(val->arr_len == 64);
30791 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
30792 ChannelAnnouncement_set_bitcoin_signature_2(&this_ptr_conv, val_ref);
30795 uint64_t __attribute__((export_name("TS_ChannelAnnouncement_get_contents"))) TS_ChannelAnnouncement_get_contents(uint64_t this_ptr) {
30796 LDKChannelAnnouncement this_ptr_conv;
30797 this_ptr_conv.inner = untag_ptr(this_ptr);
30798 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30799 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30800 this_ptr_conv.is_owned = false;
30801 LDKUnsignedChannelAnnouncement ret_var = ChannelAnnouncement_get_contents(&this_ptr_conv);
30802 uint64_t ret_ref = 0;
30803 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30804 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30808 void __attribute__((export_name("TS_ChannelAnnouncement_set_contents"))) TS_ChannelAnnouncement_set_contents(uint64_t this_ptr, uint64_t val) {
30809 LDKChannelAnnouncement this_ptr_conv;
30810 this_ptr_conv.inner = untag_ptr(this_ptr);
30811 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30812 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30813 this_ptr_conv.is_owned = false;
30814 LDKUnsignedChannelAnnouncement val_conv;
30815 val_conv.inner = untag_ptr(val);
30816 val_conv.is_owned = ptr_is_owned(val);
30817 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
30818 val_conv = UnsignedChannelAnnouncement_clone(&val_conv);
30819 ChannelAnnouncement_set_contents(&this_ptr_conv, val_conv);
30822 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) {
30823 LDKSignature node_signature_1_arg_ref;
30824 CHECK(node_signature_1_arg->arr_len == 64);
30825 memcpy(node_signature_1_arg_ref.compact_form, node_signature_1_arg->elems, 64); FREE(node_signature_1_arg);
30826 LDKSignature node_signature_2_arg_ref;
30827 CHECK(node_signature_2_arg->arr_len == 64);
30828 memcpy(node_signature_2_arg_ref.compact_form, node_signature_2_arg->elems, 64); FREE(node_signature_2_arg);
30829 LDKSignature bitcoin_signature_1_arg_ref;
30830 CHECK(bitcoin_signature_1_arg->arr_len == 64);
30831 memcpy(bitcoin_signature_1_arg_ref.compact_form, bitcoin_signature_1_arg->elems, 64); FREE(bitcoin_signature_1_arg);
30832 LDKSignature bitcoin_signature_2_arg_ref;
30833 CHECK(bitcoin_signature_2_arg->arr_len == 64);
30834 memcpy(bitcoin_signature_2_arg_ref.compact_form, bitcoin_signature_2_arg->elems, 64); FREE(bitcoin_signature_2_arg);
30835 LDKUnsignedChannelAnnouncement contents_arg_conv;
30836 contents_arg_conv.inner = untag_ptr(contents_arg);
30837 contents_arg_conv.is_owned = ptr_is_owned(contents_arg);
30838 CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv);
30839 contents_arg_conv = UnsignedChannelAnnouncement_clone(&contents_arg_conv);
30840 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);
30841 uint64_t ret_ref = 0;
30842 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30843 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30847 static inline uint64_t ChannelAnnouncement_clone_ptr(LDKChannelAnnouncement *NONNULL_PTR arg) {
30848 LDKChannelAnnouncement ret_var = ChannelAnnouncement_clone(arg);
30849 uint64_t ret_ref = 0;
30850 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30851 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30854 int64_t __attribute__((export_name("TS_ChannelAnnouncement_clone_ptr"))) TS_ChannelAnnouncement_clone_ptr(uint64_t arg) {
30855 LDKChannelAnnouncement arg_conv;
30856 arg_conv.inner = untag_ptr(arg);
30857 arg_conv.is_owned = ptr_is_owned(arg);
30858 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
30859 arg_conv.is_owned = false;
30860 int64_t ret_conv = ChannelAnnouncement_clone_ptr(&arg_conv);
30864 uint64_t __attribute__((export_name("TS_ChannelAnnouncement_clone"))) TS_ChannelAnnouncement_clone(uint64_t orig) {
30865 LDKChannelAnnouncement orig_conv;
30866 orig_conv.inner = untag_ptr(orig);
30867 orig_conv.is_owned = ptr_is_owned(orig);
30868 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
30869 orig_conv.is_owned = false;
30870 LDKChannelAnnouncement ret_var = ChannelAnnouncement_clone(&orig_conv);
30871 uint64_t ret_ref = 0;
30872 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30873 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30877 void __attribute__((export_name("TS_UnsignedChannelUpdate_free"))) TS_UnsignedChannelUpdate_free(uint64_t this_obj) {
30878 LDKUnsignedChannelUpdate this_obj_conv;
30879 this_obj_conv.inner = untag_ptr(this_obj);
30880 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30881 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30882 UnsignedChannelUpdate_free(this_obj_conv);
30885 int8_tArray __attribute__((export_name("TS_UnsignedChannelUpdate_get_chain_hash"))) TS_UnsignedChannelUpdate_get_chain_hash(uint64_t this_ptr) {
30886 LDKUnsignedChannelUpdate this_ptr_conv;
30887 this_ptr_conv.inner = untag_ptr(this_ptr);
30888 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30889 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30890 this_ptr_conv.is_owned = false;
30891 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
30892 memcpy(ret_arr->elems, *UnsignedChannelUpdate_get_chain_hash(&this_ptr_conv), 32);
30896 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_chain_hash"))) TS_UnsignedChannelUpdate_set_chain_hash(uint64_t this_ptr, int8_tArray val) {
30897 LDKUnsignedChannelUpdate this_ptr_conv;
30898 this_ptr_conv.inner = untag_ptr(this_ptr);
30899 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30900 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30901 this_ptr_conv.is_owned = false;
30902 LDKThirtyTwoBytes val_ref;
30903 CHECK(val->arr_len == 32);
30904 memcpy(val_ref.data, val->elems, 32); FREE(val);
30905 UnsignedChannelUpdate_set_chain_hash(&this_ptr_conv, val_ref);
30908 int64_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_short_channel_id"))) TS_UnsignedChannelUpdate_get_short_channel_id(uint64_t this_ptr) {
30909 LDKUnsignedChannelUpdate this_ptr_conv;
30910 this_ptr_conv.inner = untag_ptr(this_ptr);
30911 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30912 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30913 this_ptr_conv.is_owned = false;
30914 int64_t ret_conv = UnsignedChannelUpdate_get_short_channel_id(&this_ptr_conv);
30918 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_short_channel_id"))) TS_UnsignedChannelUpdate_set_short_channel_id(uint64_t this_ptr, int64_t val) {
30919 LDKUnsignedChannelUpdate this_ptr_conv;
30920 this_ptr_conv.inner = untag_ptr(this_ptr);
30921 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30922 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30923 this_ptr_conv.is_owned = false;
30924 UnsignedChannelUpdate_set_short_channel_id(&this_ptr_conv, val);
30927 int32_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_timestamp"))) TS_UnsignedChannelUpdate_get_timestamp(uint64_t this_ptr) {
30928 LDKUnsignedChannelUpdate this_ptr_conv;
30929 this_ptr_conv.inner = untag_ptr(this_ptr);
30930 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30931 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30932 this_ptr_conv.is_owned = false;
30933 int32_t ret_conv = UnsignedChannelUpdate_get_timestamp(&this_ptr_conv);
30937 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_timestamp"))) TS_UnsignedChannelUpdate_set_timestamp(uint64_t this_ptr, int32_t val) {
30938 LDKUnsignedChannelUpdate this_ptr_conv;
30939 this_ptr_conv.inner = untag_ptr(this_ptr);
30940 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30941 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30942 this_ptr_conv.is_owned = false;
30943 UnsignedChannelUpdate_set_timestamp(&this_ptr_conv, val);
30946 int8_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_flags"))) TS_UnsignedChannelUpdate_get_flags(uint64_t this_ptr) {
30947 LDKUnsignedChannelUpdate this_ptr_conv;
30948 this_ptr_conv.inner = untag_ptr(this_ptr);
30949 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30950 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30951 this_ptr_conv.is_owned = false;
30952 int8_t ret_conv = UnsignedChannelUpdate_get_flags(&this_ptr_conv);
30956 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_flags"))) TS_UnsignedChannelUpdate_set_flags(uint64_t this_ptr, int8_t val) {
30957 LDKUnsignedChannelUpdate this_ptr_conv;
30958 this_ptr_conv.inner = untag_ptr(this_ptr);
30959 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30960 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30961 this_ptr_conv.is_owned = false;
30962 UnsignedChannelUpdate_set_flags(&this_ptr_conv, val);
30965 int16_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_cltv_expiry_delta"))) TS_UnsignedChannelUpdate_get_cltv_expiry_delta(uint64_t this_ptr) {
30966 LDKUnsignedChannelUpdate this_ptr_conv;
30967 this_ptr_conv.inner = untag_ptr(this_ptr);
30968 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30969 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30970 this_ptr_conv.is_owned = false;
30971 int16_t ret_conv = UnsignedChannelUpdate_get_cltv_expiry_delta(&this_ptr_conv);
30975 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_cltv_expiry_delta"))) TS_UnsignedChannelUpdate_set_cltv_expiry_delta(uint64_t this_ptr, int16_t val) {
30976 LDKUnsignedChannelUpdate this_ptr_conv;
30977 this_ptr_conv.inner = untag_ptr(this_ptr);
30978 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30979 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30980 this_ptr_conv.is_owned = false;
30981 UnsignedChannelUpdate_set_cltv_expiry_delta(&this_ptr_conv, val);
30984 int64_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_htlc_minimum_msat"))) TS_UnsignedChannelUpdate_get_htlc_minimum_msat(uint64_t this_ptr) {
30985 LDKUnsignedChannelUpdate this_ptr_conv;
30986 this_ptr_conv.inner = untag_ptr(this_ptr);
30987 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30988 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30989 this_ptr_conv.is_owned = false;
30990 int64_t ret_conv = UnsignedChannelUpdate_get_htlc_minimum_msat(&this_ptr_conv);
30994 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_htlc_minimum_msat"))) TS_UnsignedChannelUpdate_set_htlc_minimum_msat(uint64_t this_ptr, int64_t val) {
30995 LDKUnsignedChannelUpdate this_ptr_conv;
30996 this_ptr_conv.inner = untag_ptr(this_ptr);
30997 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30998 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30999 this_ptr_conv.is_owned = false;
31000 UnsignedChannelUpdate_set_htlc_minimum_msat(&this_ptr_conv, val);
31003 int64_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_htlc_maximum_msat"))) TS_UnsignedChannelUpdate_get_htlc_maximum_msat(uint64_t this_ptr) {
31004 LDKUnsignedChannelUpdate this_ptr_conv;
31005 this_ptr_conv.inner = untag_ptr(this_ptr);
31006 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31007 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31008 this_ptr_conv.is_owned = false;
31009 int64_t ret_conv = UnsignedChannelUpdate_get_htlc_maximum_msat(&this_ptr_conv);
31013 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_htlc_maximum_msat"))) TS_UnsignedChannelUpdate_set_htlc_maximum_msat(uint64_t this_ptr, int64_t val) {
31014 LDKUnsignedChannelUpdate this_ptr_conv;
31015 this_ptr_conv.inner = untag_ptr(this_ptr);
31016 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31017 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31018 this_ptr_conv.is_owned = false;
31019 UnsignedChannelUpdate_set_htlc_maximum_msat(&this_ptr_conv, val);
31022 int32_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_fee_base_msat"))) TS_UnsignedChannelUpdate_get_fee_base_msat(uint64_t this_ptr) {
31023 LDKUnsignedChannelUpdate this_ptr_conv;
31024 this_ptr_conv.inner = untag_ptr(this_ptr);
31025 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31026 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31027 this_ptr_conv.is_owned = false;
31028 int32_t ret_conv = UnsignedChannelUpdate_get_fee_base_msat(&this_ptr_conv);
31032 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_fee_base_msat"))) TS_UnsignedChannelUpdate_set_fee_base_msat(uint64_t this_ptr, int32_t val) {
31033 LDKUnsignedChannelUpdate this_ptr_conv;
31034 this_ptr_conv.inner = untag_ptr(this_ptr);
31035 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31036 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31037 this_ptr_conv.is_owned = false;
31038 UnsignedChannelUpdate_set_fee_base_msat(&this_ptr_conv, val);
31041 int32_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_fee_proportional_millionths"))) TS_UnsignedChannelUpdate_get_fee_proportional_millionths(uint64_t this_ptr) {
31042 LDKUnsignedChannelUpdate this_ptr_conv;
31043 this_ptr_conv.inner = untag_ptr(this_ptr);
31044 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31045 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31046 this_ptr_conv.is_owned = false;
31047 int32_t ret_conv = UnsignedChannelUpdate_get_fee_proportional_millionths(&this_ptr_conv);
31051 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_fee_proportional_millionths"))) TS_UnsignedChannelUpdate_set_fee_proportional_millionths(uint64_t this_ptr, int32_t val) {
31052 LDKUnsignedChannelUpdate this_ptr_conv;
31053 this_ptr_conv.inner = untag_ptr(this_ptr);
31054 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31055 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31056 this_ptr_conv.is_owned = false;
31057 UnsignedChannelUpdate_set_fee_proportional_millionths(&this_ptr_conv, val);
31060 int8_tArray __attribute__((export_name("TS_UnsignedChannelUpdate_get_excess_data"))) TS_UnsignedChannelUpdate_get_excess_data(uint64_t this_ptr) {
31061 LDKUnsignedChannelUpdate this_ptr_conv;
31062 this_ptr_conv.inner = untag_ptr(this_ptr);
31063 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31064 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31065 this_ptr_conv.is_owned = false;
31066 LDKCVec_u8Z ret_var = UnsignedChannelUpdate_get_excess_data(&this_ptr_conv);
31067 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
31068 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
31069 CVec_u8Z_free(ret_var);
31073 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_excess_data"))) TS_UnsignedChannelUpdate_set_excess_data(uint64_t this_ptr, int8_tArray val) {
31074 LDKUnsignedChannelUpdate this_ptr_conv;
31075 this_ptr_conv.inner = untag_ptr(this_ptr);
31076 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31077 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31078 this_ptr_conv.is_owned = false;
31079 LDKCVec_u8Z val_ref;
31080 val_ref.datalen = val->arr_len;
31081 val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes");
31082 memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val);
31083 UnsignedChannelUpdate_set_excess_data(&this_ptr_conv, val_ref);
31086 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) {
31087 LDKThirtyTwoBytes chain_hash_arg_ref;
31088 CHECK(chain_hash_arg->arr_len == 32);
31089 memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg);
31090 LDKCVec_u8Z excess_data_arg_ref;
31091 excess_data_arg_ref.datalen = excess_data_arg->arr_len;
31092 excess_data_arg_ref.data = MALLOC(excess_data_arg_ref.datalen, "LDKCVec_u8Z Bytes");
31093 memcpy(excess_data_arg_ref.data, excess_data_arg->elems, excess_data_arg_ref.datalen); FREE(excess_data_arg);
31094 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);
31095 uint64_t ret_ref = 0;
31096 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31097 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31101 static inline uint64_t UnsignedChannelUpdate_clone_ptr(LDKUnsignedChannelUpdate *NONNULL_PTR arg) {
31102 LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_clone(arg);
31103 uint64_t ret_ref = 0;
31104 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31105 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31108 int64_t __attribute__((export_name("TS_UnsignedChannelUpdate_clone_ptr"))) TS_UnsignedChannelUpdate_clone_ptr(uint64_t arg) {
31109 LDKUnsignedChannelUpdate arg_conv;
31110 arg_conv.inner = untag_ptr(arg);
31111 arg_conv.is_owned = ptr_is_owned(arg);
31112 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
31113 arg_conv.is_owned = false;
31114 int64_t ret_conv = UnsignedChannelUpdate_clone_ptr(&arg_conv);
31118 uint64_t __attribute__((export_name("TS_UnsignedChannelUpdate_clone"))) TS_UnsignedChannelUpdate_clone(uint64_t orig) {
31119 LDKUnsignedChannelUpdate orig_conv;
31120 orig_conv.inner = untag_ptr(orig);
31121 orig_conv.is_owned = ptr_is_owned(orig);
31122 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
31123 orig_conv.is_owned = false;
31124 LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_clone(&orig_conv);
31125 uint64_t ret_ref = 0;
31126 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31127 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31131 void __attribute__((export_name("TS_ChannelUpdate_free"))) TS_ChannelUpdate_free(uint64_t this_obj) {
31132 LDKChannelUpdate this_obj_conv;
31133 this_obj_conv.inner = untag_ptr(this_obj);
31134 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31135 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31136 ChannelUpdate_free(this_obj_conv);
31139 int8_tArray __attribute__((export_name("TS_ChannelUpdate_get_signature"))) TS_ChannelUpdate_get_signature(uint64_t this_ptr) {
31140 LDKChannelUpdate this_ptr_conv;
31141 this_ptr_conv.inner = untag_ptr(this_ptr);
31142 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31143 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31144 this_ptr_conv.is_owned = false;
31145 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
31146 memcpy(ret_arr->elems, ChannelUpdate_get_signature(&this_ptr_conv).compact_form, 64);
31150 void __attribute__((export_name("TS_ChannelUpdate_set_signature"))) TS_ChannelUpdate_set_signature(uint64_t this_ptr, int8_tArray val) {
31151 LDKChannelUpdate this_ptr_conv;
31152 this_ptr_conv.inner = untag_ptr(this_ptr);
31153 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31154 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31155 this_ptr_conv.is_owned = false;
31156 LDKSignature val_ref;
31157 CHECK(val->arr_len == 64);
31158 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
31159 ChannelUpdate_set_signature(&this_ptr_conv, val_ref);
31162 uint64_t __attribute__((export_name("TS_ChannelUpdate_get_contents"))) TS_ChannelUpdate_get_contents(uint64_t this_ptr) {
31163 LDKChannelUpdate this_ptr_conv;
31164 this_ptr_conv.inner = untag_ptr(this_ptr);
31165 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31166 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31167 this_ptr_conv.is_owned = false;
31168 LDKUnsignedChannelUpdate ret_var = ChannelUpdate_get_contents(&this_ptr_conv);
31169 uint64_t ret_ref = 0;
31170 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31171 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31175 void __attribute__((export_name("TS_ChannelUpdate_set_contents"))) TS_ChannelUpdate_set_contents(uint64_t this_ptr, uint64_t val) {
31176 LDKChannelUpdate this_ptr_conv;
31177 this_ptr_conv.inner = untag_ptr(this_ptr);
31178 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31179 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31180 this_ptr_conv.is_owned = false;
31181 LDKUnsignedChannelUpdate val_conv;
31182 val_conv.inner = untag_ptr(val);
31183 val_conv.is_owned = ptr_is_owned(val);
31184 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
31185 val_conv = UnsignedChannelUpdate_clone(&val_conv);
31186 ChannelUpdate_set_contents(&this_ptr_conv, val_conv);
31189 uint64_t __attribute__((export_name("TS_ChannelUpdate_new"))) TS_ChannelUpdate_new(int8_tArray signature_arg, uint64_t contents_arg) {
31190 LDKSignature signature_arg_ref;
31191 CHECK(signature_arg->arr_len == 64);
31192 memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg);
31193 LDKUnsignedChannelUpdate contents_arg_conv;
31194 contents_arg_conv.inner = untag_ptr(contents_arg);
31195 contents_arg_conv.is_owned = ptr_is_owned(contents_arg);
31196 CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv);
31197 contents_arg_conv = UnsignedChannelUpdate_clone(&contents_arg_conv);
31198 LDKChannelUpdate ret_var = ChannelUpdate_new(signature_arg_ref, contents_arg_conv);
31199 uint64_t ret_ref = 0;
31200 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31201 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31205 static inline uint64_t ChannelUpdate_clone_ptr(LDKChannelUpdate *NONNULL_PTR arg) {
31206 LDKChannelUpdate ret_var = ChannelUpdate_clone(arg);
31207 uint64_t ret_ref = 0;
31208 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31209 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31212 int64_t __attribute__((export_name("TS_ChannelUpdate_clone_ptr"))) TS_ChannelUpdate_clone_ptr(uint64_t arg) {
31213 LDKChannelUpdate arg_conv;
31214 arg_conv.inner = untag_ptr(arg);
31215 arg_conv.is_owned = ptr_is_owned(arg);
31216 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
31217 arg_conv.is_owned = false;
31218 int64_t ret_conv = ChannelUpdate_clone_ptr(&arg_conv);
31222 uint64_t __attribute__((export_name("TS_ChannelUpdate_clone"))) TS_ChannelUpdate_clone(uint64_t orig) {
31223 LDKChannelUpdate orig_conv;
31224 orig_conv.inner = untag_ptr(orig);
31225 orig_conv.is_owned = ptr_is_owned(orig);
31226 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
31227 orig_conv.is_owned = false;
31228 LDKChannelUpdate ret_var = ChannelUpdate_clone(&orig_conv);
31229 uint64_t ret_ref = 0;
31230 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31231 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31235 void __attribute__((export_name("TS_QueryChannelRange_free"))) TS_QueryChannelRange_free(uint64_t this_obj) {
31236 LDKQueryChannelRange this_obj_conv;
31237 this_obj_conv.inner = untag_ptr(this_obj);
31238 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31239 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31240 QueryChannelRange_free(this_obj_conv);
31243 int8_tArray __attribute__((export_name("TS_QueryChannelRange_get_chain_hash"))) TS_QueryChannelRange_get_chain_hash(uint64_t this_ptr) {
31244 LDKQueryChannelRange this_ptr_conv;
31245 this_ptr_conv.inner = untag_ptr(this_ptr);
31246 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31247 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31248 this_ptr_conv.is_owned = false;
31249 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
31250 memcpy(ret_arr->elems, *QueryChannelRange_get_chain_hash(&this_ptr_conv), 32);
31254 void __attribute__((export_name("TS_QueryChannelRange_set_chain_hash"))) TS_QueryChannelRange_set_chain_hash(uint64_t this_ptr, int8_tArray val) {
31255 LDKQueryChannelRange this_ptr_conv;
31256 this_ptr_conv.inner = untag_ptr(this_ptr);
31257 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31258 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31259 this_ptr_conv.is_owned = false;
31260 LDKThirtyTwoBytes val_ref;
31261 CHECK(val->arr_len == 32);
31262 memcpy(val_ref.data, val->elems, 32); FREE(val);
31263 QueryChannelRange_set_chain_hash(&this_ptr_conv, val_ref);
31266 int32_t __attribute__((export_name("TS_QueryChannelRange_get_first_blocknum"))) TS_QueryChannelRange_get_first_blocknum(uint64_t this_ptr) {
31267 LDKQueryChannelRange this_ptr_conv;
31268 this_ptr_conv.inner = untag_ptr(this_ptr);
31269 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31270 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31271 this_ptr_conv.is_owned = false;
31272 int32_t ret_conv = QueryChannelRange_get_first_blocknum(&this_ptr_conv);
31276 void __attribute__((export_name("TS_QueryChannelRange_set_first_blocknum"))) TS_QueryChannelRange_set_first_blocknum(uint64_t this_ptr, int32_t val) {
31277 LDKQueryChannelRange this_ptr_conv;
31278 this_ptr_conv.inner = untag_ptr(this_ptr);
31279 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31280 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31281 this_ptr_conv.is_owned = false;
31282 QueryChannelRange_set_first_blocknum(&this_ptr_conv, val);
31285 int32_t __attribute__((export_name("TS_QueryChannelRange_get_number_of_blocks"))) TS_QueryChannelRange_get_number_of_blocks(uint64_t this_ptr) {
31286 LDKQueryChannelRange this_ptr_conv;
31287 this_ptr_conv.inner = untag_ptr(this_ptr);
31288 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31289 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31290 this_ptr_conv.is_owned = false;
31291 int32_t ret_conv = QueryChannelRange_get_number_of_blocks(&this_ptr_conv);
31295 void __attribute__((export_name("TS_QueryChannelRange_set_number_of_blocks"))) TS_QueryChannelRange_set_number_of_blocks(uint64_t this_ptr, int32_t val) {
31296 LDKQueryChannelRange this_ptr_conv;
31297 this_ptr_conv.inner = untag_ptr(this_ptr);
31298 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31299 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31300 this_ptr_conv.is_owned = false;
31301 QueryChannelRange_set_number_of_blocks(&this_ptr_conv, val);
31304 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) {
31305 LDKThirtyTwoBytes chain_hash_arg_ref;
31306 CHECK(chain_hash_arg->arr_len == 32);
31307 memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg);
31308 LDKQueryChannelRange ret_var = QueryChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_arg);
31309 uint64_t ret_ref = 0;
31310 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31311 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31315 static inline uint64_t QueryChannelRange_clone_ptr(LDKQueryChannelRange *NONNULL_PTR arg) {
31316 LDKQueryChannelRange ret_var = QueryChannelRange_clone(arg);
31317 uint64_t ret_ref = 0;
31318 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31319 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31322 int64_t __attribute__((export_name("TS_QueryChannelRange_clone_ptr"))) TS_QueryChannelRange_clone_ptr(uint64_t arg) {
31323 LDKQueryChannelRange arg_conv;
31324 arg_conv.inner = untag_ptr(arg);
31325 arg_conv.is_owned = ptr_is_owned(arg);
31326 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
31327 arg_conv.is_owned = false;
31328 int64_t ret_conv = QueryChannelRange_clone_ptr(&arg_conv);
31332 uint64_t __attribute__((export_name("TS_QueryChannelRange_clone"))) TS_QueryChannelRange_clone(uint64_t orig) {
31333 LDKQueryChannelRange orig_conv;
31334 orig_conv.inner = untag_ptr(orig);
31335 orig_conv.is_owned = ptr_is_owned(orig);
31336 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
31337 orig_conv.is_owned = false;
31338 LDKQueryChannelRange ret_var = QueryChannelRange_clone(&orig_conv);
31339 uint64_t ret_ref = 0;
31340 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31341 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31345 void __attribute__((export_name("TS_ReplyChannelRange_free"))) TS_ReplyChannelRange_free(uint64_t this_obj) {
31346 LDKReplyChannelRange this_obj_conv;
31347 this_obj_conv.inner = untag_ptr(this_obj);
31348 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31349 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31350 ReplyChannelRange_free(this_obj_conv);
31353 int8_tArray __attribute__((export_name("TS_ReplyChannelRange_get_chain_hash"))) TS_ReplyChannelRange_get_chain_hash(uint64_t this_ptr) {
31354 LDKReplyChannelRange this_ptr_conv;
31355 this_ptr_conv.inner = untag_ptr(this_ptr);
31356 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31357 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31358 this_ptr_conv.is_owned = false;
31359 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
31360 memcpy(ret_arr->elems, *ReplyChannelRange_get_chain_hash(&this_ptr_conv), 32);
31364 void __attribute__((export_name("TS_ReplyChannelRange_set_chain_hash"))) TS_ReplyChannelRange_set_chain_hash(uint64_t this_ptr, int8_tArray val) {
31365 LDKReplyChannelRange this_ptr_conv;
31366 this_ptr_conv.inner = untag_ptr(this_ptr);
31367 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31368 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31369 this_ptr_conv.is_owned = false;
31370 LDKThirtyTwoBytes val_ref;
31371 CHECK(val->arr_len == 32);
31372 memcpy(val_ref.data, val->elems, 32); FREE(val);
31373 ReplyChannelRange_set_chain_hash(&this_ptr_conv, val_ref);
31376 int32_t __attribute__((export_name("TS_ReplyChannelRange_get_first_blocknum"))) TS_ReplyChannelRange_get_first_blocknum(uint64_t this_ptr) {
31377 LDKReplyChannelRange this_ptr_conv;
31378 this_ptr_conv.inner = untag_ptr(this_ptr);
31379 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31380 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31381 this_ptr_conv.is_owned = false;
31382 int32_t ret_conv = ReplyChannelRange_get_first_blocknum(&this_ptr_conv);
31386 void __attribute__((export_name("TS_ReplyChannelRange_set_first_blocknum"))) TS_ReplyChannelRange_set_first_blocknum(uint64_t this_ptr, int32_t val) {
31387 LDKReplyChannelRange this_ptr_conv;
31388 this_ptr_conv.inner = untag_ptr(this_ptr);
31389 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31390 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31391 this_ptr_conv.is_owned = false;
31392 ReplyChannelRange_set_first_blocknum(&this_ptr_conv, val);
31395 int32_t __attribute__((export_name("TS_ReplyChannelRange_get_number_of_blocks"))) TS_ReplyChannelRange_get_number_of_blocks(uint64_t this_ptr) {
31396 LDKReplyChannelRange this_ptr_conv;
31397 this_ptr_conv.inner = untag_ptr(this_ptr);
31398 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31399 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31400 this_ptr_conv.is_owned = false;
31401 int32_t ret_conv = ReplyChannelRange_get_number_of_blocks(&this_ptr_conv);
31405 void __attribute__((export_name("TS_ReplyChannelRange_set_number_of_blocks"))) TS_ReplyChannelRange_set_number_of_blocks(uint64_t this_ptr, int32_t val) {
31406 LDKReplyChannelRange this_ptr_conv;
31407 this_ptr_conv.inner = untag_ptr(this_ptr);
31408 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31409 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31410 this_ptr_conv.is_owned = false;
31411 ReplyChannelRange_set_number_of_blocks(&this_ptr_conv, val);
31414 jboolean __attribute__((export_name("TS_ReplyChannelRange_get_sync_complete"))) TS_ReplyChannelRange_get_sync_complete(uint64_t this_ptr) {
31415 LDKReplyChannelRange this_ptr_conv;
31416 this_ptr_conv.inner = untag_ptr(this_ptr);
31417 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31418 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31419 this_ptr_conv.is_owned = false;
31420 jboolean ret_conv = ReplyChannelRange_get_sync_complete(&this_ptr_conv);
31424 void __attribute__((export_name("TS_ReplyChannelRange_set_sync_complete"))) TS_ReplyChannelRange_set_sync_complete(uint64_t this_ptr, jboolean val) {
31425 LDKReplyChannelRange this_ptr_conv;
31426 this_ptr_conv.inner = untag_ptr(this_ptr);
31427 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31428 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31429 this_ptr_conv.is_owned = false;
31430 ReplyChannelRange_set_sync_complete(&this_ptr_conv, val);
31433 int64_tArray __attribute__((export_name("TS_ReplyChannelRange_get_short_channel_ids"))) TS_ReplyChannelRange_get_short_channel_ids(uint64_t this_ptr) {
31434 LDKReplyChannelRange this_ptr_conv;
31435 this_ptr_conv.inner = untag_ptr(this_ptr);
31436 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31437 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31438 this_ptr_conv.is_owned = false;
31439 LDKCVec_u64Z ret_var = ReplyChannelRange_get_short_channel_ids(&this_ptr_conv);
31440 int64_tArray ret_arr = NULL;
31441 ret_arr = init_int64_tArray(ret_var.datalen, __LINE__);
31442 int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8);
31443 for (size_t i = 0; i < ret_var.datalen; i++) {
31444 int64_t ret_conv_8_conv = ret_var.data[i];
31445 ret_arr_ptr[i] = ret_conv_8_conv;
31448 FREE(ret_var.data);
31452 void __attribute__((export_name("TS_ReplyChannelRange_set_short_channel_ids"))) TS_ReplyChannelRange_set_short_channel_ids(uint64_t this_ptr, int64_tArray val) {
31453 LDKReplyChannelRange this_ptr_conv;
31454 this_ptr_conv.inner = untag_ptr(this_ptr);
31455 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31456 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31457 this_ptr_conv.is_owned = false;
31458 LDKCVec_u64Z val_constr;
31459 val_constr.datalen = val->arr_len;
31460 if (val_constr.datalen > 0)
31461 val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
31463 val_constr.data = NULL;
31464 int64_t* val_vals = val->elems;
31465 for (size_t i = 0; i < val_constr.datalen; i++) {
31466 int64_t val_conv_8 = val_vals[i];
31467 val_constr.data[i] = val_conv_8;
31470 ReplyChannelRange_set_short_channel_ids(&this_ptr_conv, val_constr);
31473 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) {
31474 LDKThirtyTwoBytes chain_hash_arg_ref;
31475 CHECK(chain_hash_arg->arr_len == 32);
31476 memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg);
31477 LDKCVec_u64Z short_channel_ids_arg_constr;
31478 short_channel_ids_arg_constr.datalen = short_channel_ids_arg->arr_len;
31479 if (short_channel_ids_arg_constr.datalen > 0)
31480 short_channel_ids_arg_constr.data = MALLOC(short_channel_ids_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
31482 short_channel_ids_arg_constr.data = NULL;
31483 int64_t* short_channel_ids_arg_vals = short_channel_ids_arg->elems;
31484 for (size_t i = 0; i < short_channel_ids_arg_constr.datalen; i++) {
31485 int64_t short_channel_ids_arg_conv_8 = short_channel_ids_arg_vals[i];
31486 short_channel_ids_arg_constr.data[i] = short_channel_ids_arg_conv_8;
31488 FREE(short_channel_ids_arg);
31489 LDKReplyChannelRange ret_var = ReplyChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_arg, sync_complete_arg, short_channel_ids_arg_constr);
31490 uint64_t ret_ref = 0;
31491 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31492 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31496 static inline uint64_t ReplyChannelRange_clone_ptr(LDKReplyChannelRange *NONNULL_PTR arg) {
31497 LDKReplyChannelRange ret_var = ReplyChannelRange_clone(arg);
31498 uint64_t ret_ref = 0;
31499 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31500 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31503 int64_t __attribute__((export_name("TS_ReplyChannelRange_clone_ptr"))) TS_ReplyChannelRange_clone_ptr(uint64_t arg) {
31504 LDKReplyChannelRange arg_conv;
31505 arg_conv.inner = untag_ptr(arg);
31506 arg_conv.is_owned = ptr_is_owned(arg);
31507 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
31508 arg_conv.is_owned = false;
31509 int64_t ret_conv = ReplyChannelRange_clone_ptr(&arg_conv);
31513 uint64_t __attribute__((export_name("TS_ReplyChannelRange_clone"))) TS_ReplyChannelRange_clone(uint64_t orig) {
31514 LDKReplyChannelRange orig_conv;
31515 orig_conv.inner = untag_ptr(orig);
31516 orig_conv.is_owned = ptr_is_owned(orig);
31517 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
31518 orig_conv.is_owned = false;
31519 LDKReplyChannelRange ret_var = ReplyChannelRange_clone(&orig_conv);
31520 uint64_t ret_ref = 0;
31521 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31522 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31526 void __attribute__((export_name("TS_QueryShortChannelIds_free"))) TS_QueryShortChannelIds_free(uint64_t this_obj) {
31527 LDKQueryShortChannelIds this_obj_conv;
31528 this_obj_conv.inner = untag_ptr(this_obj);
31529 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31530 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31531 QueryShortChannelIds_free(this_obj_conv);
31534 int8_tArray __attribute__((export_name("TS_QueryShortChannelIds_get_chain_hash"))) TS_QueryShortChannelIds_get_chain_hash(uint64_t this_ptr) {
31535 LDKQueryShortChannelIds this_ptr_conv;
31536 this_ptr_conv.inner = untag_ptr(this_ptr);
31537 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31538 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31539 this_ptr_conv.is_owned = false;
31540 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
31541 memcpy(ret_arr->elems, *QueryShortChannelIds_get_chain_hash(&this_ptr_conv), 32);
31545 void __attribute__((export_name("TS_QueryShortChannelIds_set_chain_hash"))) TS_QueryShortChannelIds_set_chain_hash(uint64_t this_ptr, int8_tArray val) {
31546 LDKQueryShortChannelIds this_ptr_conv;
31547 this_ptr_conv.inner = untag_ptr(this_ptr);
31548 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31549 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31550 this_ptr_conv.is_owned = false;
31551 LDKThirtyTwoBytes val_ref;
31552 CHECK(val->arr_len == 32);
31553 memcpy(val_ref.data, val->elems, 32); FREE(val);
31554 QueryShortChannelIds_set_chain_hash(&this_ptr_conv, val_ref);
31557 int64_tArray __attribute__((export_name("TS_QueryShortChannelIds_get_short_channel_ids"))) TS_QueryShortChannelIds_get_short_channel_ids(uint64_t this_ptr) {
31558 LDKQueryShortChannelIds this_ptr_conv;
31559 this_ptr_conv.inner = untag_ptr(this_ptr);
31560 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31561 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31562 this_ptr_conv.is_owned = false;
31563 LDKCVec_u64Z ret_var = QueryShortChannelIds_get_short_channel_ids(&this_ptr_conv);
31564 int64_tArray ret_arr = NULL;
31565 ret_arr = init_int64_tArray(ret_var.datalen, __LINE__);
31566 int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8);
31567 for (size_t i = 0; i < ret_var.datalen; i++) {
31568 int64_t ret_conv_8_conv = ret_var.data[i];
31569 ret_arr_ptr[i] = ret_conv_8_conv;
31572 FREE(ret_var.data);
31576 void __attribute__((export_name("TS_QueryShortChannelIds_set_short_channel_ids"))) TS_QueryShortChannelIds_set_short_channel_ids(uint64_t this_ptr, int64_tArray val) {
31577 LDKQueryShortChannelIds this_ptr_conv;
31578 this_ptr_conv.inner = untag_ptr(this_ptr);
31579 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31580 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31581 this_ptr_conv.is_owned = false;
31582 LDKCVec_u64Z val_constr;
31583 val_constr.datalen = val->arr_len;
31584 if (val_constr.datalen > 0)
31585 val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
31587 val_constr.data = NULL;
31588 int64_t* val_vals = val->elems;
31589 for (size_t i = 0; i < val_constr.datalen; i++) {
31590 int64_t val_conv_8 = val_vals[i];
31591 val_constr.data[i] = val_conv_8;
31594 QueryShortChannelIds_set_short_channel_ids(&this_ptr_conv, val_constr);
31597 uint64_t __attribute__((export_name("TS_QueryShortChannelIds_new"))) TS_QueryShortChannelIds_new(int8_tArray chain_hash_arg, int64_tArray short_channel_ids_arg) {
31598 LDKThirtyTwoBytes chain_hash_arg_ref;
31599 CHECK(chain_hash_arg->arr_len == 32);
31600 memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg);
31601 LDKCVec_u64Z short_channel_ids_arg_constr;
31602 short_channel_ids_arg_constr.datalen = short_channel_ids_arg->arr_len;
31603 if (short_channel_ids_arg_constr.datalen > 0)
31604 short_channel_ids_arg_constr.data = MALLOC(short_channel_ids_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
31606 short_channel_ids_arg_constr.data = NULL;
31607 int64_t* short_channel_ids_arg_vals = short_channel_ids_arg->elems;
31608 for (size_t i = 0; i < short_channel_ids_arg_constr.datalen; i++) {
31609 int64_t short_channel_ids_arg_conv_8 = short_channel_ids_arg_vals[i];
31610 short_channel_ids_arg_constr.data[i] = short_channel_ids_arg_conv_8;
31612 FREE(short_channel_ids_arg);
31613 LDKQueryShortChannelIds ret_var = QueryShortChannelIds_new(chain_hash_arg_ref, short_channel_ids_arg_constr);
31614 uint64_t ret_ref = 0;
31615 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31616 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31620 static inline uint64_t QueryShortChannelIds_clone_ptr(LDKQueryShortChannelIds *NONNULL_PTR arg) {
31621 LDKQueryShortChannelIds ret_var = QueryShortChannelIds_clone(arg);
31622 uint64_t ret_ref = 0;
31623 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31624 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31627 int64_t __attribute__((export_name("TS_QueryShortChannelIds_clone_ptr"))) TS_QueryShortChannelIds_clone_ptr(uint64_t arg) {
31628 LDKQueryShortChannelIds arg_conv;
31629 arg_conv.inner = untag_ptr(arg);
31630 arg_conv.is_owned = ptr_is_owned(arg);
31631 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
31632 arg_conv.is_owned = false;
31633 int64_t ret_conv = QueryShortChannelIds_clone_ptr(&arg_conv);
31637 uint64_t __attribute__((export_name("TS_QueryShortChannelIds_clone"))) TS_QueryShortChannelIds_clone(uint64_t orig) {
31638 LDKQueryShortChannelIds orig_conv;
31639 orig_conv.inner = untag_ptr(orig);
31640 orig_conv.is_owned = ptr_is_owned(orig);
31641 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
31642 orig_conv.is_owned = false;
31643 LDKQueryShortChannelIds ret_var = QueryShortChannelIds_clone(&orig_conv);
31644 uint64_t ret_ref = 0;
31645 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31646 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31650 void __attribute__((export_name("TS_ReplyShortChannelIdsEnd_free"))) TS_ReplyShortChannelIdsEnd_free(uint64_t this_obj) {
31651 LDKReplyShortChannelIdsEnd this_obj_conv;
31652 this_obj_conv.inner = untag_ptr(this_obj);
31653 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31654 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31655 ReplyShortChannelIdsEnd_free(this_obj_conv);
31658 int8_tArray __attribute__((export_name("TS_ReplyShortChannelIdsEnd_get_chain_hash"))) TS_ReplyShortChannelIdsEnd_get_chain_hash(uint64_t this_ptr) {
31659 LDKReplyShortChannelIdsEnd this_ptr_conv;
31660 this_ptr_conv.inner = untag_ptr(this_ptr);
31661 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31662 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31663 this_ptr_conv.is_owned = false;
31664 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
31665 memcpy(ret_arr->elems, *ReplyShortChannelIdsEnd_get_chain_hash(&this_ptr_conv), 32);
31669 void __attribute__((export_name("TS_ReplyShortChannelIdsEnd_set_chain_hash"))) TS_ReplyShortChannelIdsEnd_set_chain_hash(uint64_t this_ptr, int8_tArray val) {
31670 LDKReplyShortChannelIdsEnd this_ptr_conv;
31671 this_ptr_conv.inner = untag_ptr(this_ptr);
31672 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31673 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31674 this_ptr_conv.is_owned = false;
31675 LDKThirtyTwoBytes val_ref;
31676 CHECK(val->arr_len == 32);
31677 memcpy(val_ref.data, val->elems, 32); FREE(val);
31678 ReplyShortChannelIdsEnd_set_chain_hash(&this_ptr_conv, val_ref);
31681 jboolean __attribute__((export_name("TS_ReplyShortChannelIdsEnd_get_full_information"))) TS_ReplyShortChannelIdsEnd_get_full_information(uint64_t this_ptr) {
31682 LDKReplyShortChannelIdsEnd this_ptr_conv;
31683 this_ptr_conv.inner = untag_ptr(this_ptr);
31684 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31685 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31686 this_ptr_conv.is_owned = false;
31687 jboolean ret_conv = ReplyShortChannelIdsEnd_get_full_information(&this_ptr_conv);
31691 void __attribute__((export_name("TS_ReplyShortChannelIdsEnd_set_full_information"))) TS_ReplyShortChannelIdsEnd_set_full_information(uint64_t this_ptr, jboolean val) {
31692 LDKReplyShortChannelIdsEnd this_ptr_conv;
31693 this_ptr_conv.inner = untag_ptr(this_ptr);
31694 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31695 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31696 this_ptr_conv.is_owned = false;
31697 ReplyShortChannelIdsEnd_set_full_information(&this_ptr_conv, val);
31700 uint64_t __attribute__((export_name("TS_ReplyShortChannelIdsEnd_new"))) TS_ReplyShortChannelIdsEnd_new(int8_tArray chain_hash_arg, jboolean full_information_arg) {
31701 LDKThirtyTwoBytes chain_hash_arg_ref;
31702 CHECK(chain_hash_arg->arr_len == 32);
31703 memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg);
31704 LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_new(chain_hash_arg_ref, full_information_arg);
31705 uint64_t ret_ref = 0;
31706 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31707 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31711 static inline uint64_t ReplyShortChannelIdsEnd_clone_ptr(LDKReplyShortChannelIdsEnd *NONNULL_PTR arg) {
31712 LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_clone(arg);
31713 uint64_t ret_ref = 0;
31714 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31715 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31718 int64_t __attribute__((export_name("TS_ReplyShortChannelIdsEnd_clone_ptr"))) TS_ReplyShortChannelIdsEnd_clone_ptr(uint64_t arg) {
31719 LDKReplyShortChannelIdsEnd arg_conv;
31720 arg_conv.inner = untag_ptr(arg);
31721 arg_conv.is_owned = ptr_is_owned(arg);
31722 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
31723 arg_conv.is_owned = false;
31724 int64_t ret_conv = ReplyShortChannelIdsEnd_clone_ptr(&arg_conv);
31728 uint64_t __attribute__((export_name("TS_ReplyShortChannelIdsEnd_clone"))) TS_ReplyShortChannelIdsEnd_clone(uint64_t orig) {
31729 LDKReplyShortChannelIdsEnd orig_conv;
31730 orig_conv.inner = untag_ptr(orig);
31731 orig_conv.is_owned = ptr_is_owned(orig);
31732 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
31733 orig_conv.is_owned = false;
31734 LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_clone(&orig_conv);
31735 uint64_t ret_ref = 0;
31736 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31737 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31741 void __attribute__((export_name("TS_GossipTimestampFilter_free"))) TS_GossipTimestampFilter_free(uint64_t this_obj) {
31742 LDKGossipTimestampFilter this_obj_conv;
31743 this_obj_conv.inner = untag_ptr(this_obj);
31744 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31745 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31746 GossipTimestampFilter_free(this_obj_conv);
31749 int8_tArray __attribute__((export_name("TS_GossipTimestampFilter_get_chain_hash"))) TS_GossipTimestampFilter_get_chain_hash(uint64_t this_ptr) {
31750 LDKGossipTimestampFilter this_ptr_conv;
31751 this_ptr_conv.inner = untag_ptr(this_ptr);
31752 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31753 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31754 this_ptr_conv.is_owned = false;
31755 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
31756 memcpy(ret_arr->elems, *GossipTimestampFilter_get_chain_hash(&this_ptr_conv), 32);
31760 void __attribute__((export_name("TS_GossipTimestampFilter_set_chain_hash"))) TS_GossipTimestampFilter_set_chain_hash(uint64_t this_ptr, int8_tArray val) {
31761 LDKGossipTimestampFilter this_ptr_conv;
31762 this_ptr_conv.inner = untag_ptr(this_ptr);
31763 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31764 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31765 this_ptr_conv.is_owned = false;
31766 LDKThirtyTwoBytes val_ref;
31767 CHECK(val->arr_len == 32);
31768 memcpy(val_ref.data, val->elems, 32); FREE(val);
31769 GossipTimestampFilter_set_chain_hash(&this_ptr_conv, val_ref);
31772 int32_t __attribute__((export_name("TS_GossipTimestampFilter_get_first_timestamp"))) TS_GossipTimestampFilter_get_first_timestamp(uint64_t this_ptr) {
31773 LDKGossipTimestampFilter this_ptr_conv;
31774 this_ptr_conv.inner = untag_ptr(this_ptr);
31775 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31776 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31777 this_ptr_conv.is_owned = false;
31778 int32_t ret_conv = GossipTimestampFilter_get_first_timestamp(&this_ptr_conv);
31782 void __attribute__((export_name("TS_GossipTimestampFilter_set_first_timestamp"))) TS_GossipTimestampFilter_set_first_timestamp(uint64_t this_ptr, int32_t val) {
31783 LDKGossipTimestampFilter this_ptr_conv;
31784 this_ptr_conv.inner = untag_ptr(this_ptr);
31785 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31786 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31787 this_ptr_conv.is_owned = false;
31788 GossipTimestampFilter_set_first_timestamp(&this_ptr_conv, val);
31791 int32_t __attribute__((export_name("TS_GossipTimestampFilter_get_timestamp_range"))) TS_GossipTimestampFilter_get_timestamp_range(uint64_t this_ptr) {
31792 LDKGossipTimestampFilter this_ptr_conv;
31793 this_ptr_conv.inner = untag_ptr(this_ptr);
31794 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31795 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31796 this_ptr_conv.is_owned = false;
31797 int32_t ret_conv = GossipTimestampFilter_get_timestamp_range(&this_ptr_conv);
31801 void __attribute__((export_name("TS_GossipTimestampFilter_set_timestamp_range"))) TS_GossipTimestampFilter_set_timestamp_range(uint64_t this_ptr, int32_t val) {
31802 LDKGossipTimestampFilter this_ptr_conv;
31803 this_ptr_conv.inner = untag_ptr(this_ptr);
31804 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31805 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31806 this_ptr_conv.is_owned = false;
31807 GossipTimestampFilter_set_timestamp_range(&this_ptr_conv, val);
31810 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) {
31811 LDKThirtyTwoBytes chain_hash_arg_ref;
31812 CHECK(chain_hash_arg->arr_len == 32);
31813 memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg);
31814 LDKGossipTimestampFilter ret_var = GossipTimestampFilter_new(chain_hash_arg_ref, first_timestamp_arg, timestamp_range_arg);
31815 uint64_t ret_ref = 0;
31816 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31817 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31821 static inline uint64_t GossipTimestampFilter_clone_ptr(LDKGossipTimestampFilter *NONNULL_PTR arg) {
31822 LDKGossipTimestampFilter ret_var = GossipTimestampFilter_clone(arg);
31823 uint64_t ret_ref = 0;
31824 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31825 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31828 int64_t __attribute__((export_name("TS_GossipTimestampFilter_clone_ptr"))) TS_GossipTimestampFilter_clone_ptr(uint64_t arg) {
31829 LDKGossipTimestampFilter arg_conv;
31830 arg_conv.inner = untag_ptr(arg);
31831 arg_conv.is_owned = ptr_is_owned(arg);
31832 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
31833 arg_conv.is_owned = false;
31834 int64_t ret_conv = GossipTimestampFilter_clone_ptr(&arg_conv);
31838 uint64_t __attribute__((export_name("TS_GossipTimestampFilter_clone"))) TS_GossipTimestampFilter_clone(uint64_t orig) {
31839 LDKGossipTimestampFilter orig_conv;
31840 orig_conv.inner = untag_ptr(orig);
31841 orig_conv.is_owned = ptr_is_owned(orig);
31842 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
31843 orig_conv.is_owned = false;
31844 LDKGossipTimestampFilter ret_var = GossipTimestampFilter_clone(&orig_conv);
31845 uint64_t ret_ref = 0;
31846 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31847 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31851 void __attribute__((export_name("TS_ErrorAction_free"))) TS_ErrorAction_free(uint64_t this_ptr) {
31852 if (!ptr_is_owned(this_ptr)) return;
31853 void* this_ptr_ptr = untag_ptr(this_ptr);
31854 CHECK_ACCESS(this_ptr_ptr);
31855 LDKErrorAction this_ptr_conv = *(LDKErrorAction*)(this_ptr_ptr);
31856 FREE(untag_ptr(this_ptr));
31857 ErrorAction_free(this_ptr_conv);
31860 static inline uint64_t ErrorAction_clone_ptr(LDKErrorAction *NONNULL_PTR arg) {
31861 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
31862 *ret_copy = ErrorAction_clone(arg);
31863 uint64_t ret_ref = tag_ptr(ret_copy, true);
31866 int64_t __attribute__((export_name("TS_ErrorAction_clone_ptr"))) TS_ErrorAction_clone_ptr(uint64_t arg) {
31867 LDKErrorAction* arg_conv = (LDKErrorAction*)untag_ptr(arg);
31868 int64_t ret_conv = ErrorAction_clone_ptr(arg_conv);
31872 uint64_t __attribute__((export_name("TS_ErrorAction_clone"))) TS_ErrorAction_clone(uint64_t orig) {
31873 LDKErrorAction* orig_conv = (LDKErrorAction*)untag_ptr(orig);
31874 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
31875 *ret_copy = ErrorAction_clone(orig_conv);
31876 uint64_t ret_ref = tag_ptr(ret_copy, true);
31880 uint64_t __attribute__((export_name("TS_ErrorAction_disconnect_peer"))) TS_ErrorAction_disconnect_peer(uint64_t msg) {
31881 LDKErrorMessage msg_conv;
31882 msg_conv.inner = untag_ptr(msg);
31883 msg_conv.is_owned = ptr_is_owned(msg);
31884 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
31885 msg_conv = ErrorMessage_clone(&msg_conv);
31886 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
31887 *ret_copy = ErrorAction_disconnect_peer(msg_conv);
31888 uint64_t ret_ref = tag_ptr(ret_copy, true);
31892 uint64_t __attribute__((export_name("TS_ErrorAction_ignore_error"))) TS_ErrorAction_ignore_error() {
31893 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
31894 *ret_copy = ErrorAction_ignore_error();
31895 uint64_t ret_ref = tag_ptr(ret_copy, true);
31899 uint64_t __attribute__((export_name("TS_ErrorAction_ignore_and_log"))) TS_ErrorAction_ignore_and_log(uint32_t a) {
31900 LDKLevel a_conv = LDKLevel_from_js(a);
31901 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
31902 *ret_copy = ErrorAction_ignore_and_log(a_conv);
31903 uint64_t ret_ref = tag_ptr(ret_copy, true);
31907 uint64_t __attribute__((export_name("TS_ErrorAction_ignore_duplicate_gossip"))) TS_ErrorAction_ignore_duplicate_gossip() {
31908 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
31909 *ret_copy = ErrorAction_ignore_duplicate_gossip();
31910 uint64_t ret_ref = tag_ptr(ret_copy, true);
31914 uint64_t __attribute__((export_name("TS_ErrorAction_send_error_message"))) TS_ErrorAction_send_error_message(uint64_t msg) {
31915 LDKErrorMessage msg_conv;
31916 msg_conv.inner = untag_ptr(msg);
31917 msg_conv.is_owned = ptr_is_owned(msg);
31918 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
31919 msg_conv = ErrorMessage_clone(&msg_conv);
31920 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
31921 *ret_copy = ErrorAction_send_error_message(msg_conv);
31922 uint64_t ret_ref = tag_ptr(ret_copy, true);
31926 uint64_t __attribute__((export_name("TS_ErrorAction_send_warning_message"))) TS_ErrorAction_send_warning_message(uint64_t msg, uint32_t log_level) {
31927 LDKWarningMessage msg_conv;
31928 msg_conv.inner = untag_ptr(msg);
31929 msg_conv.is_owned = ptr_is_owned(msg);
31930 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
31931 msg_conv = WarningMessage_clone(&msg_conv);
31932 LDKLevel log_level_conv = LDKLevel_from_js(log_level);
31933 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
31934 *ret_copy = ErrorAction_send_warning_message(msg_conv, log_level_conv);
31935 uint64_t ret_ref = tag_ptr(ret_copy, true);
31939 void __attribute__((export_name("TS_LightningError_free"))) TS_LightningError_free(uint64_t this_obj) {
31940 LDKLightningError this_obj_conv;
31941 this_obj_conv.inner = untag_ptr(this_obj);
31942 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31943 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31944 LightningError_free(this_obj_conv);
31947 jstring __attribute__((export_name("TS_LightningError_get_err"))) TS_LightningError_get_err(uint64_t this_ptr) {
31948 LDKLightningError this_ptr_conv;
31949 this_ptr_conv.inner = untag_ptr(this_ptr);
31950 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31951 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31952 this_ptr_conv.is_owned = false;
31953 LDKStr ret_str = LightningError_get_err(&this_ptr_conv);
31954 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
31959 void __attribute__((export_name("TS_LightningError_set_err"))) TS_LightningError_set_err(uint64_t this_ptr, jstring val) {
31960 LDKLightningError this_ptr_conv;
31961 this_ptr_conv.inner = untag_ptr(this_ptr);
31962 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31963 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31964 this_ptr_conv.is_owned = false;
31965 LDKStr val_conv = str_ref_to_owned_c(val);
31966 LightningError_set_err(&this_ptr_conv, val_conv);
31969 uint64_t __attribute__((export_name("TS_LightningError_get_action"))) TS_LightningError_get_action(uint64_t this_ptr) {
31970 LDKLightningError this_ptr_conv;
31971 this_ptr_conv.inner = untag_ptr(this_ptr);
31972 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31973 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31974 this_ptr_conv.is_owned = false;
31975 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
31976 *ret_copy = LightningError_get_action(&this_ptr_conv);
31977 uint64_t ret_ref = tag_ptr(ret_copy, true);
31981 void __attribute__((export_name("TS_LightningError_set_action"))) TS_LightningError_set_action(uint64_t this_ptr, uint64_t val) {
31982 LDKLightningError this_ptr_conv;
31983 this_ptr_conv.inner = untag_ptr(this_ptr);
31984 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31985 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31986 this_ptr_conv.is_owned = false;
31987 void* val_ptr = untag_ptr(val);
31988 CHECK_ACCESS(val_ptr);
31989 LDKErrorAction val_conv = *(LDKErrorAction*)(val_ptr);
31990 val_conv = ErrorAction_clone((LDKErrorAction*)untag_ptr(val));
31991 LightningError_set_action(&this_ptr_conv, val_conv);
31994 uint64_t __attribute__((export_name("TS_LightningError_new"))) TS_LightningError_new(jstring err_arg, uint64_t action_arg) {
31995 LDKStr err_arg_conv = str_ref_to_owned_c(err_arg);
31996 void* action_arg_ptr = untag_ptr(action_arg);
31997 CHECK_ACCESS(action_arg_ptr);
31998 LDKErrorAction action_arg_conv = *(LDKErrorAction*)(action_arg_ptr);
31999 action_arg_conv = ErrorAction_clone((LDKErrorAction*)untag_ptr(action_arg));
32000 LDKLightningError ret_var = LightningError_new(err_arg_conv, action_arg_conv);
32001 uint64_t ret_ref = 0;
32002 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32003 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32007 static inline uint64_t LightningError_clone_ptr(LDKLightningError *NONNULL_PTR arg) {
32008 LDKLightningError ret_var = LightningError_clone(arg);
32009 uint64_t ret_ref = 0;
32010 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32011 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32014 int64_t __attribute__((export_name("TS_LightningError_clone_ptr"))) TS_LightningError_clone_ptr(uint64_t arg) {
32015 LDKLightningError arg_conv;
32016 arg_conv.inner = untag_ptr(arg);
32017 arg_conv.is_owned = ptr_is_owned(arg);
32018 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
32019 arg_conv.is_owned = false;
32020 int64_t ret_conv = LightningError_clone_ptr(&arg_conv);
32024 uint64_t __attribute__((export_name("TS_LightningError_clone"))) TS_LightningError_clone(uint64_t orig) {
32025 LDKLightningError orig_conv;
32026 orig_conv.inner = untag_ptr(orig);
32027 orig_conv.is_owned = ptr_is_owned(orig);
32028 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
32029 orig_conv.is_owned = false;
32030 LDKLightningError ret_var = LightningError_clone(&orig_conv);
32031 uint64_t ret_ref = 0;
32032 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32033 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32037 void __attribute__((export_name("TS_CommitmentUpdate_free"))) TS_CommitmentUpdate_free(uint64_t this_obj) {
32038 LDKCommitmentUpdate this_obj_conv;
32039 this_obj_conv.inner = untag_ptr(this_obj);
32040 this_obj_conv.is_owned = ptr_is_owned(this_obj);
32041 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
32042 CommitmentUpdate_free(this_obj_conv);
32045 uint64_tArray __attribute__((export_name("TS_CommitmentUpdate_get_update_add_htlcs"))) TS_CommitmentUpdate_get_update_add_htlcs(uint64_t this_ptr) {
32046 LDKCommitmentUpdate this_ptr_conv;
32047 this_ptr_conv.inner = untag_ptr(this_ptr);
32048 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32049 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32050 this_ptr_conv.is_owned = false;
32051 LDKCVec_UpdateAddHTLCZ ret_var = CommitmentUpdate_get_update_add_htlcs(&this_ptr_conv);
32052 uint64_tArray ret_arr = NULL;
32053 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
32054 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
32055 for (size_t p = 0; p < ret_var.datalen; p++) {
32056 LDKUpdateAddHTLC ret_conv_15_var = ret_var.data[p];
32057 uint64_t ret_conv_15_ref = 0;
32058 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_15_var);
32059 ret_conv_15_ref = tag_ptr(ret_conv_15_var.inner, ret_conv_15_var.is_owned);
32060 ret_arr_ptr[p] = ret_conv_15_ref;
32063 FREE(ret_var.data);
32067 void __attribute__((export_name("TS_CommitmentUpdate_set_update_add_htlcs"))) TS_CommitmentUpdate_set_update_add_htlcs(uint64_t this_ptr, uint64_tArray val) {
32068 LDKCommitmentUpdate this_ptr_conv;
32069 this_ptr_conv.inner = untag_ptr(this_ptr);
32070 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32071 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32072 this_ptr_conv.is_owned = false;
32073 LDKCVec_UpdateAddHTLCZ val_constr;
32074 val_constr.datalen = val->arr_len;
32075 if (val_constr.datalen > 0)
32076 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements");
32078 val_constr.data = NULL;
32079 uint64_t* val_vals = val->elems;
32080 for (size_t p = 0; p < val_constr.datalen; p++) {
32081 uint64_t val_conv_15 = val_vals[p];
32082 LDKUpdateAddHTLC val_conv_15_conv;
32083 val_conv_15_conv.inner = untag_ptr(val_conv_15);
32084 val_conv_15_conv.is_owned = ptr_is_owned(val_conv_15);
32085 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_15_conv);
32086 val_conv_15_conv = UpdateAddHTLC_clone(&val_conv_15_conv);
32087 val_constr.data[p] = val_conv_15_conv;
32090 CommitmentUpdate_set_update_add_htlcs(&this_ptr_conv, val_constr);
32093 uint64_tArray __attribute__((export_name("TS_CommitmentUpdate_get_update_fulfill_htlcs"))) TS_CommitmentUpdate_get_update_fulfill_htlcs(uint64_t this_ptr) {
32094 LDKCommitmentUpdate this_ptr_conv;
32095 this_ptr_conv.inner = untag_ptr(this_ptr);
32096 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32097 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32098 this_ptr_conv.is_owned = false;
32099 LDKCVec_UpdateFulfillHTLCZ ret_var = CommitmentUpdate_get_update_fulfill_htlcs(&this_ptr_conv);
32100 uint64_tArray ret_arr = NULL;
32101 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
32102 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
32103 for (size_t t = 0; t < ret_var.datalen; t++) {
32104 LDKUpdateFulfillHTLC ret_conv_19_var = ret_var.data[t];
32105 uint64_t ret_conv_19_ref = 0;
32106 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_19_var);
32107 ret_conv_19_ref = tag_ptr(ret_conv_19_var.inner, ret_conv_19_var.is_owned);
32108 ret_arr_ptr[t] = ret_conv_19_ref;
32111 FREE(ret_var.data);
32115 void __attribute__((export_name("TS_CommitmentUpdate_set_update_fulfill_htlcs"))) TS_CommitmentUpdate_set_update_fulfill_htlcs(uint64_t this_ptr, uint64_tArray val) {
32116 LDKCommitmentUpdate this_ptr_conv;
32117 this_ptr_conv.inner = untag_ptr(this_ptr);
32118 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32119 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32120 this_ptr_conv.is_owned = false;
32121 LDKCVec_UpdateFulfillHTLCZ val_constr;
32122 val_constr.datalen = val->arr_len;
32123 if (val_constr.datalen > 0)
32124 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements");
32126 val_constr.data = NULL;
32127 uint64_t* val_vals = val->elems;
32128 for (size_t t = 0; t < val_constr.datalen; t++) {
32129 uint64_t val_conv_19 = val_vals[t];
32130 LDKUpdateFulfillHTLC val_conv_19_conv;
32131 val_conv_19_conv.inner = untag_ptr(val_conv_19);
32132 val_conv_19_conv.is_owned = ptr_is_owned(val_conv_19);
32133 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_19_conv);
32134 val_conv_19_conv = UpdateFulfillHTLC_clone(&val_conv_19_conv);
32135 val_constr.data[t] = val_conv_19_conv;
32138 CommitmentUpdate_set_update_fulfill_htlcs(&this_ptr_conv, val_constr);
32141 uint64_tArray __attribute__((export_name("TS_CommitmentUpdate_get_update_fail_htlcs"))) TS_CommitmentUpdate_get_update_fail_htlcs(uint64_t this_ptr) {
32142 LDKCommitmentUpdate this_ptr_conv;
32143 this_ptr_conv.inner = untag_ptr(this_ptr);
32144 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32145 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32146 this_ptr_conv.is_owned = false;
32147 LDKCVec_UpdateFailHTLCZ ret_var = CommitmentUpdate_get_update_fail_htlcs(&this_ptr_conv);
32148 uint64_tArray ret_arr = NULL;
32149 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
32150 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
32151 for (size_t q = 0; q < ret_var.datalen; q++) {
32152 LDKUpdateFailHTLC ret_conv_16_var = ret_var.data[q];
32153 uint64_t ret_conv_16_ref = 0;
32154 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
32155 ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned);
32156 ret_arr_ptr[q] = ret_conv_16_ref;
32159 FREE(ret_var.data);
32163 void __attribute__((export_name("TS_CommitmentUpdate_set_update_fail_htlcs"))) TS_CommitmentUpdate_set_update_fail_htlcs(uint64_t this_ptr, uint64_tArray val) {
32164 LDKCommitmentUpdate this_ptr_conv;
32165 this_ptr_conv.inner = untag_ptr(this_ptr);
32166 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32167 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32168 this_ptr_conv.is_owned = false;
32169 LDKCVec_UpdateFailHTLCZ val_constr;
32170 val_constr.datalen = val->arr_len;
32171 if (val_constr.datalen > 0)
32172 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements");
32174 val_constr.data = NULL;
32175 uint64_t* val_vals = val->elems;
32176 for (size_t q = 0; q < val_constr.datalen; q++) {
32177 uint64_t val_conv_16 = val_vals[q];
32178 LDKUpdateFailHTLC val_conv_16_conv;
32179 val_conv_16_conv.inner = untag_ptr(val_conv_16);
32180 val_conv_16_conv.is_owned = ptr_is_owned(val_conv_16);
32181 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_16_conv);
32182 val_conv_16_conv = UpdateFailHTLC_clone(&val_conv_16_conv);
32183 val_constr.data[q] = val_conv_16_conv;
32186 CommitmentUpdate_set_update_fail_htlcs(&this_ptr_conv, val_constr);
32189 uint64_tArray __attribute__((export_name("TS_CommitmentUpdate_get_update_fail_malformed_htlcs"))) TS_CommitmentUpdate_get_update_fail_malformed_htlcs(uint64_t this_ptr) {
32190 LDKCommitmentUpdate this_ptr_conv;
32191 this_ptr_conv.inner = untag_ptr(this_ptr);
32192 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32193 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32194 this_ptr_conv.is_owned = false;
32195 LDKCVec_UpdateFailMalformedHTLCZ ret_var = CommitmentUpdate_get_update_fail_malformed_htlcs(&this_ptr_conv);
32196 uint64_tArray ret_arr = NULL;
32197 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
32198 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
32199 for (size_t z = 0; z < ret_var.datalen; z++) {
32200 LDKUpdateFailMalformedHTLC ret_conv_25_var = ret_var.data[z];
32201 uint64_t ret_conv_25_ref = 0;
32202 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_25_var);
32203 ret_conv_25_ref = tag_ptr(ret_conv_25_var.inner, ret_conv_25_var.is_owned);
32204 ret_arr_ptr[z] = ret_conv_25_ref;
32207 FREE(ret_var.data);
32211 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) {
32212 LDKCommitmentUpdate this_ptr_conv;
32213 this_ptr_conv.inner = untag_ptr(this_ptr);
32214 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32215 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32216 this_ptr_conv.is_owned = false;
32217 LDKCVec_UpdateFailMalformedHTLCZ val_constr;
32218 val_constr.datalen = val->arr_len;
32219 if (val_constr.datalen > 0)
32220 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements");
32222 val_constr.data = NULL;
32223 uint64_t* val_vals = val->elems;
32224 for (size_t z = 0; z < val_constr.datalen; z++) {
32225 uint64_t val_conv_25 = val_vals[z];
32226 LDKUpdateFailMalformedHTLC val_conv_25_conv;
32227 val_conv_25_conv.inner = untag_ptr(val_conv_25);
32228 val_conv_25_conv.is_owned = ptr_is_owned(val_conv_25);
32229 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_25_conv);
32230 val_conv_25_conv = UpdateFailMalformedHTLC_clone(&val_conv_25_conv);
32231 val_constr.data[z] = val_conv_25_conv;
32234 CommitmentUpdate_set_update_fail_malformed_htlcs(&this_ptr_conv, val_constr);
32237 uint64_t __attribute__((export_name("TS_CommitmentUpdate_get_update_fee"))) TS_CommitmentUpdate_get_update_fee(uint64_t this_ptr) {
32238 LDKCommitmentUpdate this_ptr_conv;
32239 this_ptr_conv.inner = untag_ptr(this_ptr);
32240 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32241 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32242 this_ptr_conv.is_owned = false;
32243 LDKUpdateFee ret_var = CommitmentUpdate_get_update_fee(&this_ptr_conv);
32244 uint64_t ret_ref = 0;
32245 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32246 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32250 void __attribute__((export_name("TS_CommitmentUpdate_set_update_fee"))) TS_CommitmentUpdate_set_update_fee(uint64_t this_ptr, uint64_t val) {
32251 LDKCommitmentUpdate this_ptr_conv;
32252 this_ptr_conv.inner = untag_ptr(this_ptr);
32253 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32254 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32255 this_ptr_conv.is_owned = false;
32256 LDKUpdateFee val_conv;
32257 val_conv.inner = untag_ptr(val);
32258 val_conv.is_owned = ptr_is_owned(val);
32259 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
32260 val_conv = UpdateFee_clone(&val_conv);
32261 CommitmentUpdate_set_update_fee(&this_ptr_conv, val_conv);
32264 uint64_t __attribute__((export_name("TS_CommitmentUpdate_get_commitment_signed"))) TS_CommitmentUpdate_get_commitment_signed(uint64_t this_ptr) {
32265 LDKCommitmentUpdate this_ptr_conv;
32266 this_ptr_conv.inner = untag_ptr(this_ptr);
32267 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32268 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32269 this_ptr_conv.is_owned = false;
32270 LDKCommitmentSigned ret_var = CommitmentUpdate_get_commitment_signed(&this_ptr_conv);
32271 uint64_t ret_ref = 0;
32272 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32273 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32277 void __attribute__((export_name("TS_CommitmentUpdate_set_commitment_signed"))) TS_CommitmentUpdate_set_commitment_signed(uint64_t this_ptr, uint64_t val) {
32278 LDKCommitmentUpdate this_ptr_conv;
32279 this_ptr_conv.inner = untag_ptr(this_ptr);
32280 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32281 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32282 this_ptr_conv.is_owned = false;
32283 LDKCommitmentSigned val_conv;
32284 val_conv.inner = untag_ptr(val);
32285 val_conv.is_owned = ptr_is_owned(val);
32286 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
32287 val_conv = CommitmentSigned_clone(&val_conv);
32288 CommitmentUpdate_set_commitment_signed(&this_ptr_conv, val_conv);
32291 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) {
32292 LDKCVec_UpdateAddHTLCZ update_add_htlcs_arg_constr;
32293 update_add_htlcs_arg_constr.datalen = update_add_htlcs_arg->arr_len;
32294 if (update_add_htlcs_arg_constr.datalen > 0)
32295 update_add_htlcs_arg_constr.data = MALLOC(update_add_htlcs_arg_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements");
32297 update_add_htlcs_arg_constr.data = NULL;
32298 uint64_t* update_add_htlcs_arg_vals = update_add_htlcs_arg->elems;
32299 for (size_t p = 0; p < update_add_htlcs_arg_constr.datalen; p++) {
32300 uint64_t update_add_htlcs_arg_conv_15 = update_add_htlcs_arg_vals[p];
32301 LDKUpdateAddHTLC update_add_htlcs_arg_conv_15_conv;
32302 update_add_htlcs_arg_conv_15_conv.inner = untag_ptr(update_add_htlcs_arg_conv_15);
32303 update_add_htlcs_arg_conv_15_conv.is_owned = ptr_is_owned(update_add_htlcs_arg_conv_15);
32304 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_add_htlcs_arg_conv_15_conv);
32305 update_add_htlcs_arg_conv_15_conv = UpdateAddHTLC_clone(&update_add_htlcs_arg_conv_15_conv);
32306 update_add_htlcs_arg_constr.data[p] = update_add_htlcs_arg_conv_15_conv;
32308 FREE(update_add_htlcs_arg);
32309 LDKCVec_UpdateFulfillHTLCZ update_fulfill_htlcs_arg_constr;
32310 update_fulfill_htlcs_arg_constr.datalen = update_fulfill_htlcs_arg->arr_len;
32311 if (update_fulfill_htlcs_arg_constr.datalen > 0)
32312 update_fulfill_htlcs_arg_constr.data = MALLOC(update_fulfill_htlcs_arg_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements");
32314 update_fulfill_htlcs_arg_constr.data = NULL;
32315 uint64_t* update_fulfill_htlcs_arg_vals = update_fulfill_htlcs_arg->elems;
32316 for (size_t t = 0; t < update_fulfill_htlcs_arg_constr.datalen; t++) {
32317 uint64_t update_fulfill_htlcs_arg_conv_19 = update_fulfill_htlcs_arg_vals[t];
32318 LDKUpdateFulfillHTLC update_fulfill_htlcs_arg_conv_19_conv;
32319 update_fulfill_htlcs_arg_conv_19_conv.inner = untag_ptr(update_fulfill_htlcs_arg_conv_19);
32320 update_fulfill_htlcs_arg_conv_19_conv.is_owned = ptr_is_owned(update_fulfill_htlcs_arg_conv_19);
32321 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fulfill_htlcs_arg_conv_19_conv);
32322 update_fulfill_htlcs_arg_conv_19_conv = UpdateFulfillHTLC_clone(&update_fulfill_htlcs_arg_conv_19_conv);
32323 update_fulfill_htlcs_arg_constr.data[t] = update_fulfill_htlcs_arg_conv_19_conv;
32325 FREE(update_fulfill_htlcs_arg);
32326 LDKCVec_UpdateFailHTLCZ update_fail_htlcs_arg_constr;
32327 update_fail_htlcs_arg_constr.datalen = update_fail_htlcs_arg->arr_len;
32328 if (update_fail_htlcs_arg_constr.datalen > 0)
32329 update_fail_htlcs_arg_constr.data = MALLOC(update_fail_htlcs_arg_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements");
32331 update_fail_htlcs_arg_constr.data = NULL;
32332 uint64_t* update_fail_htlcs_arg_vals = update_fail_htlcs_arg->elems;
32333 for (size_t q = 0; q < update_fail_htlcs_arg_constr.datalen; q++) {
32334 uint64_t update_fail_htlcs_arg_conv_16 = update_fail_htlcs_arg_vals[q];
32335 LDKUpdateFailHTLC update_fail_htlcs_arg_conv_16_conv;
32336 update_fail_htlcs_arg_conv_16_conv.inner = untag_ptr(update_fail_htlcs_arg_conv_16);
32337 update_fail_htlcs_arg_conv_16_conv.is_owned = ptr_is_owned(update_fail_htlcs_arg_conv_16);
32338 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fail_htlcs_arg_conv_16_conv);
32339 update_fail_htlcs_arg_conv_16_conv = UpdateFailHTLC_clone(&update_fail_htlcs_arg_conv_16_conv);
32340 update_fail_htlcs_arg_constr.data[q] = update_fail_htlcs_arg_conv_16_conv;
32342 FREE(update_fail_htlcs_arg);
32343 LDKCVec_UpdateFailMalformedHTLCZ update_fail_malformed_htlcs_arg_constr;
32344 update_fail_malformed_htlcs_arg_constr.datalen = update_fail_malformed_htlcs_arg->arr_len;
32345 if (update_fail_malformed_htlcs_arg_constr.datalen > 0)
32346 update_fail_malformed_htlcs_arg_constr.data = MALLOC(update_fail_malformed_htlcs_arg_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements");
32348 update_fail_malformed_htlcs_arg_constr.data = NULL;
32349 uint64_t* update_fail_malformed_htlcs_arg_vals = update_fail_malformed_htlcs_arg->elems;
32350 for (size_t z = 0; z < update_fail_malformed_htlcs_arg_constr.datalen; z++) {
32351 uint64_t update_fail_malformed_htlcs_arg_conv_25 = update_fail_malformed_htlcs_arg_vals[z];
32352 LDKUpdateFailMalformedHTLC update_fail_malformed_htlcs_arg_conv_25_conv;
32353 update_fail_malformed_htlcs_arg_conv_25_conv.inner = untag_ptr(update_fail_malformed_htlcs_arg_conv_25);
32354 update_fail_malformed_htlcs_arg_conv_25_conv.is_owned = ptr_is_owned(update_fail_malformed_htlcs_arg_conv_25);
32355 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fail_malformed_htlcs_arg_conv_25_conv);
32356 update_fail_malformed_htlcs_arg_conv_25_conv = UpdateFailMalformedHTLC_clone(&update_fail_malformed_htlcs_arg_conv_25_conv);
32357 update_fail_malformed_htlcs_arg_constr.data[z] = update_fail_malformed_htlcs_arg_conv_25_conv;
32359 FREE(update_fail_malformed_htlcs_arg);
32360 LDKUpdateFee update_fee_arg_conv;
32361 update_fee_arg_conv.inner = untag_ptr(update_fee_arg);
32362 update_fee_arg_conv.is_owned = ptr_is_owned(update_fee_arg);
32363 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fee_arg_conv);
32364 update_fee_arg_conv = UpdateFee_clone(&update_fee_arg_conv);
32365 LDKCommitmentSigned commitment_signed_arg_conv;
32366 commitment_signed_arg_conv.inner = untag_ptr(commitment_signed_arg);
32367 commitment_signed_arg_conv.is_owned = ptr_is_owned(commitment_signed_arg);
32368 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_signed_arg_conv);
32369 commitment_signed_arg_conv = CommitmentSigned_clone(&commitment_signed_arg_conv);
32370 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);
32371 uint64_t ret_ref = 0;
32372 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32373 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32377 static inline uint64_t CommitmentUpdate_clone_ptr(LDKCommitmentUpdate *NONNULL_PTR arg) {
32378 LDKCommitmentUpdate ret_var = CommitmentUpdate_clone(arg);
32379 uint64_t ret_ref = 0;
32380 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32381 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32384 int64_t __attribute__((export_name("TS_CommitmentUpdate_clone_ptr"))) TS_CommitmentUpdate_clone_ptr(uint64_t arg) {
32385 LDKCommitmentUpdate arg_conv;
32386 arg_conv.inner = untag_ptr(arg);
32387 arg_conv.is_owned = ptr_is_owned(arg);
32388 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
32389 arg_conv.is_owned = false;
32390 int64_t ret_conv = CommitmentUpdate_clone_ptr(&arg_conv);
32394 uint64_t __attribute__((export_name("TS_CommitmentUpdate_clone"))) TS_CommitmentUpdate_clone(uint64_t orig) {
32395 LDKCommitmentUpdate orig_conv;
32396 orig_conv.inner = untag_ptr(orig);
32397 orig_conv.is_owned = ptr_is_owned(orig);
32398 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
32399 orig_conv.is_owned = false;
32400 LDKCommitmentUpdate ret_var = CommitmentUpdate_clone(&orig_conv);
32401 uint64_t ret_ref = 0;
32402 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32403 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32407 void __attribute__((export_name("TS_ChannelMessageHandler_free"))) TS_ChannelMessageHandler_free(uint64_t this_ptr) {
32408 if (!ptr_is_owned(this_ptr)) return;
32409 void* this_ptr_ptr = untag_ptr(this_ptr);
32410 CHECK_ACCESS(this_ptr_ptr);
32411 LDKChannelMessageHandler this_ptr_conv = *(LDKChannelMessageHandler*)(this_ptr_ptr);
32412 FREE(untag_ptr(this_ptr));
32413 ChannelMessageHandler_free(this_ptr_conv);
32416 void __attribute__((export_name("TS_RoutingMessageHandler_free"))) TS_RoutingMessageHandler_free(uint64_t this_ptr) {
32417 if (!ptr_is_owned(this_ptr)) return;
32418 void* this_ptr_ptr = untag_ptr(this_ptr);
32419 CHECK_ACCESS(this_ptr_ptr);
32420 LDKRoutingMessageHandler this_ptr_conv = *(LDKRoutingMessageHandler*)(this_ptr_ptr);
32421 FREE(untag_ptr(this_ptr));
32422 RoutingMessageHandler_free(this_ptr_conv);
32425 int8_tArray __attribute__((export_name("TS_AcceptChannel_write"))) TS_AcceptChannel_write(uint64_t obj) {
32426 LDKAcceptChannel obj_conv;
32427 obj_conv.inner = untag_ptr(obj);
32428 obj_conv.is_owned = ptr_is_owned(obj);
32429 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32430 obj_conv.is_owned = false;
32431 LDKCVec_u8Z ret_var = AcceptChannel_write(&obj_conv);
32432 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32433 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32434 CVec_u8Z_free(ret_var);
32438 uint64_t __attribute__((export_name("TS_AcceptChannel_read"))) TS_AcceptChannel_read(int8_tArray ser) {
32439 LDKu8slice ser_ref;
32440 ser_ref.datalen = ser->arr_len;
32441 ser_ref.data = ser->elems;
32442 LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
32443 *ret_conv = AcceptChannel_read(ser_ref);
32445 return tag_ptr(ret_conv, true);
32448 int8_tArray __attribute__((export_name("TS_AnnouncementSignatures_write"))) TS_AnnouncementSignatures_write(uint64_t obj) {
32449 LDKAnnouncementSignatures obj_conv;
32450 obj_conv.inner = untag_ptr(obj);
32451 obj_conv.is_owned = ptr_is_owned(obj);
32452 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32453 obj_conv.is_owned = false;
32454 LDKCVec_u8Z ret_var = AnnouncementSignatures_write(&obj_conv);
32455 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32456 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32457 CVec_u8Z_free(ret_var);
32461 uint64_t __attribute__((export_name("TS_AnnouncementSignatures_read"))) TS_AnnouncementSignatures_read(int8_tArray ser) {
32462 LDKu8slice ser_ref;
32463 ser_ref.datalen = ser->arr_len;
32464 ser_ref.data = ser->elems;
32465 LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
32466 *ret_conv = AnnouncementSignatures_read(ser_ref);
32468 return tag_ptr(ret_conv, true);
32471 int8_tArray __attribute__((export_name("TS_ChannelReestablish_write"))) TS_ChannelReestablish_write(uint64_t obj) {
32472 LDKChannelReestablish obj_conv;
32473 obj_conv.inner = untag_ptr(obj);
32474 obj_conv.is_owned = ptr_is_owned(obj);
32475 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32476 obj_conv.is_owned = false;
32477 LDKCVec_u8Z ret_var = ChannelReestablish_write(&obj_conv);
32478 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32479 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32480 CVec_u8Z_free(ret_var);
32484 uint64_t __attribute__((export_name("TS_ChannelReestablish_read"))) TS_ChannelReestablish_read(int8_tArray ser) {
32485 LDKu8slice ser_ref;
32486 ser_ref.datalen = ser->arr_len;
32487 ser_ref.data = ser->elems;
32488 LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
32489 *ret_conv = ChannelReestablish_read(ser_ref);
32491 return tag_ptr(ret_conv, true);
32494 int8_tArray __attribute__((export_name("TS_ClosingSigned_write"))) TS_ClosingSigned_write(uint64_t obj) {
32495 LDKClosingSigned obj_conv;
32496 obj_conv.inner = untag_ptr(obj);
32497 obj_conv.is_owned = ptr_is_owned(obj);
32498 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32499 obj_conv.is_owned = false;
32500 LDKCVec_u8Z ret_var = ClosingSigned_write(&obj_conv);
32501 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32502 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32503 CVec_u8Z_free(ret_var);
32507 uint64_t __attribute__((export_name("TS_ClosingSigned_read"))) TS_ClosingSigned_read(int8_tArray ser) {
32508 LDKu8slice ser_ref;
32509 ser_ref.datalen = ser->arr_len;
32510 ser_ref.data = ser->elems;
32511 LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
32512 *ret_conv = ClosingSigned_read(ser_ref);
32514 return tag_ptr(ret_conv, true);
32517 int8_tArray __attribute__((export_name("TS_ClosingSignedFeeRange_write"))) TS_ClosingSignedFeeRange_write(uint64_t obj) {
32518 LDKClosingSignedFeeRange obj_conv;
32519 obj_conv.inner = untag_ptr(obj);
32520 obj_conv.is_owned = ptr_is_owned(obj);
32521 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32522 obj_conv.is_owned = false;
32523 LDKCVec_u8Z ret_var = ClosingSignedFeeRange_write(&obj_conv);
32524 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32525 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32526 CVec_u8Z_free(ret_var);
32530 uint64_t __attribute__((export_name("TS_ClosingSignedFeeRange_read"))) TS_ClosingSignedFeeRange_read(int8_tArray ser) {
32531 LDKu8slice ser_ref;
32532 ser_ref.datalen = ser->arr_len;
32533 ser_ref.data = ser->elems;
32534 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
32535 *ret_conv = ClosingSignedFeeRange_read(ser_ref);
32537 return tag_ptr(ret_conv, true);
32540 int8_tArray __attribute__((export_name("TS_CommitmentSigned_write"))) TS_CommitmentSigned_write(uint64_t obj) {
32541 LDKCommitmentSigned obj_conv;
32542 obj_conv.inner = untag_ptr(obj);
32543 obj_conv.is_owned = ptr_is_owned(obj);
32544 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32545 obj_conv.is_owned = false;
32546 LDKCVec_u8Z ret_var = CommitmentSigned_write(&obj_conv);
32547 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32548 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32549 CVec_u8Z_free(ret_var);
32553 uint64_t __attribute__((export_name("TS_CommitmentSigned_read"))) TS_CommitmentSigned_read(int8_tArray ser) {
32554 LDKu8slice ser_ref;
32555 ser_ref.datalen = ser->arr_len;
32556 ser_ref.data = ser->elems;
32557 LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
32558 *ret_conv = CommitmentSigned_read(ser_ref);
32560 return tag_ptr(ret_conv, true);
32563 int8_tArray __attribute__((export_name("TS_FundingCreated_write"))) TS_FundingCreated_write(uint64_t obj) {
32564 LDKFundingCreated obj_conv;
32565 obj_conv.inner = untag_ptr(obj);
32566 obj_conv.is_owned = ptr_is_owned(obj);
32567 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32568 obj_conv.is_owned = false;
32569 LDKCVec_u8Z ret_var = FundingCreated_write(&obj_conv);
32570 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32571 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32572 CVec_u8Z_free(ret_var);
32576 uint64_t __attribute__((export_name("TS_FundingCreated_read"))) TS_FundingCreated_read(int8_tArray ser) {
32577 LDKu8slice ser_ref;
32578 ser_ref.datalen = ser->arr_len;
32579 ser_ref.data = ser->elems;
32580 LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
32581 *ret_conv = FundingCreated_read(ser_ref);
32583 return tag_ptr(ret_conv, true);
32586 int8_tArray __attribute__((export_name("TS_FundingSigned_write"))) TS_FundingSigned_write(uint64_t obj) {
32587 LDKFundingSigned obj_conv;
32588 obj_conv.inner = untag_ptr(obj);
32589 obj_conv.is_owned = ptr_is_owned(obj);
32590 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32591 obj_conv.is_owned = false;
32592 LDKCVec_u8Z ret_var = FundingSigned_write(&obj_conv);
32593 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32594 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32595 CVec_u8Z_free(ret_var);
32599 uint64_t __attribute__((export_name("TS_FundingSigned_read"))) TS_FundingSigned_read(int8_tArray ser) {
32600 LDKu8slice ser_ref;
32601 ser_ref.datalen = ser->arr_len;
32602 ser_ref.data = ser->elems;
32603 LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
32604 *ret_conv = FundingSigned_read(ser_ref);
32606 return tag_ptr(ret_conv, true);
32609 int8_tArray __attribute__((export_name("TS_ChannelReady_write"))) TS_ChannelReady_write(uint64_t obj) {
32610 LDKChannelReady obj_conv;
32611 obj_conv.inner = untag_ptr(obj);
32612 obj_conv.is_owned = ptr_is_owned(obj);
32613 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32614 obj_conv.is_owned = false;
32615 LDKCVec_u8Z ret_var = ChannelReady_write(&obj_conv);
32616 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32617 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32618 CVec_u8Z_free(ret_var);
32622 uint64_t __attribute__((export_name("TS_ChannelReady_read"))) TS_ChannelReady_read(int8_tArray ser) {
32623 LDKu8slice ser_ref;
32624 ser_ref.datalen = ser->arr_len;
32625 ser_ref.data = ser->elems;
32626 LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
32627 *ret_conv = ChannelReady_read(ser_ref);
32629 return tag_ptr(ret_conv, true);
32632 int8_tArray __attribute__((export_name("TS_Init_write"))) TS_Init_write(uint64_t obj) {
32634 obj_conv.inner = untag_ptr(obj);
32635 obj_conv.is_owned = ptr_is_owned(obj);
32636 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32637 obj_conv.is_owned = false;
32638 LDKCVec_u8Z ret_var = Init_write(&obj_conv);
32639 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32640 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32641 CVec_u8Z_free(ret_var);
32645 uint64_t __attribute__((export_name("TS_Init_read"))) TS_Init_read(int8_tArray ser) {
32646 LDKu8slice ser_ref;
32647 ser_ref.datalen = ser->arr_len;
32648 ser_ref.data = ser->elems;
32649 LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
32650 *ret_conv = Init_read(ser_ref);
32652 return tag_ptr(ret_conv, true);
32655 int8_tArray __attribute__((export_name("TS_OpenChannel_write"))) TS_OpenChannel_write(uint64_t obj) {
32656 LDKOpenChannel obj_conv;
32657 obj_conv.inner = untag_ptr(obj);
32658 obj_conv.is_owned = ptr_is_owned(obj);
32659 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32660 obj_conv.is_owned = false;
32661 LDKCVec_u8Z ret_var = OpenChannel_write(&obj_conv);
32662 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32663 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32664 CVec_u8Z_free(ret_var);
32668 uint64_t __attribute__((export_name("TS_OpenChannel_read"))) TS_OpenChannel_read(int8_tArray ser) {
32669 LDKu8slice ser_ref;
32670 ser_ref.datalen = ser->arr_len;
32671 ser_ref.data = ser->elems;
32672 LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
32673 *ret_conv = OpenChannel_read(ser_ref);
32675 return tag_ptr(ret_conv, true);
32678 int8_tArray __attribute__((export_name("TS_RevokeAndACK_write"))) TS_RevokeAndACK_write(uint64_t obj) {
32679 LDKRevokeAndACK obj_conv;
32680 obj_conv.inner = untag_ptr(obj);
32681 obj_conv.is_owned = ptr_is_owned(obj);
32682 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32683 obj_conv.is_owned = false;
32684 LDKCVec_u8Z ret_var = RevokeAndACK_write(&obj_conv);
32685 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32686 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32687 CVec_u8Z_free(ret_var);
32691 uint64_t __attribute__((export_name("TS_RevokeAndACK_read"))) TS_RevokeAndACK_read(int8_tArray ser) {
32692 LDKu8slice ser_ref;
32693 ser_ref.datalen = ser->arr_len;
32694 ser_ref.data = ser->elems;
32695 LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
32696 *ret_conv = RevokeAndACK_read(ser_ref);
32698 return tag_ptr(ret_conv, true);
32701 int8_tArray __attribute__((export_name("TS_Shutdown_write"))) TS_Shutdown_write(uint64_t obj) {
32702 LDKShutdown obj_conv;
32703 obj_conv.inner = untag_ptr(obj);
32704 obj_conv.is_owned = ptr_is_owned(obj);
32705 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32706 obj_conv.is_owned = false;
32707 LDKCVec_u8Z ret_var = Shutdown_write(&obj_conv);
32708 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32709 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32710 CVec_u8Z_free(ret_var);
32714 uint64_t __attribute__((export_name("TS_Shutdown_read"))) TS_Shutdown_read(int8_tArray ser) {
32715 LDKu8slice ser_ref;
32716 ser_ref.datalen = ser->arr_len;
32717 ser_ref.data = ser->elems;
32718 LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
32719 *ret_conv = Shutdown_read(ser_ref);
32721 return tag_ptr(ret_conv, true);
32724 int8_tArray __attribute__((export_name("TS_UpdateFailHTLC_write"))) TS_UpdateFailHTLC_write(uint64_t obj) {
32725 LDKUpdateFailHTLC obj_conv;
32726 obj_conv.inner = untag_ptr(obj);
32727 obj_conv.is_owned = ptr_is_owned(obj);
32728 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32729 obj_conv.is_owned = false;
32730 LDKCVec_u8Z ret_var = UpdateFailHTLC_write(&obj_conv);
32731 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32732 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32733 CVec_u8Z_free(ret_var);
32737 uint64_t __attribute__((export_name("TS_UpdateFailHTLC_read"))) TS_UpdateFailHTLC_read(int8_tArray ser) {
32738 LDKu8slice ser_ref;
32739 ser_ref.datalen = ser->arr_len;
32740 ser_ref.data = ser->elems;
32741 LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
32742 *ret_conv = UpdateFailHTLC_read(ser_ref);
32744 return tag_ptr(ret_conv, true);
32747 int8_tArray __attribute__((export_name("TS_UpdateFailMalformedHTLC_write"))) TS_UpdateFailMalformedHTLC_write(uint64_t obj) {
32748 LDKUpdateFailMalformedHTLC obj_conv;
32749 obj_conv.inner = untag_ptr(obj);
32750 obj_conv.is_owned = ptr_is_owned(obj);
32751 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32752 obj_conv.is_owned = false;
32753 LDKCVec_u8Z ret_var = UpdateFailMalformedHTLC_write(&obj_conv);
32754 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32755 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32756 CVec_u8Z_free(ret_var);
32760 uint64_t __attribute__((export_name("TS_UpdateFailMalformedHTLC_read"))) TS_UpdateFailMalformedHTLC_read(int8_tArray ser) {
32761 LDKu8slice ser_ref;
32762 ser_ref.datalen = ser->arr_len;
32763 ser_ref.data = ser->elems;
32764 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
32765 *ret_conv = UpdateFailMalformedHTLC_read(ser_ref);
32767 return tag_ptr(ret_conv, true);
32770 int8_tArray __attribute__((export_name("TS_UpdateFee_write"))) TS_UpdateFee_write(uint64_t obj) {
32771 LDKUpdateFee obj_conv;
32772 obj_conv.inner = untag_ptr(obj);
32773 obj_conv.is_owned = ptr_is_owned(obj);
32774 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32775 obj_conv.is_owned = false;
32776 LDKCVec_u8Z ret_var = UpdateFee_write(&obj_conv);
32777 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32778 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32779 CVec_u8Z_free(ret_var);
32783 uint64_t __attribute__((export_name("TS_UpdateFee_read"))) TS_UpdateFee_read(int8_tArray ser) {
32784 LDKu8slice ser_ref;
32785 ser_ref.datalen = ser->arr_len;
32786 ser_ref.data = ser->elems;
32787 LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
32788 *ret_conv = UpdateFee_read(ser_ref);
32790 return tag_ptr(ret_conv, true);
32793 int8_tArray __attribute__((export_name("TS_UpdateFulfillHTLC_write"))) TS_UpdateFulfillHTLC_write(uint64_t obj) {
32794 LDKUpdateFulfillHTLC obj_conv;
32795 obj_conv.inner = untag_ptr(obj);
32796 obj_conv.is_owned = ptr_is_owned(obj);
32797 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32798 obj_conv.is_owned = false;
32799 LDKCVec_u8Z ret_var = UpdateFulfillHTLC_write(&obj_conv);
32800 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32801 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32802 CVec_u8Z_free(ret_var);
32806 uint64_t __attribute__((export_name("TS_UpdateFulfillHTLC_read"))) TS_UpdateFulfillHTLC_read(int8_tArray ser) {
32807 LDKu8slice ser_ref;
32808 ser_ref.datalen = ser->arr_len;
32809 ser_ref.data = ser->elems;
32810 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
32811 *ret_conv = UpdateFulfillHTLC_read(ser_ref);
32813 return tag_ptr(ret_conv, true);
32816 int8_tArray __attribute__((export_name("TS_UpdateAddHTLC_write"))) TS_UpdateAddHTLC_write(uint64_t obj) {
32817 LDKUpdateAddHTLC obj_conv;
32818 obj_conv.inner = untag_ptr(obj);
32819 obj_conv.is_owned = ptr_is_owned(obj);
32820 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32821 obj_conv.is_owned = false;
32822 LDKCVec_u8Z ret_var = UpdateAddHTLC_write(&obj_conv);
32823 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32824 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32825 CVec_u8Z_free(ret_var);
32829 uint64_t __attribute__((export_name("TS_UpdateAddHTLC_read"))) TS_UpdateAddHTLC_read(int8_tArray ser) {
32830 LDKu8slice ser_ref;
32831 ser_ref.datalen = ser->arr_len;
32832 ser_ref.data = ser->elems;
32833 LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
32834 *ret_conv = UpdateAddHTLC_read(ser_ref);
32836 return tag_ptr(ret_conv, true);
32839 int8_tArray __attribute__((export_name("TS_Ping_write"))) TS_Ping_write(uint64_t obj) {
32841 obj_conv.inner = untag_ptr(obj);
32842 obj_conv.is_owned = ptr_is_owned(obj);
32843 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32844 obj_conv.is_owned = false;
32845 LDKCVec_u8Z ret_var = Ping_write(&obj_conv);
32846 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32847 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32848 CVec_u8Z_free(ret_var);
32852 uint64_t __attribute__((export_name("TS_Ping_read"))) TS_Ping_read(int8_tArray ser) {
32853 LDKu8slice ser_ref;
32854 ser_ref.datalen = ser->arr_len;
32855 ser_ref.data = ser->elems;
32856 LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
32857 *ret_conv = Ping_read(ser_ref);
32859 return tag_ptr(ret_conv, true);
32862 int8_tArray __attribute__((export_name("TS_Pong_write"))) TS_Pong_write(uint64_t obj) {
32864 obj_conv.inner = untag_ptr(obj);
32865 obj_conv.is_owned = ptr_is_owned(obj);
32866 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32867 obj_conv.is_owned = false;
32868 LDKCVec_u8Z ret_var = Pong_write(&obj_conv);
32869 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32870 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32871 CVec_u8Z_free(ret_var);
32875 uint64_t __attribute__((export_name("TS_Pong_read"))) TS_Pong_read(int8_tArray ser) {
32876 LDKu8slice ser_ref;
32877 ser_ref.datalen = ser->arr_len;
32878 ser_ref.data = ser->elems;
32879 LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
32880 *ret_conv = Pong_read(ser_ref);
32882 return tag_ptr(ret_conv, true);
32885 int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_write"))) TS_UnsignedChannelAnnouncement_write(uint64_t obj) {
32886 LDKUnsignedChannelAnnouncement obj_conv;
32887 obj_conv.inner = untag_ptr(obj);
32888 obj_conv.is_owned = ptr_is_owned(obj);
32889 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32890 obj_conv.is_owned = false;
32891 LDKCVec_u8Z ret_var = UnsignedChannelAnnouncement_write(&obj_conv);
32892 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32893 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32894 CVec_u8Z_free(ret_var);
32898 uint64_t __attribute__((export_name("TS_UnsignedChannelAnnouncement_read"))) TS_UnsignedChannelAnnouncement_read(int8_tArray ser) {
32899 LDKu8slice ser_ref;
32900 ser_ref.datalen = ser->arr_len;
32901 ser_ref.data = ser->elems;
32902 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
32903 *ret_conv = UnsignedChannelAnnouncement_read(ser_ref);
32905 return tag_ptr(ret_conv, true);
32908 int8_tArray __attribute__((export_name("TS_ChannelAnnouncement_write"))) TS_ChannelAnnouncement_write(uint64_t obj) {
32909 LDKChannelAnnouncement obj_conv;
32910 obj_conv.inner = untag_ptr(obj);
32911 obj_conv.is_owned = ptr_is_owned(obj);
32912 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32913 obj_conv.is_owned = false;
32914 LDKCVec_u8Z ret_var = ChannelAnnouncement_write(&obj_conv);
32915 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32916 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32917 CVec_u8Z_free(ret_var);
32921 uint64_t __attribute__((export_name("TS_ChannelAnnouncement_read"))) TS_ChannelAnnouncement_read(int8_tArray ser) {
32922 LDKu8slice ser_ref;
32923 ser_ref.datalen = ser->arr_len;
32924 ser_ref.data = ser->elems;
32925 LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
32926 *ret_conv = ChannelAnnouncement_read(ser_ref);
32928 return tag_ptr(ret_conv, true);
32931 int8_tArray __attribute__((export_name("TS_UnsignedChannelUpdate_write"))) TS_UnsignedChannelUpdate_write(uint64_t obj) {
32932 LDKUnsignedChannelUpdate obj_conv;
32933 obj_conv.inner = untag_ptr(obj);
32934 obj_conv.is_owned = ptr_is_owned(obj);
32935 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32936 obj_conv.is_owned = false;
32937 LDKCVec_u8Z ret_var = UnsignedChannelUpdate_write(&obj_conv);
32938 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32939 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32940 CVec_u8Z_free(ret_var);
32944 uint64_t __attribute__((export_name("TS_UnsignedChannelUpdate_read"))) TS_UnsignedChannelUpdate_read(int8_tArray ser) {
32945 LDKu8slice ser_ref;
32946 ser_ref.datalen = ser->arr_len;
32947 ser_ref.data = ser->elems;
32948 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
32949 *ret_conv = UnsignedChannelUpdate_read(ser_ref);
32951 return tag_ptr(ret_conv, true);
32954 int8_tArray __attribute__((export_name("TS_ChannelUpdate_write"))) TS_ChannelUpdate_write(uint64_t obj) {
32955 LDKChannelUpdate obj_conv;
32956 obj_conv.inner = untag_ptr(obj);
32957 obj_conv.is_owned = ptr_is_owned(obj);
32958 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32959 obj_conv.is_owned = false;
32960 LDKCVec_u8Z ret_var = ChannelUpdate_write(&obj_conv);
32961 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32962 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32963 CVec_u8Z_free(ret_var);
32967 uint64_t __attribute__((export_name("TS_ChannelUpdate_read"))) TS_ChannelUpdate_read(int8_tArray ser) {
32968 LDKu8slice ser_ref;
32969 ser_ref.datalen = ser->arr_len;
32970 ser_ref.data = ser->elems;
32971 LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
32972 *ret_conv = ChannelUpdate_read(ser_ref);
32974 return tag_ptr(ret_conv, true);
32977 int8_tArray __attribute__((export_name("TS_ErrorMessage_write"))) TS_ErrorMessage_write(uint64_t obj) {
32978 LDKErrorMessage obj_conv;
32979 obj_conv.inner = untag_ptr(obj);
32980 obj_conv.is_owned = ptr_is_owned(obj);
32981 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32982 obj_conv.is_owned = false;
32983 LDKCVec_u8Z ret_var = ErrorMessage_write(&obj_conv);
32984 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32985 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32986 CVec_u8Z_free(ret_var);
32990 uint64_t __attribute__((export_name("TS_ErrorMessage_read"))) TS_ErrorMessage_read(int8_tArray ser) {
32991 LDKu8slice ser_ref;
32992 ser_ref.datalen = ser->arr_len;
32993 ser_ref.data = ser->elems;
32994 LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
32995 *ret_conv = ErrorMessage_read(ser_ref);
32997 return tag_ptr(ret_conv, true);
33000 int8_tArray __attribute__((export_name("TS_WarningMessage_write"))) TS_WarningMessage_write(uint64_t obj) {
33001 LDKWarningMessage obj_conv;
33002 obj_conv.inner = untag_ptr(obj);
33003 obj_conv.is_owned = ptr_is_owned(obj);
33004 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
33005 obj_conv.is_owned = false;
33006 LDKCVec_u8Z ret_var = WarningMessage_write(&obj_conv);
33007 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
33008 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
33009 CVec_u8Z_free(ret_var);
33013 uint64_t __attribute__((export_name("TS_WarningMessage_read"))) TS_WarningMessage_read(int8_tArray ser) {
33014 LDKu8slice ser_ref;
33015 ser_ref.datalen = ser->arr_len;
33016 ser_ref.data = ser->elems;
33017 LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
33018 *ret_conv = WarningMessage_read(ser_ref);
33020 return tag_ptr(ret_conv, true);
33023 int8_tArray __attribute__((export_name("TS_UnsignedNodeAnnouncement_write"))) TS_UnsignedNodeAnnouncement_write(uint64_t obj) {
33024 LDKUnsignedNodeAnnouncement obj_conv;
33025 obj_conv.inner = untag_ptr(obj);
33026 obj_conv.is_owned = ptr_is_owned(obj);
33027 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
33028 obj_conv.is_owned = false;
33029 LDKCVec_u8Z ret_var = UnsignedNodeAnnouncement_write(&obj_conv);
33030 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
33031 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
33032 CVec_u8Z_free(ret_var);
33036 uint64_t __attribute__((export_name("TS_UnsignedNodeAnnouncement_read"))) TS_UnsignedNodeAnnouncement_read(int8_tArray ser) {
33037 LDKu8slice ser_ref;
33038 ser_ref.datalen = ser->arr_len;
33039 ser_ref.data = ser->elems;
33040 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
33041 *ret_conv = UnsignedNodeAnnouncement_read(ser_ref);
33043 return tag_ptr(ret_conv, true);
33046 int8_tArray __attribute__((export_name("TS_NodeAnnouncement_write"))) TS_NodeAnnouncement_write(uint64_t obj) {
33047 LDKNodeAnnouncement obj_conv;
33048 obj_conv.inner = untag_ptr(obj);
33049 obj_conv.is_owned = ptr_is_owned(obj);
33050 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
33051 obj_conv.is_owned = false;
33052 LDKCVec_u8Z ret_var = NodeAnnouncement_write(&obj_conv);
33053 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
33054 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
33055 CVec_u8Z_free(ret_var);
33059 uint64_t __attribute__((export_name("TS_NodeAnnouncement_read"))) TS_NodeAnnouncement_read(int8_tArray ser) {
33060 LDKu8slice ser_ref;
33061 ser_ref.datalen = ser->arr_len;
33062 ser_ref.data = ser->elems;
33063 LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
33064 *ret_conv = NodeAnnouncement_read(ser_ref);
33066 return tag_ptr(ret_conv, true);
33069 uint64_t __attribute__((export_name("TS_QueryShortChannelIds_read"))) TS_QueryShortChannelIds_read(int8_tArray ser) {
33070 LDKu8slice ser_ref;
33071 ser_ref.datalen = ser->arr_len;
33072 ser_ref.data = ser->elems;
33073 LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
33074 *ret_conv = QueryShortChannelIds_read(ser_ref);
33076 return tag_ptr(ret_conv, true);
33079 int8_tArray __attribute__((export_name("TS_QueryShortChannelIds_write"))) TS_QueryShortChannelIds_write(uint64_t obj) {
33080 LDKQueryShortChannelIds obj_conv;
33081 obj_conv.inner = untag_ptr(obj);
33082 obj_conv.is_owned = ptr_is_owned(obj);
33083 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
33084 obj_conv.is_owned = false;
33085 LDKCVec_u8Z ret_var = QueryShortChannelIds_write(&obj_conv);
33086 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
33087 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
33088 CVec_u8Z_free(ret_var);
33092 int8_tArray __attribute__((export_name("TS_ReplyShortChannelIdsEnd_write"))) TS_ReplyShortChannelIdsEnd_write(uint64_t obj) {
33093 LDKReplyShortChannelIdsEnd obj_conv;
33094 obj_conv.inner = untag_ptr(obj);
33095 obj_conv.is_owned = ptr_is_owned(obj);
33096 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
33097 obj_conv.is_owned = false;
33098 LDKCVec_u8Z ret_var = ReplyShortChannelIdsEnd_write(&obj_conv);
33099 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
33100 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
33101 CVec_u8Z_free(ret_var);
33105 uint64_t __attribute__((export_name("TS_ReplyShortChannelIdsEnd_read"))) TS_ReplyShortChannelIdsEnd_read(int8_tArray ser) {
33106 LDKu8slice ser_ref;
33107 ser_ref.datalen = ser->arr_len;
33108 ser_ref.data = ser->elems;
33109 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
33110 *ret_conv = ReplyShortChannelIdsEnd_read(ser_ref);
33112 return tag_ptr(ret_conv, true);
33115 int32_t __attribute__((export_name("TS_QueryChannelRange_end_blocknum"))) TS_QueryChannelRange_end_blocknum(uint64_t this_arg) {
33116 LDKQueryChannelRange this_arg_conv;
33117 this_arg_conv.inner = untag_ptr(this_arg);
33118 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33119 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33120 this_arg_conv.is_owned = false;
33121 int32_t ret_conv = QueryChannelRange_end_blocknum(&this_arg_conv);
33125 int8_tArray __attribute__((export_name("TS_QueryChannelRange_write"))) TS_QueryChannelRange_write(uint64_t obj) {
33126 LDKQueryChannelRange obj_conv;
33127 obj_conv.inner = untag_ptr(obj);
33128 obj_conv.is_owned = ptr_is_owned(obj);
33129 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
33130 obj_conv.is_owned = false;
33131 LDKCVec_u8Z ret_var = QueryChannelRange_write(&obj_conv);
33132 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
33133 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
33134 CVec_u8Z_free(ret_var);
33138 uint64_t __attribute__((export_name("TS_QueryChannelRange_read"))) TS_QueryChannelRange_read(int8_tArray ser) {
33139 LDKu8slice ser_ref;
33140 ser_ref.datalen = ser->arr_len;
33141 ser_ref.data = ser->elems;
33142 LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
33143 *ret_conv = QueryChannelRange_read(ser_ref);
33145 return tag_ptr(ret_conv, true);
33148 uint64_t __attribute__((export_name("TS_ReplyChannelRange_read"))) TS_ReplyChannelRange_read(int8_tArray ser) {
33149 LDKu8slice ser_ref;
33150 ser_ref.datalen = ser->arr_len;
33151 ser_ref.data = ser->elems;
33152 LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
33153 *ret_conv = ReplyChannelRange_read(ser_ref);
33155 return tag_ptr(ret_conv, true);
33158 int8_tArray __attribute__((export_name("TS_ReplyChannelRange_write"))) TS_ReplyChannelRange_write(uint64_t obj) {
33159 LDKReplyChannelRange obj_conv;
33160 obj_conv.inner = untag_ptr(obj);
33161 obj_conv.is_owned = ptr_is_owned(obj);
33162 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
33163 obj_conv.is_owned = false;
33164 LDKCVec_u8Z ret_var = ReplyChannelRange_write(&obj_conv);
33165 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
33166 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
33167 CVec_u8Z_free(ret_var);
33171 int8_tArray __attribute__((export_name("TS_GossipTimestampFilter_write"))) TS_GossipTimestampFilter_write(uint64_t obj) {
33172 LDKGossipTimestampFilter obj_conv;
33173 obj_conv.inner = untag_ptr(obj);
33174 obj_conv.is_owned = ptr_is_owned(obj);
33175 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
33176 obj_conv.is_owned = false;
33177 LDKCVec_u8Z ret_var = GossipTimestampFilter_write(&obj_conv);
33178 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
33179 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
33180 CVec_u8Z_free(ret_var);
33184 uint64_t __attribute__((export_name("TS_GossipTimestampFilter_read"))) TS_GossipTimestampFilter_read(int8_tArray ser) {
33185 LDKu8slice ser_ref;
33186 ser_ref.datalen = ser->arr_len;
33187 ser_ref.data = ser->elems;
33188 LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
33189 *ret_conv = GossipTimestampFilter_read(ser_ref);
33191 return tag_ptr(ret_conv, true);
33194 void __attribute__((export_name("TS_CustomMessageHandler_free"))) TS_CustomMessageHandler_free(uint64_t this_ptr) {
33195 if (!ptr_is_owned(this_ptr)) return;
33196 void* this_ptr_ptr = untag_ptr(this_ptr);
33197 CHECK_ACCESS(this_ptr_ptr);
33198 LDKCustomMessageHandler this_ptr_conv = *(LDKCustomMessageHandler*)(this_ptr_ptr);
33199 FREE(untag_ptr(this_ptr));
33200 CustomMessageHandler_free(this_ptr_conv);
33203 void __attribute__((export_name("TS_IgnoringMessageHandler_free"))) TS_IgnoringMessageHandler_free(uint64_t this_obj) {
33204 LDKIgnoringMessageHandler this_obj_conv;
33205 this_obj_conv.inner = untag_ptr(this_obj);
33206 this_obj_conv.is_owned = ptr_is_owned(this_obj);
33207 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
33208 IgnoringMessageHandler_free(this_obj_conv);
33211 uint64_t __attribute__((export_name("TS_IgnoringMessageHandler_new"))) TS_IgnoringMessageHandler_new() {
33212 LDKIgnoringMessageHandler ret_var = IgnoringMessageHandler_new();
33213 uint64_t ret_ref = 0;
33214 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33215 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33219 uint64_t __attribute__((export_name("TS_IgnoringMessageHandler_as_MessageSendEventsProvider"))) TS_IgnoringMessageHandler_as_MessageSendEventsProvider(uint64_t this_arg) {
33220 LDKIgnoringMessageHandler this_arg_conv;
33221 this_arg_conv.inner = untag_ptr(this_arg);
33222 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33223 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33224 this_arg_conv.is_owned = false;
33225 LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
33226 *ret_ret = IgnoringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv);
33227 return tag_ptr(ret_ret, true);
33230 uint64_t __attribute__((export_name("TS_IgnoringMessageHandler_as_RoutingMessageHandler"))) TS_IgnoringMessageHandler_as_RoutingMessageHandler(uint64_t this_arg) {
33231 LDKIgnoringMessageHandler this_arg_conv;
33232 this_arg_conv.inner = untag_ptr(this_arg);
33233 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33234 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33235 this_arg_conv.is_owned = false;
33236 LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
33237 *ret_ret = IgnoringMessageHandler_as_RoutingMessageHandler(&this_arg_conv);
33238 return tag_ptr(ret_ret, true);
33241 uint64_t __attribute__((export_name("TS_IgnoringMessageHandler_as_CustomMessageReader"))) TS_IgnoringMessageHandler_as_CustomMessageReader(uint64_t this_arg) {
33242 LDKIgnoringMessageHandler this_arg_conv;
33243 this_arg_conv.inner = untag_ptr(this_arg);
33244 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33245 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33246 this_arg_conv.is_owned = false;
33247 LDKCustomMessageReader* ret_ret = MALLOC(sizeof(LDKCustomMessageReader), "LDKCustomMessageReader");
33248 *ret_ret = IgnoringMessageHandler_as_CustomMessageReader(&this_arg_conv);
33249 return tag_ptr(ret_ret, true);
33252 uint64_t __attribute__((export_name("TS_IgnoringMessageHandler_as_CustomMessageHandler"))) TS_IgnoringMessageHandler_as_CustomMessageHandler(uint64_t this_arg) {
33253 LDKIgnoringMessageHandler this_arg_conv;
33254 this_arg_conv.inner = untag_ptr(this_arg);
33255 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33256 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33257 this_arg_conv.is_owned = false;
33258 LDKCustomMessageHandler* ret_ret = MALLOC(sizeof(LDKCustomMessageHandler), "LDKCustomMessageHandler");
33259 *ret_ret = IgnoringMessageHandler_as_CustomMessageHandler(&this_arg_conv);
33260 return tag_ptr(ret_ret, true);
33263 void __attribute__((export_name("TS_ErroringMessageHandler_free"))) TS_ErroringMessageHandler_free(uint64_t this_obj) {
33264 LDKErroringMessageHandler this_obj_conv;
33265 this_obj_conv.inner = untag_ptr(this_obj);
33266 this_obj_conv.is_owned = ptr_is_owned(this_obj);
33267 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
33268 ErroringMessageHandler_free(this_obj_conv);
33271 uint64_t __attribute__((export_name("TS_ErroringMessageHandler_new"))) TS_ErroringMessageHandler_new() {
33272 LDKErroringMessageHandler ret_var = ErroringMessageHandler_new();
33273 uint64_t ret_ref = 0;
33274 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33275 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33279 uint64_t __attribute__((export_name("TS_ErroringMessageHandler_as_MessageSendEventsProvider"))) TS_ErroringMessageHandler_as_MessageSendEventsProvider(uint64_t this_arg) {
33280 LDKErroringMessageHandler this_arg_conv;
33281 this_arg_conv.inner = untag_ptr(this_arg);
33282 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33283 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33284 this_arg_conv.is_owned = false;
33285 LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
33286 *ret_ret = ErroringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv);
33287 return tag_ptr(ret_ret, true);
33290 uint64_t __attribute__((export_name("TS_ErroringMessageHandler_as_ChannelMessageHandler"))) TS_ErroringMessageHandler_as_ChannelMessageHandler(uint64_t this_arg) {
33291 LDKErroringMessageHandler this_arg_conv;
33292 this_arg_conv.inner = untag_ptr(this_arg);
33293 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33294 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33295 this_arg_conv.is_owned = false;
33296 LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
33297 *ret_ret = ErroringMessageHandler_as_ChannelMessageHandler(&this_arg_conv);
33298 return tag_ptr(ret_ret, true);
33301 void __attribute__((export_name("TS_MessageHandler_free"))) TS_MessageHandler_free(uint64_t this_obj) {
33302 LDKMessageHandler this_obj_conv;
33303 this_obj_conv.inner = untag_ptr(this_obj);
33304 this_obj_conv.is_owned = ptr_is_owned(this_obj);
33305 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
33306 MessageHandler_free(this_obj_conv);
33309 uint64_t __attribute__((export_name("TS_MessageHandler_get_chan_handler"))) TS_MessageHandler_get_chan_handler(uint64_t this_ptr) {
33310 LDKMessageHandler this_ptr_conv;
33311 this_ptr_conv.inner = untag_ptr(this_ptr);
33312 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33313 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33314 this_ptr_conv.is_owned = false;
33315 // WARNING: This object doesn't live past this scope, needs clone!
33316 uint64_t ret_ret = tag_ptr(MessageHandler_get_chan_handler(&this_ptr_conv), false);
33320 void __attribute__((export_name("TS_MessageHandler_set_chan_handler"))) TS_MessageHandler_set_chan_handler(uint64_t this_ptr, uint64_t val) {
33321 LDKMessageHandler this_ptr_conv;
33322 this_ptr_conv.inner = untag_ptr(this_ptr);
33323 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33324 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33325 this_ptr_conv.is_owned = false;
33326 void* val_ptr = untag_ptr(val);
33327 CHECK_ACCESS(val_ptr);
33328 LDKChannelMessageHandler val_conv = *(LDKChannelMessageHandler*)(val_ptr);
33329 if (val_conv.free == LDKChannelMessageHandler_JCalls_free) {
33330 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
33331 LDKChannelMessageHandler_JCalls_cloned(&val_conv);
33333 MessageHandler_set_chan_handler(&this_ptr_conv, val_conv);
33336 uint64_t __attribute__((export_name("TS_MessageHandler_get_route_handler"))) TS_MessageHandler_get_route_handler(uint64_t this_ptr) {
33337 LDKMessageHandler this_ptr_conv;
33338 this_ptr_conv.inner = untag_ptr(this_ptr);
33339 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33340 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33341 this_ptr_conv.is_owned = false;
33342 // WARNING: This object doesn't live past this scope, needs clone!
33343 uint64_t ret_ret = tag_ptr(MessageHandler_get_route_handler(&this_ptr_conv), false);
33347 void __attribute__((export_name("TS_MessageHandler_set_route_handler"))) TS_MessageHandler_set_route_handler(uint64_t this_ptr, uint64_t val) {
33348 LDKMessageHandler this_ptr_conv;
33349 this_ptr_conv.inner = untag_ptr(this_ptr);
33350 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33351 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33352 this_ptr_conv.is_owned = false;
33353 void* val_ptr = untag_ptr(val);
33354 CHECK_ACCESS(val_ptr);
33355 LDKRoutingMessageHandler val_conv = *(LDKRoutingMessageHandler*)(val_ptr);
33356 if (val_conv.free == LDKRoutingMessageHandler_JCalls_free) {
33357 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
33358 LDKRoutingMessageHandler_JCalls_cloned(&val_conv);
33360 MessageHandler_set_route_handler(&this_ptr_conv, val_conv);
33363 uint64_t __attribute__((export_name("TS_MessageHandler_new"))) TS_MessageHandler_new(uint64_t chan_handler_arg, uint64_t route_handler_arg) {
33364 void* chan_handler_arg_ptr = untag_ptr(chan_handler_arg);
33365 CHECK_ACCESS(chan_handler_arg_ptr);
33366 LDKChannelMessageHandler chan_handler_arg_conv = *(LDKChannelMessageHandler*)(chan_handler_arg_ptr);
33367 if (chan_handler_arg_conv.free == LDKChannelMessageHandler_JCalls_free) {
33368 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
33369 LDKChannelMessageHandler_JCalls_cloned(&chan_handler_arg_conv);
33371 void* route_handler_arg_ptr = untag_ptr(route_handler_arg);
33372 CHECK_ACCESS(route_handler_arg_ptr);
33373 LDKRoutingMessageHandler route_handler_arg_conv = *(LDKRoutingMessageHandler*)(route_handler_arg_ptr);
33374 if (route_handler_arg_conv.free == LDKRoutingMessageHandler_JCalls_free) {
33375 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
33376 LDKRoutingMessageHandler_JCalls_cloned(&route_handler_arg_conv);
33378 LDKMessageHandler ret_var = MessageHandler_new(chan_handler_arg_conv, route_handler_arg_conv);
33379 uint64_t ret_ref = 0;
33380 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33381 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33385 static inline uint64_t SocketDescriptor_clone_ptr(LDKSocketDescriptor *NONNULL_PTR arg) {
33386 LDKSocketDescriptor* ret_ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
33387 *ret_ret = SocketDescriptor_clone(arg);
33388 return tag_ptr(ret_ret, true);
33390 int64_t __attribute__((export_name("TS_SocketDescriptor_clone_ptr"))) TS_SocketDescriptor_clone_ptr(uint64_t arg) {
33391 void* arg_ptr = untag_ptr(arg);
33392 if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); }
33393 LDKSocketDescriptor* arg_conv = (LDKSocketDescriptor*)arg_ptr;
33394 int64_t ret_conv = SocketDescriptor_clone_ptr(arg_conv);
33398 uint64_t __attribute__((export_name("TS_SocketDescriptor_clone"))) TS_SocketDescriptor_clone(uint64_t orig) {
33399 void* orig_ptr = untag_ptr(orig);
33400 if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); }
33401 LDKSocketDescriptor* orig_conv = (LDKSocketDescriptor*)orig_ptr;
33402 LDKSocketDescriptor* ret_ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
33403 *ret_ret = SocketDescriptor_clone(orig_conv);
33404 return tag_ptr(ret_ret, true);
33407 void __attribute__((export_name("TS_SocketDescriptor_free"))) TS_SocketDescriptor_free(uint64_t this_ptr) {
33408 if (!ptr_is_owned(this_ptr)) return;
33409 void* this_ptr_ptr = untag_ptr(this_ptr);
33410 CHECK_ACCESS(this_ptr_ptr);
33411 LDKSocketDescriptor this_ptr_conv = *(LDKSocketDescriptor*)(this_ptr_ptr);
33412 FREE(untag_ptr(this_ptr));
33413 SocketDescriptor_free(this_ptr_conv);
33416 void __attribute__((export_name("TS_PeerHandleError_free"))) TS_PeerHandleError_free(uint64_t this_obj) {
33417 LDKPeerHandleError this_obj_conv;
33418 this_obj_conv.inner = untag_ptr(this_obj);
33419 this_obj_conv.is_owned = ptr_is_owned(this_obj);
33420 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
33421 PeerHandleError_free(this_obj_conv);
33424 jboolean __attribute__((export_name("TS_PeerHandleError_get_no_connection_possible"))) TS_PeerHandleError_get_no_connection_possible(uint64_t this_ptr) {
33425 LDKPeerHandleError this_ptr_conv;
33426 this_ptr_conv.inner = untag_ptr(this_ptr);
33427 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33428 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33429 this_ptr_conv.is_owned = false;
33430 jboolean ret_conv = PeerHandleError_get_no_connection_possible(&this_ptr_conv);
33434 void __attribute__((export_name("TS_PeerHandleError_set_no_connection_possible"))) TS_PeerHandleError_set_no_connection_possible(uint64_t this_ptr, jboolean val) {
33435 LDKPeerHandleError this_ptr_conv;
33436 this_ptr_conv.inner = untag_ptr(this_ptr);
33437 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33438 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33439 this_ptr_conv.is_owned = false;
33440 PeerHandleError_set_no_connection_possible(&this_ptr_conv, val);
33443 uint64_t __attribute__((export_name("TS_PeerHandleError_new"))) TS_PeerHandleError_new(jboolean no_connection_possible_arg) {
33444 LDKPeerHandleError ret_var = PeerHandleError_new(no_connection_possible_arg);
33445 uint64_t ret_ref = 0;
33446 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33447 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33451 static inline uint64_t PeerHandleError_clone_ptr(LDKPeerHandleError *NONNULL_PTR arg) {
33452 LDKPeerHandleError ret_var = PeerHandleError_clone(arg);
33453 uint64_t ret_ref = 0;
33454 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33455 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33458 int64_t __attribute__((export_name("TS_PeerHandleError_clone_ptr"))) TS_PeerHandleError_clone_ptr(uint64_t arg) {
33459 LDKPeerHandleError arg_conv;
33460 arg_conv.inner = untag_ptr(arg);
33461 arg_conv.is_owned = ptr_is_owned(arg);
33462 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
33463 arg_conv.is_owned = false;
33464 int64_t ret_conv = PeerHandleError_clone_ptr(&arg_conv);
33468 uint64_t __attribute__((export_name("TS_PeerHandleError_clone"))) TS_PeerHandleError_clone(uint64_t orig) {
33469 LDKPeerHandleError orig_conv;
33470 orig_conv.inner = untag_ptr(orig);
33471 orig_conv.is_owned = ptr_is_owned(orig);
33472 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
33473 orig_conv.is_owned = false;
33474 LDKPeerHandleError ret_var = PeerHandleError_clone(&orig_conv);
33475 uint64_t ret_ref = 0;
33476 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33477 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33481 void __attribute__((export_name("TS_PeerManager_free"))) TS_PeerManager_free(uint64_t this_obj) {
33482 LDKPeerManager this_obj_conv;
33483 this_obj_conv.inner = untag_ptr(this_obj);
33484 this_obj_conv.is_owned = ptr_is_owned(this_obj);
33485 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
33486 PeerManager_free(this_obj_conv);
33489 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) {
33490 LDKMessageHandler message_handler_conv;
33491 message_handler_conv.inner = untag_ptr(message_handler);
33492 message_handler_conv.is_owned = ptr_is_owned(message_handler);
33493 CHECK_INNER_FIELD_ACCESS_OR_NULL(message_handler_conv);
33494 // WARNING: we need a move here but no clone is available for LDKMessageHandler
33496 LDKSecretKey our_node_secret_ref;
33497 CHECK(our_node_secret->arr_len == 32);
33498 memcpy(our_node_secret_ref.bytes, our_node_secret->elems, 32); FREE(our_node_secret);
33499 unsigned char ephemeral_random_data_arr[32];
33500 CHECK(ephemeral_random_data->arr_len == 32);
33501 memcpy(ephemeral_random_data_arr, ephemeral_random_data->elems, 32); FREE(ephemeral_random_data);
33502 unsigned char (*ephemeral_random_data_ref)[32] = &ephemeral_random_data_arr;
33503 void* logger_ptr = untag_ptr(logger);
33504 CHECK_ACCESS(logger_ptr);
33505 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
33506 if (logger_conv.free == LDKLogger_JCalls_free) {
33507 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
33508 LDKLogger_JCalls_cloned(&logger_conv);
33510 void* custom_message_handler_ptr = untag_ptr(custom_message_handler);
33511 CHECK_ACCESS(custom_message_handler_ptr);
33512 LDKCustomMessageHandler custom_message_handler_conv = *(LDKCustomMessageHandler*)(custom_message_handler_ptr);
33513 if (custom_message_handler_conv.free == LDKCustomMessageHandler_JCalls_free) {
33514 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
33515 LDKCustomMessageHandler_JCalls_cloned(&custom_message_handler_conv);
33517 LDKPeerManager ret_var = PeerManager_new(message_handler_conv, our_node_secret_ref, ephemeral_random_data_ref, logger_conv, custom_message_handler_conv);
33518 uint64_t ret_ref = 0;
33519 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33520 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33524 ptrArray __attribute__((export_name("TS_PeerManager_get_peer_node_ids"))) TS_PeerManager_get_peer_node_ids(uint64_t this_arg) {
33525 LDKPeerManager this_arg_conv;
33526 this_arg_conv.inner = untag_ptr(this_arg);
33527 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33528 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33529 this_arg_conv.is_owned = false;
33530 LDKCVec_PublicKeyZ ret_var = PeerManager_get_peer_node_ids(&this_arg_conv);
33531 ptrArray ret_arr = NULL;
33532 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
33533 int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8);
33534 for (size_t m = 0; m < ret_var.datalen; m++) {
33535 int8_tArray ret_conv_12_arr = init_int8_tArray(33, __LINE__);
33536 memcpy(ret_conv_12_arr->elems, ret_var.data[m].compressed_form, 33);
33537 ret_arr_ptr[m] = ret_conv_12_arr;
33540 FREE(ret_var.data);
33544 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) {
33545 LDKPeerManager this_arg_conv;
33546 this_arg_conv.inner = untag_ptr(this_arg);
33547 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33548 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33549 this_arg_conv.is_owned = false;
33550 LDKPublicKey their_node_id_ref;
33551 CHECK(their_node_id->arr_len == 33);
33552 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
33553 void* descriptor_ptr = untag_ptr(descriptor);
33554 CHECK_ACCESS(descriptor_ptr);
33555 LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(descriptor_ptr);
33556 if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) {
33557 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
33558 LDKSocketDescriptor_JCalls_cloned(&descriptor_conv);
33560 void* remote_network_address_ptr = untag_ptr(remote_network_address);
33561 CHECK_ACCESS(remote_network_address_ptr);
33562 LDKCOption_NetAddressZ remote_network_address_conv = *(LDKCOption_NetAddressZ*)(remote_network_address_ptr);
33563 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
33564 *ret_conv = PeerManager_new_outbound_connection(&this_arg_conv, their_node_id_ref, descriptor_conv, remote_network_address_conv);
33565 return tag_ptr(ret_conv, true);
33568 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) {
33569 LDKPeerManager this_arg_conv;
33570 this_arg_conv.inner = untag_ptr(this_arg);
33571 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33572 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33573 this_arg_conv.is_owned = false;
33574 void* descriptor_ptr = untag_ptr(descriptor);
33575 CHECK_ACCESS(descriptor_ptr);
33576 LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(descriptor_ptr);
33577 if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) {
33578 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
33579 LDKSocketDescriptor_JCalls_cloned(&descriptor_conv);
33581 void* remote_network_address_ptr = untag_ptr(remote_network_address);
33582 CHECK_ACCESS(remote_network_address_ptr);
33583 LDKCOption_NetAddressZ remote_network_address_conv = *(LDKCOption_NetAddressZ*)(remote_network_address_ptr);
33584 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
33585 *ret_conv = PeerManager_new_inbound_connection(&this_arg_conv, descriptor_conv, remote_network_address_conv);
33586 return tag_ptr(ret_conv, true);
33589 uint64_t __attribute__((export_name("TS_PeerManager_write_buffer_space_avail"))) TS_PeerManager_write_buffer_space_avail(uint64_t this_arg, uint64_t descriptor) {
33590 LDKPeerManager this_arg_conv;
33591 this_arg_conv.inner = untag_ptr(this_arg);
33592 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33593 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33594 this_arg_conv.is_owned = false;
33595 void* descriptor_ptr = untag_ptr(descriptor);
33596 if (ptr_is_owned(descriptor)) { CHECK_ACCESS(descriptor_ptr); }
33597 LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr;
33598 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
33599 *ret_conv = PeerManager_write_buffer_space_avail(&this_arg_conv, descriptor_conv);
33600 return tag_ptr(ret_conv, true);
33603 uint64_t __attribute__((export_name("TS_PeerManager_read_event"))) TS_PeerManager_read_event(uint64_t this_arg, uint64_t peer_descriptor, int8_tArray data) {
33604 LDKPeerManager this_arg_conv;
33605 this_arg_conv.inner = untag_ptr(this_arg);
33606 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33607 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33608 this_arg_conv.is_owned = false;
33609 void* peer_descriptor_ptr = untag_ptr(peer_descriptor);
33610 if (ptr_is_owned(peer_descriptor)) { CHECK_ACCESS(peer_descriptor_ptr); }
33611 LDKSocketDescriptor* peer_descriptor_conv = (LDKSocketDescriptor*)peer_descriptor_ptr;
33612 LDKu8slice data_ref;
33613 data_ref.datalen = data->arr_len;
33614 data_ref.data = data->elems;
33615 LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
33616 *ret_conv = PeerManager_read_event(&this_arg_conv, peer_descriptor_conv, data_ref);
33618 return tag_ptr(ret_conv, true);
33621 void __attribute__((export_name("TS_PeerManager_process_events"))) TS_PeerManager_process_events(uint64_t this_arg) {
33622 LDKPeerManager this_arg_conv;
33623 this_arg_conv.inner = untag_ptr(this_arg);
33624 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33625 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33626 this_arg_conv.is_owned = false;
33627 PeerManager_process_events(&this_arg_conv);
33630 void __attribute__((export_name("TS_PeerManager_socket_disconnected"))) TS_PeerManager_socket_disconnected(uint64_t this_arg, uint64_t descriptor) {
33631 LDKPeerManager this_arg_conv;
33632 this_arg_conv.inner = untag_ptr(this_arg);
33633 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33634 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33635 this_arg_conv.is_owned = false;
33636 void* descriptor_ptr = untag_ptr(descriptor);
33637 if (ptr_is_owned(descriptor)) { CHECK_ACCESS(descriptor_ptr); }
33638 LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr;
33639 PeerManager_socket_disconnected(&this_arg_conv, descriptor_conv);
33642 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) {
33643 LDKPeerManager this_arg_conv;
33644 this_arg_conv.inner = untag_ptr(this_arg);
33645 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33646 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33647 this_arg_conv.is_owned = false;
33648 LDKPublicKey node_id_ref;
33649 CHECK(node_id->arr_len == 33);
33650 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
33651 PeerManager_disconnect_by_node_id(&this_arg_conv, node_id_ref, no_connection_possible);
33654 void __attribute__((export_name("TS_PeerManager_disconnect_all_peers"))) TS_PeerManager_disconnect_all_peers(uint64_t this_arg) {
33655 LDKPeerManager this_arg_conv;
33656 this_arg_conv.inner = untag_ptr(this_arg);
33657 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33658 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33659 this_arg_conv.is_owned = false;
33660 PeerManager_disconnect_all_peers(&this_arg_conv);
33663 void __attribute__((export_name("TS_PeerManager_timer_tick_occurred"))) TS_PeerManager_timer_tick_occurred(uint64_t this_arg) {
33664 LDKPeerManager this_arg_conv;
33665 this_arg_conv.inner = untag_ptr(this_arg);
33666 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33667 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33668 this_arg_conv.is_owned = false;
33669 PeerManager_timer_tick_occurred(&this_arg_conv);
33672 int64_t __attribute__((export_name("TS_htlc_success_tx_weight"))) TS_htlc_success_tx_weight(jboolean opt_anchors) {
33673 int64_t ret_conv = htlc_success_tx_weight(opt_anchors);
33677 int64_t __attribute__((export_name("TS_htlc_timeout_tx_weight"))) TS_htlc_timeout_tx_weight(jboolean opt_anchors) {
33678 int64_t ret_conv = htlc_timeout_tx_weight(opt_anchors);
33682 int8_tArray __attribute__((export_name("TS_build_commitment_secret"))) TS_build_commitment_secret(int8_tArray commitment_seed, int64_t idx) {
33683 unsigned char commitment_seed_arr[32];
33684 CHECK(commitment_seed->arr_len == 32);
33685 memcpy(commitment_seed_arr, commitment_seed->elems, 32); FREE(commitment_seed);
33686 unsigned char (*commitment_seed_ref)[32] = &commitment_seed_arr;
33687 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
33688 memcpy(ret_arr->elems, build_commitment_secret(commitment_seed_ref, idx).data, 32);
33692 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) {
33693 LDKCVec_u8Z to_holder_script_ref;
33694 to_holder_script_ref.datalen = to_holder_script->arr_len;
33695 to_holder_script_ref.data = MALLOC(to_holder_script_ref.datalen, "LDKCVec_u8Z Bytes");
33696 memcpy(to_holder_script_ref.data, to_holder_script->elems, to_holder_script_ref.datalen); FREE(to_holder_script);
33697 LDKCVec_u8Z to_counterparty_script_ref;
33698 to_counterparty_script_ref.datalen = to_counterparty_script->arr_len;
33699 to_counterparty_script_ref.data = MALLOC(to_counterparty_script_ref.datalen, "LDKCVec_u8Z Bytes");
33700 memcpy(to_counterparty_script_ref.data, to_counterparty_script->elems, to_counterparty_script_ref.datalen); FREE(to_counterparty_script);
33701 LDKOutPoint funding_outpoint_conv;
33702 funding_outpoint_conv.inner = untag_ptr(funding_outpoint);
33703 funding_outpoint_conv.is_owned = ptr_is_owned(funding_outpoint);
33704 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv);
33705 funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv);
33706 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);
33707 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
33708 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
33709 Transaction_free(ret_var);
33713 void __attribute__((export_name("TS_CounterpartyCommitmentSecrets_free"))) TS_CounterpartyCommitmentSecrets_free(uint64_t this_obj) {
33714 LDKCounterpartyCommitmentSecrets this_obj_conv;
33715 this_obj_conv.inner = untag_ptr(this_obj);
33716 this_obj_conv.is_owned = ptr_is_owned(this_obj);
33717 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
33718 CounterpartyCommitmentSecrets_free(this_obj_conv);
33721 static inline uint64_t CounterpartyCommitmentSecrets_clone_ptr(LDKCounterpartyCommitmentSecrets *NONNULL_PTR arg) {
33722 LDKCounterpartyCommitmentSecrets ret_var = CounterpartyCommitmentSecrets_clone(arg);
33723 uint64_t ret_ref = 0;
33724 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33725 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33728 int64_t __attribute__((export_name("TS_CounterpartyCommitmentSecrets_clone_ptr"))) TS_CounterpartyCommitmentSecrets_clone_ptr(uint64_t arg) {
33729 LDKCounterpartyCommitmentSecrets arg_conv;
33730 arg_conv.inner = untag_ptr(arg);
33731 arg_conv.is_owned = ptr_is_owned(arg);
33732 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
33733 arg_conv.is_owned = false;
33734 int64_t ret_conv = CounterpartyCommitmentSecrets_clone_ptr(&arg_conv);
33738 uint64_t __attribute__((export_name("TS_CounterpartyCommitmentSecrets_clone"))) TS_CounterpartyCommitmentSecrets_clone(uint64_t orig) {
33739 LDKCounterpartyCommitmentSecrets orig_conv;
33740 orig_conv.inner = untag_ptr(orig);
33741 orig_conv.is_owned = ptr_is_owned(orig);
33742 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
33743 orig_conv.is_owned = false;
33744 LDKCounterpartyCommitmentSecrets ret_var = CounterpartyCommitmentSecrets_clone(&orig_conv);
33745 uint64_t ret_ref = 0;
33746 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33747 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33751 uint64_t __attribute__((export_name("TS_CounterpartyCommitmentSecrets_new"))) TS_CounterpartyCommitmentSecrets_new() {
33752 LDKCounterpartyCommitmentSecrets ret_var = CounterpartyCommitmentSecrets_new();
33753 uint64_t ret_ref = 0;
33754 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33755 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33759 int64_t __attribute__((export_name("TS_CounterpartyCommitmentSecrets_get_min_seen_secret"))) TS_CounterpartyCommitmentSecrets_get_min_seen_secret(uint64_t this_arg) {
33760 LDKCounterpartyCommitmentSecrets this_arg_conv;
33761 this_arg_conv.inner = untag_ptr(this_arg);
33762 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33763 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33764 this_arg_conv.is_owned = false;
33765 int64_t ret_conv = CounterpartyCommitmentSecrets_get_min_seen_secret(&this_arg_conv);
33769 uint64_t __attribute__((export_name("TS_CounterpartyCommitmentSecrets_provide_secret"))) TS_CounterpartyCommitmentSecrets_provide_secret(uint64_t this_arg, int64_t idx, int8_tArray secret) {
33770 LDKCounterpartyCommitmentSecrets this_arg_conv;
33771 this_arg_conv.inner = untag_ptr(this_arg);
33772 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33773 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33774 this_arg_conv.is_owned = false;
33775 LDKThirtyTwoBytes secret_ref;
33776 CHECK(secret->arr_len == 32);
33777 memcpy(secret_ref.data, secret->elems, 32); FREE(secret);
33778 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
33779 *ret_conv = CounterpartyCommitmentSecrets_provide_secret(&this_arg_conv, idx, secret_ref);
33780 return tag_ptr(ret_conv, true);
33783 int8_tArray __attribute__((export_name("TS_CounterpartyCommitmentSecrets_get_secret"))) TS_CounterpartyCommitmentSecrets_get_secret(uint64_t this_arg, int64_t idx) {
33784 LDKCounterpartyCommitmentSecrets this_arg_conv;
33785 this_arg_conv.inner = untag_ptr(this_arg);
33786 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33787 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33788 this_arg_conv.is_owned = false;
33789 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
33790 memcpy(ret_arr->elems, CounterpartyCommitmentSecrets_get_secret(&this_arg_conv, idx).data, 32);
33794 int8_tArray __attribute__((export_name("TS_CounterpartyCommitmentSecrets_write"))) TS_CounterpartyCommitmentSecrets_write(uint64_t obj) {
33795 LDKCounterpartyCommitmentSecrets obj_conv;
33796 obj_conv.inner = untag_ptr(obj);
33797 obj_conv.is_owned = ptr_is_owned(obj);
33798 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
33799 obj_conv.is_owned = false;
33800 LDKCVec_u8Z ret_var = CounterpartyCommitmentSecrets_write(&obj_conv);
33801 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
33802 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
33803 CVec_u8Z_free(ret_var);
33807 uint64_t __attribute__((export_name("TS_CounterpartyCommitmentSecrets_read"))) TS_CounterpartyCommitmentSecrets_read(int8_tArray ser) {
33808 LDKu8slice ser_ref;
33809 ser_ref.datalen = ser->arr_len;
33810 ser_ref.data = ser->elems;
33811 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
33812 *ret_conv = CounterpartyCommitmentSecrets_read(ser_ref);
33814 return tag_ptr(ret_conv, true);
33817 uint64_t __attribute__((export_name("TS_derive_private_key"))) TS_derive_private_key(int8_tArray per_commitment_point, int8_tArray base_secret) {
33818 LDKPublicKey per_commitment_point_ref;
33819 CHECK(per_commitment_point->arr_len == 33);
33820 memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point);
33821 unsigned char base_secret_arr[32];
33822 CHECK(base_secret->arr_len == 32);
33823 memcpy(base_secret_arr, base_secret->elems, 32); FREE(base_secret);
33824 unsigned char (*base_secret_ref)[32] = &base_secret_arr;
33825 LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
33826 *ret_conv = derive_private_key(per_commitment_point_ref, base_secret_ref);
33827 return tag_ptr(ret_conv, true);
33830 uint64_t __attribute__((export_name("TS_derive_public_key"))) TS_derive_public_key(int8_tArray per_commitment_point, int8_tArray base_point) {
33831 LDKPublicKey per_commitment_point_ref;
33832 CHECK(per_commitment_point->arr_len == 33);
33833 memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point);
33834 LDKPublicKey base_point_ref;
33835 CHECK(base_point->arr_len == 33);
33836 memcpy(base_point_ref.compressed_form, base_point->elems, 33); FREE(base_point);
33837 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
33838 *ret_conv = derive_public_key(per_commitment_point_ref, base_point_ref);
33839 return tag_ptr(ret_conv, true);
33842 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) {
33843 unsigned char per_commitment_secret_arr[32];
33844 CHECK(per_commitment_secret->arr_len == 32);
33845 memcpy(per_commitment_secret_arr, per_commitment_secret->elems, 32); FREE(per_commitment_secret);
33846 unsigned char (*per_commitment_secret_ref)[32] = &per_commitment_secret_arr;
33847 unsigned char countersignatory_revocation_base_secret_arr[32];
33848 CHECK(countersignatory_revocation_base_secret->arr_len == 32);
33849 memcpy(countersignatory_revocation_base_secret_arr, countersignatory_revocation_base_secret->elems, 32); FREE(countersignatory_revocation_base_secret);
33850 unsigned char (*countersignatory_revocation_base_secret_ref)[32] = &countersignatory_revocation_base_secret_arr;
33851 LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
33852 *ret_conv = derive_private_revocation_key(per_commitment_secret_ref, countersignatory_revocation_base_secret_ref);
33853 return tag_ptr(ret_conv, true);
33856 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) {
33857 LDKPublicKey per_commitment_point_ref;
33858 CHECK(per_commitment_point->arr_len == 33);
33859 memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point);
33860 LDKPublicKey countersignatory_revocation_base_point_ref;
33861 CHECK(countersignatory_revocation_base_point->arr_len == 33);
33862 memcpy(countersignatory_revocation_base_point_ref.compressed_form, countersignatory_revocation_base_point->elems, 33); FREE(countersignatory_revocation_base_point);
33863 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
33864 *ret_conv = derive_public_revocation_key(per_commitment_point_ref, countersignatory_revocation_base_point_ref);
33865 return tag_ptr(ret_conv, true);
33868 void __attribute__((export_name("TS_TxCreationKeys_free"))) TS_TxCreationKeys_free(uint64_t this_obj) {
33869 LDKTxCreationKeys this_obj_conv;
33870 this_obj_conv.inner = untag_ptr(this_obj);
33871 this_obj_conv.is_owned = ptr_is_owned(this_obj);
33872 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
33873 TxCreationKeys_free(this_obj_conv);
33876 int8_tArray __attribute__((export_name("TS_TxCreationKeys_get_per_commitment_point"))) TS_TxCreationKeys_get_per_commitment_point(uint64_t this_ptr) {
33877 LDKTxCreationKeys this_ptr_conv;
33878 this_ptr_conv.inner = untag_ptr(this_ptr);
33879 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33880 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33881 this_ptr_conv.is_owned = false;
33882 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
33883 memcpy(ret_arr->elems, TxCreationKeys_get_per_commitment_point(&this_ptr_conv).compressed_form, 33);
33887 void __attribute__((export_name("TS_TxCreationKeys_set_per_commitment_point"))) TS_TxCreationKeys_set_per_commitment_point(uint64_t this_ptr, int8_tArray val) {
33888 LDKTxCreationKeys this_ptr_conv;
33889 this_ptr_conv.inner = untag_ptr(this_ptr);
33890 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33891 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33892 this_ptr_conv.is_owned = false;
33893 LDKPublicKey val_ref;
33894 CHECK(val->arr_len == 33);
33895 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
33896 TxCreationKeys_set_per_commitment_point(&this_ptr_conv, val_ref);
33899 int8_tArray __attribute__((export_name("TS_TxCreationKeys_get_revocation_key"))) TS_TxCreationKeys_get_revocation_key(uint64_t this_ptr) {
33900 LDKTxCreationKeys this_ptr_conv;
33901 this_ptr_conv.inner = untag_ptr(this_ptr);
33902 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33903 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33904 this_ptr_conv.is_owned = false;
33905 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
33906 memcpy(ret_arr->elems, TxCreationKeys_get_revocation_key(&this_ptr_conv).compressed_form, 33);
33910 void __attribute__((export_name("TS_TxCreationKeys_set_revocation_key"))) TS_TxCreationKeys_set_revocation_key(uint64_t this_ptr, int8_tArray val) {
33911 LDKTxCreationKeys this_ptr_conv;
33912 this_ptr_conv.inner = untag_ptr(this_ptr);
33913 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33914 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33915 this_ptr_conv.is_owned = false;
33916 LDKPublicKey val_ref;
33917 CHECK(val->arr_len == 33);
33918 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
33919 TxCreationKeys_set_revocation_key(&this_ptr_conv, val_ref);
33922 int8_tArray __attribute__((export_name("TS_TxCreationKeys_get_broadcaster_htlc_key"))) TS_TxCreationKeys_get_broadcaster_htlc_key(uint64_t this_ptr) {
33923 LDKTxCreationKeys this_ptr_conv;
33924 this_ptr_conv.inner = untag_ptr(this_ptr);
33925 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33926 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33927 this_ptr_conv.is_owned = false;
33928 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
33929 memcpy(ret_arr->elems, TxCreationKeys_get_broadcaster_htlc_key(&this_ptr_conv).compressed_form, 33);
33933 void __attribute__((export_name("TS_TxCreationKeys_set_broadcaster_htlc_key"))) TS_TxCreationKeys_set_broadcaster_htlc_key(uint64_t this_ptr, int8_tArray val) {
33934 LDKTxCreationKeys this_ptr_conv;
33935 this_ptr_conv.inner = untag_ptr(this_ptr);
33936 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33937 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33938 this_ptr_conv.is_owned = false;
33939 LDKPublicKey val_ref;
33940 CHECK(val->arr_len == 33);
33941 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
33942 TxCreationKeys_set_broadcaster_htlc_key(&this_ptr_conv, val_ref);
33945 int8_tArray __attribute__((export_name("TS_TxCreationKeys_get_countersignatory_htlc_key"))) TS_TxCreationKeys_get_countersignatory_htlc_key(uint64_t this_ptr) {
33946 LDKTxCreationKeys this_ptr_conv;
33947 this_ptr_conv.inner = untag_ptr(this_ptr);
33948 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33949 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33950 this_ptr_conv.is_owned = false;
33951 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
33952 memcpy(ret_arr->elems, TxCreationKeys_get_countersignatory_htlc_key(&this_ptr_conv).compressed_form, 33);
33956 void __attribute__((export_name("TS_TxCreationKeys_set_countersignatory_htlc_key"))) TS_TxCreationKeys_set_countersignatory_htlc_key(uint64_t this_ptr, int8_tArray val) {
33957 LDKTxCreationKeys this_ptr_conv;
33958 this_ptr_conv.inner = untag_ptr(this_ptr);
33959 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33960 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33961 this_ptr_conv.is_owned = false;
33962 LDKPublicKey val_ref;
33963 CHECK(val->arr_len == 33);
33964 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
33965 TxCreationKeys_set_countersignatory_htlc_key(&this_ptr_conv, val_ref);
33968 int8_tArray __attribute__((export_name("TS_TxCreationKeys_get_broadcaster_delayed_payment_key"))) TS_TxCreationKeys_get_broadcaster_delayed_payment_key(uint64_t this_ptr) {
33969 LDKTxCreationKeys this_ptr_conv;
33970 this_ptr_conv.inner = untag_ptr(this_ptr);
33971 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33972 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33973 this_ptr_conv.is_owned = false;
33974 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
33975 memcpy(ret_arr->elems, TxCreationKeys_get_broadcaster_delayed_payment_key(&this_ptr_conv).compressed_form, 33);
33979 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) {
33980 LDKTxCreationKeys this_ptr_conv;
33981 this_ptr_conv.inner = untag_ptr(this_ptr);
33982 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33983 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33984 this_ptr_conv.is_owned = false;
33985 LDKPublicKey val_ref;
33986 CHECK(val->arr_len == 33);
33987 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
33988 TxCreationKeys_set_broadcaster_delayed_payment_key(&this_ptr_conv, val_ref);
33991 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) {
33992 LDKPublicKey per_commitment_point_arg_ref;
33993 CHECK(per_commitment_point_arg->arr_len == 33);
33994 memcpy(per_commitment_point_arg_ref.compressed_form, per_commitment_point_arg->elems, 33); FREE(per_commitment_point_arg);
33995 LDKPublicKey revocation_key_arg_ref;
33996 CHECK(revocation_key_arg->arr_len == 33);
33997 memcpy(revocation_key_arg_ref.compressed_form, revocation_key_arg->elems, 33); FREE(revocation_key_arg);
33998 LDKPublicKey broadcaster_htlc_key_arg_ref;
33999 CHECK(broadcaster_htlc_key_arg->arr_len == 33);
34000 memcpy(broadcaster_htlc_key_arg_ref.compressed_form, broadcaster_htlc_key_arg->elems, 33); FREE(broadcaster_htlc_key_arg);
34001 LDKPublicKey countersignatory_htlc_key_arg_ref;
34002 CHECK(countersignatory_htlc_key_arg->arr_len == 33);
34003 memcpy(countersignatory_htlc_key_arg_ref.compressed_form, countersignatory_htlc_key_arg->elems, 33); FREE(countersignatory_htlc_key_arg);
34004 LDKPublicKey broadcaster_delayed_payment_key_arg_ref;
34005 CHECK(broadcaster_delayed_payment_key_arg->arr_len == 33);
34006 memcpy(broadcaster_delayed_payment_key_arg_ref.compressed_form, broadcaster_delayed_payment_key_arg->elems, 33); FREE(broadcaster_delayed_payment_key_arg);
34007 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);
34008 uint64_t ret_ref = 0;
34009 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34010 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34014 static inline uint64_t TxCreationKeys_clone_ptr(LDKTxCreationKeys *NONNULL_PTR arg) {
34015 LDKTxCreationKeys ret_var = TxCreationKeys_clone(arg);
34016 uint64_t ret_ref = 0;
34017 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34018 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34021 int64_t __attribute__((export_name("TS_TxCreationKeys_clone_ptr"))) TS_TxCreationKeys_clone_ptr(uint64_t arg) {
34022 LDKTxCreationKeys arg_conv;
34023 arg_conv.inner = untag_ptr(arg);
34024 arg_conv.is_owned = ptr_is_owned(arg);
34025 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
34026 arg_conv.is_owned = false;
34027 int64_t ret_conv = TxCreationKeys_clone_ptr(&arg_conv);
34031 uint64_t __attribute__((export_name("TS_TxCreationKeys_clone"))) TS_TxCreationKeys_clone(uint64_t orig) {
34032 LDKTxCreationKeys orig_conv;
34033 orig_conv.inner = untag_ptr(orig);
34034 orig_conv.is_owned = ptr_is_owned(orig);
34035 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
34036 orig_conv.is_owned = false;
34037 LDKTxCreationKeys ret_var = TxCreationKeys_clone(&orig_conv);
34038 uint64_t ret_ref = 0;
34039 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34040 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34044 int8_tArray __attribute__((export_name("TS_TxCreationKeys_write"))) TS_TxCreationKeys_write(uint64_t obj) {
34045 LDKTxCreationKeys obj_conv;
34046 obj_conv.inner = untag_ptr(obj);
34047 obj_conv.is_owned = ptr_is_owned(obj);
34048 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34049 obj_conv.is_owned = false;
34050 LDKCVec_u8Z ret_var = TxCreationKeys_write(&obj_conv);
34051 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34052 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34053 CVec_u8Z_free(ret_var);
34057 uint64_t __attribute__((export_name("TS_TxCreationKeys_read"))) TS_TxCreationKeys_read(int8_tArray ser) {
34058 LDKu8slice ser_ref;
34059 ser_ref.datalen = ser->arr_len;
34060 ser_ref.data = ser->elems;
34061 LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
34062 *ret_conv = TxCreationKeys_read(ser_ref);
34064 return tag_ptr(ret_conv, true);
34067 void __attribute__((export_name("TS_ChannelPublicKeys_free"))) TS_ChannelPublicKeys_free(uint64_t this_obj) {
34068 LDKChannelPublicKeys this_obj_conv;
34069 this_obj_conv.inner = untag_ptr(this_obj);
34070 this_obj_conv.is_owned = ptr_is_owned(this_obj);
34071 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
34072 ChannelPublicKeys_free(this_obj_conv);
34075 int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_get_funding_pubkey"))) TS_ChannelPublicKeys_get_funding_pubkey(uint64_t this_ptr) {
34076 LDKChannelPublicKeys this_ptr_conv;
34077 this_ptr_conv.inner = untag_ptr(this_ptr);
34078 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34079 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34080 this_ptr_conv.is_owned = false;
34081 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
34082 memcpy(ret_arr->elems, ChannelPublicKeys_get_funding_pubkey(&this_ptr_conv).compressed_form, 33);
34086 void __attribute__((export_name("TS_ChannelPublicKeys_set_funding_pubkey"))) TS_ChannelPublicKeys_set_funding_pubkey(uint64_t this_ptr, int8_tArray val) {
34087 LDKChannelPublicKeys this_ptr_conv;
34088 this_ptr_conv.inner = untag_ptr(this_ptr);
34089 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34090 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34091 this_ptr_conv.is_owned = false;
34092 LDKPublicKey val_ref;
34093 CHECK(val->arr_len == 33);
34094 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
34095 ChannelPublicKeys_set_funding_pubkey(&this_ptr_conv, val_ref);
34098 int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_get_revocation_basepoint"))) TS_ChannelPublicKeys_get_revocation_basepoint(uint64_t this_ptr) {
34099 LDKChannelPublicKeys this_ptr_conv;
34100 this_ptr_conv.inner = untag_ptr(this_ptr);
34101 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34102 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34103 this_ptr_conv.is_owned = false;
34104 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
34105 memcpy(ret_arr->elems, ChannelPublicKeys_get_revocation_basepoint(&this_ptr_conv).compressed_form, 33);
34109 void __attribute__((export_name("TS_ChannelPublicKeys_set_revocation_basepoint"))) TS_ChannelPublicKeys_set_revocation_basepoint(uint64_t this_ptr, int8_tArray val) {
34110 LDKChannelPublicKeys this_ptr_conv;
34111 this_ptr_conv.inner = untag_ptr(this_ptr);
34112 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34113 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34114 this_ptr_conv.is_owned = false;
34115 LDKPublicKey val_ref;
34116 CHECK(val->arr_len == 33);
34117 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
34118 ChannelPublicKeys_set_revocation_basepoint(&this_ptr_conv, val_ref);
34121 int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_get_payment_point"))) TS_ChannelPublicKeys_get_payment_point(uint64_t this_ptr) {
34122 LDKChannelPublicKeys this_ptr_conv;
34123 this_ptr_conv.inner = untag_ptr(this_ptr);
34124 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34125 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34126 this_ptr_conv.is_owned = false;
34127 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
34128 memcpy(ret_arr->elems, ChannelPublicKeys_get_payment_point(&this_ptr_conv).compressed_form, 33);
34132 void __attribute__((export_name("TS_ChannelPublicKeys_set_payment_point"))) TS_ChannelPublicKeys_set_payment_point(uint64_t this_ptr, int8_tArray val) {
34133 LDKChannelPublicKeys this_ptr_conv;
34134 this_ptr_conv.inner = untag_ptr(this_ptr);
34135 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34136 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34137 this_ptr_conv.is_owned = false;
34138 LDKPublicKey val_ref;
34139 CHECK(val->arr_len == 33);
34140 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
34141 ChannelPublicKeys_set_payment_point(&this_ptr_conv, val_ref);
34144 int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_get_delayed_payment_basepoint"))) TS_ChannelPublicKeys_get_delayed_payment_basepoint(uint64_t this_ptr) {
34145 LDKChannelPublicKeys this_ptr_conv;
34146 this_ptr_conv.inner = untag_ptr(this_ptr);
34147 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34148 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34149 this_ptr_conv.is_owned = false;
34150 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
34151 memcpy(ret_arr->elems, ChannelPublicKeys_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33);
34155 void __attribute__((export_name("TS_ChannelPublicKeys_set_delayed_payment_basepoint"))) TS_ChannelPublicKeys_set_delayed_payment_basepoint(uint64_t this_ptr, int8_tArray val) {
34156 LDKChannelPublicKeys this_ptr_conv;
34157 this_ptr_conv.inner = untag_ptr(this_ptr);
34158 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34159 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34160 this_ptr_conv.is_owned = false;
34161 LDKPublicKey val_ref;
34162 CHECK(val->arr_len == 33);
34163 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
34164 ChannelPublicKeys_set_delayed_payment_basepoint(&this_ptr_conv, val_ref);
34167 int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_get_htlc_basepoint"))) TS_ChannelPublicKeys_get_htlc_basepoint(uint64_t this_ptr) {
34168 LDKChannelPublicKeys this_ptr_conv;
34169 this_ptr_conv.inner = untag_ptr(this_ptr);
34170 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34171 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34172 this_ptr_conv.is_owned = false;
34173 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
34174 memcpy(ret_arr->elems, ChannelPublicKeys_get_htlc_basepoint(&this_ptr_conv).compressed_form, 33);
34178 void __attribute__((export_name("TS_ChannelPublicKeys_set_htlc_basepoint"))) TS_ChannelPublicKeys_set_htlc_basepoint(uint64_t this_ptr, int8_tArray val) {
34179 LDKChannelPublicKeys this_ptr_conv;
34180 this_ptr_conv.inner = untag_ptr(this_ptr);
34181 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34182 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34183 this_ptr_conv.is_owned = false;
34184 LDKPublicKey val_ref;
34185 CHECK(val->arr_len == 33);
34186 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
34187 ChannelPublicKeys_set_htlc_basepoint(&this_ptr_conv, val_ref);
34190 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) {
34191 LDKPublicKey funding_pubkey_arg_ref;
34192 CHECK(funding_pubkey_arg->arr_len == 33);
34193 memcpy(funding_pubkey_arg_ref.compressed_form, funding_pubkey_arg->elems, 33); FREE(funding_pubkey_arg);
34194 LDKPublicKey revocation_basepoint_arg_ref;
34195 CHECK(revocation_basepoint_arg->arr_len == 33);
34196 memcpy(revocation_basepoint_arg_ref.compressed_form, revocation_basepoint_arg->elems, 33); FREE(revocation_basepoint_arg);
34197 LDKPublicKey payment_point_arg_ref;
34198 CHECK(payment_point_arg->arr_len == 33);
34199 memcpy(payment_point_arg_ref.compressed_form, payment_point_arg->elems, 33); FREE(payment_point_arg);
34200 LDKPublicKey delayed_payment_basepoint_arg_ref;
34201 CHECK(delayed_payment_basepoint_arg->arr_len == 33);
34202 memcpy(delayed_payment_basepoint_arg_ref.compressed_form, delayed_payment_basepoint_arg->elems, 33); FREE(delayed_payment_basepoint_arg);
34203 LDKPublicKey htlc_basepoint_arg_ref;
34204 CHECK(htlc_basepoint_arg->arr_len == 33);
34205 memcpy(htlc_basepoint_arg_ref.compressed_form, htlc_basepoint_arg->elems, 33); FREE(htlc_basepoint_arg);
34206 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);
34207 uint64_t ret_ref = 0;
34208 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34209 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34213 static inline uint64_t ChannelPublicKeys_clone_ptr(LDKChannelPublicKeys *NONNULL_PTR arg) {
34214 LDKChannelPublicKeys ret_var = ChannelPublicKeys_clone(arg);
34215 uint64_t ret_ref = 0;
34216 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34217 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34220 int64_t __attribute__((export_name("TS_ChannelPublicKeys_clone_ptr"))) TS_ChannelPublicKeys_clone_ptr(uint64_t arg) {
34221 LDKChannelPublicKeys arg_conv;
34222 arg_conv.inner = untag_ptr(arg);
34223 arg_conv.is_owned = ptr_is_owned(arg);
34224 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
34225 arg_conv.is_owned = false;
34226 int64_t ret_conv = ChannelPublicKeys_clone_ptr(&arg_conv);
34230 uint64_t __attribute__((export_name("TS_ChannelPublicKeys_clone"))) TS_ChannelPublicKeys_clone(uint64_t orig) {
34231 LDKChannelPublicKeys orig_conv;
34232 orig_conv.inner = untag_ptr(orig);
34233 orig_conv.is_owned = ptr_is_owned(orig);
34234 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
34235 orig_conv.is_owned = false;
34236 LDKChannelPublicKeys ret_var = ChannelPublicKeys_clone(&orig_conv);
34237 uint64_t ret_ref = 0;
34238 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34239 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34243 int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_write"))) TS_ChannelPublicKeys_write(uint64_t obj) {
34244 LDKChannelPublicKeys obj_conv;
34245 obj_conv.inner = untag_ptr(obj);
34246 obj_conv.is_owned = ptr_is_owned(obj);
34247 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34248 obj_conv.is_owned = false;
34249 LDKCVec_u8Z ret_var = ChannelPublicKeys_write(&obj_conv);
34250 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34251 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34252 CVec_u8Z_free(ret_var);
34256 uint64_t __attribute__((export_name("TS_ChannelPublicKeys_read"))) TS_ChannelPublicKeys_read(int8_tArray ser) {
34257 LDKu8slice ser_ref;
34258 ser_ref.datalen = ser->arr_len;
34259 ser_ref.data = ser->elems;
34260 LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
34261 *ret_conv = ChannelPublicKeys_read(ser_ref);
34263 return tag_ptr(ret_conv, true);
34266 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) {
34267 LDKPublicKey per_commitment_point_ref;
34268 CHECK(per_commitment_point->arr_len == 33);
34269 memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point);
34270 LDKPublicKey broadcaster_delayed_payment_base_ref;
34271 CHECK(broadcaster_delayed_payment_base->arr_len == 33);
34272 memcpy(broadcaster_delayed_payment_base_ref.compressed_form, broadcaster_delayed_payment_base->elems, 33); FREE(broadcaster_delayed_payment_base);
34273 LDKPublicKey broadcaster_htlc_base_ref;
34274 CHECK(broadcaster_htlc_base->arr_len == 33);
34275 memcpy(broadcaster_htlc_base_ref.compressed_form, broadcaster_htlc_base->elems, 33); FREE(broadcaster_htlc_base);
34276 LDKPublicKey countersignatory_revocation_base_ref;
34277 CHECK(countersignatory_revocation_base->arr_len == 33);
34278 memcpy(countersignatory_revocation_base_ref.compressed_form, countersignatory_revocation_base->elems, 33); FREE(countersignatory_revocation_base);
34279 LDKPublicKey countersignatory_htlc_base_ref;
34280 CHECK(countersignatory_htlc_base->arr_len == 33);
34281 memcpy(countersignatory_htlc_base_ref.compressed_form, countersignatory_htlc_base->elems, 33); FREE(countersignatory_htlc_base);
34282 LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
34283 *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);
34284 return tag_ptr(ret_conv, true);
34287 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) {
34288 LDKPublicKey per_commitment_point_ref;
34289 CHECK(per_commitment_point->arr_len == 33);
34290 memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point);
34291 LDKChannelPublicKeys broadcaster_keys_conv;
34292 broadcaster_keys_conv.inner = untag_ptr(broadcaster_keys);
34293 broadcaster_keys_conv.is_owned = ptr_is_owned(broadcaster_keys);
34294 CHECK_INNER_FIELD_ACCESS_OR_NULL(broadcaster_keys_conv);
34295 broadcaster_keys_conv.is_owned = false;
34296 LDKChannelPublicKeys countersignatory_keys_conv;
34297 countersignatory_keys_conv.inner = untag_ptr(countersignatory_keys);
34298 countersignatory_keys_conv.is_owned = ptr_is_owned(countersignatory_keys);
34299 CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_keys_conv);
34300 countersignatory_keys_conv.is_owned = false;
34301 LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
34302 *ret_conv = TxCreationKeys_from_channel_static_keys(per_commitment_point_ref, &broadcaster_keys_conv, &countersignatory_keys_conv);
34303 return tag_ptr(ret_conv, true);
34306 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) {
34307 LDKPublicKey revocation_key_ref;
34308 CHECK(revocation_key->arr_len == 33);
34309 memcpy(revocation_key_ref.compressed_form, revocation_key->elems, 33); FREE(revocation_key);
34310 LDKPublicKey broadcaster_delayed_payment_key_ref;
34311 CHECK(broadcaster_delayed_payment_key->arr_len == 33);
34312 memcpy(broadcaster_delayed_payment_key_ref.compressed_form, broadcaster_delayed_payment_key->elems, 33); FREE(broadcaster_delayed_payment_key);
34313 LDKCVec_u8Z ret_var = get_revokeable_redeemscript(revocation_key_ref, contest_delay, broadcaster_delayed_payment_key_ref);
34314 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34315 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34316 CVec_u8Z_free(ret_var);
34320 void __attribute__((export_name("TS_HTLCOutputInCommitment_free"))) TS_HTLCOutputInCommitment_free(uint64_t this_obj) {
34321 LDKHTLCOutputInCommitment this_obj_conv;
34322 this_obj_conv.inner = untag_ptr(this_obj);
34323 this_obj_conv.is_owned = ptr_is_owned(this_obj);
34324 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
34325 HTLCOutputInCommitment_free(this_obj_conv);
34328 jboolean __attribute__((export_name("TS_HTLCOutputInCommitment_get_offered"))) TS_HTLCOutputInCommitment_get_offered(uint64_t this_ptr) {
34329 LDKHTLCOutputInCommitment this_ptr_conv;
34330 this_ptr_conv.inner = untag_ptr(this_ptr);
34331 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34332 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34333 this_ptr_conv.is_owned = false;
34334 jboolean ret_conv = HTLCOutputInCommitment_get_offered(&this_ptr_conv);
34338 void __attribute__((export_name("TS_HTLCOutputInCommitment_set_offered"))) TS_HTLCOutputInCommitment_set_offered(uint64_t this_ptr, jboolean val) {
34339 LDKHTLCOutputInCommitment this_ptr_conv;
34340 this_ptr_conv.inner = untag_ptr(this_ptr);
34341 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34342 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34343 this_ptr_conv.is_owned = false;
34344 HTLCOutputInCommitment_set_offered(&this_ptr_conv, val);
34347 int64_t __attribute__((export_name("TS_HTLCOutputInCommitment_get_amount_msat"))) TS_HTLCOutputInCommitment_get_amount_msat(uint64_t this_ptr) {
34348 LDKHTLCOutputInCommitment this_ptr_conv;
34349 this_ptr_conv.inner = untag_ptr(this_ptr);
34350 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34351 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34352 this_ptr_conv.is_owned = false;
34353 int64_t ret_conv = HTLCOutputInCommitment_get_amount_msat(&this_ptr_conv);
34357 void __attribute__((export_name("TS_HTLCOutputInCommitment_set_amount_msat"))) TS_HTLCOutputInCommitment_set_amount_msat(uint64_t this_ptr, int64_t val) {
34358 LDKHTLCOutputInCommitment this_ptr_conv;
34359 this_ptr_conv.inner = untag_ptr(this_ptr);
34360 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34361 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34362 this_ptr_conv.is_owned = false;
34363 HTLCOutputInCommitment_set_amount_msat(&this_ptr_conv, val);
34366 int32_t __attribute__((export_name("TS_HTLCOutputInCommitment_get_cltv_expiry"))) TS_HTLCOutputInCommitment_get_cltv_expiry(uint64_t this_ptr) {
34367 LDKHTLCOutputInCommitment this_ptr_conv;
34368 this_ptr_conv.inner = untag_ptr(this_ptr);
34369 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34370 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34371 this_ptr_conv.is_owned = false;
34372 int32_t ret_conv = HTLCOutputInCommitment_get_cltv_expiry(&this_ptr_conv);
34376 void __attribute__((export_name("TS_HTLCOutputInCommitment_set_cltv_expiry"))) TS_HTLCOutputInCommitment_set_cltv_expiry(uint64_t this_ptr, int32_t val) {
34377 LDKHTLCOutputInCommitment this_ptr_conv;
34378 this_ptr_conv.inner = untag_ptr(this_ptr);
34379 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34380 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34381 this_ptr_conv.is_owned = false;
34382 HTLCOutputInCommitment_set_cltv_expiry(&this_ptr_conv, val);
34385 int8_tArray __attribute__((export_name("TS_HTLCOutputInCommitment_get_payment_hash"))) TS_HTLCOutputInCommitment_get_payment_hash(uint64_t this_ptr) {
34386 LDKHTLCOutputInCommitment this_ptr_conv;
34387 this_ptr_conv.inner = untag_ptr(this_ptr);
34388 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34389 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34390 this_ptr_conv.is_owned = false;
34391 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
34392 memcpy(ret_arr->elems, *HTLCOutputInCommitment_get_payment_hash(&this_ptr_conv), 32);
34396 void __attribute__((export_name("TS_HTLCOutputInCommitment_set_payment_hash"))) TS_HTLCOutputInCommitment_set_payment_hash(uint64_t this_ptr, int8_tArray val) {
34397 LDKHTLCOutputInCommitment this_ptr_conv;
34398 this_ptr_conv.inner = untag_ptr(this_ptr);
34399 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34400 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34401 this_ptr_conv.is_owned = false;
34402 LDKThirtyTwoBytes val_ref;
34403 CHECK(val->arr_len == 32);
34404 memcpy(val_ref.data, val->elems, 32); FREE(val);
34405 HTLCOutputInCommitment_set_payment_hash(&this_ptr_conv, val_ref);
34408 uint64_t __attribute__((export_name("TS_HTLCOutputInCommitment_get_transaction_output_index"))) TS_HTLCOutputInCommitment_get_transaction_output_index(uint64_t this_ptr) {
34409 LDKHTLCOutputInCommitment this_ptr_conv;
34410 this_ptr_conv.inner = untag_ptr(this_ptr);
34411 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34412 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34413 this_ptr_conv.is_owned = false;
34414 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
34415 *ret_copy = HTLCOutputInCommitment_get_transaction_output_index(&this_ptr_conv);
34416 uint64_t ret_ref = tag_ptr(ret_copy, true);
34420 void __attribute__((export_name("TS_HTLCOutputInCommitment_set_transaction_output_index"))) TS_HTLCOutputInCommitment_set_transaction_output_index(uint64_t this_ptr, uint64_t val) {
34421 LDKHTLCOutputInCommitment this_ptr_conv;
34422 this_ptr_conv.inner = untag_ptr(this_ptr);
34423 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34424 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34425 this_ptr_conv.is_owned = false;
34426 void* val_ptr = untag_ptr(val);
34427 CHECK_ACCESS(val_ptr);
34428 LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr);
34429 val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val));
34430 HTLCOutputInCommitment_set_transaction_output_index(&this_ptr_conv, val_conv);
34433 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) {
34434 LDKThirtyTwoBytes payment_hash_arg_ref;
34435 CHECK(payment_hash_arg->arr_len == 32);
34436 memcpy(payment_hash_arg_ref.data, payment_hash_arg->elems, 32); FREE(payment_hash_arg);
34437 void* transaction_output_index_arg_ptr = untag_ptr(transaction_output_index_arg);
34438 CHECK_ACCESS(transaction_output_index_arg_ptr);
34439 LDKCOption_u32Z transaction_output_index_arg_conv = *(LDKCOption_u32Z*)(transaction_output_index_arg_ptr);
34440 transaction_output_index_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(transaction_output_index_arg));
34441 LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_new(offered_arg, amount_msat_arg, cltv_expiry_arg, payment_hash_arg_ref, transaction_output_index_arg_conv);
34442 uint64_t ret_ref = 0;
34443 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34444 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34448 static inline uint64_t HTLCOutputInCommitment_clone_ptr(LDKHTLCOutputInCommitment *NONNULL_PTR arg) {
34449 LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_clone(arg);
34450 uint64_t ret_ref = 0;
34451 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34452 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34455 int64_t __attribute__((export_name("TS_HTLCOutputInCommitment_clone_ptr"))) TS_HTLCOutputInCommitment_clone_ptr(uint64_t arg) {
34456 LDKHTLCOutputInCommitment arg_conv;
34457 arg_conv.inner = untag_ptr(arg);
34458 arg_conv.is_owned = ptr_is_owned(arg);
34459 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
34460 arg_conv.is_owned = false;
34461 int64_t ret_conv = HTLCOutputInCommitment_clone_ptr(&arg_conv);
34465 uint64_t __attribute__((export_name("TS_HTLCOutputInCommitment_clone"))) TS_HTLCOutputInCommitment_clone(uint64_t orig) {
34466 LDKHTLCOutputInCommitment orig_conv;
34467 orig_conv.inner = untag_ptr(orig);
34468 orig_conv.is_owned = ptr_is_owned(orig);
34469 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
34470 orig_conv.is_owned = false;
34471 LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_clone(&orig_conv);
34472 uint64_t ret_ref = 0;
34473 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34474 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34478 int8_tArray __attribute__((export_name("TS_HTLCOutputInCommitment_write"))) TS_HTLCOutputInCommitment_write(uint64_t obj) {
34479 LDKHTLCOutputInCommitment obj_conv;
34480 obj_conv.inner = untag_ptr(obj);
34481 obj_conv.is_owned = ptr_is_owned(obj);
34482 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34483 obj_conv.is_owned = false;
34484 LDKCVec_u8Z ret_var = HTLCOutputInCommitment_write(&obj_conv);
34485 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34486 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34487 CVec_u8Z_free(ret_var);
34491 uint64_t __attribute__((export_name("TS_HTLCOutputInCommitment_read"))) TS_HTLCOutputInCommitment_read(int8_tArray ser) {
34492 LDKu8slice ser_ref;
34493 ser_ref.datalen = ser->arr_len;
34494 ser_ref.data = ser->elems;
34495 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
34496 *ret_conv = HTLCOutputInCommitment_read(ser_ref);
34498 return tag_ptr(ret_conv, true);
34501 int8_tArray __attribute__((export_name("TS_get_htlc_redeemscript"))) TS_get_htlc_redeemscript(uint64_t htlc, jboolean opt_anchors, uint64_t keys) {
34502 LDKHTLCOutputInCommitment htlc_conv;
34503 htlc_conv.inner = untag_ptr(htlc);
34504 htlc_conv.is_owned = ptr_is_owned(htlc);
34505 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv);
34506 htlc_conv.is_owned = false;
34507 LDKTxCreationKeys keys_conv;
34508 keys_conv.inner = untag_ptr(keys);
34509 keys_conv.is_owned = ptr_is_owned(keys);
34510 CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv);
34511 keys_conv.is_owned = false;
34512 LDKCVec_u8Z ret_var = get_htlc_redeemscript(&htlc_conv, opt_anchors, &keys_conv);
34513 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34514 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34515 CVec_u8Z_free(ret_var);
34519 int8_tArray __attribute__((export_name("TS_make_funding_redeemscript"))) TS_make_funding_redeemscript(int8_tArray broadcaster, int8_tArray countersignatory) {
34520 LDKPublicKey broadcaster_ref;
34521 CHECK(broadcaster->arr_len == 33);
34522 memcpy(broadcaster_ref.compressed_form, broadcaster->elems, 33); FREE(broadcaster);
34523 LDKPublicKey countersignatory_ref;
34524 CHECK(countersignatory->arr_len == 33);
34525 memcpy(countersignatory_ref.compressed_form, countersignatory->elems, 33); FREE(countersignatory);
34526 LDKCVec_u8Z ret_var = make_funding_redeemscript(broadcaster_ref, countersignatory_ref);
34527 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34528 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34529 CVec_u8Z_free(ret_var);
34533 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) {
34534 unsigned char commitment_txid_arr[32];
34535 CHECK(commitment_txid->arr_len == 32);
34536 memcpy(commitment_txid_arr, commitment_txid->elems, 32); FREE(commitment_txid);
34537 unsigned char (*commitment_txid_ref)[32] = &commitment_txid_arr;
34538 LDKHTLCOutputInCommitment htlc_conv;
34539 htlc_conv.inner = untag_ptr(htlc);
34540 htlc_conv.is_owned = ptr_is_owned(htlc);
34541 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv);
34542 htlc_conv.is_owned = false;
34543 LDKPublicKey broadcaster_delayed_payment_key_ref;
34544 CHECK(broadcaster_delayed_payment_key->arr_len == 33);
34545 memcpy(broadcaster_delayed_payment_key_ref.compressed_form, broadcaster_delayed_payment_key->elems, 33); FREE(broadcaster_delayed_payment_key);
34546 LDKPublicKey revocation_key_ref;
34547 CHECK(revocation_key->arr_len == 33);
34548 memcpy(revocation_key_ref.compressed_form, revocation_key->elems, 33); FREE(revocation_key);
34549 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);
34550 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34551 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34552 Transaction_free(ret_var);
34556 int8_tArray __attribute__((export_name("TS_get_anchor_redeemscript"))) TS_get_anchor_redeemscript(int8_tArray funding_pubkey) {
34557 LDKPublicKey funding_pubkey_ref;
34558 CHECK(funding_pubkey->arr_len == 33);
34559 memcpy(funding_pubkey_ref.compressed_form, funding_pubkey->elems, 33); FREE(funding_pubkey);
34560 LDKCVec_u8Z ret_var = get_anchor_redeemscript(funding_pubkey_ref);
34561 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34562 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34563 CVec_u8Z_free(ret_var);
34567 void __attribute__((export_name("TS_ChannelTransactionParameters_free"))) TS_ChannelTransactionParameters_free(uint64_t this_obj) {
34568 LDKChannelTransactionParameters this_obj_conv;
34569 this_obj_conv.inner = untag_ptr(this_obj);
34570 this_obj_conv.is_owned = ptr_is_owned(this_obj);
34571 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
34572 ChannelTransactionParameters_free(this_obj_conv);
34575 uint64_t __attribute__((export_name("TS_ChannelTransactionParameters_get_holder_pubkeys"))) TS_ChannelTransactionParameters_get_holder_pubkeys(uint64_t this_ptr) {
34576 LDKChannelTransactionParameters this_ptr_conv;
34577 this_ptr_conv.inner = untag_ptr(this_ptr);
34578 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34579 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34580 this_ptr_conv.is_owned = false;
34581 LDKChannelPublicKeys ret_var = ChannelTransactionParameters_get_holder_pubkeys(&this_ptr_conv);
34582 uint64_t ret_ref = 0;
34583 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34584 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34588 void __attribute__((export_name("TS_ChannelTransactionParameters_set_holder_pubkeys"))) TS_ChannelTransactionParameters_set_holder_pubkeys(uint64_t this_ptr, uint64_t val) {
34589 LDKChannelTransactionParameters this_ptr_conv;
34590 this_ptr_conv.inner = untag_ptr(this_ptr);
34591 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34592 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34593 this_ptr_conv.is_owned = false;
34594 LDKChannelPublicKeys val_conv;
34595 val_conv.inner = untag_ptr(val);
34596 val_conv.is_owned = ptr_is_owned(val);
34597 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
34598 val_conv = ChannelPublicKeys_clone(&val_conv);
34599 ChannelTransactionParameters_set_holder_pubkeys(&this_ptr_conv, val_conv);
34602 int16_t __attribute__((export_name("TS_ChannelTransactionParameters_get_holder_selected_contest_delay"))) TS_ChannelTransactionParameters_get_holder_selected_contest_delay(uint64_t this_ptr) {
34603 LDKChannelTransactionParameters this_ptr_conv;
34604 this_ptr_conv.inner = untag_ptr(this_ptr);
34605 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34606 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34607 this_ptr_conv.is_owned = false;
34608 int16_t ret_conv = ChannelTransactionParameters_get_holder_selected_contest_delay(&this_ptr_conv);
34612 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) {
34613 LDKChannelTransactionParameters this_ptr_conv;
34614 this_ptr_conv.inner = untag_ptr(this_ptr);
34615 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34616 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34617 this_ptr_conv.is_owned = false;
34618 ChannelTransactionParameters_set_holder_selected_contest_delay(&this_ptr_conv, val);
34621 jboolean __attribute__((export_name("TS_ChannelTransactionParameters_get_is_outbound_from_holder"))) TS_ChannelTransactionParameters_get_is_outbound_from_holder(uint64_t this_ptr) {
34622 LDKChannelTransactionParameters this_ptr_conv;
34623 this_ptr_conv.inner = untag_ptr(this_ptr);
34624 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34625 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34626 this_ptr_conv.is_owned = false;
34627 jboolean ret_conv = ChannelTransactionParameters_get_is_outbound_from_holder(&this_ptr_conv);
34631 void __attribute__((export_name("TS_ChannelTransactionParameters_set_is_outbound_from_holder"))) TS_ChannelTransactionParameters_set_is_outbound_from_holder(uint64_t this_ptr, jboolean val) {
34632 LDKChannelTransactionParameters this_ptr_conv;
34633 this_ptr_conv.inner = untag_ptr(this_ptr);
34634 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34635 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34636 this_ptr_conv.is_owned = false;
34637 ChannelTransactionParameters_set_is_outbound_from_holder(&this_ptr_conv, val);
34640 uint64_t __attribute__((export_name("TS_ChannelTransactionParameters_get_counterparty_parameters"))) TS_ChannelTransactionParameters_get_counterparty_parameters(uint64_t this_ptr) {
34641 LDKChannelTransactionParameters this_ptr_conv;
34642 this_ptr_conv.inner = untag_ptr(this_ptr);
34643 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34644 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34645 this_ptr_conv.is_owned = false;
34646 LDKCounterpartyChannelTransactionParameters ret_var = ChannelTransactionParameters_get_counterparty_parameters(&this_ptr_conv);
34647 uint64_t ret_ref = 0;
34648 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34649 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34653 void __attribute__((export_name("TS_ChannelTransactionParameters_set_counterparty_parameters"))) TS_ChannelTransactionParameters_set_counterparty_parameters(uint64_t this_ptr, uint64_t val) {
34654 LDKChannelTransactionParameters this_ptr_conv;
34655 this_ptr_conv.inner = untag_ptr(this_ptr);
34656 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34657 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34658 this_ptr_conv.is_owned = false;
34659 LDKCounterpartyChannelTransactionParameters val_conv;
34660 val_conv.inner = untag_ptr(val);
34661 val_conv.is_owned = ptr_is_owned(val);
34662 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
34663 val_conv = CounterpartyChannelTransactionParameters_clone(&val_conv);
34664 ChannelTransactionParameters_set_counterparty_parameters(&this_ptr_conv, val_conv);
34667 uint64_t __attribute__((export_name("TS_ChannelTransactionParameters_get_funding_outpoint"))) TS_ChannelTransactionParameters_get_funding_outpoint(uint64_t this_ptr) {
34668 LDKChannelTransactionParameters this_ptr_conv;
34669 this_ptr_conv.inner = untag_ptr(this_ptr);
34670 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34671 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34672 this_ptr_conv.is_owned = false;
34673 LDKOutPoint ret_var = ChannelTransactionParameters_get_funding_outpoint(&this_ptr_conv);
34674 uint64_t ret_ref = 0;
34675 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34676 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34680 void __attribute__((export_name("TS_ChannelTransactionParameters_set_funding_outpoint"))) TS_ChannelTransactionParameters_set_funding_outpoint(uint64_t this_ptr, uint64_t val) {
34681 LDKChannelTransactionParameters this_ptr_conv;
34682 this_ptr_conv.inner = untag_ptr(this_ptr);
34683 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34684 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34685 this_ptr_conv.is_owned = false;
34686 LDKOutPoint val_conv;
34687 val_conv.inner = untag_ptr(val);
34688 val_conv.is_owned = ptr_is_owned(val);
34689 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
34690 val_conv = OutPoint_clone(&val_conv);
34691 ChannelTransactionParameters_set_funding_outpoint(&this_ptr_conv, val_conv);
34694 uint32_t __attribute__((export_name("TS_ChannelTransactionParameters_get_opt_anchors"))) TS_ChannelTransactionParameters_get_opt_anchors(uint64_t this_ptr) {
34695 LDKChannelTransactionParameters this_ptr_conv;
34696 this_ptr_conv.inner = untag_ptr(this_ptr);
34697 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34698 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34699 this_ptr_conv.is_owned = false;
34700 uint32_t ret_conv = LDKCOption_NoneZ_to_js(ChannelTransactionParameters_get_opt_anchors(&this_ptr_conv));
34704 void __attribute__((export_name("TS_ChannelTransactionParameters_set_opt_anchors"))) TS_ChannelTransactionParameters_set_opt_anchors(uint64_t this_ptr, uint32_t val) {
34705 LDKChannelTransactionParameters this_ptr_conv;
34706 this_ptr_conv.inner = untag_ptr(this_ptr);
34707 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34708 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34709 this_ptr_conv.is_owned = false;
34710 LDKCOption_NoneZ val_conv = LDKCOption_NoneZ_from_js(val);
34711 ChannelTransactionParameters_set_opt_anchors(&this_ptr_conv, val_conv);
34714 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) {
34715 LDKChannelPublicKeys holder_pubkeys_arg_conv;
34716 holder_pubkeys_arg_conv.inner = untag_ptr(holder_pubkeys_arg);
34717 holder_pubkeys_arg_conv.is_owned = ptr_is_owned(holder_pubkeys_arg);
34718 CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_pubkeys_arg_conv);
34719 holder_pubkeys_arg_conv = ChannelPublicKeys_clone(&holder_pubkeys_arg_conv);
34720 LDKCounterpartyChannelTransactionParameters counterparty_parameters_arg_conv;
34721 counterparty_parameters_arg_conv.inner = untag_ptr(counterparty_parameters_arg);
34722 counterparty_parameters_arg_conv.is_owned = ptr_is_owned(counterparty_parameters_arg);
34723 CHECK_INNER_FIELD_ACCESS_OR_NULL(counterparty_parameters_arg_conv);
34724 counterparty_parameters_arg_conv = CounterpartyChannelTransactionParameters_clone(&counterparty_parameters_arg_conv);
34725 LDKOutPoint funding_outpoint_arg_conv;
34726 funding_outpoint_arg_conv.inner = untag_ptr(funding_outpoint_arg);
34727 funding_outpoint_arg_conv.is_owned = ptr_is_owned(funding_outpoint_arg);
34728 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_arg_conv);
34729 funding_outpoint_arg_conv = OutPoint_clone(&funding_outpoint_arg_conv);
34730 LDKCOption_NoneZ opt_anchors_arg_conv = LDKCOption_NoneZ_from_js(opt_anchors_arg);
34731 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);
34732 uint64_t ret_ref = 0;
34733 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34734 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34738 static inline uint64_t ChannelTransactionParameters_clone_ptr(LDKChannelTransactionParameters *NONNULL_PTR arg) {
34739 LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_clone(arg);
34740 uint64_t ret_ref = 0;
34741 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34742 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34745 int64_t __attribute__((export_name("TS_ChannelTransactionParameters_clone_ptr"))) TS_ChannelTransactionParameters_clone_ptr(uint64_t arg) {
34746 LDKChannelTransactionParameters arg_conv;
34747 arg_conv.inner = untag_ptr(arg);
34748 arg_conv.is_owned = ptr_is_owned(arg);
34749 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
34750 arg_conv.is_owned = false;
34751 int64_t ret_conv = ChannelTransactionParameters_clone_ptr(&arg_conv);
34755 uint64_t __attribute__((export_name("TS_ChannelTransactionParameters_clone"))) TS_ChannelTransactionParameters_clone(uint64_t orig) {
34756 LDKChannelTransactionParameters orig_conv;
34757 orig_conv.inner = untag_ptr(orig);
34758 orig_conv.is_owned = ptr_is_owned(orig);
34759 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
34760 orig_conv.is_owned = false;
34761 LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_clone(&orig_conv);
34762 uint64_t ret_ref = 0;
34763 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34764 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34768 void __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_free"))) TS_CounterpartyChannelTransactionParameters_free(uint64_t this_obj) {
34769 LDKCounterpartyChannelTransactionParameters this_obj_conv;
34770 this_obj_conv.inner = untag_ptr(this_obj);
34771 this_obj_conv.is_owned = ptr_is_owned(this_obj);
34772 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
34773 CounterpartyChannelTransactionParameters_free(this_obj_conv);
34776 uint64_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_get_pubkeys"))) TS_CounterpartyChannelTransactionParameters_get_pubkeys(uint64_t this_ptr) {
34777 LDKCounterpartyChannelTransactionParameters this_ptr_conv;
34778 this_ptr_conv.inner = untag_ptr(this_ptr);
34779 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34780 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34781 this_ptr_conv.is_owned = false;
34782 LDKChannelPublicKeys ret_var = CounterpartyChannelTransactionParameters_get_pubkeys(&this_ptr_conv);
34783 uint64_t ret_ref = 0;
34784 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34785 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34789 void __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_set_pubkeys"))) TS_CounterpartyChannelTransactionParameters_set_pubkeys(uint64_t this_ptr, uint64_t val) {
34790 LDKCounterpartyChannelTransactionParameters this_ptr_conv;
34791 this_ptr_conv.inner = untag_ptr(this_ptr);
34792 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34793 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34794 this_ptr_conv.is_owned = false;
34795 LDKChannelPublicKeys val_conv;
34796 val_conv.inner = untag_ptr(val);
34797 val_conv.is_owned = ptr_is_owned(val);
34798 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
34799 val_conv = ChannelPublicKeys_clone(&val_conv);
34800 CounterpartyChannelTransactionParameters_set_pubkeys(&this_ptr_conv, val_conv);
34803 int16_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_get_selected_contest_delay"))) TS_CounterpartyChannelTransactionParameters_get_selected_contest_delay(uint64_t this_ptr) {
34804 LDKCounterpartyChannelTransactionParameters this_ptr_conv;
34805 this_ptr_conv.inner = untag_ptr(this_ptr);
34806 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34807 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34808 this_ptr_conv.is_owned = false;
34809 int16_t ret_conv = CounterpartyChannelTransactionParameters_get_selected_contest_delay(&this_ptr_conv);
34813 void __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_set_selected_contest_delay"))) TS_CounterpartyChannelTransactionParameters_set_selected_contest_delay(uint64_t this_ptr, int16_t val) {
34814 LDKCounterpartyChannelTransactionParameters this_ptr_conv;
34815 this_ptr_conv.inner = untag_ptr(this_ptr);
34816 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34817 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34818 this_ptr_conv.is_owned = false;
34819 CounterpartyChannelTransactionParameters_set_selected_contest_delay(&this_ptr_conv, val);
34822 uint64_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_new"))) TS_CounterpartyChannelTransactionParameters_new(uint64_t pubkeys_arg, int16_t selected_contest_delay_arg) {
34823 LDKChannelPublicKeys pubkeys_arg_conv;
34824 pubkeys_arg_conv.inner = untag_ptr(pubkeys_arg);
34825 pubkeys_arg_conv.is_owned = ptr_is_owned(pubkeys_arg);
34826 CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_arg_conv);
34827 pubkeys_arg_conv = ChannelPublicKeys_clone(&pubkeys_arg_conv);
34828 LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_new(pubkeys_arg_conv, selected_contest_delay_arg);
34829 uint64_t ret_ref = 0;
34830 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34831 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34835 static inline uint64_t CounterpartyChannelTransactionParameters_clone_ptr(LDKCounterpartyChannelTransactionParameters *NONNULL_PTR arg) {
34836 LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_clone(arg);
34837 uint64_t ret_ref = 0;
34838 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34839 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34842 int64_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_clone_ptr"))) TS_CounterpartyChannelTransactionParameters_clone_ptr(uint64_t arg) {
34843 LDKCounterpartyChannelTransactionParameters arg_conv;
34844 arg_conv.inner = untag_ptr(arg);
34845 arg_conv.is_owned = ptr_is_owned(arg);
34846 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
34847 arg_conv.is_owned = false;
34848 int64_t ret_conv = CounterpartyChannelTransactionParameters_clone_ptr(&arg_conv);
34852 uint64_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_clone"))) TS_CounterpartyChannelTransactionParameters_clone(uint64_t orig) {
34853 LDKCounterpartyChannelTransactionParameters orig_conv;
34854 orig_conv.inner = untag_ptr(orig);
34855 orig_conv.is_owned = ptr_is_owned(orig);
34856 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
34857 orig_conv.is_owned = false;
34858 LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_clone(&orig_conv);
34859 uint64_t ret_ref = 0;
34860 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34861 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34865 jboolean __attribute__((export_name("TS_ChannelTransactionParameters_is_populated"))) TS_ChannelTransactionParameters_is_populated(uint64_t this_arg) {
34866 LDKChannelTransactionParameters this_arg_conv;
34867 this_arg_conv.inner = untag_ptr(this_arg);
34868 this_arg_conv.is_owned = ptr_is_owned(this_arg);
34869 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
34870 this_arg_conv.is_owned = false;
34871 jboolean ret_conv = ChannelTransactionParameters_is_populated(&this_arg_conv);
34875 uint64_t __attribute__((export_name("TS_ChannelTransactionParameters_as_holder_broadcastable"))) TS_ChannelTransactionParameters_as_holder_broadcastable(uint64_t this_arg) {
34876 LDKChannelTransactionParameters this_arg_conv;
34877 this_arg_conv.inner = untag_ptr(this_arg);
34878 this_arg_conv.is_owned = ptr_is_owned(this_arg);
34879 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
34880 this_arg_conv.is_owned = false;
34881 LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_holder_broadcastable(&this_arg_conv);
34882 uint64_t ret_ref = 0;
34883 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34884 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34888 uint64_t __attribute__((export_name("TS_ChannelTransactionParameters_as_counterparty_broadcastable"))) TS_ChannelTransactionParameters_as_counterparty_broadcastable(uint64_t this_arg) {
34889 LDKChannelTransactionParameters this_arg_conv;
34890 this_arg_conv.inner = untag_ptr(this_arg);
34891 this_arg_conv.is_owned = ptr_is_owned(this_arg);
34892 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
34893 this_arg_conv.is_owned = false;
34894 LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_counterparty_broadcastable(&this_arg_conv);
34895 uint64_t ret_ref = 0;
34896 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34897 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34901 int8_tArray __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_write"))) TS_CounterpartyChannelTransactionParameters_write(uint64_t obj) {
34902 LDKCounterpartyChannelTransactionParameters obj_conv;
34903 obj_conv.inner = untag_ptr(obj);
34904 obj_conv.is_owned = ptr_is_owned(obj);
34905 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34906 obj_conv.is_owned = false;
34907 LDKCVec_u8Z ret_var = CounterpartyChannelTransactionParameters_write(&obj_conv);
34908 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34909 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34910 CVec_u8Z_free(ret_var);
34914 uint64_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_read"))) TS_CounterpartyChannelTransactionParameters_read(int8_tArray ser) {
34915 LDKu8slice ser_ref;
34916 ser_ref.datalen = ser->arr_len;
34917 ser_ref.data = ser->elems;
34918 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
34919 *ret_conv = CounterpartyChannelTransactionParameters_read(ser_ref);
34921 return tag_ptr(ret_conv, true);
34924 int8_tArray __attribute__((export_name("TS_ChannelTransactionParameters_write"))) TS_ChannelTransactionParameters_write(uint64_t obj) {
34925 LDKChannelTransactionParameters obj_conv;
34926 obj_conv.inner = untag_ptr(obj);
34927 obj_conv.is_owned = ptr_is_owned(obj);
34928 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34929 obj_conv.is_owned = false;
34930 LDKCVec_u8Z ret_var = ChannelTransactionParameters_write(&obj_conv);
34931 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34932 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34933 CVec_u8Z_free(ret_var);
34937 uint64_t __attribute__((export_name("TS_ChannelTransactionParameters_read"))) TS_ChannelTransactionParameters_read(int8_tArray ser) {
34938 LDKu8slice ser_ref;
34939 ser_ref.datalen = ser->arr_len;
34940 ser_ref.data = ser->elems;
34941 LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
34942 *ret_conv = ChannelTransactionParameters_read(ser_ref);
34944 return tag_ptr(ret_conv, true);
34947 void __attribute__((export_name("TS_DirectedChannelTransactionParameters_free"))) TS_DirectedChannelTransactionParameters_free(uint64_t this_obj) {
34948 LDKDirectedChannelTransactionParameters this_obj_conv;
34949 this_obj_conv.inner = untag_ptr(this_obj);
34950 this_obj_conv.is_owned = ptr_is_owned(this_obj);
34951 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
34952 DirectedChannelTransactionParameters_free(this_obj_conv);
34955 uint64_t __attribute__((export_name("TS_DirectedChannelTransactionParameters_broadcaster_pubkeys"))) TS_DirectedChannelTransactionParameters_broadcaster_pubkeys(uint64_t this_arg) {
34956 LDKDirectedChannelTransactionParameters this_arg_conv;
34957 this_arg_conv.inner = untag_ptr(this_arg);
34958 this_arg_conv.is_owned = ptr_is_owned(this_arg);
34959 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
34960 this_arg_conv.is_owned = false;
34961 LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_broadcaster_pubkeys(&this_arg_conv);
34962 uint64_t ret_ref = 0;
34963 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34964 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34968 uint64_t __attribute__((export_name("TS_DirectedChannelTransactionParameters_countersignatory_pubkeys"))) TS_DirectedChannelTransactionParameters_countersignatory_pubkeys(uint64_t this_arg) {
34969 LDKDirectedChannelTransactionParameters this_arg_conv;
34970 this_arg_conv.inner = untag_ptr(this_arg);
34971 this_arg_conv.is_owned = ptr_is_owned(this_arg);
34972 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
34973 this_arg_conv.is_owned = false;
34974 LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_countersignatory_pubkeys(&this_arg_conv);
34975 uint64_t ret_ref = 0;
34976 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34977 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34981 int16_t __attribute__((export_name("TS_DirectedChannelTransactionParameters_contest_delay"))) TS_DirectedChannelTransactionParameters_contest_delay(uint64_t this_arg) {
34982 LDKDirectedChannelTransactionParameters this_arg_conv;
34983 this_arg_conv.inner = untag_ptr(this_arg);
34984 this_arg_conv.is_owned = ptr_is_owned(this_arg);
34985 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
34986 this_arg_conv.is_owned = false;
34987 int16_t ret_conv = DirectedChannelTransactionParameters_contest_delay(&this_arg_conv);
34991 jboolean __attribute__((export_name("TS_DirectedChannelTransactionParameters_is_outbound"))) TS_DirectedChannelTransactionParameters_is_outbound(uint64_t this_arg) {
34992 LDKDirectedChannelTransactionParameters this_arg_conv;
34993 this_arg_conv.inner = untag_ptr(this_arg);
34994 this_arg_conv.is_owned = ptr_is_owned(this_arg);
34995 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
34996 this_arg_conv.is_owned = false;
34997 jboolean ret_conv = DirectedChannelTransactionParameters_is_outbound(&this_arg_conv);
35001 uint64_t __attribute__((export_name("TS_DirectedChannelTransactionParameters_funding_outpoint"))) TS_DirectedChannelTransactionParameters_funding_outpoint(uint64_t this_arg) {
35002 LDKDirectedChannelTransactionParameters this_arg_conv;
35003 this_arg_conv.inner = untag_ptr(this_arg);
35004 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35005 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35006 this_arg_conv.is_owned = false;
35007 LDKOutPoint ret_var = DirectedChannelTransactionParameters_funding_outpoint(&this_arg_conv);
35008 uint64_t ret_ref = 0;
35009 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35010 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35014 jboolean __attribute__((export_name("TS_DirectedChannelTransactionParameters_opt_anchors"))) TS_DirectedChannelTransactionParameters_opt_anchors(uint64_t this_arg) {
35015 LDKDirectedChannelTransactionParameters this_arg_conv;
35016 this_arg_conv.inner = untag_ptr(this_arg);
35017 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35018 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35019 this_arg_conv.is_owned = false;
35020 jboolean ret_conv = DirectedChannelTransactionParameters_opt_anchors(&this_arg_conv);
35024 void __attribute__((export_name("TS_HolderCommitmentTransaction_free"))) TS_HolderCommitmentTransaction_free(uint64_t this_obj) {
35025 LDKHolderCommitmentTransaction this_obj_conv;
35026 this_obj_conv.inner = untag_ptr(this_obj);
35027 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35028 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35029 HolderCommitmentTransaction_free(this_obj_conv);
35032 int8_tArray __attribute__((export_name("TS_HolderCommitmentTransaction_get_counterparty_sig"))) TS_HolderCommitmentTransaction_get_counterparty_sig(uint64_t this_ptr) {
35033 LDKHolderCommitmentTransaction this_ptr_conv;
35034 this_ptr_conv.inner = untag_ptr(this_ptr);
35035 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35036 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35037 this_ptr_conv.is_owned = false;
35038 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
35039 memcpy(ret_arr->elems, HolderCommitmentTransaction_get_counterparty_sig(&this_ptr_conv).compact_form, 64);
35043 void __attribute__((export_name("TS_HolderCommitmentTransaction_set_counterparty_sig"))) TS_HolderCommitmentTransaction_set_counterparty_sig(uint64_t this_ptr, int8_tArray val) {
35044 LDKHolderCommitmentTransaction this_ptr_conv;
35045 this_ptr_conv.inner = untag_ptr(this_ptr);
35046 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35047 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35048 this_ptr_conv.is_owned = false;
35049 LDKSignature val_ref;
35050 CHECK(val->arr_len == 64);
35051 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
35052 HolderCommitmentTransaction_set_counterparty_sig(&this_ptr_conv, val_ref);
35055 ptrArray __attribute__((export_name("TS_HolderCommitmentTransaction_get_counterparty_htlc_sigs"))) TS_HolderCommitmentTransaction_get_counterparty_htlc_sigs(uint64_t this_ptr) {
35056 LDKHolderCommitmentTransaction this_ptr_conv;
35057 this_ptr_conv.inner = untag_ptr(this_ptr);
35058 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35059 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35060 this_ptr_conv.is_owned = false;
35061 LDKCVec_SignatureZ ret_var = HolderCommitmentTransaction_get_counterparty_htlc_sigs(&this_ptr_conv);
35062 ptrArray ret_arr = NULL;
35063 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
35064 int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8);
35065 for (size_t m = 0; m < ret_var.datalen; m++) {
35066 int8_tArray ret_conv_12_arr = init_int8_tArray(64, __LINE__);
35067 memcpy(ret_conv_12_arr->elems, ret_var.data[m].compact_form, 64);
35068 ret_arr_ptr[m] = ret_conv_12_arr;
35071 FREE(ret_var.data);
35075 void __attribute__((export_name("TS_HolderCommitmentTransaction_set_counterparty_htlc_sigs"))) TS_HolderCommitmentTransaction_set_counterparty_htlc_sigs(uint64_t this_ptr, ptrArray val) {
35076 LDKHolderCommitmentTransaction this_ptr_conv;
35077 this_ptr_conv.inner = untag_ptr(this_ptr);
35078 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35079 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35080 this_ptr_conv.is_owned = false;
35081 LDKCVec_SignatureZ val_constr;
35082 val_constr.datalen = val->arr_len;
35083 if (val_constr.datalen > 0)
35084 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
35086 val_constr.data = NULL;
35087 int8_tArray* val_vals = (void*) val->elems;
35088 for (size_t m = 0; m < val_constr.datalen; m++) {
35089 int8_tArray val_conv_12 = val_vals[m];
35090 LDKSignature val_conv_12_ref;
35091 CHECK(val_conv_12->arr_len == 64);
35092 memcpy(val_conv_12_ref.compact_form, val_conv_12->elems, 64); FREE(val_conv_12);
35093 val_constr.data[m] = val_conv_12_ref;
35096 HolderCommitmentTransaction_set_counterparty_htlc_sigs(&this_ptr_conv, val_constr);
35099 static inline uint64_t HolderCommitmentTransaction_clone_ptr(LDKHolderCommitmentTransaction *NONNULL_PTR arg) {
35100 LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_clone(arg);
35101 uint64_t ret_ref = 0;
35102 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35103 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35106 int64_t __attribute__((export_name("TS_HolderCommitmentTransaction_clone_ptr"))) TS_HolderCommitmentTransaction_clone_ptr(uint64_t arg) {
35107 LDKHolderCommitmentTransaction arg_conv;
35108 arg_conv.inner = untag_ptr(arg);
35109 arg_conv.is_owned = ptr_is_owned(arg);
35110 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35111 arg_conv.is_owned = false;
35112 int64_t ret_conv = HolderCommitmentTransaction_clone_ptr(&arg_conv);
35116 uint64_t __attribute__((export_name("TS_HolderCommitmentTransaction_clone"))) TS_HolderCommitmentTransaction_clone(uint64_t orig) {
35117 LDKHolderCommitmentTransaction orig_conv;
35118 orig_conv.inner = untag_ptr(orig);
35119 orig_conv.is_owned = ptr_is_owned(orig);
35120 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35121 orig_conv.is_owned = false;
35122 LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_clone(&orig_conv);
35123 uint64_t ret_ref = 0;
35124 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35125 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35129 int8_tArray __attribute__((export_name("TS_HolderCommitmentTransaction_write"))) TS_HolderCommitmentTransaction_write(uint64_t obj) {
35130 LDKHolderCommitmentTransaction obj_conv;
35131 obj_conv.inner = untag_ptr(obj);
35132 obj_conv.is_owned = ptr_is_owned(obj);
35133 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
35134 obj_conv.is_owned = false;
35135 LDKCVec_u8Z ret_var = HolderCommitmentTransaction_write(&obj_conv);
35136 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35137 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35138 CVec_u8Z_free(ret_var);
35142 uint64_t __attribute__((export_name("TS_HolderCommitmentTransaction_read"))) TS_HolderCommitmentTransaction_read(int8_tArray ser) {
35143 LDKu8slice ser_ref;
35144 ser_ref.datalen = ser->arr_len;
35145 ser_ref.data = ser->elems;
35146 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
35147 *ret_conv = HolderCommitmentTransaction_read(ser_ref);
35149 return tag_ptr(ret_conv, true);
35152 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) {
35153 LDKCommitmentTransaction commitment_tx_conv;
35154 commitment_tx_conv.inner = untag_ptr(commitment_tx);
35155 commitment_tx_conv.is_owned = ptr_is_owned(commitment_tx);
35156 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv);
35157 commitment_tx_conv = CommitmentTransaction_clone(&commitment_tx_conv);
35158 LDKSignature counterparty_sig_ref;
35159 CHECK(counterparty_sig->arr_len == 64);
35160 memcpy(counterparty_sig_ref.compact_form, counterparty_sig->elems, 64); FREE(counterparty_sig);
35161 LDKCVec_SignatureZ counterparty_htlc_sigs_constr;
35162 counterparty_htlc_sigs_constr.datalen = counterparty_htlc_sigs->arr_len;
35163 if (counterparty_htlc_sigs_constr.datalen > 0)
35164 counterparty_htlc_sigs_constr.data = MALLOC(counterparty_htlc_sigs_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
35166 counterparty_htlc_sigs_constr.data = NULL;
35167 int8_tArray* counterparty_htlc_sigs_vals = (void*) counterparty_htlc_sigs->elems;
35168 for (size_t m = 0; m < counterparty_htlc_sigs_constr.datalen; m++) {
35169 int8_tArray counterparty_htlc_sigs_conv_12 = counterparty_htlc_sigs_vals[m];
35170 LDKSignature counterparty_htlc_sigs_conv_12_ref;
35171 CHECK(counterparty_htlc_sigs_conv_12->arr_len == 64);
35172 memcpy(counterparty_htlc_sigs_conv_12_ref.compact_form, counterparty_htlc_sigs_conv_12->elems, 64); FREE(counterparty_htlc_sigs_conv_12);
35173 counterparty_htlc_sigs_constr.data[m] = counterparty_htlc_sigs_conv_12_ref;
35175 FREE(counterparty_htlc_sigs);
35176 LDKPublicKey holder_funding_key_ref;
35177 CHECK(holder_funding_key->arr_len == 33);
35178 memcpy(holder_funding_key_ref.compressed_form, holder_funding_key->elems, 33); FREE(holder_funding_key);
35179 LDKPublicKey counterparty_funding_key_ref;
35180 CHECK(counterparty_funding_key->arr_len == 33);
35181 memcpy(counterparty_funding_key_ref.compressed_form, counterparty_funding_key->elems, 33); FREE(counterparty_funding_key);
35182 LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_new(commitment_tx_conv, counterparty_sig_ref, counterparty_htlc_sigs_constr, holder_funding_key_ref, counterparty_funding_key_ref);
35183 uint64_t ret_ref = 0;
35184 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35185 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35189 void __attribute__((export_name("TS_BuiltCommitmentTransaction_free"))) TS_BuiltCommitmentTransaction_free(uint64_t this_obj) {
35190 LDKBuiltCommitmentTransaction this_obj_conv;
35191 this_obj_conv.inner = untag_ptr(this_obj);
35192 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35193 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35194 BuiltCommitmentTransaction_free(this_obj_conv);
35197 int8_tArray __attribute__((export_name("TS_BuiltCommitmentTransaction_get_transaction"))) TS_BuiltCommitmentTransaction_get_transaction(uint64_t this_ptr) {
35198 LDKBuiltCommitmentTransaction this_ptr_conv;
35199 this_ptr_conv.inner = untag_ptr(this_ptr);
35200 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35201 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35202 this_ptr_conv.is_owned = false;
35203 LDKTransaction ret_var = BuiltCommitmentTransaction_get_transaction(&this_ptr_conv);
35204 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35205 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35206 Transaction_free(ret_var);
35210 void __attribute__((export_name("TS_BuiltCommitmentTransaction_set_transaction"))) TS_BuiltCommitmentTransaction_set_transaction(uint64_t this_ptr, int8_tArray val) {
35211 LDKBuiltCommitmentTransaction this_ptr_conv;
35212 this_ptr_conv.inner = untag_ptr(this_ptr);
35213 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35214 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35215 this_ptr_conv.is_owned = false;
35216 LDKTransaction val_ref;
35217 val_ref.datalen = val->arr_len;
35218 val_ref.data = MALLOC(val_ref.datalen, "LDKTransaction Bytes");
35219 memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val);
35220 val_ref.data_is_owned = true;
35221 BuiltCommitmentTransaction_set_transaction(&this_ptr_conv, val_ref);
35224 int8_tArray __attribute__((export_name("TS_BuiltCommitmentTransaction_get_txid"))) TS_BuiltCommitmentTransaction_get_txid(uint64_t this_ptr) {
35225 LDKBuiltCommitmentTransaction this_ptr_conv;
35226 this_ptr_conv.inner = untag_ptr(this_ptr);
35227 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35228 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35229 this_ptr_conv.is_owned = false;
35230 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
35231 memcpy(ret_arr->elems, *BuiltCommitmentTransaction_get_txid(&this_ptr_conv), 32);
35235 void __attribute__((export_name("TS_BuiltCommitmentTransaction_set_txid"))) TS_BuiltCommitmentTransaction_set_txid(uint64_t this_ptr, int8_tArray val) {
35236 LDKBuiltCommitmentTransaction this_ptr_conv;
35237 this_ptr_conv.inner = untag_ptr(this_ptr);
35238 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35239 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35240 this_ptr_conv.is_owned = false;
35241 LDKThirtyTwoBytes val_ref;
35242 CHECK(val->arr_len == 32);
35243 memcpy(val_ref.data, val->elems, 32); FREE(val);
35244 BuiltCommitmentTransaction_set_txid(&this_ptr_conv, val_ref);
35247 uint64_t __attribute__((export_name("TS_BuiltCommitmentTransaction_new"))) TS_BuiltCommitmentTransaction_new(int8_tArray transaction_arg, int8_tArray txid_arg) {
35248 LDKTransaction transaction_arg_ref;
35249 transaction_arg_ref.datalen = transaction_arg->arr_len;
35250 transaction_arg_ref.data = MALLOC(transaction_arg_ref.datalen, "LDKTransaction Bytes");
35251 memcpy(transaction_arg_ref.data, transaction_arg->elems, transaction_arg_ref.datalen); FREE(transaction_arg);
35252 transaction_arg_ref.data_is_owned = true;
35253 LDKThirtyTwoBytes txid_arg_ref;
35254 CHECK(txid_arg->arr_len == 32);
35255 memcpy(txid_arg_ref.data, txid_arg->elems, 32); FREE(txid_arg);
35256 LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_new(transaction_arg_ref, txid_arg_ref);
35257 uint64_t ret_ref = 0;
35258 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35259 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35263 static inline uint64_t BuiltCommitmentTransaction_clone_ptr(LDKBuiltCommitmentTransaction *NONNULL_PTR arg) {
35264 LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_clone(arg);
35265 uint64_t ret_ref = 0;
35266 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35267 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35270 int64_t __attribute__((export_name("TS_BuiltCommitmentTransaction_clone_ptr"))) TS_BuiltCommitmentTransaction_clone_ptr(uint64_t arg) {
35271 LDKBuiltCommitmentTransaction arg_conv;
35272 arg_conv.inner = untag_ptr(arg);
35273 arg_conv.is_owned = ptr_is_owned(arg);
35274 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35275 arg_conv.is_owned = false;
35276 int64_t ret_conv = BuiltCommitmentTransaction_clone_ptr(&arg_conv);
35280 uint64_t __attribute__((export_name("TS_BuiltCommitmentTransaction_clone"))) TS_BuiltCommitmentTransaction_clone(uint64_t orig) {
35281 LDKBuiltCommitmentTransaction orig_conv;
35282 orig_conv.inner = untag_ptr(orig);
35283 orig_conv.is_owned = ptr_is_owned(orig);
35284 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35285 orig_conv.is_owned = false;
35286 LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_clone(&orig_conv);
35287 uint64_t ret_ref = 0;
35288 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35289 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35293 int8_tArray __attribute__((export_name("TS_BuiltCommitmentTransaction_write"))) TS_BuiltCommitmentTransaction_write(uint64_t obj) {
35294 LDKBuiltCommitmentTransaction obj_conv;
35295 obj_conv.inner = untag_ptr(obj);
35296 obj_conv.is_owned = ptr_is_owned(obj);
35297 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
35298 obj_conv.is_owned = false;
35299 LDKCVec_u8Z ret_var = BuiltCommitmentTransaction_write(&obj_conv);
35300 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35301 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35302 CVec_u8Z_free(ret_var);
35306 uint64_t __attribute__((export_name("TS_BuiltCommitmentTransaction_read"))) TS_BuiltCommitmentTransaction_read(int8_tArray ser) {
35307 LDKu8slice ser_ref;
35308 ser_ref.datalen = ser->arr_len;
35309 ser_ref.data = ser->elems;
35310 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
35311 *ret_conv = BuiltCommitmentTransaction_read(ser_ref);
35313 return tag_ptr(ret_conv, true);
35316 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) {
35317 LDKBuiltCommitmentTransaction this_arg_conv;
35318 this_arg_conv.inner = untag_ptr(this_arg);
35319 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35320 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35321 this_arg_conv.is_owned = false;
35322 LDKu8slice funding_redeemscript_ref;
35323 funding_redeemscript_ref.datalen = funding_redeemscript->arr_len;
35324 funding_redeemscript_ref.data = funding_redeemscript->elems;
35325 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
35326 memcpy(ret_arr->elems, BuiltCommitmentTransaction_get_sighash_all(&this_arg_conv, funding_redeemscript_ref, channel_value_satoshis).data, 32);
35327 FREE(funding_redeemscript);
35331 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) {
35332 LDKBuiltCommitmentTransaction this_arg_conv;
35333 this_arg_conv.inner = untag_ptr(this_arg);
35334 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35335 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35336 this_arg_conv.is_owned = false;
35337 unsigned char funding_key_arr[32];
35338 CHECK(funding_key->arr_len == 32);
35339 memcpy(funding_key_arr, funding_key->elems, 32); FREE(funding_key);
35340 unsigned char (*funding_key_ref)[32] = &funding_key_arr;
35341 LDKu8slice funding_redeemscript_ref;
35342 funding_redeemscript_ref.datalen = funding_redeemscript->arr_len;
35343 funding_redeemscript_ref.data = funding_redeemscript->elems;
35344 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
35345 memcpy(ret_arr->elems, BuiltCommitmentTransaction_sign(&this_arg_conv, funding_key_ref, funding_redeemscript_ref, channel_value_satoshis).compact_form, 64);
35346 FREE(funding_redeemscript);
35350 void __attribute__((export_name("TS_ClosingTransaction_free"))) TS_ClosingTransaction_free(uint64_t this_obj) {
35351 LDKClosingTransaction this_obj_conv;
35352 this_obj_conv.inner = untag_ptr(this_obj);
35353 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35354 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35355 ClosingTransaction_free(this_obj_conv);
35358 static inline uint64_t ClosingTransaction_clone_ptr(LDKClosingTransaction *NONNULL_PTR arg) {
35359 LDKClosingTransaction ret_var = ClosingTransaction_clone(arg);
35360 uint64_t ret_ref = 0;
35361 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35362 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35365 int64_t __attribute__((export_name("TS_ClosingTransaction_clone_ptr"))) TS_ClosingTransaction_clone_ptr(uint64_t arg) {
35366 LDKClosingTransaction arg_conv;
35367 arg_conv.inner = untag_ptr(arg);
35368 arg_conv.is_owned = ptr_is_owned(arg);
35369 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35370 arg_conv.is_owned = false;
35371 int64_t ret_conv = ClosingTransaction_clone_ptr(&arg_conv);
35375 uint64_t __attribute__((export_name("TS_ClosingTransaction_clone"))) TS_ClosingTransaction_clone(uint64_t orig) {
35376 LDKClosingTransaction orig_conv;
35377 orig_conv.inner = untag_ptr(orig);
35378 orig_conv.is_owned = ptr_is_owned(orig);
35379 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35380 orig_conv.is_owned = false;
35381 LDKClosingTransaction ret_var = ClosingTransaction_clone(&orig_conv);
35382 uint64_t ret_ref = 0;
35383 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35384 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35388 int64_t __attribute__((export_name("TS_ClosingTransaction_hash"))) TS_ClosingTransaction_hash(uint64_t o) {
35389 LDKClosingTransaction o_conv;
35390 o_conv.inner = untag_ptr(o);
35391 o_conv.is_owned = ptr_is_owned(o);
35392 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
35393 o_conv.is_owned = false;
35394 int64_t ret_conv = ClosingTransaction_hash(&o_conv);
35398 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) {
35399 LDKCVec_u8Z to_holder_script_ref;
35400 to_holder_script_ref.datalen = to_holder_script->arr_len;
35401 to_holder_script_ref.data = MALLOC(to_holder_script_ref.datalen, "LDKCVec_u8Z Bytes");
35402 memcpy(to_holder_script_ref.data, to_holder_script->elems, to_holder_script_ref.datalen); FREE(to_holder_script);
35403 LDKCVec_u8Z to_counterparty_script_ref;
35404 to_counterparty_script_ref.datalen = to_counterparty_script->arr_len;
35405 to_counterparty_script_ref.data = MALLOC(to_counterparty_script_ref.datalen, "LDKCVec_u8Z Bytes");
35406 memcpy(to_counterparty_script_ref.data, to_counterparty_script->elems, to_counterparty_script_ref.datalen); FREE(to_counterparty_script);
35407 LDKOutPoint funding_outpoint_conv;
35408 funding_outpoint_conv.inner = untag_ptr(funding_outpoint);
35409 funding_outpoint_conv.is_owned = ptr_is_owned(funding_outpoint);
35410 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv);
35411 funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv);
35412 LDKClosingTransaction ret_var = ClosingTransaction_new(to_holder_value_sat, to_counterparty_value_sat, to_holder_script_ref, to_counterparty_script_ref, funding_outpoint_conv);
35413 uint64_t ret_ref = 0;
35414 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35415 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35419 uint64_t __attribute__((export_name("TS_ClosingTransaction_trust"))) TS_ClosingTransaction_trust(uint64_t this_arg) {
35420 LDKClosingTransaction this_arg_conv;
35421 this_arg_conv.inner = untag_ptr(this_arg);
35422 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35423 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35424 this_arg_conv.is_owned = false;
35425 LDKTrustedClosingTransaction ret_var = ClosingTransaction_trust(&this_arg_conv);
35426 uint64_t ret_ref = 0;
35427 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35428 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35432 uint64_t __attribute__((export_name("TS_ClosingTransaction_verify"))) TS_ClosingTransaction_verify(uint64_t this_arg, uint64_t funding_outpoint) {
35433 LDKClosingTransaction this_arg_conv;
35434 this_arg_conv.inner = untag_ptr(this_arg);
35435 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35436 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35437 this_arg_conv.is_owned = false;
35438 LDKOutPoint funding_outpoint_conv;
35439 funding_outpoint_conv.inner = untag_ptr(funding_outpoint);
35440 funding_outpoint_conv.is_owned = ptr_is_owned(funding_outpoint);
35441 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv);
35442 funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv);
35443 LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ");
35444 *ret_conv = ClosingTransaction_verify(&this_arg_conv, funding_outpoint_conv);
35445 return tag_ptr(ret_conv, true);
35448 int64_t __attribute__((export_name("TS_ClosingTransaction_to_holder_value_sat"))) TS_ClosingTransaction_to_holder_value_sat(uint64_t this_arg) {
35449 LDKClosingTransaction this_arg_conv;
35450 this_arg_conv.inner = untag_ptr(this_arg);
35451 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35452 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35453 this_arg_conv.is_owned = false;
35454 int64_t ret_conv = ClosingTransaction_to_holder_value_sat(&this_arg_conv);
35458 int64_t __attribute__((export_name("TS_ClosingTransaction_to_counterparty_value_sat"))) TS_ClosingTransaction_to_counterparty_value_sat(uint64_t this_arg) {
35459 LDKClosingTransaction this_arg_conv;
35460 this_arg_conv.inner = untag_ptr(this_arg);
35461 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35462 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35463 this_arg_conv.is_owned = false;
35464 int64_t ret_conv = ClosingTransaction_to_counterparty_value_sat(&this_arg_conv);
35468 int8_tArray __attribute__((export_name("TS_ClosingTransaction_to_holder_script"))) TS_ClosingTransaction_to_holder_script(uint64_t this_arg) {
35469 LDKClosingTransaction this_arg_conv;
35470 this_arg_conv.inner = untag_ptr(this_arg);
35471 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35472 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35473 this_arg_conv.is_owned = false;
35474 LDKu8slice ret_var = ClosingTransaction_to_holder_script(&this_arg_conv);
35475 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35476 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35480 int8_tArray __attribute__((export_name("TS_ClosingTransaction_to_counterparty_script"))) TS_ClosingTransaction_to_counterparty_script(uint64_t this_arg) {
35481 LDKClosingTransaction this_arg_conv;
35482 this_arg_conv.inner = untag_ptr(this_arg);
35483 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35484 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35485 this_arg_conv.is_owned = false;
35486 LDKu8slice ret_var = ClosingTransaction_to_counterparty_script(&this_arg_conv);
35487 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35488 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35492 void __attribute__((export_name("TS_TrustedClosingTransaction_free"))) TS_TrustedClosingTransaction_free(uint64_t this_obj) {
35493 LDKTrustedClosingTransaction this_obj_conv;
35494 this_obj_conv.inner = untag_ptr(this_obj);
35495 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35496 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35497 TrustedClosingTransaction_free(this_obj_conv);
35500 int8_tArray __attribute__((export_name("TS_TrustedClosingTransaction_built_transaction"))) TS_TrustedClosingTransaction_built_transaction(uint64_t this_arg) {
35501 LDKTrustedClosingTransaction this_arg_conv;
35502 this_arg_conv.inner = untag_ptr(this_arg);
35503 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35504 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35505 this_arg_conv.is_owned = false;
35506 LDKTransaction ret_var = TrustedClosingTransaction_built_transaction(&this_arg_conv);
35507 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35508 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35509 Transaction_free(ret_var);
35513 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) {
35514 LDKTrustedClosingTransaction this_arg_conv;
35515 this_arg_conv.inner = untag_ptr(this_arg);
35516 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35517 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35518 this_arg_conv.is_owned = false;
35519 LDKu8slice funding_redeemscript_ref;
35520 funding_redeemscript_ref.datalen = funding_redeemscript->arr_len;
35521 funding_redeemscript_ref.data = funding_redeemscript->elems;
35522 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
35523 memcpy(ret_arr->elems, TrustedClosingTransaction_get_sighash_all(&this_arg_conv, funding_redeemscript_ref, channel_value_satoshis).data, 32);
35524 FREE(funding_redeemscript);
35528 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) {
35529 LDKTrustedClosingTransaction this_arg_conv;
35530 this_arg_conv.inner = untag_ptr(this_arg);
35531 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35532 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35533 this_arg_conv.is_owned = false;
35534 unsigned char funding_key_arr[32];
35535 CHECK(funding_key->arr_len == 32);
35536 memcpy(funding_key_arr, funding_key->elems, 32); FREE(funding_key);
35537 unsigned char (*funding_key_ref)[32] = &funding_key_arr;
35538 LDKu8slice funding_redeemscript_ref;
35539 funding_redeemscript_ref.datalen = funding_redeemscript->arr_len;
35540 funding_redeemscript_ref.data = funding_redeemscript->elems;
35541 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
35542 memcpy(ret_arr->elems, TrustedClosingTransaction_sign(&this_arg_conv, funding_key_ref, funding_redeemscript_ref, channel_value_satoshis).compact_form, 64);
35543 FREE(funding_redeemscript);
35547 void __attribute__((export_name("TS_CommitmentTransaction_free"))) TS_CommitmentTransaction_free(uint64_t this_obj) {
35548 LDKCommitmentTransaction this_obj_conv;
35549 this_obj_conv.inner = untag_ptr(this_obj);
35550 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35551 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35552 CommitmentTransaction_free(this_obj_conv);
35555 static inline uint64_t CommitmentTransaction_clone_ptr(LDKCommitmentTransaction *NONNULL_PTR arg) {
35556 LDKCommitmentTransaction ret_var = CommitmentTransaction_clone(arg);
35557 uint64_t ret_ref = 0;
35558 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35559 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35562 int64_t __attribute__((export_name("TS_CommitmentTransaction_clone_ptr"))) TS_CommitmentTransaction_clone_ptr(uint64_t arg) {
35563 LDKCommitmentTransaction arg_conv;
35564 arg_conv.inner = untag_ptr(arg);
35565 arg_conv.is_owned = ptr_is_owned(arg);
35566 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35567 arg_conv.is_owned = false;
35568 int64_t ret_conv = CommitmentTransaction_clone_ptr(&arg_conv);
35572 uint64_t __attribute__((export_name("TS_CommitmentTransaction_clone"))) TS_CommitmentTransaction_clone(uint64_t orig) {
35573 LDKCommitmentTransaction orig_conv;
35574 orig_conv.inner = untag_ptr(orig);
35575 orig_conv.is_owned = ptr_is_owned(orig);
35576 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35577 orig_conv.is_owned = false;
35578 LDKCommitmentTransaction ret_var = CommitmentTransaction_clone(&orig_conv);
35579 uint64_t ret_ref = 0;
35580 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35581 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35585 int8_tArray __attribute__((export_name("TS_CommitmentTransaction_write"))) TS_CommitmentTransaction_write(uint64_t obj) {
35586 LDKCommitmentTransaction obj_conv;
35587 obj_conv.inner = untag_ptr(obj);
35588 obj_conv.is_owned = ptr_is_owned(obj);
35589 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
35590 obj_conv.is_owned = false;
35591 LDKCVec_u8Z ret_var = CommitmentTransaction_write(&obj_conv);
35592 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35593 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35594 CVec_u8Z_free(ret_var);
35598 uint64_t __attribute__((export_name("TS_CommitmentTransaction_read"))) TS_CommitmentTransaction_read(int8_tArray ser) {
35599 LDKu8slice ser_ref;
35600 ser_ref.datalen = ser->arr_len;
35601 ser_ref.data = ser->elems;
35602 LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
35603 *ret_conv = CommitmentTransaction_read(ser_ref);
35605 return tag_ptr(ret_conv, true);
35608 int64_t __attribute__((export_name("TS_CommitmentTransaction_commitment_number"))) TS_CommitmentTransaction_commitment_number(uint64_t this_arg) {
35609 LDKCommitmentTransaction this_arg_conv;
35610 this_arg_conv.inner = untag_ptr(this_arg);
35611 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35612 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35613 this_arg_conv.is_owned = false;
35614 int64_t ret_conv = CommitmentTransaction_commitment_number(&this_arg_conv);
35618 int64_t __attribute__((export_name("TS_CommitmentTransaction_to_broadcaster_value_sat"))) TS_CommitmentTransaction_to_broadcaster_value_sat(uint64_t this_arg) {
35619 LDKCommitmentTransaction this_arg_conv;
35620 this_arg_conv.inner = untag_ptr(this_arg);
35621 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35622 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35623 this_arg_conv.is_owned = false;
35624 int64_t ret_conv = CommitmentTransaction_to_broadcaster_value_sat(&this_arg_conv);
35628 int64_t __attribute__((export_name("TS_CommitmentTransaction_to_countersignatory_value_sat"))) TS_CommitmentTransaction_to_countersignatory_value_sat(uint64_t this_arg) {
35629 LDKCommitmentTransaction this_arg_conv;
35630 this_arg_conv.inner = untag_ptr(this_arg);
35631 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35632 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35633 this_arg_conv.is_owned = false;
35634 int64_t ret_conv = CommitmentTransaction_to_countersignatory_value_sat(&this_arg_conv);
35638 int32_t __attribute__((export_name("TS_CommitmentTransaction_feerate_per_kw"))) TS_CommitmentTransaction_feerate_per_kw(uint64_t this_arg) {
35639 LDKCommitmentTransaction this_arg_conv;
35640 this_arg_conv.inner = untag_ptr(this_arg);
35641 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35642 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35643 this_arg_conv.is_owned = false;
35644 int32_t ret_conv = CommitmentTransaction_feerate_per_kw(&this_arg_conv);
35648 uint64_t __attribute__((export_name("TS_CommitmentTransaction_trust"))) TS_CommitmentTransaction_trust(uint64_t this_arg) {
35649 LDKCommitmentTransaction this_arg_conv;
35650 this_arg_conv.inner = untag_ptr(this_arg);
35651 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35652 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35653 this_arg_conv.is_owned = false;
35654 LDKTrustedCommitmentTransaction ret_var = CommitmentTransaction_trust(&this_arg_conv);
35655 uint64_t ret_ref = 0;
35656 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35657 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35661 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) {
35662 LDKCommitmentTransaction this_arg_conv;
35663 this_arg_conv.inner = untag_ptr(this_arg);
35664 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35665 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35666 this_arg_conv.is_owned = false;
35667 LDKDirectedChannelTransactionParameters channel_parameters_conv;
35668 channel_parameters_conv.inner = untag_ptr(channel_parameters);
35669 channel_parameters_conv.is_owned = ptr_is_owned(channel_parameters);
35670 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv);
35671 channel_parameters_conv.is_owned = false;
35672 LDKChannelPublicKeys broadcaster_keys_conv;
35673 broadcaster_keys_conv.inner = untag_ptr(broadcaster_keys);
35674 broadcaster_keys_conv.is_owned = ptr_is_owned(broadcaster_keys);
35675 CHECK_INNER_FIELD_ACCESS_OR_NULL(broadcaster_keys_conv);
35676 broadcaster_keys_conv.is_owned = false;
35677 LDKChannelPublicKeys countersignatory_keys_conv;
35678 countersignatory_keys_conv.inner = untag_ptr(countersignatory_keys);
35679 countersignatory_keys_conv.is_owned = ptr_is_owned(countersignatory_keys);
35680 CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_keys_conv);
35681 countersignatory_keys_conv.is_owned = false;
35682 LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ");
35683 *ret_conv = CommitmentTransaction_verify(&this_arg_conv, &channel_parameters_conv, &broadcaster_keys_conv, &countersignatory_keys_conv);
35684 return tag_ptr(ret_conv, true);
35687 void __attribute__((export_name("TS_TrustedCommitmentTransaction_free"))) TS_TrustedCommitmentTransaction_free(uint64_t this_obj) {
35688 LDKTrustedCommitmentTransaction this_obj_conv;
35689 this_obj_conv.inner = untag_ptr(this_obj);
35690 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35691 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35692 TrustedCommitmentTransaction_free(this_obj_conv);
35695 int8_tArray __attribute__((export_name("TS_TrustedCommitmentTransaction_txid"))) TS_TrustedCommitmentTransaction_txid(uint64_t this_arg) {
35696 LDKTrustedCommitmentTransaction this_arg_conv;
35697 this_arg_conv.inner = untag_ptr(this_arg);
35698 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35699 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35700 this_arg_conv.is_owned = false;
35701 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
35702 memcpy(ret_arr->elems, TrustedCommitmentTransaction_txid(&this_arg_conv).data, 32);
35706 uint64_t __attribute__((export_name("TS_TrustedCommitmentTransaction_built_transaction"))) TS_TrustedCommitmentTransaction_built_transaction(uint64_t this_arg) {
35707 LDKTrustedCommitmentTransaction this_arg_conv;
35708 this_arg_conv.inner = untag_ptr(this_arg);
35709 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35710 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35711 this_arg_conv.is_owned = false;
35712 LDKBuiltCommitmentTransaction ret_var = TrustedCommitmentTransaction_built_transaction(&this_arg_conv);
35713 uint64_t ret_ref = 0;
35714 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35715 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35719 uint64_t __attribute__((export_name("TS_TrustedCommitmentTransaction_keys"))) TS_TrustedCommitmentTransaction_keys(uint64_t this_arg) {
35720 LDKTrustedCommitmentTransaction this_arg_conv;
35721 this_arg_conv.inner = untag_ptr(this_arg);
35722 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35723 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35724 this_arg_conv.is_owned = false;
35725 LDKTxCreationKeys ret_var = TrustedCommitmentTransaction_keys(&this_arg_conv);
35726 uint64_t ret_ref = 0;
35727 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35728 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35732 jboolean __attribute__((export_name("TS_TrustedCommitmentTransaction_opt_anchors"))) TS_TrustedCommitmentTransaction_opt_anchors(uint64_t this_arg) {
35733 LDKTrustedCommitmentTransaction this_arg_conv;
35734 this_arg_conv.inner = untag_ptr(this_arg);
35735 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35736 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35737 this_arg_conv.is_owned = false;
35738 jboolean ret_conv = TrustedCommitmentTransaction_opt_anchors(&this_arg_conv);
35742 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) {
35743 LDKTrustedCommitmentTransaction this_arg_conv;
35744 this_arg_conv.inner = untag_ptr(this_arg);
35745 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35746 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35747 this_arg_conv.is_owned = false;
35748 unsigned char htlc_base_key_arr[32];
35749 CHECK(htlc_base_key->arr_len == 32);
35750 memcpy(htlc_base_key_arr, htlc_base_key->elems, 32); FREE(htlc_base_key);
35751 unsigned char (*htlc_base_key_ref)[32] = &htlc_base_key_arr;
35752 LDKDirectedChannelTransactionParameters channel_parameters_conv;
35753 channel_parameters_conv.inner = untag_ptr(channel_parameters);
35754 channel_parameters_conv.is_owned = ptr_is_owned(channel_parameters);
35755 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv);
35756 channel_parameters_conv.is_owned = false;
35757 LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
35758 *ret_conv = TrustedCommitmentTransaction_get_htlc_sigs(&this_arg_conv, htlc_base_key_ref, &channel_parameters_conv);
35759 return tag_ptr(ret_conv, true);
35762 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) {
35763 LDKPublicKey broadcaster_payment_basepoint_ref;
35764 CHECK(broadcaster_payment_basepoint->arr_len == 33);
35765 memcpy(broadcaster_payment_basepoint_ref.compressed_form, broadcaster_payment_basepoint->elems, 33); FREE(broadcaster_payment_basepoint);
35766 LDKPublicKey countersignatory_payment_basepoint_ref;
35767 CHECK(countersignatory_payment_basepoint->arr_len == 33);
35768 memcpy(countersignatory_payment_basepoint_ref.compressed_form, countersignatory_payment_basepoint->elems, 33); FREE(countersignatory_payment_basepoint);
35769 int64_t ret_conv = get_commitment_transaction_number_obscure_factor(broadcaster_payment_basepoint_ref, countersignatory_payment_basepoint_ref, outbound_from_broadcaster);
35773 jboolean __attribute__((export_name("TS_InitFeatures_eq"))) TS_InitFeatures_eq(uint64_t a, uint64_t b) {
35774 LDKInitFeatures a_conv;
35775 a_conv.inner = untag_ptr(a);
35776 a_conv.is_owned = ptr_is_owned(a);
35777 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
35778 a_conv.is_owned = false;
35779 LDKInitFeatures b_conv;
35780 b_conv.inner = untag_ptr(b);
35781 b_conv.is_owned = ptr_is_owned(b);
35782 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
35783 b_conv.is_owned = false;
35784 jboolean ret_conv = InitFeatures_eq(&a_conv, &b_conv);
35788 jboolean __attribute__((export_name("TS_NodeFeatures_eq"))) TS_NodeFeatures_eq(uint64_t a, uint64_t b) {
35789 LDKNodeFeatures a_conv;
35790 a_conv.inner = untag_ptr(a);
35791 a_conv.is_owned = ptr_is_owned(a);
35792 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
35793 a_conv.is_owned = false;
35794 LDKNodeFeatures b_conv;
35795 b_conv.inner = untag_ptr(b);
35796 b_conv.is_owned = ptr_is_owned(b);
35797 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
35798 b_conv.is_owned = false;
35799 jboolean ret_conv = NodeFeatures_eq(&a_conv, &b_conv);
35803 jboolean __attribute__((export_name("TS_ChannelFeatures_eq"))) TS_ChannelFeatures_eq(uint64_t a, uint64_t b) {
35804 LDKChannelFeatures a_conv;
35805 a_conv.inner = untag_ptr(a);
35806 a_conv.is_owned = ptr_is_owned(a);
35807 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
35808 a_conv.is_owned = false;
35809 LDKChannelFeatures b_conv;
35810 b_conv.inner = untag_ptr(b);
35811 b_conv.is_owned = ptr_is_owned(b);
35812 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
35813 b_conv.is_owned = false;
35814 jboolean ret_conv = ChannelFeatures_eq(&a_conv, &b_conv);
35818 jboolean __attribute__((export_name("TS_InvoiceFeatures_eq"))) TS_InvoiceFeatures_eq(uint64_t a, uint64_t b) {
35819 LDKInvoiceFeatures a_conv;
35820 a_conv.inner = untag_ptr(a);
35821 a_conv.is_owned = ptr_is_owned(a);
35822 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
35823 a_conv.is_owned = false;
35824 LDKInvoiceFeatures b_conv;
35825 b_conv.inner = untag_ptr(b);
35826 b_conv.is_owned = ptr_is_owned(b);
35827 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
35828 b_conv.is_owned = false;
35829 jboolean ret_conv = InvoiceFeatures_eq(&a_conv, &b_conv);
35833 jboolean __attribute__((export_name("TS_ChannelTypeFeatures_eq"))) TS_ChannelTypeFeatures_eq(uint64_t a, uint64_t b) {
35834 LDKChannelTypeFeatures a_conv;
35835 a_conv.inner = untag_ptr(a);
35836 a_conv.is_owned = ptr_is_owned(a);
35837 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
35838 a_conv.is_owned = false;
35839 LDKChannelTypeFeatures b_conv;
35840 b_conv.inner = untag_ptr(b);
35841 b_conv.is_owned = ptr_is_owned(b);
35842 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
35843 b_conv.is_owned = false;
35844 jboolean ret_conv = ChannelTypeFeatures_eq(&a_conv, &b_conv);
35848 static inline uint64_t InitFeatures_clone_ptr(LDKInitFeatures *NONNULL_PTR arg) {
35849 LDKInitFeatures ret_var = InitFeatures_clone(arg);
35850 uint64_t ret_ref = 0;
35851 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35852 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35855 int64_t __attribute__((export_name("TS_InitFeatures_clone_ptr"))) TS_InitFeatures_clone_ptr(uint64_t arg) {
35856 LDKInitFeatures arg_conv;
35857 arg_conv.inner = untag_ptr(arg);
35858 arg_conv.is_owned = ptr_is_owned(arg);
35859 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35860 arg_conv.is_owned = false;
35861 int64_t ret_conv = InitFeatures_clone_ptr(&arg_conv);
35865 uint64_t __attribute__((export_name("TS_InitFeatures_clone"))) TS_InitFeatures_clone(uint64_t orig) {
35866 LDKInitFeatures orig_conv;
35867 orig_conv.inner = untag_ptr(orig);
35868 orig_conv.is_owned = ptr_is_owned(orig);
35869 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35870 orig_conv.is_owned = false;
35871 LDKInitFeatures ret_var = InitFeatures_clone(&orig_conv);
35872 uint64_t ret_ref = 0;
35873 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35874 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35878 static inline uint64_t NodeFeatures_clone_ptr(LDKNodeFeatures *NONNULL_PTR arg) {
35879 LDKNodeFeatures ret_var = NodeFeatures_clone(arg);
35880 uint64_t ret_ref = 0;
35881 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35882 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35885 int64_t __attribute__((export_name("TS_NodeFeatures_clone_ptr"))) TS_NodeFeatures_clone_ptr(uint64_t arg) {
35886 LDKNodeFeatures arg_conv;
35887 arg_conv.inner = untag_ptr(arg);
35888 arg_conv.is_owned = ptr_is_owned(arg);
35889 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35890 arg_conv.is_owned = false;
35891 int64_t ret_conv = NodeFeatures_clone_ptr(&arg_conv);
35895 uint64_t __attribute__((export_name("TS_NodeFeatures_clone"))) TS_NodeFeatures_clone(uint64_t orig) {
35896 LDKNodeFeatures orig_conv;
35897 orig_conv.inner = untag_ptr(orig);
35898 orig_conv.is_owned = ptr_is_owned(orig);
35899 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35900 orig_conv.is_owned = false;
35901 LDKNodeFeatures ret_var = NodeFeatures_clone(&orig_conv);
35902 uint64_t ret_ref = 0;
35903 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35904 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35908 static inline uint64_t ChannelFeatures_clone_ptr(LDKChannelFeatures *NONNULL_PTR arg) {
35909 LDKChannelFeatures ret_var = ChannelFeatures_clone(arg);
35910 uint64_t ret_ref = 0;
35911 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35912 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35915 int64_t __attribute__((export_name("TS_ChannelFeatures_clone_ptr"))) TS_ChannelFeatures_clone_ptr(uint64_t arg) {
35916 LDKChannelFeatures arg_conv;
35917 arg_conv.inner = untag_ptr(arg);
35918 arg_conv.is_owned = ptr_is_owned(arg);
35919 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35920 arg_conv.is_owned = false;
35921 int64_t ret_conv = ChannelFeatures_clone_ptr(&arg_conv);
35925 uint64_t __attribute__((export_name("TS_ChannelFeatures_clone"))) TS_ChannelFeatures_clone(uint64_t orig) {
35926 LDKChannelFeatures orig_conv;
35927 orig_conv.inner = untag_ptr(orig);
35928 orig_conv.is_owned = ptr_is_owned(orig);
35929 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35930 orig_conv.is_owned = false;
35931 LDKChannelFeatures ret_var = ChannelFeatures_clone(&orig_conv);
35932 uint64_t ret_ref = 0;
35933 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35934 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35938 static inline uint64_t InvoiceFeatures_clone_ptr(LDKInvoiceFeatures *NONNULL_PTR arg) {
35939 LDKInvoiceFeatures ret_var = InvoiceFeatures_clone(arg);
35940 uint64_t ret_ref = 0;
35941 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35942 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35945 int64_t __attribute__((export_name("TS_InvoiceFeatures_clone_ptr"))) TS_InvoiceFeatures_clone_ptr(uint64_t arg) {
35946 LDKInvoiceFeatures arg_conv;
35947 arg_conv.inner = untag_ptr(arg);
35948 arg_conv.is_owned = ptr_is_owned(arg);
35949 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35950 arg_conv.is_owned = false;
35951 int64_t ret_conv = InvoiceFeatures_clone_ptr(&arg_conv);
35955 uint64_t __attribute__((export_name("TS_InvoiceFeatures_clone"))) TS_InvoiceFeatures_clone(uint64_t orig) {
35956 LDKInvoiceFeatures orig_conv;
35957 orig_conv.inner = untag_ptr(orig);
35958 orig_conv.is_owned = ptr_is_owned(orig);
35959 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35960 orig_conv.is_owned = false;
35961 LDKInvoiceFeatures ret_var = InvoiceFeatures_clone(&orig_conv);
35962 uint64_t ret_ref = 0;
35963 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35964 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35968 static inline uint64_t ChannelTypeFeatures_clone_ptr(LDKChannelTypeFeatures *NONNULL_PTR arg) {
35969 LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(arg);
35970 uint64_t ret_ref = 0;
35971 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35972 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35975 int64_t __attribute__((export_name("TS_ChannelTypeFeatures_clone_ptr"))) TS_ChannelTypeFeatures_clone_ptr(uint64_t arg) {
35976 LDKChannelTypeFeatures arg_conv;
35977 arg_conv.inner = untag_ptr(arg);
35978 arg_conv.is_owned = ptr_is_owned(arg);
35979 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35980 arg_conv.is_owned = false;
35981 int64_t ret_conv = ChannelTypeFeatures_clone_ptr(&arg_conv);
35985 uint64_t __attribute__((export_name("TS_ChannelTypeFeatures_clone"))) TS_ChannelTypeFeatures_clone(uint64_t orig) {
35986 LDKChannelTypeFeatures orig_conv;
35987 orig_conv.inner = untag_ptr(orig);
35988 orig_conv.is_owned = ptr_is_owned(orig);
35989 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35990 orig_conv.is_owned = false;
35991 LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(&orig_conv);
35992 uint64_t ret_ref = 0;
35993 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35994 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35998 void __attribute__((export_name("TS_InitFeatures_free"))) TS_InitFeatures_free(uint64_t this_obj) {
35999 LDKInitFeatures this_obj_conv;
36000 this_obj_conv.inner = untag_ptr(this_obj);
36001 this_obj_conv.is_owned = ptr_is_owned(this_obj);
36002 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
36003 InitFeatures_free(this_obj_conv);
36006 void __attribute__((export_name("TS_NodeFeatures_free"))) TS_NodeFeatures_free(uint64_t this_obj) {
36007 LDKNodeFeatures this_obj_conv;
36008 this_obj_conv.inner = untag_ptr(this_obj);
36009 this_obj_conv.is_owned = ptr_is_owned(this_obj);
36010 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
36011 NodeFeatures_free(this_obj_conv);
36014 void __attribute__((export_name("TS_ChannelFeatures_free"))) TS_ChannelFeatures_free(uint64_t this_obj) {
36015 LDKChannelFeatures this_obj_conv;
36016 this_obj_conv.inner = untag_ptr(this_obj);
36017 this_obj_conv.is_owned = ptr_is_owned(this_obj);
36018 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
36019 ChannelFeatures_free(this_obj_conv);
36022 void __attribute__((export_name("TS_InvoiceFeatures_free"))) TS_InvoiceFeatures_free(uint64_t this_obj) {
36023 LDKInvoiceFeatures this_obj_conv;
36024 this_obj_conv.inner = untag_ptr(this_obj);
36025 this_obj_conv.is_owned = ptr_is_owned(this_obj);
36026 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
36027 InvoiceFeatures_free(this_obj_conv);
36030 void __attribute__((export_name("TS_ChannelTypeFeatures_free"))) TS_ChannelTypeFeatures_free(uint64_t this_obj) {
36031 LDKChannelTypeFeatures this_obj_conv;
36032 this_obj_conv.inner = untag_ptr(this_obj);
36033 this_obj_conv.is_owned = ptr_is_owned(this_obj);
36034 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
36035 ChannelTypeFeatures_free(this_obj_conv);
36038 uint64_t __attribute__((export_name("TS_InitFeatures_empty"))) TS_InitFeatures_empty() {
36039 LDKInitFeatures ret_var = InitFeatures_empty();
36040 uint64_t ret_ref = 0;
36041 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36042 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36046 uint64_t __attribute__((export_name("TS_InitFeatures_known"))) TS_InitFeatures_known() {
36047 LDKInitFeatures ret_var = InitFeatures_known();
36048 uint64_t ret_ref = 0;
36049 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36050 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36054 jboolean __attribute__((export_name("TS_InitFeatures_requires_unknown_bits"))) TS_InitFeatures_requires_unknown_bits(uint64_t this_arg) {
36055 LDKInitFeatures this_arg_conv;
36056 this_arg_conv.inner = untag_ptr(this_arg);
36057 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36058 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36059 this_arg_conv.is_owned = false;
36060 jboolean ret_conv = InitFeatures_requires_unknown_bits(&this_arg_conv);
36064 uint64_t __attribute__((export_name("TS_NodeFeatures_empty"))) TS_NodeFeatures_empty() {
36065 LDKNodeFeatures ret_var = NodeFeatures_empty();
36066 uint64_t ret_ref = 0;
36067 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36068 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36072 uint64_t __attribute__((export_name("TS_NodeFeatures_known"))) TS_NodeFeatures_known() {
36073 LDKNodeFeatures ret_var = NodeFeatures_known();
36074 uint64_t ret_ref = 0;
36075 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36076 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36080 jboolean __attribute__((export_name("TS_NodeFeatures_requires_unknown_bits"))) TS_NodeFeatures_requires_unknown_bits(uint64_t this_arg) {
36081 LDKNodeFeatures this_arg_conv;
36082 this_arg_conv.inner = untag_ptr(this_arg);
36083 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36084 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36085 this_arg_conv.is_owned = false;
36086 jboolean ret_conv = NodeFeatures_requires_unknown_bits(&this_arg_conv);
36090 uint64_t __attribute__((export_name("TS_ChannelFeatures_empty"))) TS_ChannelFeatures_empty() {
36091 LDKChannelFeatures ret_var = ChannelFeatures_empty();
36092 uint64_t ret_ref = 0;
36093 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36094 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36098 uint64_t __attribute__((export_name("TS_ChannelFeatures_known"))) TS_ChannelFeatures_known() {
36099 LDKChannelFeatures ret_var = ChannelFeatures_known();
36100 uint64_t ret_ref = 0;
36101 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36102 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36106 jboolean __attribute__((export_name("TS_ChannelFeatures_requires_unknown_bits"))) TS_ChannelFeatures_requires_unknown_bits(uint64_t this_arg) {
36107 LDKChannelFeatures this_arg_conv;
36108 this_arg_conv.inner = untag_ptr(this_arg);
36109 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36110 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36111 this_arg_conv.is_owned = false;
36112 jboolean ret_conv = ChannelFeatures_requires_unknown_bits(&this_arg_conv);
36116 uint64_t __attribute__((export_name("TS_InvoiceFeatures_empty"))) TS_InvoiceFeatures_empty() {
36117 LDKInvoiceFeatures ret_var = InvoiceFeatures_empty();
36118 uint64_t ret_ref = 0;
36119 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36120 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36124 uint64_t __attribute__((export_name("TS_InvoiceFeatures_known"))) TS_InvoiceFeatures_known() {
36125 LDKInvoiceFeatures ret_var = InvoiceFeatures_known();
36126 uint64_t ret_ref = 0;
36127 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36128 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36132 jboolean __attribute__((export_name("TS_InvoiceFeatures_requires_unknown_bits"))) TS_InvoiceFeatures_requires_unknown_bits(uint64_t this_arg) {
36133 LDKInvoiceFeatures this_arg_conv;
36134 this_arg_conv.inner = untag_ptr(this_arg);
36135 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36136 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36137 this_arg_conv.is_owned = false;
36138 jboolean ret_conv = InvoiceFeatures_requires_unknown_bits(&this_arg_conv);
36142 uint64_t __attribute__((export_name("TS_ChannelTypeFeatures_empty"))) TS_ChannelTypeFeatures_empty() {
36143 LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_empty();
36144 uint64_t ret_ref = 0;
36145 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36146 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36150 uint64_t __attribute__((export_name("TS_ChannelTypeFeatures_known"))) TS_ChannelTypeFeatures_known() {
36151 LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_known();
36152 uint64_t ret_ref = 0;
36153 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
36154 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
36158 jboolean __attribute__((export_name("TS_ChannelTypeFeatures_requires_unknown_bits"))) TS_ChannelTypeFeatures_requires_unknown_bits(uint64_t this_arg) {
36159 LDKChannelTypeFeatures this_arg_conv;
36160 this_arg_conv.inner = untag_ptr(this_arg);
36161 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36162 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36163 this_arg_conv.is_owned = false;
36164 jboolean ret_conv = ChannelTypeFeatures_requires_unknown_bits(&this_arg_conv);
36168 int8_tArray __attribute__((export_name("TS_InitFeatures_write"))) TS_InitFeatures_write(uint64_t obj) {
36169 LDKInitFeatures obj_conv;
36170 obj_conv.inner = untag_ptr(obj);
36171 obj_conv.is_owned = ptr_is_owned(obj);
36172 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
36173 obj_conv.is_owned = false;
36174 LDKCVec_u8Z ret_var = InitFeatures_write(&obj_conv);
36175 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
36176 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
36177 CVec_u8Z_free(ret_var);
36181 uint64_t __attribute__((export_name("TS_InitFeatures_read"))) TS_InitFeatures_read(int8_tArray ser) {
36182 LDKu8slice ser_ref;
36183 ser_ref.datalen = ser->arr_len;
36184 ser_ref.data = ser->elems;
36185 LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
36186 *ret_conv = InitFeatures_read(ser_ref);
36188 return tag_ptr(ret_conv, true);
36191 int8_tArray __attribute__((export_name("TS_ChannelFeatures_write"))) TS_ChannelFeatures_write(uint64_t obj) {
36192 LDKChannelFeatures obj_conv;
36193 obj_conv.inner = untag_ptr(obj);
36194 obj_conv.is_owned = ptr_is_owned(obj);
36195 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
36196 obj_conv.is_owned = false;
36197 LDKCVec_u8Z ret_var = ChannelFeatures_write(&obj_conv);
36198 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
36199 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
36200 CVec_u8Z_free(ret_var);
36204 uint64_t __attribute__((export_name("TS_ChannelFeatures_read"))) TS_ChannelFeatures_read(int8_tArray ser) {
36205 LDKu8slice ser_ref;
36206 ser_ref.datalen = ser->arr_len;
36207 ser_ref.data = ser->elems;
36208 LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
36209 *ret_conv = ChannelFeatures_read(ser_ref);
36211 return tag_ptr(ret_conv, true);
36214 int8_tArray __attribute__((export_name("TS_NodeFeatures_write"))) TS_NodeFeatures_write(uint64_t obj) {
36215 LDKNodeFeatures obj_conv;
36216 obj_conv.inner = untag_ptr(obj);
36217 obj_conv.is_owned = ptr_is_owned(obj);
36218 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
36219 obj_conv.is_owned = false;
36220 LDKCVec_u8Z ret_var = NodeFeatures_write(&obj_conv);
36221 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
36222 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
36223 CVec_u8Z_free(ret_var);
36227 uint64_t __attribute__((export_name("TS_NodeFeatures_read"))) TS_NodeFeatures_read(int8_tArray ser) {
36228 LDKu8slice ser_ref;
36229 ser_ref.datalen = ser->arr_len;
36230 ser_ref.data = ser->elems;
36231 LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
36232 *ret_conv = NodeFeatures_read(ser_ref);
36234 return tag_ptr(ret_conv, true);
36237 int8_tArray __attribute__((export_name("TS_InvoiceFeatures_write"))) TS_InvoiceFeatures_write(uint64_t obj) {
36238 LDKInvoiceFeatures obj_conv;
36239 obj_conv.inner = untag_ptr(obj);
36240 obj_conv.is_owned = ptr_is_owned(obj);
36241 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
36242 obj_conv.is_owned = false;
36243 LDKCVec_u8Z ret_var = InvoiceFeatures_write(&obj_conv);
36244 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
36245 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
36246 CVec_u8Z_free(ret_var);
36250 uint64_t __attribute__((export_name("TS_InvoiceFeatures_read"))) TS_InvoiceFeatures_read(int8_tArray ser) {
36251 LDKu8slice ser_ref;
36252 ser_ref.datalen = ser->arr_len;
36253 ser_ref.data = ser->elems;
36254 LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
36255 *ret_conv = InvoiceFeatures_read(ser_ref);
36257 return tag_ptr(ret_conv, true);
36260 int8_tArray __attribute__((export_name("TS_ChannelTypeFeatures_write"))) TS_ChannelTypeFeatures_write(uint64_t obj) {
36261 LDKChannelTypeFeatures obj_conv;
36262 obj_conv.inner = untag_ptr(obj);
36263 obj_conv.is_owned = ptr_is_owned(obj);
36264 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
36265 obj_conv.is_owned = false;
36266 LDKCVec_u8Z ret_var = ChannelTypeFeatures_write(&obj_conv);
36267 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
36268 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
36269 CVec_u8Z_free(ret_var);
36273 uint64_t __attribute__((export_name("TS_ChannelTypeFeatures_read"))) TS_ChannelTypeFeatures_read(int8_tArray ser) {
36274 LDKu8slice ser_ref;
36275 ser_ref.datalen = ser->arr_len;
36276 ser_ref.data = ser->elems;
36277 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
36278 *ret_conv = ChannelTypeFeatures_read(ser_ref);
36280 return tag_ptr(ret_conv, true);
36283 void __attribute__((export_name("TS_InitFeatures_set_data_loss_protect_optional"))) TS_InitFeatures_set_data_loss_protect_optional(uint64_t this_arg) {
36284 LDKInitFeatures this_arg_conv;
36285 this_arg_conv.inner = untag_ptr(this_arg);
36286 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36287 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36288 this_arg_conv.is_owned = false;
36289 InitFeatures_set_data_loss_protect_optional(&this_arg_conv);
36292 void __attribute__((export_name("TS_InitFeatures_set_data_loss_protect_required"))) TS_InitFeatures_set_data_loss_protect_required(uint64_t this_arg) {
36293 LDKInitFeatures this_arg_conv;
36294 this_arg_conv.inner = untag_ptr(this_arg);
36295 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36296 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36297 this_arg_conv.is_owned = false;
36298 InitFeatures_set_data_loss_protect_required(&this_arg_conv);
36301 jboolean __attribute__((export_name("TS_InitFeatures_supports_data_loss_protect"))) TS_InitFeatures_supports_data_loss_protect(uint64_t this_arg) {
36302 LDKInitFeatures this_arg_conv;
36303 this_arg_conv.inner = untag_ptr(this_arg);
36304 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36305 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36306 this_arg_conv.is_owned = false;
36307 jboolean ret_conv = InitFeatures_supports_data_loss_protect(&this_arg_conv);
36311 void __attribute__((export_name("TS_NodeFeatures_set_data_loss_protect_optional"))) TS_NodeFeatures_set_data_loss_protect_optional(uint64_t this_arg) {
36312 LDKNodeFeatures this_arg_conv;
36313 this_arg_conv.inner = untag_ptr(this_arg);
36314 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36315 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36316 this_arg_conv.is_owned = false;
36317 NodeFeatures_set_data_loss_protect_optional(&this_arg_conv);
36320 void __attribute__((export_name("TS_NodeFeatures_set_data_loss_protect_required"))) TS_NodeFeatures_set_data_loss_protect_required(uint64_t this_arg) {
36321 LDKNodeFeatures this_arg_conv;
36322 this_arg_conv.inner = untag_ptr(this_arg);
36323 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36324 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36325 this_arg_conv.is_owned = false;
36326 NodeFeatures_set_data_loss_protect_required(&this_arg_conv);
36329 jboolean __attribute__((export_name("TS_NodeFeatures_supports_data_loss_protect"))) TS_NodeFeatures_supports_data_loss_protect(uint64_t this_arg) {
36330 LDKNodeFeatures this_arg_conv;
36331 this_arg_conv.inner = untag_ptr(this_arg);
36332 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36333 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36334 this_arg_conv.is_owned = false;
36335 jboolean ret_conv = NodeFeatures_supports_data_loss_protect(&this_arg_conv);
36339 jboolean __attribute__((export_name("TS_InitFeatures_requires_data_loss_protect"))) TS_InitFeatures_requires_data_loss_protect(uint64_t this_arg) {
36340 LDKInitFeatures this_arg_conv;
36341 this_arg_conv.inner = untag_ptr(this_arg);
36342 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36343 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36344 this_arg_conv.is_owned = false;
36345 jboolean ret_conv = InitFeatures_requires_data_loss_protect(&this_arg_conv);
36349 jboolean __attribute__((export_name("TS_NodeFeatures_requires_data_loss_protect"))) TS_NodeFeatures_requires_data_loss_protect(uint64_t this_arg) {
36350 LDKNodeFeatures this_arg_conv;
36351 this_arg_conv.inner = untag_ptr(this_arg);
36352 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36353 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36354 this_arg_conv.is_owned = false;
36355 jboolean ret_conv = NodeFeatures_requires_data_loss_protect(&this_arg_conv);
36359 void __attribute__((export_name("TS_InitFeatures_set_initial_routing_sync_optional"))) TS_InitFeatures_set_initial_routing_sync_optional(uint64_t this_arg) {
36360 LDKInitFeatures this_arg_conv;
36361 this_arg_conv.inner = untag_ptr(this_arg);
36362 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36363 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36364 this_arg_conv.is_owned = false;
36365 InitFeatures_set_initial_routing_sync_optional(&this_arg_conv);
36368 void __attribute__((export_name("TS_InitFeatures_set_initial_routing_sync_required"))) TS_InitFeatures_set_initial_routing_sync_required(uint64_t this_arg) {
36369 LDKInitFeatures this_arg_conv;
36370 this_arg_conv.inner = untag_ptr(this_arg);
36371 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36372 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36373 this_arg_conv.is_owned = false;
36374 InitFeatures_set_initial_routing_sync_required(&this_arg_conv);
36377 jboolean __attribute__((export_name("TS_InitFeatures_initial_routing_sync"))) TS_InitFeatures_initial_routing_sync(uint64_t this_arg) {
36378 LDKInitFeatures this_arg_conv;
36379 this_arg_conv.inner = untag_ptr(this_arg);
36380 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36381 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36382 this_arg_conv.is_owned = false;
36383 jboolean ret_conv = InitFeatures_initial_routing_sync(&this_arg_conv);
36387 void __attribute__((export_name("TS_InitFeatures_set_upfront_shutdown_script_optional"))) TS_InitFeatures_set_upfront_shutdown_script_optional(uint64_t this_arg) {
36388 LDKInitFeatures this_arg_conv;
36389 this_arg_conv.inner = untag_ptr(this_arg);
36390 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36391 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36392 this_arg_conv.is_owned = false;
36393 InitFeatures_set_upfront_shutdown_script_optional(&this_arg_conv);
36396 void __attribute__((export_name("TS_InitFeatures_set_upfront_shutdown_script_required"))) TS_InitFeatures_set_upfront_shutdown_script_required(uint64_t this_arg) {
36397 LDKInitFeatures this_arg_conv;
36398 this_arg_conv.inner = untag_ptr(this_arg);
36399 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36400 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36401 this_arg_conv.is_owned = false;
36402 InitFeatures_set_upfront_shutdown_script_required(&this_arg_conv);
36405 jboolean __attribute__((export_name("TS_InitFeatures_supports_upfront_shutdown_script"))) TS_InitFeatures_supports_upfront_shutdown_script(uint64_t this_arg) {
36406 LDKInitFeatures this_arg_conv;
36407 this_arg_conv.inner = untag_ptr(this_arg);
36408 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36409 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36410 this_arg_conv.is_owned = false;
36411 jboolean ret_conv = InitFeatures_supports_upfront_shutdown_script(&this_arg_conv);
36415 void __attribute__((export_name("TS_NodeFeatures_set_upfront_shutdown_script_optional"))) TS_NodeFeatures_set_upfront_shutdown_script_optional(uint64_t this_arg) {
36416 LDKNodeFeatures this_arg_conv;
36417 this_arg_conv.inner = untag_ptr(this_arg);
36418 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36419 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36420 this_arg_conv.is_owned = false;
36421 NodeFeatures_set_upfront_shutdown_script_optional(&this_arg_conv);
36424 void __attribute__((export_name("TS_NodeFeatures_set_upfront_shutdown_script_required"))) TS_NodeFeatures_set_upfront_shutdown_script_required(uint64_t this_arg) {
36425 LDKNodeFeatures this_arg_conv;
36426 this_arg_conv.inner = untag_ptr(this_arg);
36427 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36428 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36429 this_arg_conv.is_owned = false;
36430 NodeFeatures_set_upfront_shutdown_script_required(&this_arg_conv);
36433 jboolean __attribute__((export_name("TS_NodeFeatures_supports_upfront_shutdown_script"))) TS_NodeFeatures_supports_upfront_shutdown_script(uint64_t this_arg) {
36434 LDKNodeFeatures this_arg_conv;
36435 this_arg_conv.inner = untag_ptr(this_arg);
36436 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36437 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36438 this_arg_conv.is_owned = false;
36439 jboolean ret_conv = NodeFeatures_supports_upfront_shutdown_script(&this_arg_conv);
36443 jboolean __attribute__((export_name("TS_InitFeatures_requires_upfront_shutdown_script"))) TS_InitFeatures_requires_upfront_shutdown_script(uint64_t this_arg) {
36444 LDKInitFeatures this_arg_conv;
36445 this_arg_conv.inner = untag_ptr(this_arg);
36446 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36447 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36448 this_arg_conv.is_owned = false;
36449 jboolean ret_conv = InitFeatures_requires_upfront_shutdown_script(&this_arg_conv);
36453 jboolean __attribute__((export_name("TS_NodeFeatures_requires_upfront_shutdown_script"))) TS_NodeFeatures_requires_upfront_shutdown_script(uint64_t this_arg) {
36454 LDKNodeFeatures this_arg_conv;
36455 this_arg_conv.inner = untag_ptr(this_arg);
36456 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36457 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36458 this_arg_conv.is_owned = false;
36459 jboolean ret_conv = NodeFeatures_requires_upfront_shutdown_script(&this_arg_conv);
36463 void __attribute__((export_name("TS_InitFeatures_set_gossip_queries_optional"))) TS_InitFeatures_set_gossip_queries_optional(uint64_t this_arg) {
36464 LDKInitFeatures this_arg_conv;
36465 this_arg_conv.inner = untag_ptr(this_arg);
36466 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36467 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36468 this_arg_conv.is_owned = false;
36469 InitFeatures_set_gossip_queries_optional(&this_arg_conv);
36472 void __attribute__((export_name("TS_InitFeatures_set_gossip_queries_required"))) TS_InitFeatures_set_gossip_queries_required(uint64_t this_arg) {
36473 LDKInitFeatures this_arg_conv;
36474 this_arg_conv.inner = untag_ptr(this_arg);
36475 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36476 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36477 this_arg_conv.is_owned = false;
36478 InitFeatures_set_gossip_queries_required(&this_arg_conv);
36481 jboolean __attribute__((export_name("TS_InitFeatures_supports_gossip_queries"))) TS_InitFeatures_supports_gossip_queries(uint64_t this_arg) {
36482 LDKInitFeatures this_arg_conv;
36483 this_arg_conv.inner = untag_ptr(this_arg);
36484 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36485 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36486 this_arg_conv.is_owned = false;
36487 jboolean ret_conv = InitFeatures_supports_gossip_queries(&this_arg_conv);
36491 void __attribute__((export_name("TS_NodeFeatures_set_gossip_queries_optional"))) TS_NodeFeatures_set_gossip_queries_optional(uint64_t this_arg) {
36492 LDKNodeFeatures this_arg_conv;
36493 this_arg_conv.inner = untag_ptr(this_arg);
36494 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36495 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36496 this_arg_conv.is_owned = false;
36497 NodeFeatures_set_gossip_queries_optional(&this_arg_conv);
36500 void __attribute__((export_name("TS_NodeFeatures_set_gossip_queries_required"))) TS_NodeFeatures_set_gossip_queries_required(uint64_t this_arg) {
36501 LDKNodeFeatures this_arg_conv;
36502 this_arg_conv.inner = untag_ptr(this_arg);
36503 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36504 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36505 this_arg_conv.is_owned = false;
36506 NodeFeatures_set_gossip_queries_required(&this_arg_conv);
36509 jboolean __attribute__((export_name("TS_NodeFeatures_supports_gossip_queries"))) TS_NodeFeatures_supports_gossip_queries(uint64_t this_arg) {
36510 LDKNodeFeatures this_arg_conv;
36511 this_arg_conv.inner = untag_ptr(this_arg);
36512 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36513 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36514 this_arg_conv.is_owned = false;
36515 jboolean ret_conv = NodeFeatures_supports_gossip_queries(&this_arg_conv);
36519 jboolean __attribute__((export_name("TS_InitFeatures_requires_gossip_queries"))) TS_InitFeatures_requires_gossip_queries(uint64_t this_arg) {
36520 LDKInitFeatures this_arg_conv;
36521 this_arg_conv.inner = untag_ptr(this_arg);
36522 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36523 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36524 this_arg_conv.is_owned = false;
36525 jboolean ret_conv = InitFeatures_requires_gossip_queries(&this_arg_conv);
36529 jboolean __attribute__((export_name("TS_NodeFeatures_requires_gossip_queries"))) TS_NodeFeatures_requires_gossip_queries(uint64_t this_arg) {
36530 LDKNodeFeatures this_arg_conv;
36531 this_arg_conv.inner = untag_ptr(this_arg);
36532 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36533 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36534 this_arg_conv.is_owned = false;
36535 jboolean ret_conv = NodeFeatures_requires_gossip_queries(&this_arg_conv);
36539 void __attribute__((export_name("TS_InitFeatures_set_variable_length_onion_optional"))) TS_InitFeatures_set_variable_length_onion_optional(uint64_t this_arg) {
36540 LDKInitFeatures this_arg_conv;
36541 this_arg_conv.inner = untag_ptr(this_arg);
36542 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36543 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36544 this_arg_conv.is_owned = false;
36545 InitFeatures_set_variable_length_onion_optional(&this_arg_conv);
36548 void __attribute__((export_name("TS_InitFeatures_set_variable_length_onion_required"))) TS_InitFeatures_set_variable_length_onion_required(uint64_t this_arg) {
36549 LDKInitFeatures this_arg_conv;
36550 this_arg_conv.inner = untag_ptr(this_arg);
36551 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36552 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36553 this_arg_conv.is_owned = false;
36554 InitFeatures_set_variable_length_onion_required(&this_arg_conv);
36557 jboolean __attribute__((export_name("TS_InitFeatures_supports_variable_length_onion"))) TS_InitFeatures_supports_variable_length_onion(uint64_t this_arg) {
36558 LDKInitFeatures this_arg_conv;
36559 this_arg_conv.inner = untag_ptr(this_arg);
36560 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36561 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36562 this_arg_conv.is_owned = false;
36563 jboolean ret_conv = InitFeatures_supports_variable_length_onion(&this_arg_conv);
36567 void __attribute__((export_name("TS_NodeFeatures_set_variable_length_onion_optional"))) TS_NodeFeatures_set_variable_length_onion_optional(uint64_t this_arg) {
36568 LDKNodeFeatures this_arg_conv;
36569 this_arg_conv.inner = untag_ptr(this_arg);
36570 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36571 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36572 this_arg_conv.is_owned = false;
36573 NodeFeatures_set_variable_length_onion_optional(&this_arg_conv);
36576 void __attribute__((export_name("TS_NodeFeatures_set_variable_length_onion_required"))) TS_NodeFeatures_set_variable_length_onion_required(uint64_t this_arg) {
36577 LDKNodeFeatures this_arg_conv;
36578 this_arg_conv.inner = untag_ptr(this_arg);
36579 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36580 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36581 this_arg_conv.is_owned = false;
36582 NodeFeatures_set_variable_length_onion_required(&this_arg_conv);
36585 jboolean __attribute__((export_name("TS_NodeFeatures_supports_variable_length_onion"))) TS_NodeFeatures_supports_variable_length_onion(uint64_t this_arg) {
36586 LDKNodeFeatures this_arg_conv;
36587 this_arg_conv.inner = untag_ptr(this_arg);
36588 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36589 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36590 this_arg_conv.is_owned = false;
36591 jboolean ret_conv = NodeFeatures_supports_variable_length_onion(&this_arg_conv);
36595 void __attribute__((export_name("TS_InvoiceFeatures_set_variable_length_onion_optional"))) TS_InvoiceFeatures_set_variable_length_onion_optional(uint64_t this_arg) {
36596 LDKInvoiceFeatures this_arg_conv;
36597 this_arg_conv.inner = untag_ptr(this_arg);
36598 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36599 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36600 this_arg_conv.is_owned = false;
36601 InvoiceFeatures_set_variable_length_onion_optional(&this_arg_conv);
36604 void __attribute__((export_name("TS_InvoiceFeatures_set_variable_length_onion_required"))) TS_InvoiceFeatures_set_variable_length_onion_required(uint64_t this_arg) {
36605 LDKInvoiceFeatures this_arg_conv;
36606 this_arg_conv.inner = untag_ptr(this_arg);
36607 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36608 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36609 this_arg_conv.is_owned = false;
36610 InvoiceFeatures_set_variable_length_onion_required(&this_arg_conv);
36613 jboolean __attribute__((export_name("TS_InvoiceFeatures_supports_variable_length_onion"))) TS_InvoiceFeatures_supports_variable_length_onion(uint64_t this_arg) {
36614 LDKInvoiceFeatures this_arg_conv;
36615 this_arg_conv.inner = untag_ptr(this_arg);
36616 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36617 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36618 this_arg_conv.is_owned = false;
36619 jboolean ret_conv = InvoiceFeatures_supports_variable_length_onion(&this_arg_conv);
36623 jboolean __attribute__((export_name("TS_InitFeatures_requires_variable_length_onion"))) TS_InitFeatures_requires_variable_length_onion(uint64_t this_arg) {
36624 LDKInitFeatures this_arg_conv;
36625 this_arg_conv.inner = untag_ptr(this_arg);
36626 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36627 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36628 this_arg_conv.is_owned = false;
36629 jboolean ret_conv = InitFeatures_requires_variable_length_onion(&this_arg_conv);
36633 jboolean __attribute__((export_name("TS_NodeFeatures_requires_variable_length_onion"))) TS_NodeFeatures_requires_variable_length_onion(uint64_t this_arg) {
36634 LDKNodeFeatures this_arg_conv;
36635 this_arg_conv.inner = untag_ptr(this_arg);
36636 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36637 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36638 this_arg_conv.is_owned = false;
36639 jboolean ret_conv = NodeFeatures_requires_variable_length_onion(&this_arg_conv);
36643 jboolean __attribute__((export_name("TS_InvoiceFeatures_requires_variable_length_onion"))) TS_InvoiceFeatures_requires_variable_length_onion(uint64_t this_arg) {
36644 LDKInvoiceFeatures this_arg_conv;
36645 this_arg_conv.inner = untag_ptr(this_arg);
36646 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36647 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36648 this_arg_conv.is_owned = false;
36649 jboolean ret_conv = InvoiceFeatures_requires_variable_length_onion(&this_arg_conv);
36653 void __attribute__((export_name("TS_InitFeatures_set_static_remote_key_optional"))) TS_InitFeatures_set_static_remote_key_optional(uint64_t this_arg) {
36654 LDKInitFeatures this_arg_conv;
36655 this_arg_conv.inner = untag_ptr(this_arg);
36656 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36657 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36658 this_arg_conv.is_owned = false;
36659 InitFeatures_set_static_remote_key_optional(&this_arg_conv);
36662 void __attribute__((export_name("TS_InitFeatures_set_static_remote_key_required"))) TS_InitFeatures_set_static_remote_key_required(uint64_t this_arg) {
36663 LDKInitFeatures this_arg_conv;
36664 this_arg_conv.inner = untag_ptr(this_arg);
36665 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36666 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36667 this_arg_conv.is_owned = false;
36668 InitFeatures_set_static_remote_key_required(&this_arg_conv);
36671 jboolean __attribute__((export_name("TS_InitFeatures_supports_static_remote_key"))) TS_InitFeatures_supports_static_remote_key(uint64_t this_arg) {
36672 LDKInitFeatures this_arg_conv;
36673 this_arg_conv.inner = untag_ptr(this_arg);
36674 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36675 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36676 this_arg_conv.is_owned = false;
36677 jboolean ret_conv = InitFeatures_supports_static_remote_key(&this_arg_conv);
36681 void __attribute__((export_name("TS_NodeFeatures_set_static_remote_key_optional"))) TS_NodeFeatures_set_static_remote_key_optional(uint64_t this_arg) {
36682 LDKNodeFeatures this_arg_conv;
36683 this_arg_conv.inner = untag_ptr(this_arg);
36684 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36685 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36686 this_arg_conv.is_owned = false;
36687 NodeFeatures_set_static_remote_key_optional(&this_arg_conv);
36690 void __attribute__((export_name("TS_NodeFeatures_set_static_remote_key_required"))) TS_NodeFeatures_set_static_remote_key_required(uint64_t this_arg) {
36691 LDKNodeFeatures this_arg_conv;
36692 this_arg_conv.inner = untag_ptr(this_arg);
36693 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36694 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36695 this_arg_conv.is_owned = false;
36696 NodeFeatures_set_static_remote_key_required(&this_arg_conv);
36699 jboolean __attribute__((export_name("TS_NodeFeatures_supports_static_remote_key"))) TS_NodeFeatures_supports_static_remote_key(uint64_t this_arg) {
36700 LDKNodeFeatures this_arg_conv;
36701 this_arg_conv.inner = untag_ptr(this_arg);
36702 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36703 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36704 this_arg_conv.is_owned = false;
36705 jboolean ret_conv = NodeFeatures_supports_static_remote_key(&this_arg_conv);
36709 void __attribute__((export_name("TS_ChannelTypeFeatures_set_static_remote_key_optional"))) TS_ChannelTypeFeatures_set_static_remote_key_optional(uint64_t this_arg) {
36710 LDKChannelTypeFeatures this_arg_conv;
36711 this_arg_conv.inner = untag_ptr(this_arg);
36712 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36713 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36714 this_arg_conv.is_owned = false;
36715 ChannelTypeFeatures_set_static_remote_key_optional(&this_arg_conv);
36718 void __attribute__((export_name("TS_ChannelTypeFeatures_set_static_remote_key_required"))) TS_ChannelTypeFeatures_set_static_remote_key_required(uint64_t this_arg) {
36719 LDKChannelTypeFeatures this_arg_conv;
36720 this_arg_conv.inner = untag_ptr(this_arg);
36721 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36722 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36723 this_arg_conv.is_owned = false;
36724 ChannelTypeFeatures_set_static_remote_key_required(&this_arg_conv);
36727 jboolean __attribute__((export_name("TS_ChannelTypeFeatures_supports_static_remote_key"))) TS_ChannelTypeFeatures_supports_static_remote_key(uint64_t this_arg) {
36728 LDKChannelTypeFeatures this_arg_conv;
36729 this_arg_conv.inner = untag_ptr(this_arg);
36730 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36731 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36732 this_arg_conv.is_owned = false;
36733 jboolean ret_conv = ChannelTypeFeatures_supports_static_remote_key(&this_arg_conv);
36737 jboolean __attribute__((export_name("TS_InitFeatures_requires_static_remote_key"))) TS_InitFeatures_requires_static_remote_key(uint64_t this_arg) {
36738 LDKInitFeatures this_arg_conv;
36739 this_arg_conv.inner = untag_ptr(this_arg);
36740 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36741 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36742 this_arg_conv.is_owned = false;
36743 jboolean ret_conv = InitFeatures_requires_static_remote_key(&this_arg_conv);
36747 jboolean __attribute__((export_name("TS_NodeFeatures_requires_static_remote_key"))) TS_NodeFeatures_requires_static_remote_key(uint64_t this_arg) {
36748 LDKNodeFeatures this_arg_conv;
36749 this_arg_conv.inner = untag_ptr(this_arg);
36750 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36751 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36752 this_arg_conv.is_owned = false;
36753 jboolean ret_conv = NodeFeatures_requires_static_remote_key(&this_arg_conv);
36757 jboolean __attribute__((export_name("TS_ChannelTypeFeatures_requires_static_remote_key"))) TS_ChannelTypeFeatures_requires_static_remote_key(uint64_t this_arg) {
36758 LDKChannelTypeFeatures this_arg_conv;
36759 this_arg_conv.inner = untag_ptr(this_arg);
36760 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36761 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36762 this_arg_conv.is_owned = false;
36763 jboolean ret_conv = ChannelTypeFeatures_requires_static_remote_key(&this_arg_conv);
36767 void __attribute__((export_name("TS_InitFeatures_set_payment_secret_optional"))) TS_InitFeatures_set_payment_secret_optional(uint64_t this_arg) {
36768 LDKInitFeatures this_arg_conv;
36769 this_arg_conv.inner = untag_ptr(this_arg);
36770 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36771 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36772 this_arg_conv.is_owned = false;
36773 InitFeatures_set_payment_secret_optional(&this_arg_conv);
36776 void __attribute__((export_name("TS_InitFeatures_set_payment_secret_required"))) TS_InitFeatures_set_payment_secret_required(uint64_t this_arg) {
36777 LDKInitFeatures this_arg_conv;
36778 this_arg_conv.inner = untag_ptr(this_arg);
36779 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36780 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36781 this_arg_conv.is_owned = false;
36782 InitFeatures_set_payment_secret_required(&this_arg_conv);
36785 jboolean __attribute__((export_name("TS_InitFeatures_supports_payment_secret"))) TS_InitFeatures_supports_payment_secret(uint64_t this_arg) {
36786 LDKInitFeatures this_arg_conv;
36787 this_arg_conv.inner = untag_ptr(this_arg);
36788 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36789 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36790 this_arg_conv.is_owned = false;
36791 jboolean ret_conv = InitFeatures_supports_payment_secret(&this_arg_conv);
36795 void __attribute__((export_name("TS_NodeFeatures_set_payment_secret_optional"))) TS_NodeFeatures_set_payment_secret_optional(uint64_t this_arg) {
36796 LDKNodeFeatures this_arg_conv;
36797 this_arg_conv.inner = untag_ptr(this_arg);
36798 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36799 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36800 this_arg_conv.is_owned = false;
36801 NodeFeatures_set_payment_secret_optional(&this_arg_conv);
36804 void __attribute__((export_name("TS_NodeFeatures_set_payment_secret_required"))) TS_NodeFeatures_set_payment_secret_required(uint64_t this_arg) {
36805 LDKNodeFeatures this_arg_conv;
36806 this_arg_conv.inner = untag_ptr(this_arg);
36807 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36808 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36809 this_arg_conv.is_owned = false;
36810 NodeFeatures_set_payment_secret_required(&this_arg_conv);
36813 jboolean __attribute__((export_name("TS_NodeFeatures_supports_payment_secret"))) TS_NodeFeatures_supports_payment_secret(uint64_t this_arg) {
36814 LDKNodeFeatures this_arg_conv;
36815 this_arg_conv.inner = untag_ptr(this_arg);
36816 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36817 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36818 this_arg_conv.is_owned = false;
36819 jboolean ret_conv = NodeFeatures_supports_payment_secret(&this_arg_conv);
36823 void __attribute__((export_name("TS_InvoiceFeatures_set_payment_secret_optional"))) TS_InvoiceFeatures_set_payment_secret_optional(uint64_t this_arg) {
36824 LDKInvoiceFeatures this_arg_conv;
36825 this_arg_conv.inner = untag_ptr(this_arg);
36826 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36827 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36828 this_arg_conv.is_owned = false;
36829 InvoiceFeatures_set_payment_secret_optional(&this_arg_conv);
36832 void __attribute__((export_name("TS_InvoiceFeatures_set_payment_secret_required"))) TS_InvoiceFeatures_set_payment_secret_required(uint64_t this_arg) {
36833 LDKInvoiceFeatures this_arg_conv;
36834 this_arg_conv.inner = untag_ptr(this_arg);
36835 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36836 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36837 this_arg_conv.is_owned = false;
36838 InvoiceFeatures_set_payment_secret_required(&this_arg_conv);
36841 jboolean __attribute__((export_name("TS_InvoiceFeatures_supports_payment_secret"))) TS_InvoiceFeatures_supports_payment_secret(uint64_t this_arg) {
36842 LDKInvoiceFeatures this_arg_conv;
36843 this_arg_conv.inner = untag_ptr(this_arg);
36844 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36845 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36846 this_arg_conv.is_owned = false;
36847 jboolean ret_conv = InvoiceFeatures_supports_payment_secret(&this_arg_conv);
36851 jboolean __attribute__((export_name("TS_InitFeatures_requires_payment_secret"))) TS_InitFeatures_requires_payment_secret(uint64_t this_arg) {
36852 LDKInitFeatures this_arg_conv;
36853 this_arg_conv.inner = untag_ptr(this_arg);
36854 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36855 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36856 this_arg_conv.is_owned = false;
36857 jboolean ret_conv = InitFeatures_requires_payment_secret(&this_arg_conv);
36861 jboolean __attribute__((export_name("TS_NodeFeatures_requires_payment_secret"))) TS_NodeFeatures_requires_payment_secret(uint64_t this_arg) {
36862 LDKNodeFeatures this_arg_conv;
36863 this_arg_conv.inner = untag_ptr(this_arg);
36864 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36865 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36866 this_arg_conv.is_owned = false;
36867 jboolean ret_conv = NodeFeatures_requires_payment_secret(&this_arg_conv);
36871 jboolean __attribute__((export_name("TS_InvoiceFeatures_requires_payment_secret"))) TS_InvoiceFeatures_requires_payment_secret(uint64_t this_arg) {
36872 LDKInvoiceFeatures this_arg_conv;
36873 this_arg_conv.inner = untag_ptr(this_arg);
36874 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36875 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36876 this_arg_conv.is_owned = false;
36877 jboolean ret_conv = InvoiceFeatures_requires_payment_secret(&this_arg_conv);
36881 void __attribute__((export_name("TS_InitFeatures_set_basic_mpp_optional"))) TS_InitFeatures_set_basic_mpp_optional(uint64_t this_arg) {
36882 LDKInitFeatures this_arg_conv;
36883 this_arg_conv.inner = untag_ptr(this_arg);
36884 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36885 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36886 this_arg_conv.is_owned = false;
36887 InitFeatures_set_basic_mpp_optional(&this_arg_conv);
36890 void __attribute__((export_name("TS_InitFeatures_set_basic_mpp_required"))) TS_InitFeatures_set_basic_mpp_required(uint64_t this_arg) {
36891 LDKInitFeatures this_arg_conv;
36892 this_arg_conv.inner = untag_ptr(this_arg);
36893 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36894 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36895 this_arg_conv.is_owned = false;
36896 InitFeatures_set_basic_mpp_required(&this_arg_conv);
36899 jboolean __attribute__((export_name("TS_InitFeatures_supports_basic_mpp"))) TS_InitFeatures_supports_basic_mpp(uint64_t this_arg) {
36900 LDKInitFeatures this_arg_conv;
36901 this_arg_conv.inner = untag_ptr(this_arg);
36902 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36903 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36904 this_arg_conv.is_owned = false;
36905 jboolean ret_conv = InitFeatures_supports_basic_mpp(&this_arg_conv);
36909 void __attribute__((export_name("TS_NodeFeatures_set_basic_mpp_optional"))) TS_NodeFeatures_set_basic_mpp_optional(uint64_t this_arg) {
36910 LDKNodeFeatures this_arg_conv;
36911 this_arg_conv.inner = untag_ptr(this_arg);
36912 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36913 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36914 this_arg_conv.is_owned = false;
36915 NodeFeatures_set_basic_mpp_optional(&this_arg_conv);
36918 void __attribute__((export_name("TS_NodeFeatures_set_basic_mpp_required"))) TS_NodeFeatures_set_basic_mpp_required(uint64_t this_arg) {
36919 LDKNodeFeatures this_arg_conv;
36920 this_arg_conv.inner = untag_ptr(this_arg);
36921 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36922 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36923 this_arg_conv.is_owned = false;
36924 NodeFeatures_set_basic_mpp_required(&this_arg_conv);
36927 jboolean __attribute__((export_name("TS_NodeFeatures_supports_basic_mpp"))) TS_NodeFeatures_supports_basic_mpp(uint64_t this_arg) {
36928 LDKNodeFeatures this_arg_conv;
36929 this_arg_conv.inner = untag_ptr(this_arg);
36930 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36931 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36932 this_arg_conv.is_owned = false;
36933 jboolean ret_conv = NodeFeatures_supports_basic_mpp(&this_arg_conv);
36937 void __attribute__((export_name("TS_InvoiceFeatures_set_basic_mpp_optional"))) TS_InvoiceFeatures_set_basic_mpp_optional(uint64_t this_arg) {
36938 LDKInvoiceFeatures this_arg_conv;
36939 this_arg_conv.inner = untag_ptr(this_arg);
36940 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36941 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36942 this_arg_conv.is_owned = false;
36943 InvoiceFeatures_set_basic_mpp_optional(&this_arg_conv);
36946 void __attribute__((export_name("TS_InvoiceFeatures_set_basic_mpp_required"))) TS_InvoiceFeatures_set_basic_mpp_required(uint64_t this_arg) {
36947 LDKInvoiceFeatures this_arg_conv;
36948 this_arg_conv.inner = untag_ptr(this_arg);
36949 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36950 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36951 this_arg_conv.is_owned = false;
36952 InvoiceFeatures_set_basic_mpp_required(&this_arg_conv);
36955 jboolean __attribute__((export_name("TS_InvoiceFeatures_supports_basic_mpp"))) TS_InvoiceFeatures_supports_basic_mpp(uint64_t this_arg) {
36956 LDKInvoiceFeatures this_arg_conv;
36957 this_arg_conv.inner = untag_ptr(this_arg);
36958 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36959 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36960 this_arg_conv.is_owned = false;
36961 jboolean ret_conv = InvoiceFeatures_supports_basic_mpp(&this_arg_conv);
36965 jboolean __attribute__((export_name("TS_InitFeatures_requires_basic_mpp"))) TS_InitFeatures_requires_basic_mpp(uint64_t this_arg) {
36966 LDKInitFeatures this_arg_conv;
36967 this_arg_conv.inner = untag_ptr(this_arg);
36968 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36969 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36970 this_arg_conv.is_owned = false;
36971 jboolean ret_conv = InitFeatures_requires_basic_mpp(&this_arg_conv);
36975 jboolean __attribute__((export_name("TS_NodeFeatures_requires_basic_mpp"))) TS_NodeFeatures_requires_basic_mpp(uint64_t this_arg) {
36976 LDKNodeFeatures this_arg_conv;
36977 this_arg_conv.inner = untag_ptr(this_arg);
36978 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36979 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36980 this_arg_conv.is_owned = false;
36981 jboolean ret_conv = NodeFeatures_requires_basic_mpp(&this_arg_conv);
36985 jboolean __attribute__((export_name("TS_InvoiceFeatures_requires_basic_mpp"))) TS_InvoiceFeatures_requires_basic_mpp(uint64_t this_arg) {
36986 LDKInvoiceFeatures this_arg_conv;
36987 this_arg_conv.inner = untag_ptr(this_arg);
36988 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36989 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36990 this_arg_conv.is_owned = false;
36991 jboolean ret_conv = InvoiceFeatures_requires_basic_mpp(&this_arg_conv);
36995 void __attribute__((export_name("TS_InitFeatures_set_wumbo_optional"))) TS_InitFeatures_set_wumbo_optional(uint64_t this_arg) {
36996 LDKInitFeatures this_arg_conv;
36997 this_arg_conv.inner = untag_ptr(this_arg);
36998 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36999 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37000 this_arg_conv.is_owned = false;
37001 InitFeatures_set_wumbo_optional(&this_arg_conv);
37004 void __attribute__((export_name("TS_InitFeatures_set_wumbo_required"))) TS_InitFeatures_set_wumbo_required(uint64_t this_arg) {
37005 LDKInitFeatures this_arg_conv;
37006 this_arg_conv.inner = untag_ptr(this_arg);
37007 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37008 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37009 this_arg_conv.is_owned = false;
37010 InitFeatures_set_wumbo_required(&this_arg_conv);
37013 jboolean __attribute__((export_name("TS_InitFeatures_supports_wumbo"))) TS_InitFeatures_supports_wumbo(uint64_t this_arg) {
37014 LDKInitFeatures this_arg_conv;
37015 this_arg_conv.inner = untag_ptr(this_arg);
37016 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37017 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37018 this_arg_conv.is_owned = false;
37019 jboolean ret_conv = InitFeatures_supports_wumbo(&this_arg_conv);
37023 void __attribute__((export_name("TS_NodeFeatures_set_wumbo_optional"))) TS_NodeFeatures_set_wumbo_optional(uint64_t this_arg) {
37024 LDKNodeFeatures this_arg_conv;
37025 this_arg_conv.inner = untag_ptr(this_arg);
37026 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37027 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37028 this_arg_conv.is_owned = false;
37029 NodeFeatures_set_wumbo_optional(&this_arg_conv);
37032 void __attribute__((export_name("TS_NodeFeatures_set_wumbo_required"))) TS_NodeFeatures_set_wumbo_required(uint64_t this_arg) {
37033 LDKNodeFeatures this_arg_conv;
37034 this_arg_conv.inner = untag_ptr(this_arg);
37035 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37036 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37037 this_arg_conv.is_owned = false;
37038 NodeFeatures_set_wumbo_required(&this_arg_conv);
37041 jboolean __attribute__((export_name("TS_NodeFeatures_supports_wumbo"))) TS_NodeFeatures_supports_wumbo(uint64_t this_arg) {
37042 LDKNodeFeatures this_arg_conv;
37043 this_arg_conv.inner = untag_ptr(this_arg);
37044 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37045 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37046 this_arg_conv.is_owned = false;
37047 jboolean ret_conv = NodeFeatures_supports_wumbo(&this_arg_conv);
37051 jboolean __attribute__((export_name("TS_InitFeatures_requires_wumbo"))) TS_InitFeatures_requires_wumbo(uint64_t this_arg) {
37052 LDKInitFeatures this_arg_conv;
37053 this_arg_conv.inner = untag_ptr(this_arg);
37054 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37055 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37056 this_arg_conv.is_owned = false;
37057 jboolean ret_conv = InitFeatures_requires_wumbo(&this_arg_conv);
37061 jboolean __attribute__((export_name("TS_NodeFeatures_requires_wumbo"))) TS_NodeFeatures_requires_wumbo(uint64_t this_arg) {
37062 LDKNodeFeatures this_arg_conv;
37063 this_arg_conv.inner = untag_ptr(this_arg);
37064 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37065 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37066 this_arg_conv.is_owned = false;
37067 jboolean ret_conv = NodeFeatures_requires_wumbo(&this_arg_conv);
37071 void __attribute__((export_name("TS_InitFeatures_set_shutdown_any_segwit_optional"))) TS_InitFeatures_set_shutdown_any_segwit_optional(uint64_t this_arg) {
37072 LDKInitFeatures this_arg_conv;
37073 this_arg_conv.inner = untag_ptr(this_arg);
37074 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37075 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37076 this_arg_conv.is_owned = false;
37077 InitFeatures_set_shutdown_any_segwit_optional(&this_arg_conv);
37080 void __attribute__((export_name("TS_InitFeatures_set_shutdown_any_segwit_required"))) TS_InitFeatures_set_shutdown_any_segwit_required(uint64_t this_arg) {
37081 LDKInitFeatures this_arg_conv;
37082 this_arg_conv.inner = untag_ptr(this_arg);
37083 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37084 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37085 this_arg_conv.is_owned = false;
37086 InitFeatures_set_shutdown_any_segwit_required(&this_arg_conv);
37089 jboolean __attribute__((export_name("TS_InitFeatures_supports_shutdown_anysegwit"))) TS_InitFeatures_supports_shutdown_anysegwit(uint64_t this_arg) {
37090 LDKInitFeatures this_arg_conv;
37091 this_arg_conv.inner = untag_ptr(this_arg);
37092 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37093 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37094 this_arg_conv.is_owned = false;
37095 jboolean ret_conv = InitFeatures_supports_shutdown_anysegwit(&this_arg_conv);
37099 void __attribute__((export_name("TS_NodeFeatures_set_shutdown_any_segwit_optional"))) TS_NodeFeatures_set_shutdown_any_segwit_optional(uint64_t this_arg) {
37100 LDKNodeFeatures this_arg_conv;
37101 this_arg_conv.inner = untag_ptr(this_arg);
37102 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37103 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37104 this_arg_conv.is_owned = false;
37105 NodeFeatures_set_shutdown_any_segwit_optional(&this_arg_conv);
37108 void __attribute__((export_name("TS_NodeFeatures_set_shutdown_any_segwit_required"))) TS_NodeFeatures_set_shutdown_any_segwit_required(uint64_t this_arg) {
37109 LDKNodeFeatures this_arg_conv;
37110 this_arg_conv.inner = untag_ptr(this_arg);
37111 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37112 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37113 this_arg_conv.is_owned = false;
37114 NodeFeatures_set_shutdown_any_segwit_required(&this_arg_conv);
37117 jboolean __attribute__((export_name("TS_NodeFeatures_supports_shutdown_anysegwit"))) TS_NodeFeatures_supports_shutdown_anysegwit(uint64_t this_arg) {
37118 LDKNodeFeatures this_arg_conv;
37119 this_arg_conv.inner = untag_ptr(this_arg);
37120 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37121 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37122 this_arg_conv.is_owned = false;
37123 jboolean ret_conv = NodeFeatures_supports_shutdown_anysegwit(&this_arg_conv);
37127 jboolean __attribute__((export_name("TS_InitFeatures_requires_shutdown_anysegwit"))) TS_InitFeatures_requires_shutdown_anysegwit(uint64_t this_arg) {
37128 LDKInitFeatures this_arg_conv;
37129 this_arg_conv.inner = untag_ptr(this_arg);
37130 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37131 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37132 this_arg_conv.is_owned = false;
37133 jboolean ret_conv = InitFeatures_requires_shutdown_anysegwit(&this_arg_conv);
37137 jboolean __attribute__((export_name("TS_NodeFeatures_requires_shutdown_anysegwit"))) TS_NodeFeatures_requires_shutdown_anysegwit(uint64_t this_arg) {
37138 LDKNodeFeatures this_arg_conv;
37139 this_arg_conv.inner = untag_ptr(this_arg);
37140 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37141 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37142 this_arg_conv.is_owned = false;
37143 jboolean ret_conv = NodeFeatures_requires_shutdown_anysegwit(&this_arg_conv);
37147 void __attribute__((export_name("TS_InitFeatures_set_channel_type_optional"))) TS_InitFeatures_set_channel_type_optional(uint64_t this_arg) {
37148 LDKInitFeatures this_arg_conv;
37149 this_arg_conv.inner = untag_ptr(this_arg);
37150 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37151 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37152 this_arg_conv.is_owned = false;
37153 InitFeatures_set_channel_type_optional(&this_arg_conv);
37156 void __attribute__((export_name("TS_InitFeatures_set_channel_type_required"))) TS_InitFeatures_set_channel_type_required(uint64_t this_arg) {
37157 LDKInitFeatures this_arg_conv;
37158 this_arg_conv.inner = untag_ptr(this_arg);
37159 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37160 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37161 this_arg_conv.is_owned = false;
37162 InitFeatures_set_channel_type_required(&this_arg_conv);
37165 jboolean __attribute__((export_name("TS_InitFeatures_supports_channel_type"))) TS_InitFeatures_supports_channel_type(uint64_t this_arg) {
37166 LDKInitFeatures this_arg_conv;
37167 this_arg_conv.inner = untag_ptr(this_arg);
37168 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37169 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37170 this_arg_conv.is_owned = false;
37171 jboolean ret_conv = InitFeatures_supports_channel_type(&this_arg_conv);
37175 void __attribute__((export_name("TS_NodeFeatures_set_channel_type_optional"))) TS_NodeFeatures_set_channel_type_optional(uint64_t this_arg) {
37176 LDKNodeFeatures this_arg_conv;
37177 this_arg_conv.inner = untag_ptr(this_arg);
37178 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37179 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37180 this_arg_conv.is_owned = false;
37181 NodeFeatures_set_channel_type_optional(&this_arg_conv);
37184 void __attribute__((export_name("TS_NodeFeatures_set_channel_type_required"))) TS_NodeFeatures_set_channel_type_required(uint64_t this_arg) {
37185 LDKNodeFeatures this_arg_conv;
37186 this_arg_conv.inner = untag_ptr(this_arg);
37187 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37188 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37189 this_arg_conv.is_owned = false;
37190 NodeFeatures_set_channel_type_required(&this_arg_conv);
37193 jboolean __attribute__((export_name("TS_NodeFeatures_supports_channel_type"))) TS_NodeFeatures_supports_channel_type(uint64_t this_arg) {
37194 LDKNodeFeatures this_arg_conv;
37195 this_arg_conv.inner = untag_ptr(this_arg);
37196 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37197 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37198 this_arg_conv.is_owned = false;
37199 jboolean ret_conv = NodeFeatures_supports_channel_type(&this_arg_conv);
37203 jboolean __attribute__((export_name("TS_InitFeatures_requires_channel_type"))) TS_InitFeatures_requires_channel_type(uint64_t this_arg) {
37204 LDKInitFeatures this_arg_conv;
37205 this_arg_conv.inner = untag_ptr(this_arg);
37206 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37207 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37208 this_arg_conv.is_owned = false;
37209 jboolean ret_conv = InitFeatures_requires_channel_type(&this_arg_conv);
37213 jboolean __attribute__((export_name("TS_NodeFeatures_requires_channel_type"))) TS_NodeFeatures_requires_channel_type(uint64_t this_arg) {
37214 LDKNodeFeatures this_arg_conv;
37215 this_arg_conv.inner = untag_ptr(this_arg);
37216 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37217 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37218 this_arg_conv.is_owned = false;
37219 jboolean ret_conv = NodeFeatures_requires_channel_type(&this_arg_conv);
37223 void __attribute__((export_name("TS_InitFeatures_set_scid_privacy_optional"))) TS_InitFeatures_set_scid_privacy_optional(uint64_t this_arg) {
37224 LDKInitFeatures this_arg_conv;
37225 this_arg_conv.inner = untag_ptr(this_arg);
37226 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37227 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37228 this_arg_conv.is_owned = false;
37229 InitFeatures_set_scid_privacy_optional(&this_arg_conv);
37232 void __attribute__((export_name("TS_InitFeatures_set_scid_privacy_required"))) TS_InitFeatures_set_scid_privacy_required(uint64_t this_arg) {
37233 LDKInitFeatures this_arg_conv;
37234 this_arg_conv.inner = untag_ptr(this_arg);
37235 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37236 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37237 this_arg_conv.is_owned = false;
37238 InitFeatures_set_scid_privacy_required(&this_arg_conv);
37241 jboolean __attribute__((export_name("TS_InitFeatures_supports_scid_privacy"))) TS_InitFeatures_supports_scid_privacy(uint64_t this_arg) {
37242 LDKInitFeatures this_arg_conv;
37243 this_arg_conv.inner = untag_ptr(this_arg);
37244 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37245 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37246 this_arg_conv.is_owned = false;
37247 jboolean ret_conv = InitFeatures_supports_scid_privacy(&this_arg_conv);
37251 void __attribute__((export_name("TS_NodeFeatures_set_scid_privacy_optional"))) TS_NodeFeatures_set_scid_privacy_optional(uint64_t this_arg) {
37252 LDKNodeFeatures this_arg_conv;
37253 this_arg_conv.inner = untag_ptr(this_arg);
37254 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37255 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37256 this_arg_conv.is_owned = false;
37257 NodeFeatures_set_scid_privacy_optional(&this_arg_conv);
37260 void __attribute__((export_name("TS_NodeFeatures_set_scid_privacy_required"))) TS_NodeFeatures_set_scid_privacy_required(uint64_t this_arg) {
37261 LDKNodeFeatures this_arg_conv;
37262 this_arg_conv.inner = untag_ptr(this_arg);
37263 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37264 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37265 this_arg_conv.is_owned = false;
37266 NodeFeatures_set_scid_privacy_required(&this_arg_conv);
37269 jboolean __attribute__((export_name("TS_NodeFeatures_supports_scid_privacy"))) TS_NodeFeatures_supports_scid_privacy(uint64_t this_arg) {
37270 LDKNodeFeatures this_arg_conv;
37271 this_arg_conv.inner = untag_ptr(this_arg);
37272 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37273 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37274 this_arg_conv.is_owned = false;
37275 jboolean ret_conv = NodeFeatures_supports_scid_privacy(&this_arg_conv);
37279 void __attribute__((export_name("TS_ChannelTypeFeatures_set_scid_privacy_optional"))) TS_ChannelTypeFeatures_set_scid_privacy_optional(uint64_t this_arg) {
37280 LDKChannelTypeFeatures this_arg_conv;
37281 this_arg_conv.inner = untag_ptr(this_arg);
37282 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37283 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37284 this_arg_conv.is_owned = false;
37285 ChannelTypeFeatures_set_scid_privacy_optional(&this_arg_conv);
37288 void __attribute__((export_name("TS_ChannelTypeFeatures_set_scid_privacy_required"))) TS_ChannelTypeFeatures_set_scid_privacy_required(uint64_t this_arg) {
37289 LDKChannelTypeFeatures this_arg_conv;
37290 this_arg_conv.inner = untag_ptr(this_arg);
37291 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37292 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37293 this_arg_conv.is_owned = false;
37294 ChannelTypeFeatures_set_scid_privacy_required(&this_arg_conv);
37297 jboolean __attribute__((export_name("TS_ChannelTypeFeatures_supports_scid_privacy"))) TS_ChannelTypeFeatures_supports_scid_privacy(uint64_t this_arg) {
37298 LDKChannelTypeFeatures this_arg_conv;
37299 this_arg_conv.inner = untag_ptr(this_arg);
37300 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37301 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37302 this_arg_conv.is_owned = false;
37303 jboolean ret_conv = ChannelTypeFeatures_supports_scid_privacy(&this_arg_conv);
37307 jboolean __attribute__((export_name("TS_InitFeatures_requires_scid_privacy"))) TS_InitFeatures_requires_scid_privacy(uint64_t this_arg) {
37308 LDKInitFeatures this_arg_conv;
37309 this_arg_conv.inner = untag_ptr(this_arg);
37310 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37311 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37312 this_arg_conv.is_owned = false;
37313 jboolean ret_conv = InitFeatures_requires_scid_privacy(&this_arg_conv);
37317 jboolean __attribute__((export_name("TS_NodeFeatures_requires_scid_privacy"))) TS_NodeFeatures_requires_scid_privacy(uint64_t this_arg) {
37318 LDKNodeFeatures this_arg_conv;
37319 this_arg_conv.inner = untag_ptr(this_arg);
37320 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37321 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37322 this_arg_conv.is_owned = false;
37323 jboolean ret_conv = NodeFeatures_requires_scid_privacy(&this_arg_conv);
37327 jboolean __attribute__((export_name("TS_ChannelTypeFeatures_requires_scid_privacy"))) TS_ChannelTypeFeatures_requires_scid_privacy(uint64_t this_arg) {
37328 LDKChannelTypeFeatures this_arg_conv;
37329 this_arg_conv.inner = untag_ptr(this_arg);
37330 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37331 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37332 this_arg_conv.is_owned = false;
37333 jboolean ret_conv = ChannelTypeFeatures_requires_scid_privacy(&this_arg_conv);
37337 void __attribute__((export_name("TS_InitFeatures_set_zero_conf_optional"))) TS_InitFeatures_set_zero_conf_optional(uint64_t this_arg) {
37338 LDKInitFeatures this_arg_conv;
37339 this_arg_conv.inner = untag_ptr(this_arg);
37340 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37341 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37342 this_arg_conv.is_owned = false;
37343 InitFeatures_set_zero_conf_optional(&this_arg_conv);
37346 void __attribute__((export_name("TS_InitFeatures_set_zero_conf_required"))) TS_InitFeatures_set_zero_conf_required(uint64_t this_arg) {
37347 LDKInitFeatures this_arg_conv;
37348 this_arg_conv.inner = untag_ptr(this_arg);
37349 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37350 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37351 this_arg_conv.is_owned = false;
37352 InitFeatures_set_zero_conf_required(&this_arg_conv);
37355 jboolean __attribute__((export_name("TS_InitFeatures_supports_zero_conf"))) TS_InitFeatures_supports_zero_conf(uint64_t this_arg) {
37356 LDKInitFeatures this_arg_conv;
37357 this_arg_conv.inner = untag_ptr(this_arg);
37358 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37359 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37360 this_arg_conv.is_owned = false;
37361 jboolean ret_conv = InitFeatures_supports_zero_conf(&this_arg_conv);
37365 void __attribute__((export_name("TS_NodeFeatures_set_zero_conf_optional"))) TS_NodeFeatures_set_zero_conf_optional(uint64_t this_arg) {
37366 LDKNodeFeatures this_arg_conv;
37367 this_arg_conv.inner = untag_ptr(this_arg);
37368 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37369 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37370 this_arg_conv.is_owned = false;
37371 NodeFeatures_set_zero_conf_optional(&this_arg_conv);
37374 void __attribute__((export_name("TS_NodeFeatures_set_zero_conf_required"))) TS_NodeFeatures_set_zero_conf_required(uint64_t this_arg) {
37375 LDKNodeFeatures this_arg_conv;
37376 this_arg_conv.inner = untag_ptr(this_arg);
37377 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37378 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37379 this_arg_conv.is_owned = false;
37380 NodeFeatures_set_zero_conf_required(&this_arg_conv);
37383 jboolean __attribute__((export_name("TS_NodeFeatures_supports_zero_conf"))) TS_NodeFeatures_supports_zero_conf(uint64_t this_arg) {
37384 LDKNodeFeatures this_arg_conv;
37385 this_arg_conv.inner = untag_ptr(this_arg);
37386 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37387 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37388 this_arg_conv.is_owned = false;
37389 jboolean ret_conv = NodeFeatures_supports_zero_conf(&this_arg_conv);
37393 void __attribute__((export_name("TS_ChannelTypeFeatures_set_zero_conf_optional"))) TS_ChannelTypeFeatures_set_zero_conf_optional(uint64_t this_arg) {
37394 LDKChannelTypeFeatures this_arg_conv;
37395 this_arg_conv.inner = untag_ptr(this_arg);
37396 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37397 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37398 this_arg_conv.is_owned = false;
37399 ChannelTypeFeatures_set_zero_conf_optional(&this_arg_conv);
37402 void __attribute__((export_name("TS_ChannelTypeFeatures_set_zero_conf_required"))) TS_ChannelTypeFeatures_set_zero_conf_required(uint64_t this_arg) {
37403 LDKChannelTypeFeatures this_arg_conv;
37404 this_arg_conv.inner = untag_ptr(this_arg);
37405 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37406 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37407 this_arg_conv.is_owned = false;
37408 ChannelTypeFeatures_set_zero_conf_required(&this_arg_conv);
37411 jboolean __attribute__((export_name("TS_ChannelTypeFeatures_supports_zero_conf"))) TS_ChannelTypeFeatures_supports_zero_conf(uint64_t this_arg) {
37412 LDKChannelTypeFeatures this_arg_conv;
37413 this_arg_conv.inner = untag_ptr(this_arg);
37414 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37415 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37416 this_arg_conv.is_owned = false;
37417 jboolean ret_conv = ChannelTypeFeatures_supports_zero_conf(&this_arg_conv);
37421 jboolean __attribute__((export_name("TS_InitFeatures_requires_zero_conf"))) TS_InitFeatures_requires_zero_conf(uint64_t this_arg) {
37422 LDKInitFeatures this_arg_conv;
37423 this_arg_conv.inner = untag_ptr(this_arg);
37424 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37425 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37426 this_arg_conv.is_owned = false;
37427 jboolean ret_conv = InitFeatures_requires_zero_conf(&this_arg_conv);
37431 jboolean __attribute__((export_name("TS_NodeFeatures_requires_zero_conf"))) TS_NodeFeatures_requires_zero_conf(uint64_t this_arg) {
37432 LDKNodeFeatures this_arg_conv;
37433 this_arg_conv.inner = untag_ptr(this_arg);
37434 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37435 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37436 this_arg_conv.is_owned = false;
37437 jboolean ret_conv = NodeFeatures_requires_zero_conf(&this_arg_conv);
37441 jboolean __attribute__((export_name("TS_ChannelTypeFeatures_requires_zero_conf"))) TS_ChannelTypeFeatures_requires_zero_conf(uint64_t this_arg) {
37442 LDKChannelTypeFeatures this_arg_conv;
37443 this_arg_conv.inner = untag_ptr(this_arg);
37444 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37445 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37446 this_arg_conv.is_owned = false;
37447 jboolean ret_conv = ChannelTypeFeatures_requires_zero_conf(&this_arg_conv);
37451 void __attribute__((export_name("TS_NodeFeatures_set_keysend_optional"))) TS_NodeFeatures_set_keysend_optional(uint64_t this_arg) {
37452 LDKNodeFeatures this_arg_conv;
37453 this_arg_conv.inner = untag_ptr(this_arg);
37454 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37455 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37456 this_arg_conv.is_owned = false;
37457 NodeFeatures_set_keysend_optional(&this_arg_conv);
37460 void __attribute__((export_name("TS_NodeFeatures_set_keysend_required"))) TS_NodeFeatures_set_keysend_required(uint64_t this_arg) {
37461 LDKNodeFeatures this_arg_conv;
37462 this_arg_conv.inner = untag_ptr(this_arg);
37463 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37464 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37465 this_arg_conv.is_owned = false;
37466 NodeFeatures_set_keysend_required(&this_arg_conv);
37469 jboolean __attribute__((export_name("TS_NodeFeatures_supports_keysend"))) TS_NodeFeatures_supports_keysend(uint64_t this_arg) {
37470 LDKNodeFeatures this_arg_conv;
37471 this_arg_conv.inner = untag_ptr(this_arg);
37472 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37473 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37474 this_arg_conv.is_owned = false;
37475 jboolean ret_conv = NodeFeatures_supports_keysend(&this_arg_conv);
37479 jboolean __attribute__((export_name("TS_NodeFeatures_requires_keysend"))) TS_NodeFeatures_requires_keysend(uint64_t this_arg) {
37480 LDKNodeFeatures this_arg_conv;
37481 this_arg_conv.inner = untag_ptr(this_arg);
37482 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37483 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37484 this_arg_conv.is_owned = false;
37485 jboolean ret_conv = NodeFeatures_requires_keysend(&this_arg_conv);
37489 void __attribute__((export_name("TS_ShutdownScript_free"))) TS_ShutdownScript_free(uint64_t this_obj) {
37490 LDKShutdownScript this_obj_conv;
37491 this_obj_conv.inner = untag_ptr(this_obj);
37492 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37493 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37494 ShutdownScript_free(this_obj_conv);
37497 static inline uint64_t ShutdownScript_clone_ptr(LDKShutdownScript *NONNULL_PTR arg) {
37498 LDKShutdownScript ret_var = ShutdownScript_clone(arg);
37499 uint64_t ret_ref = 0;
37500 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37501 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37504 int64_t __attribute__((export_name("TS_ShutdownScript_clone_ptr"))) TS_ShutdownScript_clone_ptr(uint64_t arg) {
37505 LDKShutdownScript arg_conv;
37506 arg_conv.inner = untag_ptr(arg);
37507 arg_conv.is_owned = ptr_is_owned(arg);
37508 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
37509 arg_conv.is_owned = false;
37510 int64_t ret_conv = ShutdownScript_clone_ptr(&arg_conv);
37514 uint64_t __attribute__((export_name("TS_ShutdownScript_clone"))) TS_ShutdownScript_clone(uint64_t orig) {
37515 LDKShutdownScript orig_conv;
37516 orig_conv.inner = untag_ptr(orig);
37517 orig_conv.is_owned = ptr_is_owned(orig);
37518 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
37519 orig_conv.is_owned = false;
37520 LDKShutdownScript ret_var = ShutdownScript_clone(&orig_conv);
37521 uint64_t ret_ref = 0;
37522 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37523 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37527 void __attribute__((export_name("TS_InvalidShutdownScript_free"))) TS_InvalidShutdownScript_free(uint64_t this_obj) {
37528 LDKInvalidShutdownScript this_obj_conv;
37529 this_obj_conv.inner = untag_ptr(this_obj);
37530 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37531 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37532 InvalidShutdownScript_free(this_obj_conv);
37535 int8_tArray __attribute__((export_name("TS_InvalidShutdownScript_get_script"))) TS_InvalidShutdownScript_get_script(uint64_t this_ptr) {
37536 LDKInvalidShutdownScript this_ptr_conv;
37537 this_ptr_conv.inner = untag_ptr(this_ptr);
37538 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37539 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37540 this_ptr_conv.is_owned = false;
37541 LDKu8slice ret_var = InvalidShutdownScript_get_script(&this_ptr_conv);
37542 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
37543 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
37547 void __attribute__((export_name("TS_InvalidShutdownScript_set_script"))) TS_InvalidShutdownScript_set_script(uint64_t this_ptr, int8_tArray val) {
37548 LDKInvalidShutdownScript this_ptr_conv;
37549 this_ptr_conv.inner = untag_ptr(this_ptr);
37550 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37551 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37552 this_ptr_conv.is_owned = false;
37553 LDKCVec_u8Z val_ref;
37554 val_ref.datalen = val->arr_len;
37555 val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes");
37556 memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val);
37557 InvalidShutdownScript_set_script(&this_ptr_conv, val_ref);
37560 uint64_t __attribute__((export_name("TS_InvalidShutdownScript_new"))) TS_InvalidShutdownScript_new(int8_tArray script_arg) {
37561 LDKCVec_u8Z script_arg_ref;
37562 script_arg_ref.datalen = script_arg->arr_len;
37563 script_arg_ref.data = MALLOC(script_arg_ref.datalen, "LDKCVec_u8Z Bytes");
37564 memcpy(script_arg_ref.data, script_arg->elems, script_arg_ref.datalen); FREE(script_arg);
37565 LDKInvalidShutdownScript ret_var = InvalidShutdownScript_new(script_arg_ref);
37566 uint64_t ret_ref = 0;
37567 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37568 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37572 static inline uint64_t InvalidShutdownScript_clone_ptr(LDKInvalidShutdownScript *NONNULL_PTR arg) {
37573 LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(arg);
37574 uint64_t ret_ref = 0;
37575 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37576 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37579 int64_t __attribute__((export_name("TS_InvalidShutdownScript_clone_ptr"))) TS_InvalidShutdownScript_clone_ptr(uint64_t arg) {
37580 LDKInvalidShutdownScript arg_conv;
37581 arg_conv.inner = untag_ptr(arg);
37582 arg_conv.is_owned = ptr_is_owned(arg);
37583 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
37584 arg_conv.is_owned = false;
37585 int64_t ret_conv = InvalidShutdownScript_clone_ptr(&arg_conv);
37589 uint64_t __attribute__((export_name("TS_InvalidShutdownScript_clone"))) TS_InvalidShutdownScript_clone(uint64_t orig) {
37590 LDKInvalidShutdownScript orig_conv;
37591 orig_conv.inner = untag_ptr(orig);
37592 orig_conv.is_owned = ptr_is_owned(orig);
37593 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
37594 orig_conv.is_owned = false;
37595 LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(&orig_conv);
37596 uint64_t ret_ref = 0;
37597 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37598 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37602 int8_tArray __attribute__((export_name("TS_ShutdownScript_write"))) TS_ShutdownScript_write(uint64_t obj) {
37603 LDKShutdownScript obj_conv;
37604 obj_conv.inner = untag_ptr(obj);
37605 obj_conv.is_owned = ptr_is_owned(obj);
37606 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
37607 obj_conv.is_owned = false;
37608 LDKCVec_u8Z ret_var = ShutdownScript_write(&obj_conv);
37609 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
37610 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
37611 CVec_u8Z_free(ret_var);
37615 uint64_t __attribute__((export_name("TS_ShutdownScript_read"))) TS_ShutdownScript_read(int8_tArray ser) {
37616 LDKu8slice ser_ref;
37617 ser_ref.datalen = ser->arr_len;
37618 ser_ref.data = ser->elems;
37619 LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
37620 *ret_conv = ShutdownScript_read(ser_ref);
37622 return tag_ptr(ret_conv, true);
37625 uint64_t __attribute__((export_name("TS_ShutdownScript_new_p2wpkh"))) TS_ShutdownScript_new_p2wpkh(int8_tArray pubkey_hash) {
37626 unsigned char pubkey_hash_arr[20];
37627 CHECK(pubkey_hash->arr_len == 20);
37628 memcpy(pubkey_hash_arr, pubkey_hash->elems, 20); FREE(pubkey_hash);
37629 unsigned char (*pubkey_hash_ref)[20] = &pubkey_hash_arr;
37630 LDKShutdownScript ret_var = ShutdownScript_new_p2wpkh(pubkey_hash_ref);
37631 uint64_t ret_ref = 0;
37632 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37633 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37637 uint64_t __attribute__((export_name("TS_ShutdownScript_new_p2wsh"))) TS_ShutdownScript_new_p2wsh(int8_tArray script_hash) {
37638 unsigned char script_hash_arr[32];
37639 CHECK(script_hash->arr_len == 32);
37640 memcpy(script_hash_arr, script_hash->elems, 32); FREE(script_hash);
37641 unsigned char (*script_hash_ref)[32] = &script_hash_arr;
37642 LDKShutdownScript ret_var = ShutdownScript_new_p2wsh(script_hash_ref);
37643 uint64_t ret_ref = 0;
37644 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37645 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37649 uint64_t __attribute__((export_name("TS_ShutdownScript_new_witness_program"))) TS_ShutdownScript_new_witness_program(int8_t version, int8_tArray program) {
37651 LDKu8slice program_ref;
37652 program_ref.datalen = program->arr_len;
37653 program_ref.data = program->elems;
37654 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
37655 *ret_conv = ShutdownScript_new_witness_program((LDKWitnessVersion){ ._0 = version }, program_ref);
37657 return tag_ptr(ret_conv, true);
37660 int8_tArray __attribute__((export_name("TS_ShutdownScript_into_inner"))) TS_ShutdownScript_into_inner(uint64_t this_arg) {
37661 LDKShutdownScript this_arg_conv;
37662 this_arg_conv.inner = untag_ptr(this_arg);
37663 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37664 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37665 this_arg_conv = ShutdownScript_clone(&this_arg_conv);
37666 LDKCVec_u8Z ret_var = ShutdownScript_into_inner(this_arg_conv);
37667 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
37668 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
37669 CVec_u8Z_free(ret_var);
37673 int8_tArray __attribute__((export_name("TS_ShutdownScript_as_legacy_pubkey"))) TS_ShutdownScript_as_legacy_pubkey(uint64_t this_arg) {
37674 LDKShutdownScript this_arg_conv;
37675 this_arg_conv.inner = untag_ptr(this_arg);
37676 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37677 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37678 this_arg_conv.is_owned = false;
37679 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
37680 memcpy(ret_arr->elems, ShutdownScript_as_legacy_pubkey(&this_arg_conv).compressed_form, 33);
37684 jboolean __attribute__((export_name("TS_ShutdownScript_is_compatible"))) TS_ShutdownScript_is_compatible(uint64_t this_arg, uint64_t features) {
37685 LDKShutdownScript this_arg_conv;
37686 this_arg_conv.inner = untag_ptr(this_arg);
37687 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37688 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37689 this_arg_conv.is_owned = false;
37690 LDKInitFeatures features_conv;
37691 features_conv.inner = untag_ptr(features);
37692 features_conv.is_owned = ptr_is_owned(features);
37693 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv);
37694 features_conv.is_owned = false;
37695 jboolean ret_conv = ShutdownScript_is_compatible(&this_arg_conv, &features_conv);
37699 void __attribute__((export_name("TS_CustomMessageReader_free"))) TS_CustomMessageReader_free(uint64_t this_ptr) {
37700 if (!ptr_is_owned(this_ptr)) return;
37701 void* this_ptr_ptr = untag_ptr(this_ptr);
37702 CHECK_ACCESS(this_ptr_ptr);
37703 LDKCustomMessageReader this_ptr_conv = *(LDKCustomMessageReader*)(this_ptr_ptr);
37704 FREE(untag_ptr(this_ptr));
37705 CustomMessageReader_free(this_ptr_conv);
37708 static inline uint64_t Type_clone_ptr(LDKType *NONNULL_PTR arg) {
37709 LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType");
37710 *ret_ret = Type_clone(arg);
37711 return tag_ptr(ret_ret, true);
37713 int64_t __attribute__((export_name("TS_Type_clone_ptr"))) TS_Type_clone_ptr(uint64_t arg) {
37714 void* arg_ptr = untag_ptr(arg);
37715 if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); }
37716 LDKType* arg_conv = (LDKType*)arg_ptr;
37717 int64_t ret_conv = Type_clone_ptr(arg_conv);
37721 uint64_t __attribute__((export_name("TS_Type_clone"))) TS_Type_clone(uint64_t orig) {
37722 void* orig_ptr = untag_ptr(orig);
37723 if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); }
37724 LDKType* orig_conv = (LDKType*)orig_ptr;
37725 LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType");
37726 *ret_ret = Type_clone(orig_conv);
37727 return tag_ptr(ret_ret, true);
37730 void __attribute__((export_name("TS_Type_free"))) TS_Type_free(uint64_t this_ptr) {
37731 if (!ptr_is_owned(this_ptr)) return;
37732 void* this_ptr_ptr = untag_ptr(this_ptr);
37733 CHECK_ACCESS(this_ptr_ptr);
37734 LDKType this_ptr_conv = *(LDKType*)(this_ptr_ptr);
37735 FREE(untag_ptr(this_ptr));
37736 Type_free(this_ptr_conv);
37739 void __attribute__((export_name("TS_NodeId_free"))) TS_NodeId_free(uint64_t this_obj) {
37740 LDKNodeId this_obj_conv;
37741 this_obj_conv.inner = untag_ptr(this_obj);
37742 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37743 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37744 NodeId_free(this_obj_conv);
37747 static inline uint64_t NodeId_clone_ptr(LDKNodeId *NONNULL_PTR arg) {
37748 LDKNodeId ret_var = NodeId_clone(arg);
37749 uint64_t ret_ref = 0;
37750 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37751 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37754 int64_t __attribute__((export_name("TS_NodeId_clone_ptr"))) TS_NodeId_clone_ptr(uint64_t arg) {
37755 LDKNodeId arg_conv;
37756 arg_conv.inner = untag_ptr(arg);
37757 arg_conv.is_owned = ptr_is_owned(arg);
37758 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
37759 arg_conv.is_owned = false;
37760 int64_t ret_conv = NodeId_clone_ptr(&arg_conv);
37764 uint64_t __attribute__((export_name("TS_NodeId_clone"))) TS_NodeId_clone(uint64_t orig) {
37765 LDKNodeId orig_conv;
37766 orig_conv.inner = untag_ptr(orig);
37767 orig_conv.is_owned = ptr_is_owned(orig);
37768 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
37769 orig_conv.is_owned = false;
37770 LDKNodeId ret_var = NodeId_clone(&orig_conv);
37771 uint64_t ret_ref = 0;
37772 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37773 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37777 uint64_t __attribute__((export_name("TS_NodeId_from_pubkey"))) TS_NodeId_from_pubkey(int8_tArray pubkey) {
37778 LDKPublicKey pubkey_ref;
37779 CHECK(pubkey->arr_len == 33);
37780 memcpy(pubkey_ref.compressed_form, pubkey->elems, 33); FREE(pubkey);
37781 LDKNodeId ret_var = NodeId_from_pubkey(pubkey_ref);
37782 uint64_t ret_ref = 0;
37783 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37784 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37788 int8_tArray __attribute__((export_name("TS_NodeId_as_slice"))) TS_NodeId_as_slice(uint64_t this_arg) {
37789 LDKNodeId this_arg_conv;
37790 this_arg_conv.inner = untag_ptr(this_arg);
37791 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37792 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37793 this_arg_conv.is_owned = false;
37794 LDKu8slice ret_var = NodeId_as_slice(&this_arg_conv);
37795 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
37796 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
37800 int64_t __attribute__((export_name("TS_NodeId_hash"))) TS_NodeId_hash(uint64_t o) {
37802 o_conv.inner = untag_ptr(o);
37803 o_conv.is_owned = ptr_is_owned(o);
37804 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
37805 o_conv.is_owned = false;
37806 int64_t ret_conv = NodeId_hash(&o_conv);
37810 int8_tArray __attribute__((export_name("TS_NodeId_write"))) TS_NodeId_write(uint64_t obj) {
37811 LDKNodeId obj_conv;
37812 obj_conv.inner = untag_ptr(obj);
37813 obj_conv.is_owned = ptr_is_owned(obj);
37814 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
37815 obj_conv.is_owned = false;
37816 LDKCVec_u8Z ret_var = NodeId_write(&obj_conv);
37817 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
37818 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
37819 CVec_u8Z_free(ret_var);
37823 uint64_t __attribute__((export_name("TS_NodeId_read"))) TS_NodeId_read(int8_tArray ser) {
37824 LDKu8slice ser_ref;
37825 ser_ref.datalen = ser->arr_len;
37826 ser_ref.data = ser->elems;
37827 LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
37828 *ret_conv = NodeId_read(ser_ref);
37830 return tag_ptr(ret_conv, true);
37833 void __attribute__((export_name("TS_NetworkGraph_free"))) TS_NetworkGraph_free(uint64_t this_obj) {
37834 LDKNetworkGraph this_obj_conv;
37835 this_obj_conv.inner = untag_ptr(this_obj);
37836 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37837 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37838 NetworkGraph_free(this_obj_conv);
37841 void __attribute__((export_name("TS_ReadOnlyNetworkGraph_free"))) TS_ReadOnlyNetworkGraph_free(uint64_t this_obj) {
37842 LDKReadOnlyNetworkGraph this_obj_conv;
37843 this_obj_conv.inner = untag_ptr(this_obj);
37844 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37845 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37846 ReadOnlyNetworkGraph_free(this_obj_conv);
37849 void __attribute__((export_name("TS_NetworkUpdate_free"))) TS_NetworkUpdate_free(uint64_t this_ptr) {
37850 if (!ptr_is_owned(this_ptr)) return;
37851 void* this_ptr_ptr = untag_ptr(this_ptr);
37852 CHECK_ACCESS(this_ptr_ptr);
37853 LDKNetworkUpdate this_ptr_conv = *(LDKNetworkUpdate*)(this_ptr_ptr);
37854 FREE(untag_ptr(this_ptr));
37855 NetworkUpdate_free(this_ptr_conv);
37858 static inline uint64_t NetworkUpdate_clone_ptr(LDKNetworkUpdate *NONNULL_PTR arg) {
37859 LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate");
37860 *ret_copy = NetworkUpdate_clone(arg);
37861 uint64_t ret_ref = tag_ptr(ret_copy, true);
37864 int64_t __attribute__((export_name("TS_NetworkUpdate_clone_ptr"))) TS_NetworkUpdate_clone_ptr(uint64_t arg) {
37865 LDKNetworkUpdate* arg_conv = (LDKNetworkUpdate*)untag_ptr(arg);
37866 int64_t ret_conv = NetworkUpdate_clone_ptr(arg_conv);
37870 uint64_t __attribute__((export_name("TS_NetworkUpdate_clone"))) TS_NetworkUpdate_clone(uint64_t orig) {
37871 LDKNetworkUpdate* orig_conv = (LDKNetworkUpdate*)untag_ptr(orig);
37872 LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate");
37873 *ret_copy = NetworkUpdate_clone(orig_conv);
37874 uint64_t ret_ref = tag_ptr(ret_copy, true);
37878 uint64_t __attribute__((export_name("TS_NetworkUpdate_channel_update_message"))) TS_NetworkUpdate_channel_update_message(uint64_t msg) {
37879 LDKChannelUpdate msg_conv;
37880 msg_conv.inner = untag_ptr(msg);
37881 msg_conv.is_owned = ptr_is_owned(msg);
37882 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
37883 msg_conv = ChannelUpdate_clone(&msg_conv);
37884 LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate");
37885 *ret_copy = NetworkUpdate_channel_update_message(msg_conv);
37886 uint64_t ret_ref = tag_ptr(ret_copy, true);
37890 uint64_t __attribute__((export_name("TS_NetworkUpdate_channel_failure"))) TS_NetworkUpdate_channel_failure(int64_t short_channel_id, jboolean is_permanent) {
37891 LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate");
37892 *ret_copy = NetworkUpdate_channel_failure(short_channel_id, is_permanent);
37893 uint64_t ret_ref = tag_ptr(ret_copy, true);
37897 uint64_t __attribute__((export_name("TS_NetworkUpdate_node_failure"))) TS_NetworkUpdate_node_failure(int8_tArray node_id, jboolean is_permanent) {
37898 LDKPublicKey node_id_ref;
37899 CHECK(node_id->arr_len == 33);
37900 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
37901 LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate");
37902 *ret_copy = NetworkUpdate_node_failure(node_id_ref, is_permanent);
37903 uint64_t ret_ref = tag_ptr(ret_copy, true);
37907 int8_tArray __attribute__((export_name("TS_NetworkUpdate_write"))) TS_NetworkUpdate_write(uint64_t obj) {
37908 LDKNetworkUpdate* obj_conv = (LDKNetworkUpdate*)untag_ptr(obj);
37909 LDKCVec_u8Z ret_var = NetworkUpdate_write(obj_conv);
37910 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
37911 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
37912 CVec_u8Z_free(ret_var);
37916 uint64_t __attribute__((export_name("TS_NetworkUpdate_read"))) TS_NetworkUpdate_read(int8_tArray ser) {
37917 LDKu8slice ser_ref;
37918 ser_ref.datalen = ser->arr_len;
37919 ser_ref.data = ser->elems;
37920 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
37921 *ret_conv = NetworkUpdate_read(ser_ref);
37923 return tag_ptr(ret_conv, true);
37926 void __attribute__((export_name("TS_P2PGossipSync_free"))) TS_P2PGossipSync_free(uint64_t this_obj) {
37927 LDKP2PGossipSync this_obj_conv;
37928 this_obj_conv.inner = untag_ptr(this_obj);
37929 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37930 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37931 P2PGossipSync_free(this_obj_conv);
37934 uint64_t __attribute__((export_name("TS_P2PGossipSync_new"))) TS_P2PGossipSync_new(uint64_t network_graph, uint64_t chain_access, uint64_t logger) {
37935 LDKNetworkGraph network_graph_conv;
37936 network_graph_conv.inner = untag_ptr(network_graph);
37937 network_graph_conv.is_owned = ptr_is_owned(network_graph);
37938 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
37939 network_graph_conv.is_owned = false;
37940 void* chain_access_ptr = untag_ptr(chain_access);
37941 CHECK_ACCESS(chain_access_ptr);
37942 LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
37943 // WARNING: we may need a move here but no clone is available for LDKCOption_AccessZ
37944 if (chain_access_conv.tag == LDKCOption_AccessZ_Some) {
37945 // Manually implement clone for Java trait instances
37946 if (chain_access_conv.some.free == LDKAccess_JCalls_free) {
37947 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
37948 LDKAccess_JCalls_cloned(&chain_access_conv.some);
37951 void* logger_ptr = untag_ptr(logger);
37952 CHECK_ACCESS(logger_ptr);
37953 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
37954 if (logger_conv.free == LDKLogger_JCalls_free) {
37955 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
37956 LDKLogger_JCalls_cloned(&logger_conv);
37958 LDKP2PGossipSync ret_var = P2PGossipSync_new(&network_graph_conv, chain_access_conv, logger_conv);
37959 uint64_t ret_ref = 0;
37960 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37961 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37965 void __attribute__((export_name("TS_P2PGossipSync_add_chain_access"))) TS_P2PGossipSync_add_chain_access(uint64_t this_arg, uint64_t chain_access) {
37966 LDKP2PGossipSync this_arg_conv;
37967 this_arg_conv.inner = untag_ptr(this_arg);
37968 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37969 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37970 this_arg_conv.is_owned = false;
37971 void* chain_access_ptr = untag_ptr(chain_access);
37972 CHECK_ACCESS(chain_access_ptr);
37973 LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
37974 // WARNING: we may need a move here but no clone is available for LDKCOption_AccessZ
37975 if (chain_access_conv.tag == LDKCOption_AccessZ_Some) {
37976 // Manually implement clone for Java trait instances
37977 if (chain_access_conv.some.free == LDKAccess_JCalls_free) {
37978 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
37979 LDKAccess_JCalls_cloned(&chain_access_conv.some);
37982 P2PGossipSync_add_chain_access(&this_arg_conv, chain_access_conv);
37985 uint64_t __attribute__((export_name("TS_NetworkGraph_as_EventHandler"))) TS_NetworkGraph_as_EventHandler(uint64_t this_arg) {
37986 LDKNetworkGraph this_arg_conv;
37987 this_arg_conv.inner = untag_ptr(this_arg);
37988 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37989 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37990 this_arg_conv.is_owned = false;
37991 LDKEventHandler* ret_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
37992 *ret_ret = NetworkGraph_as_EventHandler(&this_arg_conv);
37993 return tag_ptr(ret_ret, true);
37996 uint64_t __attribute__((export_name("TS_P2PGossipSync_as_RoutingMessageHandler"))) TS_P2PGossipSync_as_RoutingMessageHandler(uint64_t this_arg) {
37997 LDKP2PGossipSync this_arg_conv;
37998 this_arg_conv.inner = untag_ptr(this_arg);
37999 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38000 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38001 this_arg_conv.is_owned = false;
38002 LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
38003 *ret_ret = P2PGossipSync_as_RoutingMessageHandler(&this_arg_conv);
38004 return tag_ptr(ret_ret, true);
38007 uint64_t __attribute__((export_name("TS_P2PGossipSync_as_MessageSendEventsProvider"))) TS_P2PGossipSync_as_MessageSendEventsProvider(uint64_t this_arg) {
38008 LDKP2PGossipSync this_arg_conv;
38009 this_arg_conv.inner = untag_ptr(this_arg);
38010 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38011 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38012 this_arg_conv.is_owned = false;
38013 LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
38014 *ret_ret = P2PGossipSync_as_MessageSendEventsProvider(&this_arg_conv);
38015 return tag_ptr(ret_ret, true);
38018 void __attribute__((export_name("TS_ChannelUpdateInfo_free"))) TS_ChannelUpdateInfo_free(uint64_t this_obj) {
38019 LDKChannelUpdateInfo this_obj_conv;
38020 this_obj_conv.inner = untag_ptr(this_obj);
38021 this_obj_conv.is_owned = ptr_is_owned(this_obj);
38022 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
38023 ChannelUpdateInfo_free(this_obj_conv);
38026 int32_t __attribute__((export_name("TS_ChannelUpdateInfo_get_last_update"))) TS_ChannelUpdateInfo_get_last_update(uint64_t this_ptr) {
38027 LDKChannelUpdateInfo this_ptr_conv;
38028 this_ptr_conv.inner = untag_ptr(this_ptr);
38029 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38030 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38031 this_ptr_conv.is_owned = false;
38032 int32_t ret_conv = ChannelUpdateInfo_get_last_update(&this_ptr_conv);
38036 void __attribute__((export_name("TS_ChannelUpdateInfo_set_last_update"))) TS_ChannelUpdateInfo_set_last_update(uint64_t this_ptr, int32_t val) {
38037 LDKChannelUpdateInfo this_ptr_conv;
38038 this_ptr_conv.inner = untag_ptr(this_ptr);
38039 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38040 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38041 this_ptr_conv.is_owned = false;
38042 ChannelUpdateInfo_set_last_update(&this_ptr_conv, val);
38045 jboolean __attribute__((export_name("TS_ChannelUpdateInfo_get_enabled"))) TS_ChannelUpdateInfo_get_enabled(uint64_t this_ptr) {
38046 LDKChannelUpdateInfo this_ptr_conv;
38047 this_ptr_conv.inner = untag_ptr(this_ptr);
38048 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38049 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38050 this_ptr_conv.is_owned = false;
38051 jboolean ret_conv = ChannelUpdateInfo_get_enabled(&this_ptr_conv);
38055 void __attribute__((export_name("TS_ChannelUpdateInfo_set_enabled"))) TS_ChannelUpdateInfo_set_enabled(uint64_t this_ptr, jboolean val) {
38056 LDKChannelUpdateInfo this_ptr_conv;
38057 this_ptr_conv.inner = untag_ptr(this_ptr);
38058 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38059 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38060 this_ptr_conv.is_owned = false;
38061 ChannelUpdateInfo_set_enabled(&this_ptr_conv, val);
38064 int16_t __attribute__((export_name("TS_ChannelUpdateInfo_get_cltv_expiry_delta"))) TS_ChannelUpdateInfo_get_cltv_expiry_delta(uint64_t this_ptr) {
38065 LDKChannelUpdateInfo this_ptr_conv;
38066 this_ptr_conv.inner = untag_ptr(this_ptr);
38067 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38068 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38069 this_ptr_conv.is_owned = false;
38070 int16_t ret_conv = ChannelUpdateInfo_get_cltv_expiry_delta(&this_ptr_conv);
38074 void __attribute__((export_name("TS_ChannelUpdateInfo_set_cltv_expiry_delta"))) TS_ChannelUpdateInfo_set_cltv_expiry_delta(uint64_t this_ptr, int16_t val) {
38075 LDKChannelUpdateInfo this_ptr_conv;
38076 this_ptr_conv.inner = untag_ptr(this_ptr);
38077 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38078 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38079 this_ptr_conv.is_owned = false;
38080 ChannelUpdateInfo_set_cltv_expiry_delta(&this_ptr_conv, val);
38083 int64_t __attribute__((export_name("TS_ChannelUpdateInfo_get_htlc_minimum_msat"))) TS_ChannelUpdateInfo_get_htlc_minimum_msat(uint64_t this_ptr) {
38084 LDKChannelUpdateInfo this_ptr_conv;
38085 this_ptr_conv.inner = untag_ptr(this_ptr);
38086 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38087 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38088 this_ptr_conv.is_owned = false;
38089 int64_t ret_conv = ChannelUpdateInfo_get_htlc_minimum_msat(&this_ptr_conv);
38093 void __attribute__((export_name("TS_ChannelUpdateInfo_set_htlc_minimum_msat"))) TS_ChannelUpdateInfo_set_htlc_minimum_msat(uint64_t this_ptr, int64_t val) {
38094 LDKChannelUpdateInfo this_ptr_conv;
38095 this_ptr_conv.inner = untag_ptr(this_ptr);
38096 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38097 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38098 this_ptr_conv.is_owned = false;
38099 ChannelUpdateInfo_set_htlc_minimum_msat(&this_ptr_conv, val);
38102 int64_t __attribute__((export_name("TS_ChannelUpdateInfo_get_htlc_maximum_msat"))) TS_ChannelUpdateInfo_get_htlc_maximum_msat(uint64_t this_ptr) {
38103 LDKChannelUpdateInfo this_ptr_conv;
38104 this_ptr_conv.inner = untag_ptr(this_ptr);
38105 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38106 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38107 this_ptr_conv.is_owned = false;
38108 int64_t ret_conv = ChannelUpdateInfo_get_htlc_maximum_msat(&this_ptr_conv);
38112 void __attribute__((export_name("TS_ChannelUpdateInfo_set_htlc_maximum_msat"))) TS_ChannelUpdateInfo_set_htlc_maximum_msat(uint64_t this_ptr, int64_t val) {
38113 LDKChannelUpdateInfo this_ptr_conv;
38114 this_ptr_conv.inner = untag_ptr(this_ptr);
38115 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38116 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38117 this_ptr_conv.is_owned = false;
38118 ChannelUpdateInfo_set_htlc_maximum_msat(&this_ptr_conv, val);
38121 uint64_t __attribute__((export_name("TS_ChannelUpdateInfo_get_fees"))) TS_ChannelUpdateInfo_get_fees(uint64_t this_ptr) {
38122 LDKChannelUpdateInfo this_ptr_conv;
38123 this_ptr_conv.inner = untag_ptr(this_ptr);
38124 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38125 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38126 this_ptr_conv.is_owned = false;
38127 LDKRoutingFees ret_var = ChannelUpdateInfo_get_fees(&this_ptr_conv);
38128 uint64_t ret_ref = 0;
38129 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38130 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38134 void __attribute__((export_name("TS_ChannelUpdateInfo_set_fees"))) TS_ChannelUpdateInfo_set_fees(uint64_t this_ptr, uint64_t val) {
38135 LDKChannelUpdateInfo this_ptr_conv;
38136 this_ptr_conv.inner = untag_ptr(this_ptr);
38137 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38138 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38139 this_ptr_conv.is_owned = false;
38140 LDKRoutingFees val_conv;
38141 val_conv.inner = untag_ptr(val);
38142 val_conv.is_owned = ptr_is_owned(val);
38143 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38144 val_conv = RoutingFees_clone(&val_conv);
38145 ChannelUpdateInfo_set_fees(&this_ptr_conv, val_conv);
38148 uint64_t __attribute__((export_name("TS_ChannelUpdateInfo_get_last_update_message"))) TS_ChannelUpdateInfo_get_last_update_message(uint64_t this_ptr) {
38149 LDKChannelUpdateInfo this_ptr_conv;
38150 this_ptr_conv.inner = untag_ptr(this_ptr);
38151 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38152 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38153 this_ptr_conv.is_owned = false;
38154 LDKChannelUpdate ret_var = ChannelUpdateInfo_get_last_update_message(&this_ptr_conv);
38155 uint64_t ret_ref = 0;
38156 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38157 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38161 void __attribute__((export_name("TS_ChannelUpdateInfo_set_last_update_message"))) TS_ChannelUpdateInfo_set_last_update_message(uint64_t this_ptr, uint64_t val) {
38162 LDKChannelUpdateInfo this_ptr_conv;
38163 this_ptr_conv.inner = untag_ptr(this_ptr);
38164 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38165 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38166 this_ptr_conv.is_owned = false;
38167 LDKChannelUpdate val_conv;
38168 val_conv.inner = untag_ptr(val);
38169 val_conv.is_owned = ptr_is_owned(val);
38170 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38171 val_conv = ChannelUpdate_clone(&val_conv);
38172 ChannelUpdateInfo_set_last_update_message(&this_ptr_conv, val_conv);
38175 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) {
38176 LDKRoutingFees fees_arg_conv;
38177 fees_arg_conv.inner = untag_ptr(fees_arg);
38178 fees_arg_conv.is_owned = ptr_is_owned(fees_arg);
38179 CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv);
38180 fees_arg_conv = RoutingFees_clone(&fees_arg_conv);
38181 LDKChannelUpdate last_update_message_arg_conv;
38182 last_update_message_arg_conv.inner = untag_ptr(last_update_message_arg);
38183 last_update_message_arg_conv.is_owned = ptr_is_owned(last_update_message_arg);
38184 CHECK_INNER_FIELD_ACCESS_OR_NULL(last_update_message_arg_conv);
38185 last_update_message_arg_conv = ChannelUpdate_clone(&last_update_message_arg_conv);
38186 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);
38187 uint64_t ret_ref = 0;
38188 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38189 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38193 static inline uint64_t ChannelUpdateInfo_clone_ptr(LDKChannelUpdateInfo *NONNULL_PTR arg) {
38194 LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_clone(arg);
38195 uint64_t ret_ref = 0;
38196 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38197 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38200 int64_t __attribute__((export_name("TS_ChannelUpdateInfo_clone_ptr"))) TS_ChannelUpdateInfo_clone_ptr(uint64_t arg) {
38201 LDKChannelUpdateInfo arg_conv;
38202 arg_conv.inner = untag_ptr(arg);
38203 arg_conv.is_owned = ptr_is_owned(arg);
38204 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
38205 arg_conv.is_owned = false;
38206 int64_t ret_conv = ChannelUpdateInfo_clone_ptr(&arg_conv);
38210 uint64_t __attribute__((export_name("TS_ChannelUpdateInfo_clone"))) TS_ChannelUpdateInfo_clone(uint64_t orig) {
38211 LDKChannelUpdateInfo orig_conv;
38212 orig_conv.inner = untag_ptr(orig);
38213 orig_conv.is_owned = ptr_is_owned(orig);
38214 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
38215 orig_conv.is_owned = false;
38216 LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_clone(&orig_conv);
38217 uint64_t ret_ref = 0;
38218 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38219 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38223 int8_tArray __attribute__((export_name("TS_ChannelUpdateInfo_write"))) TS_ChannelUpdateInfo_write(uint64_t obj) {
38224 LDKChannelUpdateInfo obj_conv;
38225 obj_conv.inner = untag_ptr(obj);
38226 obj_conv.is_owned = ptr_is_owned(obj);
38227 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
38228 obj_conv.is_owned = false;
38229 LDKCVec_u8Z ret_var = ChannelUpdateInfo_write(&obj_conv);
38230 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
38231 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
38232 CVec_u8Z_free(ret_var);
38236 uint64_t __attribute__((export_name("TS_ChannelUpdateInfo_read"))) TS_ChannelUpdateInfo_read(int8_tArray ser) {
38237 LDKu8slice ser_ref;
38238 ser_ref.datalen = ser->arr_len;
38239 ser_ref.data = ser->elems;
38240 LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
38241 *ret_conv = ChannelUpdateInfo_read(ser_ref);
38243 return tag_ptr(ret_conv, true);
38246 void __attribute__((export_name("TS_ChannelInfo_free"))) TS_ChannelInfo_free(uint64_t this_obj) {
38247 LDKChannelInfo this_obj_conv;
38248 this_obj_conv.inner = untag_ptr(this_obj);
38249 this_obj_conv.is_owned = ptr_is_owned(this_obj);
38250 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
38251 ChannelInfo_free(this_obj_conv);
38254 uint64_t __attribute__((export_name("TS_ChannelInfo_get_features"))) TS_ChannelInfo_get_features(uint64_t this_ptr) {
38255 LDKChannelInfo this_ptr_conv;
38256 this_ptr_conv.inner = untag_ptr(this_ptr);
38257 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38258 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38259 this_ptr_conv.is_owned = false;
38260 LDKChannelFeatures ret_var = ChannelInfo_get_features(&this_ptr_conv);
38261 uint64_t ret_ref = 0;
38262 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38263 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38267 void __attribute__((export_name("TS_ChannelInfo_set_features"))) TS_ChannelInfo_set_features(uint64_t this_ptr, uint64_t val) {
38268 LDKChannelInfo this_ptr_conv;
38269 this_ptr_conv.inner = untag_ptr(this_ptr);
38270 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38271 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38272 this_ptr_conv.is_owned = false;
38273 LDKChannelFeatures val_conv;
38274 val_conv.inner = untag_ptr(val);
38275 val_conv.is_owned = ptr_is_owned(val);
38276 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38277 val_conv = ChannelFeatures_clone(&val_conv);
38278 ChannelInfo_set_features(&this_ptr_conv, val_conv);
38281 uint64_t __attribute__((export_name("TS_ChannelInfo_get_node_one"))) TS_ChannelInfo_get_node_one(uint64_t this_ptr) {
38282 LDKChannelInfo this_ptr_conv;
38283 this_ptr_conv.inner = untag_ptr(this_ptr);
38284 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38285 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38286 this_ptr_conv.is_owned = false;
38287 LDKNodeId ret_var = ChannelInfo_get_node_one(&this_ptr_conv);
38288 uint64_t ret_ref = 0;
38289 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38290 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38294 void __attribute__((export_name("TS_ChannelInfo_set_node_one"))) TS_ChannelInfo_set_node_one(uint64_t this_ptr, uint64_t val) {
38295 LDKChannelInfo this_ptr_conv;
38296 this_ptr_conv.inner = untag_ptr(this_ptr);
38297 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38298 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38299 this_ptr_conv.is_owned = false;
38300 LDKNodeId val_conv;
38301 val_conv.inner = untag_ptr(val);
38302 val_conv.is_owned = ptr_is_owned(val);
38303 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38304 val_conv = NodeId_clone(&val_conv);
38305 ChannelInfo_set_node_one(&this_ptr_conv, val_conv);
38308 uint64_t __attribute__((export_name("TS_ChannelInfo_get_one_to_two"))) TS_ChannelInfo_get_one_to_two(uint64_t this_ptr) {
38309 LDKChannelInfo this_ptr_conv;
38310 this_ptr_conv.inner = untag_ptr(this_ptr);
38311 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38312 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38313 this_ptr_conv.is_owned = false;
38314 LDKChannelUpdateInfo ret_var = ChannelInfo_get_one_to_two(&this_ptr_conv);
38315 uint64_t ret_ref = 0;
38316 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38317 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38321 void __attribute__((export_name("TS_ChannelInfo_set_one_to_two"))) TS_ChannelInfo_set_one_to_two(uint64_t this_ptr, uint64_t val) {
38322 LDKChannelInfo this_ptr_conv;
38323 this_ptr_conv.inner = untag_ptr(this_ptr);
38324 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38325 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38326 this_ptr_conv.is_owned = false;
38327 LDKChannelUpdateInfo val_conv;
38328 val_conv.inner = untag_ptr(val);
38329 val_conv.is_owned = ptr_is_owned(val);
38330 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38331 val_conv = ChannelUpdateInfo_clone(&val_conv);
38332 ChannelInfo_set_one_to_two(&this_ptr_conv, val_conv);
38335 uint64_t __attribute__((export_name("TS_ChannelInfo_get_node_two"))) TS_ChannelInfo_get_node_two(uint64_t this_ptr) {
38336 LDKChannelInfo this_ptr_conv;
38337 this_ptr_conv.inner = untag_ptr(this_ptr);
38338 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38339 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38340 this_ptr_conv.is_owned = false;
38341 LDKNodeId ret_var = ChannelInfo_get_node_two(&this_ptr_conv);
38342 uint64_t ret_ref = 0;
38343 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38344 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38348 void __attribute__((export_name("TS_ChannelInfo_set_node_two"))) TS_ChannelInfo_set_node_two(uint64_t this_ptr, uint64_t val) {
38349 LDKChannelInfo this_ptr_conv;
38350 this_ptr_conv.inner = untag_ptr(this_ptr);
38351 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38352 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38353 this_ptr_conv.is_owned = false;
38354 LDKNodeId val_conv;
38355 val_conv.inner = untag_ptr(val);
38356 val_conv.is_owned = ptr_is_owned(val);
38357 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38358 val_conv = NodeId_clone(&val_conv);
38359 ChannelInfo_set_node_two(&this_ptr_conv, val_conv);
38362 uint64_t __attribute__((export_name("TS_ChannelInfo_get_two_to_one"))) TS_ChannelInfo_get_two_to_one(uint64_t this_ptr) {
38363 LDKChannelInfo this_ptr_conv;
38364 this_ptr_conv.inner = untag_ptr(this_ptr);
38365 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38366 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38367 this_ptr_conv.is_owned = false;
38368 LDKChannelUpdateInfo ret_var = ChannelInfo_get_two_to_one(&this_ptr_conv);
38369 uint64_t ret_ref = 0;
38370 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38371 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38375 void __attribute__((export_name("TS_ChannelInfo_set_two_to_one"))) TS_ChannelInfo_set_two_to_one(uint64_t this_ptr, uint64_t val) {
38376 LDKChannelInfo this_ptr_conv;
38377 this_ptr_conv.inner = untag_ptr(this_ptr);
38378 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38379 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38380 this_ptr_conv.is_owned = false;
38381 LDKChannelUpdateInfo val_conv;
38382 val_conv.inner = untag_ptr(val);
38383 val_conv.is_owned = ptr_is_owned(val);
38384 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38385 val_conv = ChannelUpdateInfo_clone(&val_conv);
38386 ChannelInfo_set_two_to_one(&this_ptr_conv, val_conv);
38389 uint64_t __attribute__((export_name("TS_ChannelInfo_get_capacity_sats"))) TS_ChannelInfo_get_capacity_sats(uint64_t this_ptr) {
38390 LDKChannelInfo this_ptr_conv;
38391 this_ptr_conv.inner = untag_ptr(this_ptr);
38392 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38393 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38394 this_ptr_conv.is_owned = false;
38395 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
38396 *ret_copy = ChannelInfo_get_capacity_sats(&this_ptr_conv);
38397 uint64_t ret_ref = tag_ptr(ret_copy, true);
38401 void __attribute__((export_name("TS_ChannelInfo_set_capacity_sats"))) TS_ChannelInfo_set_capacity_sats(uint64_t this_ptr, uint64_t val) {
38402 LDKChannelInfo this_ptr_conv;
38403 this_ptr_conv.inner = untag_ptr(this_ptr);
38404 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38405 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38406 this_ptr_conv.is_owned = false;
38407 void* val_ptr = untag_ptr(val);
38408 CHECK_ACCESS(val_ptr);
38409 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
38410 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
38411 ChannelInfo_set_capacity_sats(&this_ptr_conv, val_conv);
38414 uint64_t __attribute__((export_name("TS_ChannelInfo_get_announcement_message"))) TS_ChannelInfo_get_announcement_message(uint64_t this_ptr) {
38415 LDKChannelInfo this_ptr_conv;
38416 this_ptr_conv.inner = untag_ptr(this_ptr);
38417 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38418 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38419 this_ptr_conv.is_owned = false;
38420 LDKChannelAnnouncement ret_var = ChannelInfo_get_announcement_message(&this_ptr_conv);
38421 uint64_t ret_ref = 0;
38422 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38423 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38427 void __attribute__((export_name("TS_ChannelInfo_set_announcement_message"))) TS_ChannelInfo_set_announcement_message(uint64_t this_ptr, uint64_t val) {
38428 LDKChannelInfo this_ptr_conv;
38429 this_ptr_conv.inner = untag_ptr(this_ptr);
38430 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38431 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38432 this_ptr_conv.is_owned = false;
38433 LDKChannelAnnouncement val_conv;
38434 val_conv.inner = untag_ptr(val);
38435 val_conv.is_owned = ptr_is_owned(val);
38436 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38437 val_conv = ChannelAnnouncement_clone(&val_conv);
38438 ChannelInfo_set_announcement_message(&this_ptr_conv, val_conv);
38441 static inline uint64_t ChannelInfo_clone_ptr(LDKChannelInfo *NONNULL_PTR arg) {
38442 LDKChannelInfo ret_var = ChannelInfo_clone(arg);
38443 uint64_t ret_ref = 0;
38444 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38445 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38448 int64_t __attribute__((export_name("TS_ChannelInfo_clone_ptr"))) TS_ChannelInfo_clone_ptr(uint64_t arg) {
38449 LDKChannelInfo arg_conv;
38450 arg_conv.inner = untag_ptr(arg);
38451 arg_conv.is_owned = ptr_is_owned(arg);
38452 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
38453 arg_conv.is_owned = false;
38454 int64_t ret_conv = ChannelInfo_clone_ptr(&arg_conv);
38458 uint64_t __attribute__((export_name("TS_ChannelInfo_clone"))) TS_ChannelInfo_clone(uint64_t orig) {
38459 LDKChannelInfo orig_conv;
38460 orig_conv.inner = untag_ptr(orig);
38461 orig_conv.is_owned = ptr_is_owned(orig);
38462 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
38463 orig_conv.is_owned = false;
38464 LDKChannelInfo ret_var = ChannelInfo_clone(&orig_conv);
38465 uint64_t ret_ref = 0;
38466 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38467 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38471 uint64_t __attribute__((export_name("TS_ChannelInfo_get_directional_info"))) TS_ChannelInfo_get_directional_info(uint64_t this_arg, int8_t channel_flags) {
38472 LDKChannelInfo this_arg_conv;
38473 this_arg_conv.inner = untag_ptr(this_arg);
38474 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38475 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38476 this_arg_conv.is_owned = false;
38477 LDKChannelUpdateInfo ret_var = ChannelInfo_get_directional_info(&this_arg_conv, channel_flags);
38478 uint64_t ret_ref = 0;
38479 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38480 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38484 int8_tArray __attribute__((export_name("TS_ChannelInfo_write"))) TS_ChannelInfo_write(uint64_t obj) {
38485 LDKChannelInfo obj_conv;
38486 obj_conv.inner = untag_ptr(obj);
38487 obj_conv.is_owned = ptr_is_owned(obj);
38488 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
38489 obj_conv.is_owned = false;
38490 LDKCVec_u8Z ret_var = ChannelInfo_write(&obj_conv);
38491 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
38492 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
38493 CVec_u8Z_free(ret_var);
38497 uint64_t __attribute__((export_name("TS_ChannelInfo_read"))) TS_ChannelInfo_read(int8_tArray ser) {
38498 LDKu8slice ser_ref;
38499 ser_ref.datalen = ser->arr_len;
38500 ser_ref.data = ser->elems;
38501 LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
38502 *ret_conv = ChannelInfo_read(ser_ref);
38504 return tag_ptr(ret_conv, true);
38507 void __attribute__((export_name("TS_DirectedChannelInfo_free"))) TS_DirectedChannelInfo_free(uint64_t this_obj) {
38508 LDKDirectedChannelInfo this_obj_conv;
38509 this_obj_conv.inner = untag_ptr(this_obj);
38510 this_obj_conv.is_owned = ptr_is_owned(this_obj);
38511 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
38512 DirectedChannelInfo_free(this_obj_conv);
38515 static inline uint64_t DirectedChannelInfo_clone_ptr(LDKDirectedChannelInfo *NONNULL_PTR arg) {
38516 LDKDirectedChannelInfo ret_var = DirectedChannelInfo_clone(arg);
38517 uint64_t ret_ref = 0;
38518 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38519 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38522 int64_t __attribute__((export_name("TS_DirectedChannelInfo_clone_ptr"))) TS_DirectedChannelInfo_clone_ptr(uint64_t arg) {
38523 LDKDirectedChannelInfo arg_conv;
38524 arg_conv.inner = untag_ptr(arg);
38525 arg_conv.is_owned = ptr_is_owned(arg);
38526 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
38527 arg_conv.is_owned = false;
38528 int64_t ret_conv = DirectedChannelInfo_clone_ptr(&arg_conv);
38532 uint64_t __attribute__((export_name("TS_DirectedChannelInfo_clone"))) TS_DirectedChannelInfo_clone(uint64_t orig) {
38533 LDKDirectedChannelInfo orig_conv;
38534 orig_conv.inner = untag_ptr(orig);
38535 orig_conv.is_owned = ptr_is_owned(orig);
38536 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
38537 orig_conv.is_owned = false;
38538 LDKDirectedChannelInfo ret_var = DirectedChannelInfo_clone(&orig_conv);
38539 uint64_t ret_ref = 0;
38540 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38541 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38545 uint64_t __attribute__((export_name("TS_DirectedChannelInfo_channel"))) TS_DirectedChannelInfo_channel(uint64_t this_arg) {
38546 LDKDirectedChannelInfo this_arg_conv;
38547 this_arg_conv.inner = untag_ptr(this_arg);
38548 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38549 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38550 this_arg_conv.is_owned = false;
38551 LDKChannelInfo ret_var = DirectedChannelInfo_channel(&this_arg_conv);
38552 uint64_t ret_ref = 0;
38553 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38554 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38558 uint64_t __attribute__((export_name("TS_DirectedChannelInfo_direction"))) TS_DirectedChannelInfo_direction(uint64_t this_arg) {
38559 LDKDirectedChannelInfo this_arg_conv;
38560 this_arg_conv.inner = untag_ptr(this_arg);
38561 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38562 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38563 this_arg_conv.is_owned = false;
38564 LDKChannelUpdateInfo ret_var = DirectedChannelInfo_direction(&this_arg_conv);
38565 uint64_t ret_ref = 0;
38566 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38567 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38571 int64_t __attribute__((export_name("TS_DirectedChannelInfo_htlc_maximum_msat"))) TS_DirectedChannelInfo_htlc_maximum_msat(uint64_t this_arg) {
38572 LDKDirectedChannelInfo this_arg_conv;
38573 this_arg_conv.inner = untag_ptr(this_arg);
38574 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38575 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38576 this_arg_conv.is_owned = false;
38577 int64_t ret_conv = DirectedChannelInfo_htlc_maximum_msat(&this_arg_conv);
38581 uint64_t __attribute__((export_name("TS_DirectedChannelInfo_effective_capacity"))) TS_DirectedChannelInfo_effective_capacity(uint64_t this_arg) {
38582 LDKDirectedChannelInfo this_arg_conv;
38583 this_arg_conv.inner = untag_ptr(this_arg);
38584 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38585 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38586 this_arg_conv.is_owned = false;
38587 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
38588 *ret_copy = DirectedChannelInfo_effective_capacity(&this_arg_conv);
38589 uint64_t ret_ref = tag_ptr(ret_copy, true);
38593 void __attribute__((export_name("TS_EffectiveCapacity_free"))) TS_EffectiveCapacity_free(uint64_t this_ptr) {
38594 if (!ptr_is_owned(this_ptr)) return;
38595 void* this_ptr_ptr = untag_ptr(this_ptr);
38596 CHECK_ACCESS(this_ptr_ptr);
38597 LDKEffectiveCapacity this_ptr_conv = *(LDKEffectiveCapacity*)(this_ptr_ptr);
38598 FREE(untag_ptr(this_ptr));
38599 EffectiveCapacity_free(this_ptr_conv);
38602 static inline uint64_t EffectiveCapacity_clone_ptr(LDKEffectiveCapacity *NONNULL_PTR arg) {
38603 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
38604 *ret_copy = EffectiveCapacity_clone(arg);
38605 uint64_t ret_ref = tag_ptr(ret_copy, true);
38608 int64_t __attribute__((export_name("TS_EffectiveCapacity_clone_ptr"))) TS_EffectiveCapacity_clone_ptr(uint64_t arg) {
38609 LDKEffectiveCapacity* arg_conv = (LDKEffectiveCapacity*)untag_ptr(arg);
38610 int64_t ret_conv = EffectiveCapacity_clone_ptr(arg_conv);
38614 uint64_t __attribute__((export_name("TS_EffectiveCapacity_clone"))) TS_EffectiveCapacity_clone(uint64_t orig) {
38615 LDKEffectiveCapacity* orig_conv = (LDKEffectiveCapacity*)untag_ptr(orig);
38616 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
38617 *ret_copy = EffectiveCapacity_clone(orig_conv);
38618 uint64_t ret_ref = tag_ptr(ret_copy, true);
38622 uint64_t __attribute__((export_name("TS_EffectiveCapacity_exact_liquidity"))) TS_EffectiveCapacity_exact_liquidity(int64_t liquidity_msat) {
38623 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
38624 *ret_copy = EffectiveCapacity_exact_liquidity(liquidity_msat);
38625 uint64_t ret_ref = tag_ptr(ret_copy, true);
38629 uint64_t __attribute__((export_name("TS_EffectiveCapacity_maximum_htlc"))) TS_EffectiveCapacity_maximum_htlc(int64_t amount_msat) {
38630 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
38631 *ret_copy = EffectiveCapacity_maximum_htlc(amount_msat);
38632 uint64_t ret_ref = tag_ptr(ret_copy, true);
38636 uint64_t __attribute__((export_name("TS_EffectiveCapacity_total"))) TS_EffectiveCapacity_total(int64_t capacity_msat, uint64_t htlc_maximum_msat) {
38637 void* htlc_maximum_msat_ptr = untag_ptr(htlc_maximum_msat);
38638 CHECK_ACCESS(htlc_maximum_msat_ptr);
38639 LDKCOption_u64Z htlc_maximum_msat_conv = *(LDKCOption_u64Z*)(htlc_maximum_msat_ptr);
38640 htlc_maximum_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_maximum_msat));
38641 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
38642 *ret_copy = EffectiveCapacity_total(capacity_msat, htlc_maximum_msat_conv);
38643 uint64_t ret_ref = tag_ptr(ret_copy, true);
38647 uint64_t __attribute__((export_name("TS_EffectiveCapacity_infinite"))) TS_EffectiveCapacity_infinite() {
38648 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
38649 *ret_copy = EffectiveCapacity_infinite();
38650 uint64_t ret_ref = tag_ptr(ret_copy, true);
38654 uint64_t __attribute__((export_name("TS_EffectiveCapacity_unknown"))) TS_EffectiveCapacity_unknown() {
38655 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
38656 *ret_copy = EffectiveCapacity_unknown();
38657 uint64_t ret_ref = tag_ptr(ret_copy, true);
38661 int64_t __attribute__((export_name("TS_EffectiveCapacity_as_msat"))) TS_EffectiveCapacity_as_msat(uint64_t this_arg) {
38662 LDKEffectiveCapacity* this_arg_conv = (LDKEffectiveCapacity*)untag_ptr(this_arg);
38663 int64_t ret_conv = EffectiveCapacity_as_msat(this_arg_conv);
38667 void __attribute__((export_name("TS_RoutingFees_free"))) TS_RoutingFees_free(uint64_t this_obj) {
38668 LDKRoutingFees this_obj_conv;
38669 this_obj_conv.inner = untag_ptr(this_obj);
38670 this_obj_conv.is_owned = ptr_is_owned(this_obj);
38671 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
38672 RoutingFees_free(this_obj_conv);
38675 int32_t __attribute__((export_name("TS_RoutingFees_get_base_msat"))) TS_RoutingFees_get_base_msat(uint64_t this_ptr) {
38676 LDKRoutingFees this_ptr_conv;
38677 this_ptr_conv.inner = untag_ptr(this_ptr);
38678 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38679 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38680 this_ptr_conv.is_owned = false;
38681 int32_t ret_conv = RoutingFees_get_base_msat(&this_ptr_conv);
38685 void __attribute__((export_name("TS_RoutingFees_set_base_msat"))) TS_RoutingFees_set_base_msat(uint64_t this_ptr, int32_t val) {
38686 LDKRoutingFees this_ptr_conv;
38687 this_ptr_conv.inner = untag_ptr(this_ptr);
38688 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38689 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38690 this_ptr_conv.is_owned = false;
38691 RoutingFees_set_base_msat(&this_ptr_conv, val);
38694 int32_t __attribute__((export_name("TS_RoutingFees_get_proportional_millionths"))) TS_RoutingFees_get_proportional_millionths(uint64_t this_ptr) {
38695 LDKRoutingFees this_ptr_conv;
38696 this_ptr_conv.inner = untag_ptr(this_ptr);
38697 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38698 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38699 this_ptr_conv.is_owned = false;
38700 int32_t ret_conv = RoutingFees_get_proportional_millionths(&this_ptr_conv);
38704 void __attribute__((export_name("TS_RoutingFees_set_proportional_millionths"))) TS_RoutingFees_set_proportional_millionths(uint64_t this_ptr, int32_t val) {
38705 LDKRoutingFees this_ptr_conv;
38706 this_ptr_conv.inner = untag_ptr(this_ptr);
38707 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38708 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38709 this_ptr_conv.is_owned = false;
38710 RoutingFees_set_proportional_millionths(&this_ptr_conv, val);
38713 uint64_t __attribute__((export_name("TS_RoutingFees_new"))) TS_RoutingFees_new(int32_t base_msat_arg, int32_t proportional_millionths_arg) {
38714 LDKRoutingFees ret_var = RoutingFees_new(base_msat_arg, proportional_millionths_arg);
38715 uint64_t ret_ref = 0;
38716 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38717 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38721 jboolean __attribute__((export_name("TS_RoutingFees_eq"))) TS_RoutingFees_eq(uint64_t a, uint64_t b) {
38722 LDKRoutingFees a_conv;
38723 a_conv.inner = untag_ptr(a);
38724 a_conv.is_owned = ptr_is_owned(a);
38725 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
38726 a_conv.is_owned = false;
38727 LDKRoutingFees b_conv;
38728 b_conv.inner = untag_ptr(b);
38729 b_conv.is_owned = ptr_is_owned(b);
38730 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
38731 b_conv.is_owned = false;
38732 jboolean ret_conv = RoutingFees_eq(&a_conv, &b_conv);
38736 static inline uint64_t RoutingFees_clone_ptr(LDKRoutingFees *NONNULL_PTR arg) {
38737 LDKRoutingFees ret_var = RoutingFees_clone(arg);
38738 uint64_t ret_ref = 0;
38739 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38740 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38743 int64_t __attribute__((export_name("TS_RoutingFees_clone_ptr"))) TS_RoutingFees_clone_ptr(uint64_t arg) {
38744 LDKRoutingFees arg_conv;
38745 arg_conv.inner = untag_ptr(arg);
38746 arg_conv.is_owned = ptr_is_owned(arg);
38747 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
38748 arg_conv.is_owned = false;
38749 int64_t ret_conv = RoutingFees_clone_ptr(&arg_conv);
38753 uint64_t __attribute__((export_name("TS_RoutingFees_clone"))) TS_RoutingFees_clone(uint64_t orig) {
38754 LDKRoutingFees orig_conv;
38755 orig_conv.inner = untag_ptr(orig);
38756 orig_conv.is_owned = ptr_is_owned(orig);
38757 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
38758 orig_conv.is_owned = false;
38759 LDKRoutingFees ret_var = RoutingFees_clone(&orig_conv);
38760 uint64_t ret_ref = 0;
38761 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38762 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38766 int64_t __attribute__((export_name("TS_RoutingFees_hash"))) TS_RoutingFees_hash(uint64_t o) {
38767 LDKRoutingFees o_conv;
38768 o_conv.inner = untag_ptr(o);
38769 o_conv.is_owned = ptr_is_owned(o);
38770 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
38771 o_conv.is_owned = false;
38772 int64_t ret_conv = RoutingFees_hash(&o_conv);
38776 int8_tArray __attribute__((export_name("TS_RoutingFees_write"))) TS_RoutingFees_write(uint64_t obj) {
38777 LDKRoutingFees obj_conv;
38778 obj_conv.inner = untag_ptr(obj);
38779 obj_conv.is_owned = ptr_is_owned(obj);
38780 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
38781 obj_conv.is_owned = false;
38782 LDKCVec_u8Z ret_var = RoutingFees_write(&obj_conv);
38783 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
38784 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
38785 CVec_u8Z_free(ret_var);
38789 uint64_t __attribute__((export_name("TS_RoutingFees_read"))) TS_RoutingFees_read(int8_tArray ser) {
38790 LDKu8slice ser_ref;
38791 ser_ref.datalen = ser->arr_len;
38792 ser_ref.data = ser->elems;
38793 LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
38794 *ret_conv = RoutingFees_read(ser_ref);
38796 return tag_ptr(ret_conv, true);
38799 void __attribute__((export_name("TS_NodeAnnouncementInfo_free"))) TS_NodeAnnouncementInfo_free(uint64_t this_obj) {
38800 LDKNodeAnnouncementInfo this_obj_conv;
38801 this_obj_conv.inner = untag_ptr(this_obj);
38802 this_obj_conv.is_owned = ptr_is_owned(this_obj);
38803 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
38804 NodeAnnouncementInfo_free(this_obj_conv);
38807 uint64_t __attribute__((export_name("TS_NodeAnnouncementInfo_get_features"))) TS_NodeAnnouncementInfo_get_features(uint64_t this_ptr) {
38808 LDKNodeAnnouncementInfo this_ptr_conv;
38809 this_ptr_conv.inner = untag_ptr(this_ptr);
38810 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38811 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38812 this_ptr_conv.is_owned = false;
38813 LDKNodeFeatures ret_var = NodeAnnouncementInfo_get_features(&this_ptr_conv);
38814 uint64_t ret_ref = 0;
38815 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38816 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38820 void __attribute__((export_name("TS_NodeAnnouncementInfo_set_features"))) TS_NodeAnnouncementInfo_set_features(uint64_t this_ptr, uint64_t val) {
38821 LDKNodeAnnouncementInfo this_ptr_conv;
38822 this_ptr_conv.inner = untag_ptr(this_ptr);
38823 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38824 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38825 this_ptr_conv.is_owned = false;
38826 LDKNodeFeatures val_conv;
38827 val_conv.inner = untag_ptr(val);
38828 val_conv.is_owned = ptr_is_owned(val);
38829 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38830 val_conv = NodeFeatures_clone(&val_conv);
38831 NodeAnnouncementInfo_set_features(&this_ptr_conv, val_conv);
38834 int32_t __attribute__((export_name("TS_NodeAnnouncementInfo_get_last_update"))) TS_NodeAnnouncementInfo_get_last_update(uint64_t this_ptr) {
38835 LDKNodeAnnouncementInfo this_ptr_conv;
38836 this_ptr_conv.inner = untag_ptr(this_ptr);
38837 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38838 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38839 this_ptr_conv.is_owned = false;
38840 int32_t ret_conv = NodeAnnouncementInfo_get_last_update(&this_ptr_conv);
38844 void __attribute__((export_name("TS_NodeAnnouncementInfo_set_last_update"))) TS_NodeAnnouncementInfo_set_last_update(uint64_t this_ptr, int32_t val) {
38845 LDKNodeAnnouncementInfo this_ptr_conv;
38846 this_ptr_conv.inner = untag_ptr(this_ptr);
38847 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38848 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38849 this_ptr_conv.is_owned = false;
38850 NodeAnnouncementInfo_set_last_update(&this_ptr_conv, val);
38853 int8_tArray __attribute__((export_name("TS_NodeAnnouncementInfo_get_rgb"))) TS_NodeAnnouncementInfo_get_rgb(uint64_t this_ptr) {
38854 LDKNodeAnnouncementInfo this_ptr_conv;
38855 this_ptr_conv.inner = untag_ptr(this_ptr);
38856 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38857 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38858 this_ptr_conv.is_owned = false;
38859 int8_tArray ret_arr = init_int8_tArray(3, __LINE__);
38860 memcpy(ret_arr->elems, *NodeAnnouncementInfo_get_rgb(&this_ptr_conv), 3);
38864 void __attribute__((export_name("TS_NodeAnnouncementInfo_set_rgb"))) TS_NodeAnnouncementInfo_set_rgb(uint64_t this_ptr, int8_tArray val) {
38865 LDKNodeAnnouncementInfo this_ptr_conv;
38866 this_ptr_conv.inner = untag_ptr(this_ptr);
38867 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38868 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38869 this_ptr_conv.is_owned = false;
38870 LDKThreeBytes val_ref;
38871 CHECK(val->arr_len == 3);
38872 memcpy(val_ref.data, val->elems, 3); FREE(val);
38873 NodeAnnouncementInfo_set_rgb(&this_ptr_conv, val_ref);
38876 uint64_t __attribute__((export_name("TS_NodeAnnouncementInfo_get_alias"))) TS_NodeAnnouncementInfo_get_alias(uint64_t this_ptr) {
38877 LDKNodeAnnouncementInfo this_ptr_conv;
38878 this_ptr_conv.inner = untag_ptr(this_ptr);
38879 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38880 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38881 this_ptr_conv.is_owned = false;
38882 LDKNodeAlias ret_var = NodeAnnouncementInfo_get_alias(&this_ptr_conv);
38883 uint64_t ret_ref = 0;
38884 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38885 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38889 void __attribute__((export_name("TS_NodeAnnouncementInfo_set_alias"))) TS_NodeAnnouncementInfo_set_alias(uint64_t this_ptr, uint64_t val) {
38890 LDKNodeAnnouncementInfo this_ptr_conv;
38891 this_ptr_conv.inner = untag_ptr(this_ptr);
38892 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38893 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38894 this_ptr_conv.is_owned = false;
38895 LDKNodeAlias val_conv;
38896 val_conv.inner = untag_ptr(val);
38897 val_conv.is_owned = ptr_is_owned(val);
38898 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38899 val_conv = NodeAlias_clone(&val_conv);
38900 NodeAnnouncementInfo_set_alias(&this_ptr_conv, val_conv);
38903 uint64_tArray __attribute__((export_name("TS_NodeAnnouncementInfo_get_addresses"))) TS_NodeAnnouncementInfo_get_addresses(uint64_t this_ptr) {
38904 LDKNodeAnnouncementInfo this_ptr_conv;
38905 this_ptr_conv.inner = untag_ptr(this_ptr);
38906 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38907 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38908 this_ptr_conv.is_owned = false;
38909 LDKCVec_NetAddressZ ret_var = NodeAnnouncementInfo_get_addresses(&this_ptr_conv);
38910 uint64_tArray ret_arr = NULL;
38911 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
38912 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
38913 for (size_t m = 0; m < ret_var.datalen; m++) {
38914 LDKNetAddress *ret_conv_12_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
38915 *ret_conv_12_copy = ret_var.data[m];
38916 uint64_t ret_conv_12_ref = tag_ptr(ret_conv_12_copy, true);
38917 ret_arr_ptr[m] = ret_conv_12_ref;
38920 FREE(ret_var.data);
38924 void __attribute__((export_name("TS_NodeAnnouncementInfo_set_addresses"))) TS_NodeAnnouncementInfo_set_addresses(uint64_t this_ptr, uint64_tArray val) {
38925 LDKNodeAnnouncementInfo this_ptr_conv;
38926 this_ptr_conv.inner = untag_ptr(this_ptr);
38927 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38928 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38929 this_ptr_conv.is_owned = false;
38930 LDKCVec_NetAddressZ val_constr;
38931 val_constr.datalen = val->arr_len;
38932 if (val_constr.datalen > 0)
38933 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
38935 val_constr.data = NULL;
38936 uint64_t* val_vals = val->elems;
38937 for (size_t m = 0; m < val_constr.datalen; m++) {
38938 uint64_t val_conv_12 = val_vals[m];
38939 void* val_conv_12_ptr = untag_ptr(val_conv_12);
38940 CHECK_ACCESS(val_conv_12_ptr);
38941 LDKNetAddress val_conv_12_conv = *(LDKNetAddress*)(val_conv_12_ptr);
38942 val_conv_12_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(val_conv_12));
38943 val_constr.data[m] = val_conv_12_conv;
38946 NodeAnnouncementInfo_set_addresses(&this_ptr_conv, val_constr);
38949 uint64_t __attribute__((export_name("TS_NodeAnnouncementInfo_get_announcement_message"))) TS_NodeAnnouncementInfo_get_announcement_message(uint64_t this_ptr) {
38950 LDKNodeAnnouncementInfo this_ptr_conv;
38951 this_ptr_conv.inner = untag_ptr(this_ptr);
38952 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38953 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38954 this_ptr_conv.is_owned = false;
38955 LDKNodeAnnouncement ret_var = NodeAnnouncementInfo_get_announcement_message(&this_ptr_conv);
38956 uint64_t ret_ref = 0;
38957 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38958 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38962 void __attribute__((export_name("TS_NodeAnnouncementInfo_set_announcement_message"))) TS_NodeAnnouncementInfo_set_announcement_message(uint64_t this_ptr, uint64_t val) {
38963 LDKNodeAnnouncementInfo this_ptr_conv;
38964 this_ptr_conv.inner = untag_ptr(this_ptr);
38965 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38966 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38967 this_ptr_conv.is_owned = false;
38968 LDKNodeAnnouncement val_conv;
38969 val_conv.inner = untag_ptr(val);
38970 val_conv.is_owned = ptr_is_owned(val);
38971 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38972 val_conv = NodeAnnouncement_clone(&val_conv);
38973 NodeAnnouncementInfo_set_announcement_message(&this_ptr_conv, val_conv);
38976 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) {
38977 LDKNodeFeatures features_arg_conv;
38978 features_arg_conv.inner = untag_ptr(features_arg);
38979 features_arg_conv.is_owned = ptr_is_owned(features_arg);
38980 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv);
38981 features_arg_conv = NodeFeatures_clone(&features_arg_conv);
38982 LDKThreeBytes rgb_arg_ref;
38983 CHECK(rgb_arg->arr_len == 3);
38984 memcpy(rgb_arg_ref.data, rgb_arg->elems, 3); FREE(rgb_arg);
38985 LDKNodeAlias alias_arg_conv;
38986 alias_arg_conv.inner = untag_ptr(alias_arg);
38987 alias_arg_conv.is_owned = ptr_is_owned(alias_arg);
38988 CHECK_INNER_FIELD_ACCESS_OR_NULL(alias_arg_conv);
38989 alias_arg_conv = NodeAlias_clone(&alias_arg_conv);
38990 LDKCVec_NetAddressZ addresses_arg_constr;
38991 addresses_arg_constr.datalen = addresses_arg->arr_len;
38992 if (addresses_arg_constr.datalen > 0)
38993 addresses_arg_constr.data = MALLOC(addresses_arg_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
38995 addresses_arg_constr.data = NULL;
38996 uint64_t* addresses_arg_vals = addresses_arg->elems;
38997 for (size_t m = 0; m < addresses_arg_constr.datalen; m++) {
38998 uint64_t addresses_arg_conv_12 = addresses_arg_vals[m];
38999 void* addresses_arg_conv_12_ptr = untag_ptr(addresses_arg_conv_12);
39000 CHECK_ACCESS(addresses_arg_conv_12_ptr);
39001 LDKNetAddress addresses_arg_conv_12_conv = *(LDKNetAddress*)(addresses_arg_conv_12_ptr);
39002 addresses_arg_constr.data[m] = addresses_arg_conv_12_conv;
39004 FREE(addresses_arg);
39005 LDKNodeAnnouncement announcement_message_arg_conv;
39006 announcement_message_arg_conv.inner = untag_ptr(announcement_message_arg);
39007 announcement_message_arg_conv.is_owned = ptr_is_owned(announcement_message_arg);
39008 CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_message_arg_conv);
39009 announcement_message_arg_conv = NodeAnnouncement_clone(&announcement_message_arg_conv);
39010 LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_new(features_arg_conv, last_update_arg, rgb_arg_ref, alias_arg_conv, addresses_arg_constr, announcement_message_arg_conv);
39011 uint64_t ret_ref = 0;
39012 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39013 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39017 static inline uint64_t NodeAnnouncementInfo_clone_ptr(LDKNodeAnnouncementInfo *NONNULL_PTR arg) {
39018 LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_clone(arg);
39019 uint64_t ret_ref = 0;
39020 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39021 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39024 int64_t __attribute__((export_name("TS_NodeAnnouncementInfo_clone_ptr"))) TS_NodeAnnouncementInfo_clone_ptr(uint64_t arg) {
39025 LDKNodeAnnouncementInfo arg_conv;
39026 arg_conv.inner = untag_ptr(arg);
39027 arg_conv.is_owned = ptr_is_owned(arg);
39028 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
39029 arg_conv.is_owned = false;
39030 int64_t ret_conv = NodeAnnouncementInfo_clone_ptr(&arg_conv);
39034 uint64_t __attribute__((export_name("TS_NodeAnnouncementInfo_clone"))) TS_NodeAnnouncementInfo_clone(uint64_t orig) {
39035 LDKNodeAnnouncementInfo orig_conv;
39036 orig_conv.inner = untag_ptr(orig);
39037 orig_conv.is_owned = ptr_is_owned(orig);
39038 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
39039 orig_conv.is_owned = false;
39040 LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_clone(&orig_conv);
39041 uint64_t ret_ref = 0;
39042 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39043 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39047 int8_tArray __attribute__((export_name("TS_NodeAnnouncementInfo_write"))) TS_NodeAnnouncementInfo_write(uint64_t obj) {
39048 LDKNodeAnnouncementInfo obj_conv;
39049 obj_conv.inner = untag_ptr(obj);
39050 obj_conv.is_owned = ptr_is_owned(obj);
39051 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39052 obj_conv.is_owned = false;
39053 LDKCVec_u8Z ret_var = NodeAnnouncementInfo_write(&obj_conv);
39054 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
39055 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
39056 CVec_u8Z_free(ret_var);
39060 uint64_t __attribute__((export_name("TS_NodeAnnouncementInfo_read"))) TS_NodeAnnouncementInfo_read(int8_tArray ser) {
39061 LDKu8slice ser_ref;
39062 ser_ref.datalen = ser->arr_len;
39063 ser_ref.data = ser->elems;
39064 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
39065 *ret_conv = NodeAnnouncementInfo_read(ser_ref);
39067 return tag_ptr(ret_conv, true);
39070 void __attribute__((export_name("TS_NodeAlias_free"))) TS_NodeAlias_free(uint64_t this_obj) {
39071 LDKNodeAlias this_obj_conv;
39072 this_obj_conv.inner = untag_ptr(this_obj);
39073 this_obj_conv.is_owned = ptr_is_owned(this_obj);
39074 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
39075 NodeAlias_free(this_obj_conv);
39078 int8_tArray __attribute__((export_name("TS_NodeAlias_get_a"))) TS_NodeAlias_get_a(uint64_t this_ptr) {
39079 LDKNodeAlias this_ptr_conv;
39080 this_ptr_conv.inner = untag_ptr(this_ptr);
39081 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39082 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39083 this_ptr_conv.is_owned = false;
39084 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
39085 memcpy(ret_arr->elems, *NodeAlias_get_a(&this_ptr_conv), 32);
39089 void __attribute__((export_name("TS_NodeAlias_set_a"))) TS_NodeAlias_set_a(uint64_t this_ptr, int8_tArray val) {
39090 LDKNodeAlias this_ptr_conv;
39091 this_ptr_conv.inner = untag_ptr(this_ptr);
39092 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39093 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39094 this_ptr_conv.is_owned = false;
39095 LDKThirtyTwoBytes val_ref;
39096 CHECK(val->arr_len == 32);
39097 memcpy(val_ref.data, val->elems, 32); FREE(val);
39098 NodeAlias_set_a(&this_ptr_conv, val_ref);
39101 uint64_t __attribute__((export_name("TS_NodeAlias_new"))) TS_NodeAlias_new(int8_tArray a_arg) {
39102 LDKThirtyTwoBytes a_arg_ref;
39103 CHECK(a_arg->arr_len == 32);
39104 memcpy(a_arg_ref.data, a_arg->elems, 32); FREE(a_arg);
39105 LDKNodeAlias ret_var = NodeAlias_new(a_arg_ref);
39106 uint64_t ret_ref = 0;
39107 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39108 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39112 static inline uint64_t NodeAlias_clone_ptr(LDKNodeAlias *NONNULL_PTR arg) {
39113 LDKNodeAlias ret_var = NodeAlias_clone(arg);
39114 uint64_t ret_ref = 0;
39115 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39116 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39119 int64_t __attribute__((export_name("TS_NodeAlias_clone_ptr"))) TS_NodeAlias_clone_ptr(uint64_t arg) {
39120 LDKNodeAlias arg_conv;
39121 arg_conv.inner = untag_ptr(arg);
39122 arg_conv.is_owned = ptr_is_owned(arg);
39123 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
39124 arg_conv.is_owned = false;
39125 int64_t ret_conv = NodeAlias_clone_ptr(&arg_conv);
39129 uint64_t __attribute__((export_name("TS_NodeAlias_clone"))) TS_NodeAlias_clone(uint64_t orig) {
39130 LDKNodeAlias orig_conv;
39131 orig_conv.inner = untag_ptr(orig);
39132 orig_conv.is_owned = ptr_is_owned(orig);
39133 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
39134 orig_conv.is_owned = false;
39135 LDKNodeAlias ret_var = NodeAlias_clone(&orig_conv);
39136 uint64_t ret_ref = 0;
39137 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39138 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39142 int8_tArray __attribute__((export_name("TS_NodeAlias_write"))) TS_NodeAlias_write(uint64_t obj) {
39143 LDKNodeAlias obj_conv;
39144 obj_conv.inner = untag_ptr(obj);
39145 obj_conv.is_owned = ptr_is_owned(obj);
39146 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39147 obj_conv.is_owned = false;
39148 LDKCVec_u8Z ret_var = NodeAlias_write(&obj_conv);
39149 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
39150 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
39151 CVec_u8Z_free(ret_var);
39155 uint64_t __attribute__((export_name("TS_NodeAlias_read"))) TS_NodeAlias_read(int8_tArray ser) {
39156 LDKu8slice ser_ref;
39157 ser_ref.datalen = ser->arr_len;
39158 ser_ref.data = ser->elems;
39159 LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ");
39160 *ret_conv = NodeAlias_read(ser_ref);
39162 return tag_ptr(ret_conv, true);
39165 void __attribute__((export_name("TS_NodeInfo_free"))) TS_NodeInfo_free(uint64_t this_obj) {
39166 LDKNodeInfo this_obj_conv;
39167 this_obj_conv.inner = untag_ptr(this_obj);
39168 this_obj_conv.is_owned = ptr_is_owned(this_obj);
39169 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
39170 NodeInfo_free(this_obj_conv);
39173 int64_tArray __attribute__((export_name("TS_NodeInfo_get_channels"))) TS_NodeInfo_get_channels(uint64_t this_ptr) {
39174 LDKNodeInfo this_ptr_conv;
39175 this_ptr_conv.inner = untag_ptr(this_ptr);
39176 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39177 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39178 this_ptr_conv.is_owned = false;
39179 LDKCVec_u64Z ret_var = NodeInfo_get_channels(&this_ptr_conv);
39180 int64_tArray ret_arr = NULL;
39181 ret_arr = init_int64_tArray(ret_var.datalen, __LINE__);
39182 int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8);
39183 for (size_t i = 0; i < ret_var.datalen; i++) {
39184 int64_t ret_conv_8_conv = ret_var.data[i];
39185 ret_arr_ptr[i] = ret_conv_8_conv;
39188 FREE(ret_var.data);
39192 void __attribute__((export_name("TS_NodeInfo_set_channels"))) TS_NodeInfo_set_channels(uint64_t this_ptr, int64_tArray val) {
39193 LDKNodeInfo this_ptr_conv;
39194 this_ptr_conv.inner = untag_ptr(this_ptr);
39195 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39196 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39197 this_ptr_conv.is_owned = false;
39198 LDKCVec_u64Z val_constr;
39199 val_constr.datalen = val->arr_len;
39200 if (val_constr.datalen > 0)
39201 val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
39203 val_constr.data = NULL;
39204 int64_t* val_vals = val->elems;
39205 for (size_t i = 0; i < val_constr.datalen; i++) {
39206 int64_t val_conv_8 = val_vals[i];
39207 val_constr.data[i] = val_conv_8;
39210 NodeInfo_set_channels(&this_ptr_conv, val_constr);
39213 uint64_t __attribute__((export_name("TS_NodeInfo_get_lowest_inbound_channel_fees"))) TS_NodeInfo_get_lowest_inbound_channel_fees(uint64_t this_ptr) {
39214 LDKNodeInfo this_ptr_conv;
39215 this_ptr_conv.inner = untag_ptr(this_ptr);
39216 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39217 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39218 this_ptr_conv.is_owned = false;
39219 LDKRoutingFees ret_var = NodeInfo_get_lowest_inbound_channel_fees(&this_ptr_conv);
39220 uint64_t ret_ref = 0;
39221 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39222 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39226 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) {
39227 LDKNodeInfo this_ptr_conv;
39228 this_ptr_conv.inner = untag_ptr(this_ptr);
39229 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39230 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39231 this_ptr_conv.is_owned = false;
39232 LDKRoutingFees val_conv;
39233 val_conv.inner = untag_ptr(val);
39234 val_conv.is_owned = ptr_is_owned(val);
39235 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
39236 val_conv = RoutingFees_clone(&val_conv);
39237 NodeInfo_set_lowest_inbound_channel_fees(&this_ptr_conv, val_conv);
39240 uint64_t __attribute__((export_name("TS_NodeInfo_get_announcement_info"))) TS_NodeInfo_get_announcement_info(uint64_t this_ptr) {
39241 LDKNodeInfo this_ptr_conv;
39242 this_ptr_conv.inner = untag_ptr(this_ptr);
39243 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39244 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39245 this_ptr_conv.is_owned = false;
39246 LDKNodeAnnouncementInfo ret_var = NodeInfo_get_announcement_info(&this_ptr_conv);
39247 uint64_t ret_ref = 0;
39248 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39249 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39253 void __attribute__((export_name("TS_NodeInfo_set_announcement_info"))) TS_NodeInfo_set_announcement_info(uint64_t this_ptr, uint64_t val) {
39254 LDKNodeInfo this_ptr_conv;
39255 this_ptr_conv.inner = untag_ptr(this_ptr);
39256 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39257 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39258 this_ptr_conv.is_owned = false;
39259 LDKNodeAnnouncementInfo val_conv;
39260 val_conv.inner = untag_ptr(val);
39261 val_conv.is_owned = ptr_is_owned(val);
39262 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
39263 val_conv = NodeAnnouncementInfo_clone(&val_conv);
39264 NodeInfo_set_announcement_info(&this_ptr_conv, val_conv);
39267 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) {
39268 LDKCVec_u64Z channels_arg_constr;
39269 channels_arg_constr.datalen = channels_arg->arr_len;
39270 if (channels_arg_constr.datalen > 0)
39271 channels_arg_constr.data = MALLOC(channels_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
39273 channels_arg_constr.data = NULL;
39274 int64_t* channels_arg_vals = channels_arg->elems;
39275 for (size_t i = 0; i < channels_arg_constr.datalen; i++) {
39276 int64_t channels_arg_conv_8 = channels_arg_vals[i];
39277 channels_arg_constr.data[i] = channels_arg_conv_8;
39279 FREE(channels_arg);
39280 LDKRoutingFees lowest_inbound_channel_fees_arg_conv;
39281 lowest_inbound_channel_fees_arg_conv.inner = untag_ptr(lowest_inbound_channel_fees_arg);
39282 lowest_inbound_channel_fees_arg_conv.is_owned = ptr_is_owned(lowest_inbound_channel_fees_arg);
39283 CHECK_INNER_FIELD_ACCESS_OR_NULL(lowest_inbound_channel_fees_arg_conv);
39284 lowest_inbound_channel_fees_arg_conv = RoutingFees_clone(&lowest_inbound_channel_fees_arg_conv);
39285 LDKNodeAnnouncementInfo announcement_info_arg_conv;
39286 announcement_info_arg_conv.inner = untag_ptr(announcement_info_arg);
39287 announcement_info_arg_conv.is_owned = ptr_is_owned(announcement_info_arg);
39288 CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_info_arg_conv);
39289 announcement_info_arg_conv = NodeAnnouncementInfo_clone(&announcement_info_arg_conv);
39290 LDKNodeInfo ret_var = NodeInfo_new(channels_arg_constr, lowest_inbound_channel_fees_arg_conv, announcement_info_arg_conv);
39291 uint64_t ret_ref = 0;
39292 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39293 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39297 static inline uint64_t NodeInfo_clone_ptr(LDKNodeInfo *NONNULL_PTR arg) {
39298 LDKNodeInfo ret_var = NodeInfo_clone(arg);
39299 uint64_t ret_ref = 0;
39300 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39301 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39304 int64_t __attribute__((export_name("TS_NodeInfo_clone_ptr"))) TS_NodeInfo_clone_ptr(uint64_t arg) {
39305 LDKNodeInfo arg_conv;
39306 arg_conv.inner = untag_ptr(arg);
39307 arg_conv.is_owned = ptr_is_owned(arg);
39308 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
39309 arg_conv.is_owned = false;
39310 int64_t ret_conv = NodeInfo_clone_ptr(&arg_conv);
39314 uint64_t __attribute__((export_name("TS_NodeInfo_clone"))) TS_NodeInfo_clone(uint64_t orig) {
39315 LDKNodeInfo orig_conv;
39316 orig_conv.inner = untag_ptr(orig);
39317 orig_conv.is_owned = ptr_is_owned(orig);
39318 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
39319 orig_conv.is_owned = false;
39320 LDKNodeInfo ret_var = NodeInfo_clone(&orig_conv);
39321 uint64_t ret_ref = 0;
39322 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39323 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39327 int8_tArray __attribute__((export_name("TS_NodeInfo_write"))) TS_NodeInfo_write(uint64_t obj) {
39328 LDKNodeInfo obj_conv;
39329 obj_conv.inner = untag_ptr(obj);
39330 obj_conv.is_owned = ptr_is_owned(obj);
39331 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39332 obj_conv.is_owned = false;
39333 LDKCVec_u8Z ret_var = NodeInfo_write(&obj_conv);
39334 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
39335 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
39336 CVec_u8Z_free(ret_var);
39340 uint64_t __attribute__((export_name("TS_NodeInfo_read"))) TS_NodeInfo_read(int8_tArray ser) {
39341 LDKu8slice ser_ref;
39342 ser_ref.datalen = ser->arr_len;
39343 ser_ref.data = ser->elems;
39344 LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
39345 *ret_conv = NodeInfo_read(ser_ref);
39347 return tag_ptr(ret_conv, true);
39350 int8_tArray __attribute__((export_name("TS_NetworkGraph_write"))) TS_NetworkGraph_write(uint64_t obj) {
39351 LDKNetworkGraph obj_conv;
39352 obj_conv.inner = untag_ptr(obj);
39353 obj_conv.is_owned = ptr_is_owned(obj);
39354 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39355 obj_conv.is_owned = false;
39356 LDKCVec_u8Z ret_var = NetworkGraph_write(&obj_conv);
39357 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
39358 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
39359 CVec_u8Z_free(ret_var);
39363 uint64_t __attribute__((export_name("TS_NetworkGraph_read"))) TS_NetworkGraph_read(int8_tArray ser, uint64_t arg) {
39364 LDKu8slice ser_ref;
39365 ser_ref.datalen = ser->arr_len;
39366 ser_ref.data = ser->elems;
39367 void* arg_ptr = untag_ptr(arg);
39368 CHECK_ACCESS(arg_ptr);
39369 LDKLogger arg_conv = *(LDKLogger*)(arg_ptr);
39370 if (arg_conv.free == LDKLogger_JCalls_free) {
39371 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
39372 LDKLogger_JCalls_cloned(&arg_conv);
39374 LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ");
39375 *ret_conv = NetworkGraph_read(ser_ref, arg_conv);
39377 return tag_ptr(ret_conv, true);
39380 uint64_t __attribute__((export_name("TS_NetworkGraph_new"))) TS_NetworkGraph_new(int8_tArray genesis_hash, uint64_t logger) {
39381 LDKThirtyTwoBytes genesis_hash_ref;
39382 CHECK(genesis_hash->arr_len == 32);
39383 memcpy(genesis_hash_ref.data, genesis_hash->elems, 32); FREE(genesis_hash);
39384 void* logger_ptr = untag_ptr(logger);
39385 CHECK_ACCESS(logger_ptr);
39386 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
39387 if (logger_conv.free == LDKLogger_JCalls_free) {
39388 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
39389 LDKLogger_JCalls_cloned(&logger_conv);
39391 LDKNetworkGraph ret_var = NetworkGraph_new(genesis_hash_ref, logger_conv);
39392 uint64_t ret_ref = 0;
39393 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39394 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39398 uint64_t __attribute__((export_name("TS_NetworkGraph_read_only"))) TS_NetworkGraph_read_only(uint64_t this_arg) {
39399 LDKNetworkGraph this_arg_conv;
39400 this_arg_conv.inner = untag_ptr(this_arg);
39401 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39402 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39403 this_arg_conv.is_owned = false;
39404 LDKReadOnlyNetworkGraph ret_var = NetworkGraph_read_only(&this_arg_conv);
39405 uint64_t ret_ref = 0;
39406 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39407 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39411 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) {
39412 LDKNetworkGraph this_arg_conv;
39413 this_arg_conv.inner = untag_ptr(this_arg);
39414 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39415 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39416 this_arg_conv.is_owned = false;
39417 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
39418 *ret_copy = NetworkGraph_get_last_rapid_gossip_sync_timestamp(&this_arg_conv);
39419 uint64_t ret_ref = tag_ptr(ret_copy, true);
39423 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) {
39424 LDKNetworkGraph this_arg_conv;
39425 this_arg_conv.inner = untag_ptr(this_arg);
39426 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39427 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39428 this_arg_conv.is_owned = false;
39429 NetworkGraph_set_last_rapid_gossip_sync_timestamp(&this_arg_conv, last_rapid_gossip_sync_timestamp);
39432 uint64_t __attribute__((export_name("TS_NetworkGraph_update_node_from_announcement"))) TS_NetworkGraph_update_node_from_announcement(uint64_t this_arg, uint64_t msg) {
39433 LDKNetworkGraph this_arg_conv;
39434 this_arg_conv.inner = untag_ptr(this_arg);
39435 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39436 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39437 this_arg_conv.is_owned = false;
39438 LDKNodeAnnouncement msg_conv;
39439 msg_conv.inner = untag_ptr(msg);
39440 msg_conv.is_owned = ptr_is_owned(msg);
39441 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
39442 msg_conv.is_owned = false;
39443 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
39444 *ret_conv = NetworkGraph_update_node_from_announcement(&this_arg_conv, &msg_conv);
39445 return tag_ptr(ret_conv, true);
39448 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) {
39449 LDKNetworkGraph this_arg_conv;
39450 this_arg_conv.inner = untag_ptr(this_arg);
39451 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39452 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39453 this_arg_conv.is_owned = false;
39454 LDKUnsignedNodeAnnouncement msg_conv;
39455 msg_conv.inner = untag_ptr(msg);
39456 msg_conv.is_owned = ptr_is_owned(msg);
39457 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
39458 msg_conv.is_owned = false;
39459 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
39460 *ret_conv = NetworkGraph_update_node_from_unsigned_announcement(&this_arg_conv, &msg_conv);
39461 return tag_ptr(ret_conv, true);
39464 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) {
39465 LDKNetworkGraph this_arg_conv;
39466 this_arg_conv.inner = untag_ptr(this_arg);
39467 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39468 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39469 this_arg_conv.is_owned = false;
39470 LDKChannelAnnouncement msg_conv;
39471 msg_conv.inner = untag_ptr(msg);
39472 msg_conv.is_owned = ptr_is_owned(msg);
39473 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
39474 msg_conv.is_owned = false;
39475 void* chain_access_ptr = untag_ptr(chain_access);
39476 CHECK_ACCESS(chain_access_ptr);
39477 LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
39478 // WARNING: we may need a move here but no clone is available for LDKCOption_AccessZ
39479 if (chain_access_conv.tag == LDKCOption_AccessZ_Some) {
39480 // Manually implement clone for Java trait instances
39481 if (chain_access_conv.some.free == LDKAccess_JCalls_free) {
39482 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
39483 LDKAccess_JCalls_cloned(&chain_access_conv.some);
39486 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
39487 *ret_conv = NetworkGraph_update_channel_from_announcement(&this_arg_conv, &msg_conv, chain_access_conv);
39488 return tag_ptr(ret_conv, true);
39491 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) {
39492 LDKNetworkGraph this_arg_conv;
39493 this_arg_conv.inner = untag_ptr(this_arg);
39494 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39495 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39496 this_arg_conv.is_owned = false;
39497 LDKUnsignedChannelAnnouncement msg_conv;
39498 msg_conv.inner = untag_ptr(msg);
39499 msg_conv.is_owned = ptr_is_owned(msg);
39500 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
39501 msg_conv.is_owned = false;
39502 void* chain_access_ptr = untag_ptr(chain_access);
39503 CHECK_ACCESS(chain_access_ptr);
39504 LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
39505 // WARNING: we may need a move here but no clone is available for LDKCOption_AccessZ
39506 if (chain_access_conv.tag == LDKCOption_AccessZ_Some) {
39507 // Manually implement clone for Java trait instances
39508 if (chain_access_conv.some.free == LDKAccess_JCalls_free) {
39509 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
39510 LDKAccess_JCalls_cloned(&chain_access_conv.some);
39513 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
39514 *ret_conv = NetworkGraph_update_channel_from_unsigned_announcement(&this_arg_conv, &msg_conv, chain_access_conv);
39515 return tag_ptr(ret_conv, true);
39518 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) {
39519 LDKNetworkGraph this_arg_conv;
39520 this_arg_conv.inner = untag_ptr(this_arg);
39521 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39522 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39523 this_arg_conv.is_owned = false;
39524 LDKChannelFeatures features_conv;
39525 features_conv.inner = untag_ptr(features);
39526 features_conv.is_owned = ptr_is_owned(features);
39527 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv);
39528 features_conv = ChannelFeatures_clone(&features_conv);
39529 LDKPublicKey node_id_1_ref;
39530 CHECK(node_id_1->arr_len == 33);
39531 memcpy(node_id_1_ref.compressed_form, node_id_1->elems, 33); FREE(node_id_1);
39532 LDKPublicKey node_id_2_ref;
39533 CHECK(node_id_2->arr_len == 33);
39534 memcpy(node_id_2_ref.compressed_form, node_id_2->elems, 33); FREE(node_id_2);
39535 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
39536 *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);
39537 return tag_ptr(ret_conv, true);
39540 void __attribute__((export_name("TS_NetworkGraph_channel_failed"))) TS_NetworkGraph_channel_failed(uint64_t this_arg, int64_t short_channel_id, jboolean is_permanent) {
39541 LDKNetworkGraph this_arg_conv;
39542 this_arg_conv.inner = untag_ptr(this_arg);
39543 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39544 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39545 this_arg_conv.is_owned = false;
39546 NetworkGraph_channel_failed(&this_arg_conv, short_channel_id, is_permanent);
39549 void __attribute__((export_name("TS_NetworkGraph_node_failed"))) TS_NetworkGraph_node_failed(uint64_t this_arg, int8_tArray _node_id, jboolean is_permanent) {
39550 LDKNetworkGraph this_arg_conv;
39551 this_arg_conv.inner = untag_ptr(this_arg);
39552 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39553 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39554 this_arg_conv.is_owned = false;
39555 LDKPublicKey _node_id_ref;
39556 CHECK(_node_id->arr_len == 33);
39557 memcpy(_node_id_ref.compressed_form, _node_id->elems, 33); FREE(_node_id);
39558 NetworkGraph_node_failed(&this_arg_conv, _node_id_ref, is_permanent);
39561 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) {
39562 LDKNetworkGraph this_arg_conv;
39563 this_arg_conv.inner = untag_ptr(this_arg);
39564 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39565 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39566 this_arg_conv.is_owned = false;
39567 NetworkGraph_remove_stale_channels_with_time(&this_arg_conv, current_time_unix);
39570 uint64_t __attribute__((export_name("TS_NetworkGraph_update_channel"))) TS_NetworkGraph_update_channel(uint64_t this_arg, uint64_t msg) {
39571 LDKNetworkGraph this_arg_conv;
39572 this_arg_conv.inner = untag_ptr(this_arg);
39573 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39574 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39575 this_arg_conv.is_owned = false;
39576 LDKChannelUpdate msg_conv;
39577 msg_conv.inner = untag_ptr(msg);
39578 msg_conv.is_owned = ptr_is_owned(msg);
39579 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
39580 msg_conv.is_owned = false;
39581 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
39582 *ret_conv = NetworkGraph_update_channel(&this_arg_conv, &msg_conv);
39583 return tag_ptr(ret_conv, true);
39586 uint64_t __attribute__((export_name("TS_NetworkGraph_update_channel_unsigned"))) TS_NetworkGraph_update_channel_unsigned(uint64_t this_arg, uint64_t msg) {
39587 LDKNetworkGraph this_arg_conv;
39588 this_arg_conv.inner = untag_ptr(this_arg);
39589 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39590 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39591 this_arg_conv.is_owned = false;
39592 LDKUnsignedChannelUpdate msg_conv;
39593 msg_conv.inner = untag_ptr(msg);
39594 msg_conv.is_owned = ptr_is_owned(msg);
39595 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
39596 msg_conv.is_owned = false;
39597 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
39598 *ret_conv = NetworkGraph_update_channel_unsigned(&this_arg_conv, &msg_conv);
39599 return tag_ptr(ret_conv, true);
39602 uint64_t __attribute__((export_name("TS_ReadOnlyNetworkGraph_channel"))) TS_ReadOnlyNetworkGraph_channel(uint64_t this_arg, int64_t short_channel_id) {
39603 LDKReadOnlyNetworkGraph this_arg_conv;
39604 this_arg_conv.inner = untag_ptr(this_arg);
39605 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39606 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39607 this_arg_conv.is_owned = false;
39608 LDKChannelInfo ret_var = ReadOnlyNetworkGraph_channel(&this_arg_conv, short_channel_id);
39609 uint64_t ret_ref = 0;
39610 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39611 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39615 int64_tArray __attribute__((export_name("TS_ReadOnlyNetworkGraph_list_channels"))) TS_ReadOnlyNetworkGraph_list_channels(uint64_t this_arg) {
39616 LDKReadOnlyNetworkGraph this_arg_conv;
39617 this_arg_conv.inner = untag_ptr(this_arg);
39618 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39619 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39620 this_arg_conv.is_owned = false;
39621 LDKCVec_u64Z ret_var = ReadOnlyNetworkGraph_list_channels(&this_arg_conv);
39622 int64_tArray ret_arr = NULL;
39623 ret_arr = init_int64_tArray(ret_var.datalen, __LINE__);
39624 int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8);
39625 for (size_t i = 0; i < ret_var.datalen; i++) {
39626 int64_t ret_conv_8_conv = ret_var.data[i];
39627 ret_arr_ptr[i] = ret_conv_8_conv;
39630 FREE(ret_var.data);
39634 uint64_t __attribute__((export_name("TS_ReadOnlyNetworkGraph_node"))) TS_ReadOnlyNetworkGraph_node(uint64_t this_arg, uint64_t node_id) {
39635 LDKReadOnlyNetworkGraph this_arg_conv;
39636 this_arg_conv.inner = untag_ptr(this_arg);
39637 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39638 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39639 this_arg_conv.is_owned = false;
39640 LDKNodeId node_id_conv;
39641 node_id_conv.inner = untag_ptr(node_id);
39642 node_id_conv.is_owned = ptr_is_owned(node_id);
39643 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv);
39644 node_id_conv.is_owned = false;
39645 LDKNodeInfo ret_var = ReadOnlyNetworkGraph_node(&this_arg_conv, &node_id_conv);
39646 uint64_t ret_ref = 0;
39647 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39648 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39652 uint64_tArray __attribute__((export_name("TS_ReadOnlyNetworkGraph_list_nodes"))) TS_ReadOnlyNetworkGraph_list_nodes(uint64_t this_arg) {
39653 LDKReadOnlyNetworkGraph this_arg_conv;
39654 this_arg_conv.inner = untag_ptr(this_arg);
39655 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39656 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39657 this_arg_conv.is_owned = false;
39658 LDKCVec_NodeIdZ ret_var = ReadOnlyNetworkGraph_list_nodes(&this_arg_conv);
39659 uint64_tArray ret_arr = NULL;
39660 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
39661 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
39662 for (size_t i = 0; i < ret_var.datalen; i++) {
39663 LDKNodeId ret_conv_8_var = ret_var.data[i];
39664 uint64_t ret_conv_8_ref = 0;
39665 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_8_var);
39666 ret_conv_8_ref = tag_ptr(ret_conv_8_var.inner, ret_conv_8_var.is_owned);
39667 ret_arr_ptr[i] = ret_conv_8_ref;
39670 FREE(ret_var.data);
39674 uint64_t __attribute__((export_name("TS_ReadOnlyNetworkGraph_get_addresses"))) TS_ReadOnlyNetworkGraph_get_addresses(uint64_t this_arg, int8_tArray pubkey) {
39675 LDKReadOnlyNetworkGraph this_arg_conv;
39676 this_arg_conv.inner = untag_ptr(this_arg);
39677 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39678 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39679 this_arg_conv.is_owned = false;
39680 LDKPublicKey pubkey_ref;
39681 CHECK(pubkey->arr_len == 33);
39682 memcpy(pubkey_ref.compressed_form, pubkey->elems, 33); FREE(pubkey);
39683 LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
39684 *ret_copy = ReadOnlyNetworkGraph_get_addresses(&this_arg_conv, pubkey_ref);
39685 uint64_t ret_ref = tag_ptr(ret_copy, true);
39689 void __attribute__((export_name("TS_RouteHop_free"))) TS_RouteHop_free(uint64_t this_obj) {
39690 LDKRouteHop this_obj_conv;
39691 this_obj_conv.inner = untag_ptr(this_obj);
39692 this_obj_conv.is_owned = ptr_is_owned(this_obj);
39693 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
39694 RouteHop_free(this_obj_conv);
39697 int8_tArray __attribute__((export_name("TS_RouteHop_get_pubkey"))) TS_RouteHop_get_pubkey(uint64_t this_ptr) {
39698 LDKRouteHop this_ptr_conv;
39699 this_ptr_conv.inner = untag_ptr(this_ptr);
39700 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39701 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39702 this_ptr_conv.is_owned = false;
39703 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
39704 memcpy(ret_arr->elems, RouteHop_get_pubkey(&this_ptr_conv).compressed_form, 33);
39708 void __attribute__((export_name("TS_RouteHop_set_pubkey"))) TS_RouteHop_set_pubkey(uint64_t this_ptr, int8_tArray val) {
39709 LDKRouteHop this_ptr_conv;
39710 this_ptr_conv.inner = untag_ptr(this_ptr);
39711 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39712 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39713 this_ptr_conv.is_owned = false;
39714 LDKPublicKey val_ref;
39715 CHECK(val->arr_len == 33);
39716 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
39717 RouteHop_set_pubkey(&this_ptr_conv, val_ref);
39720 uint64_t __attribute__((export_name("TS_RouteHop_get_node_features"))) TS_RouteHop_get_node_features(uint64_t this_ptr) {
39721 LDKRouteHop this_ptr_conv;
39722 this_ptr_conv.inner = untag_ptr(this_ptr);
39723 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39724 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39725 this_ptr_conv.is_owned = false;
39726 LDKNodeFeatures ret_var = RouteHop_get_node_features(&this_ptr_conv);
39727 uint64_t ret_ref = 0;
39728 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39729 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39733 void __attribute__((export_name("TS_RouteHop_set_node_features"))) TS_RouteHop_set_node_features(uint64_t this_ptr, uint64_t val) {
39734 LDKRouteHop this_ptr_conv;
39735 this_ptr_conv.inner = untag_ptr(this_ptr);
39736 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39737 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39738 this_ptr_conv.is_owned = false;
39739 LDKNodeFeatures val_conv;
39740 val_conv.inner = untag_ptr(val);
39741 val_conv.is_owned = ptr_is_owned(val);
39742 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
39743 val_conv = NodeFeatures_clone(&val_conv);
39744 RouteHop_set_node_features(&this_ptr_conv, val_conv);
39747 int64_t __attribute__((export_name("TS_RouteHop_get_short_channel_id"))) TS_RouteHop_get_short_channel_id(uint64_t this_ptr) {
39748 LDKRouteHop this_ptr_conv;
39749 this_ptr_conv.inner = untag_ptr(this_ptr);
39750 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39751 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39752 this_ptr_conv.is_owned = false;
39753 int64_t ret_conv = RouteHop_get_short_channel_id(&this_ptr_conv);
39757 void __attribute__((export_name("TS_RouteHop_set_short_channel_id"))) TS_RouteHop_set_short_channel_id(uint64_t this_ptr, int64_t val) {
39758 LDKRouteHop this_ptr_conv;
39759 this_ptr_conv.inner = untag_ptr(this_ptr);
39760 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39761 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39762 this_ptr_conv.is_owned = false;
39763 RouteHop_set_short_channel_id(&this_ptr_conv, val);
39766 uint64_t __attribute__((export_name("TS_RouteHop_get_channel_features"))) TS_RouteHop_get_channel_features(uint64_t this_ptr) {
39767 LDKRouteHop this_ptr_conv;
39768 this_ptr_conv.inner = untag_ptr(this_ptr);
39769 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39770 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39771 this_ptr_conv.is_owned = false;
39772 LDKChannelFeatures ret_var = RouteHop_get_channel_features(&this_ptr_conv);
39773 uint64_t ret_ref = 0;
39774 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39775 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39779 void __attribute__((export_name("TS_RouteHop_set_channel_features"))) TS_RouteHop_set_channel_features(uint64_t this_ptr, uint64_t val) {
39780 LDKRouteHop this_ptr_conv;
39781 this_ptr_conv.inner = untag_ptr(this_ptr);
39782 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39783 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39784 this_ptr_conv.is_owned = false;
39785 LDKChannelFeatures val_conv;
39786 val_conv.inner = untag_ptr(val);
39787 val_conv.is_owned = ptr_is_owned(val);
39788 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
39789 val_conv = ChannelFeatures_clone(&val_conv);
39790 RouteHop_set_channel_features(&this_ptr_conv, val_conv);
39793 int64_t __attribute__((export_name("TS_RouteHop_get_fee_msat"))) TS_RouteHop_get_fee_msat(uint64_t this_ptr) {
39794 LDKRouteHop this_ptr_conv;
39795 this_ptr_conv.inner = untag_ptr(this_ptr);
39796 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39797 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39798 this_ptr_conv.is_owned = false;
39799 int64_t ret_conv = RouteHop_get_fee_msat(&this_ptr_conv);
39803 void __attribute__((export_name("TS_RouteHop_set_fee_msat"))) TS_RouteHop_set_fee_msat(uint64_t this_ptr, int64_t val) {
39804 LDKRouteHop this_ptr_conv;
39805 this_ptr_conv.inner = untag_ptr(this_ptr);
39806 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39807 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39808 this_ptr_conv.is_owned = false;
39809 RouteHop_set_fee_msat(&this_ptr_conv, val);
39812 int32_t __attribute__((export_name("TS_RouteHop_get_cltv_expiry_delta"))) TS_RouteHop_get_cltv_expiry_delta(uint64_t this_ptr) {
39813 LDKRouteHop this_ptr_conv;
39814 this_ptr_conv.inner = untag_ptr(this_ptr);
39815 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39816 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39817 this_ptr_conv.is_owned = false;
39818 int32_t ret_conv = RouteHop_get_cltv_expiry_delta(&this_ptr_conv);
39822 void __attribute__((export_name("TS_RouteHop_set_cltv_expiry_delta"))) TS_RouteHop_set_cltv_expiry_delta(uint64_t this_ptr, int32_t val) {
39823 LDKRouteHop this_ptr_conv;
39824 this_ptr_conv.inner = untag_ptr(this_ptr);
39825 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39826 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39827 this_ptr_conv.is_owned = false;
39828 RouteHop_set_cltv_expiry_delta(&this_ptr_conv, val);
39831 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) {
39832 LDKPublicKey pubkey_arg_ref;
39833 CHECK(pubkey_arg->arr_len == 33);
39834 memcpy(pubkey_arg_ref.compressed_form, pubkey_arg->elems, 33); FREE(pubkey_arg);
39835 LDKNodeFeatures node_features_arg_conv;
39836 node_features_arg_conv.inner = untag_ptr(node_features_arg);
39837 node_features_arg_conv.is_owned = ptr_is_owned(node_features_arg);
39838 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_features_arg_conv);
39839 node_features_arg_conv = NodeFeatures_clone(&node_features_arg_conv);
39840 LDKChannelFeatures channel_features_arg_conv;
39841 channel_features_arg_conv.inner = untag_ptr(channel_features_arg);
39842 channel_features_arg_conv.is_owned = ptr_is_owned(channel_features_arg);
39843 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_features_arg_conv);
39844 channel_features_arg_conv = ChannelFeatures_clone(&channel_features_arg_conv);
39845 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);
39846 uint64_t ret_ref = 0;
39847 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39848 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39852 static inline uint64_t RouteHop_clone_ptr(LDKRouteHop *NONNULL_PTR arg) {
39853 LDKRouteHop ret_var = RouteHop_clone(arg);
39854 uint64_t ret_ref = 0;
39855 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39856 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39859 int64_t __attribute__((export_name("TS_RouteHop_clone_ptr"))) TS_RouteHop_clone_ptr(uint64_t arg) {
39860 LDKRouteHop arg_conv;
39861 arg_conv.inner = untag_ptr(arg);
39862 arg_conv.is_owned = ptr_is_owned(arg);
39863 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
39864 arg_conv.is_owned = false;
39865 int64_t ret_conv = RouteHop_clone_ptr(&arg_conv);
39869 uint64_t __attribute__((export_name("TS_RouteHop_clone"))) TS_RouteHop_clone(uint64_t orig) {
39870 LDKRouteHop orig_conv;
39871 orig_conv.inner = untag_ptr(orig);
39872 orig_conv.is_owned = ptr_is_owned(orig);
39873 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
39874 orig_conv.is_owned = false;
39875 LDKRouteHop ret_var = RouteHop_clone(&orig_conv);
39876 uint64_t ret_ref = 0;
39877 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39878 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39882 int64_t __attribute__((export_name("TS_RouteHop_hash"))) TS_RouteHop_hash(uint64_t o) {
39883 LDKRouteHop o_conv;
39884 o_conv.inner = untag_ptr(o);
39885 o_conv.is_owned = ptr_is_owned(o);
39886 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
39887 o_conv.is_owned = false;
39888 int64_t ret_conv = RouteHop_hash(&o_conv);
39892 jboolean __attribute__((export_name("TS_RouteHop_eq"))) TS_RouteHop_eq(uint64_t a, uint64_t b) {
39893 LDKRouteHop a_conv;
39894 a_conv.inner = untag_ptr(a);
39895 a_conv.is_owned = ptr_is_owned(a);
39896 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
39897 a_conv.is_owned = false;
39898 LDKRouteHop b_conv;
39899 b_conv.inner = untag_ptr(b);
39900 b_conv.is_owned = ptr_is_owned(b);
39901 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
39902 b_conv.is_owned = false;
39903 jboolean ret_conv = RouteHop_eq(&a_conv, &b_conv);
39907 int8_tArray __attribute__((export_name("TS_RouteHop_write"))) TS_RouteHop_write(uint64_t obj) {
39908 LDKRouteHop obj_conv;
39909 obj_conv.inner = untag_ptr(obj);
39910 obj_conv.is_owned = ptr_is_owned(obj);
39911 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39912 obj_conv.is_owned = false;
39913 LDKCVec_u8Z ret_var = RouteHop_write(&obj_conv);
39914 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
39915 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
39916 CVec_u8Z_free(ret_var);
39920 uint64_t __attribute__((export_name("TS_RouteHop_read"))) TS_RouteHop_read(int8_tArray ser) {
39921 LDKu8slice ser_ref;
39922 ser_ref.datalen = ser->arr_len;
39923 ser_ref.data = ser->elems;
39924 LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
39925 *ret_conv = RouteHop_read(ser_ref);
39927 return tag_ptr(ret_conv, true);
39930 void __attribute__((export_name("TS_Route_free"))) TS_Route_free(uint64_t this_obj) {
39931 LDKRoute this_obj_conv;
39932 this_obj_conv.inner = untag_ptr(this_obj);
39933 this_obj_conv.is_owned = ptr_is_owned(this_obj);
39934 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
39935 Route_free(this_obj_conv);
39938 ptrArray __attribute__((export_name("TS_Route_get_paths"))) TS_Route_get_paths(uint64_t this_ptr) {
39939 LDKRoute this_ptr_conv;
39940 this_ptr_conv.inner = untag_ptr(this_ptr);
39941 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39942 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39943 this_ptr_conv.is_owned = false;
39944 LDKCVec_CVec_RouteHopZZ ret_var = Route_get_paths(&this_ptr_conv);
39945 ptrArray ret_arr = NULL;
39946 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
39947 uint64_tArray *ret_arr_ptr = (uint64_tArray*)(((uint8_t*)ret_arr) + 8);
39948 for (size_t m = 0; m < ret_var.datalen; m++) {
39949 LDKCVec_RouteHopZ ret_conv_12_var = ret_var.data[m];
39950 uint64_tArray ret_conv_12_arr = NULL;
39951 ret_conv_12_arr = init_uint64_tArray(ret_conv_12_var.datalen, __LINE__);
39952 uint64_t *ret_conv_12_arr_ptr = (uint64_t*)(((uint8_t*)ret_conv_12_arr) + 8);
39953 for (size_t k = 0; k < ret_conv_12_var.datalen; k++) {
39954 LDKRouteHop ret_conv_12_conv_10_var = ret_conv_12_var.data[k];
39955 uint64_t ret_conv_12_conv_10_ref = 0;
39956 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_12_conv_10_var);
39957 ret_conv_12_conv_10_ref = tag_ptr(ret_conv_12_conv_10_var.inner, ret_conv_12_conv_10_var.is_owned);
39958 ret_conv_12_arr_ptr[k] = ret_conv_12_conv_10_ref;
39961 FREE(ret_conv_12_var.data);
39962 ret_arr_ptr[m] = ret_conv_12_arr;
39965 FREE(ret_var.data);
39969 void __attribute__((export_name("TS_Route_set_paths"))) TS_Route_set_paths(uint64_t this_ptr, ptrArray val) {
39970 LDKRoute this_ptr_conv;
39971 this_ptr_conv.inner = untag_ptr(this_ptr);
39972 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39973 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39974 this_ptr_conv.is_owned = false;
39975 LDKCVec_CVec_RouteHopZZ val_constr;
39976 val_constr.datalen = val->arr_len;
39977 if (val_constr.datalen > 0)
39978 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKCVec_RouteHopZ), "LDKCVec_CVec_RouteHopZZ Elements");
39980 val_constr.data = NULL;
39981 uint64_tArray* val_vals = (void*) val->elems;
39982 for (size_t m = 0; m < val_constr.datalen; m++) {
39983 uint64_tArray val_conv_12 = val_vals[m];
39984 LDKCVec_RouteHopZ val_conv_12_constr;
39985 val_conv_12_constr.datalen = val_conv_12->arr_len;
39986 if (val_conv_12_constr.datalen > 0)
39987 val_conv_12_constr.data = MALLOC(val_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
39989 val_conv_12_constr.data = NULL;
39990 uint64_t* val_conv_12_vals = val_conv_12->elems;
39991 for (size_t k = 0; k < val_conv_12_constr.datalen; k++) {
39992 uint64_t val_conv_12_conv_10 = val_conv_12_vals[k];
39993 LDKRouteHop val_conv_12_conv_10_conv;
39994 val_conv_12_conv_10_conv.inner = untag_ptr(val_conv_12_conv_10);
39995 val_conv_12_conv_10_conv.is_owned = ptr_is_owned(val_conv_12_conv_10);
39996 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_12_conv_10_conv);
39997 val_conv_12_conv_10_conv = RouteHop_clone(&val_conv_12_conv_10_conv);
39998 val_conv_12_constr.data[k] = val_conv_12_conv_10_conv;
40001 val_constr.data[m] = val_conv_12_constr;
40004 Route_set_paths(&this_ptr_conv, val_constr);
40007 uint64_t __attribute__((export_name("TS_Route_get_payment_params"))) TS_Route_get_payment_params(uint64_t this_ptr) {
40008 LDKRoute this_ptr_conv;
40009 this_ptr_conv.inner = untag_ptr(this_ptr);
40010 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40011 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40012 this_ptr_conv.is_owned = false;
40013 LDKPaymentParameters ret_var = Route_get_payment_params(&this_ptr_conv);
40014 uint64_t ret_ref = 0;
40015 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40016 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40020 void __attribute__((export_name("TS_Route_set_payment_params"))) TS_Route_set_payment_params(uint64_t this_ptr, uint64_t val) {
40021 LDKRoute this_ptr_conv;
40022 this_ptr_conv.inner = untag_ptr(this_ptr);
40023 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40024 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40025 this_ptr_conv.is_owned = false;
40026 LDKPaymentParameters val_conv;
40027 val_conv.inner = untag_ptr(val);
40028 val_conv.is_owned = ptr_is_owned(val);
40029 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
40030 val_conv = PaymentParameters_clone(&val_conv);
40031 Route_set_payment_params(&this_ptr_conv, val_conv);
40034 uint64_t __attribute__((export_name("TS_Route_new"))) TS_Route_new(ptrArray paths_arg, uint64_t payment_params_arg) {
40035 LDKCVec_CVec_RouteHopZZ paths_arg_constr;
40036 paths_arg_constr.datalen = paths_arg->arr_len;
40037 if (paths_arg_constr.datalen > 0)
40038 paths_arg_constr.data = MALLOC(paths_arg_constr.datalen * sizeof(LDKCVec_RouteHopZ), "LDKCVec_CVec_RouteHopZZ Elements");
40040 paths_arg_constr.data = NULL;
40041 uint64_tArray* paths_arg_vals = (void*) paths_arg->elems;
40042 for (size_t m = 0; m < paths_arg_constr.datalen; m++) {
40043 uint64_tArray paths_arg_conv_12 = paths_arg_vals[m];
40044 LDKCVec_RouteHopZ paths_arg_conv_12_constr;
40045 paths_arg_conv_12_constr.datalen = paths_arg_conv_12->arr_len;
40046 if (paths_arg_conv_12_constr.datalen > 0)
40047 paths_arg_conv_12_constr.data = MALLOC(paths_arg_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
40049 paths_arg_conv_12_constr.data = NULL;
40050 uint64_t* paths_arg_conv_12_vals = paths_arg_conv_12->elems;
40051 for (size_t k = 0; k < paths_arg_conv_12_constr.datalen; k++) {
40052 uint64_t paths_arg_conv_12_conv_10 = paths_arg_conv_12_vals[k];
40053 LDKRouteHop paths_arg_conv_12_conv_10_conv;
40054 paths_arg_conv_12_conv_10_conv.inner = untag_ptr(paths_arg_conv_12_conv_10);
40055 paths_arg_conv_12_conv_10_conv.is_owned = ptr_is_owned(paths_arg_conv_12_conv_10);
40056 CHECK_INNER_FIELD_ACCESS_OR_NULL(paths_arg_conv_12_conv_10_conv);
40057 paths_arg_conv_12_conv_10_conv = RouteHop_clone(&paths_arg_conv_12_conv_10_conv);
40058 paths_arg_conv_12_constr.data[k] = paths_arg_conv_12_conv_10_conv;
40060 FREE(paths_arg_conv_12);
40061 paths_arg_constr.data[m] = paths_arg_conv_12_constr;
40064 LDKPaymentParameters payment_params_arg_conv;
40065 payment_params_arg_conv.inner = untag_ptr(payment_params_arg);
40066 payment_params_arg_conv.is_owned = ptr_is_owned(payment_params_arg);
40067 CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_params_arg_conv);
40068 payment_params_arg_conv = PaymentParameters_clone(&payment_params_arg_conv);
40069 LDKRoute ret_var = Route_new(paths_arg_constr, payment_params_arg_conv);
40070 uint64_t ret_ref = 0;
40071 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40072 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40076 static inline uint64_t Route_clone_ptr(LDKRoute *NONNULL_PTR arg) {
40077 LDKRoute ret_var = Route_clone(arg);
40078 uint64_t ret_ref = 0;
40079 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40080 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40083 int64_t __attribute__((export_name("TS_Route_clone_ptr"))) TS_Route_clone_ptr(uint64_t arg) {
40085 arg_conv.inner = untag_ptr(arg);
40086 arg_conv.is_owned = ptr_is_owned(arg);
40087 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
40088 arg_conv.is_owned = false;
40089 int64_t ret_conv = Route_clone_ptr(&arg_conv);
40093 uint64_t __attribute__((export_name("TS_Route_clone"))) TS_Route_clone(uint64_t orig) {
40094 LDKRoute orig_conv;
40095 orig_conv.inner = untag_ptr(orig);
40096 orig_conv.is_owned = ptr_is_owned(orig);
40097 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
40098 orig_conv.is_owned = false;
40099 LDKRoute ret_var = Route_clone(&orig_conv);
40100 uint64_t ret_ref = 0;
40101 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40102 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40106 int64_t __attribute__((export_name("TS_Route_hash"))) TS_Route_hash(uint64_t o) {
40108 o_conv.inner = untag_ptr(o);
40109 o_conv.is_owned = ptr_is_owned(o);
40110 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
40111 o_conv.is_owned = false;
40112 int64_t ret_conv = Route_hash(&o_conv);
40116 jboolean __attribute__((export_name("TS_Route_eq"))) TS_Route_eq(uint64_t a, uint64_t b) {
40118 a_conv.inner = untag_ptr(a);
40119 a_conv.is_owned = ptr_is_owned(a);
40120 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
40121 a_conv.is_owned = false;
40123 b_conv.inner = untag_ptr(b);
40124 b_conv.is_owned = ptr_is_owned(b);
40125 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
40126 b_conv.is_owned = false;
40127 jboolean ret_conv = Route_eq(&a_conv, &b_conv);
40131 int64_t __attribute__((export_name("TS_Route_get_total_fees"))) TS_Route_get_total_fees(uint64_t this_arg) {
40132 LDKRoute this_arg_conv;
40133 this_arg_conv.inner = untag_ptr(this_arg);
40134 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40135 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40136 this_arg_conv.is_owned = false;
40137 int64_t ret_conv = Route_get_total_fees(&this_arg_conv);
40141 int64_t __attribute__((export_name("TS_Route_get_total_amount"))) TS_Route_get_total_amount(uint64_t this_arg) {
40142 LDKRoute this_arg_conv;
40143 this_arg_conv.inner = untag_ptr(this_arg);
40144 this_arg_conv.is_owned = ptr_is_owned(this_arg);
40145 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
40146 this_arg_conv.is_owned = false;
40147 int64_t ret_conv = Route_get_total_amount(&this_arg_conv);
40151 int8_tArray __attribute__((export_name("TS_Route_write"))) TS_Route_write(uint64_t obj) {
40153 obj_conv.inner = untag_ptr(obj);
40154 obj_conv.is_owned = ptr_is_owned(obj);
40155 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
40156 obj_conv.is_owned = false;
40157 LDKCVec_u8Z ret_var = Route_write(&obj_conv);
40158 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
40159 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
40160 CVec_u8Z_free(ret_var);
40164 uint64_t __attribute__((export_name("TS_Route_read"))) TS_Route_read(int8_tArray ser) {
40165 LDKu8slice ser_ref;
40166 ser_ref.datalen = ser->arr_len;
40167 ser_ref.data = ser->elems;
40168 LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
40169 *ret_conv = Route_read(ser_ref);
40171 return tag_ptr(ret_conv, true);
40174 void __attribute__((export_name("TS_RouteParameters_free"))) TS_RouteParameters_free(uint64_t this_obj) {
40175 LDKRouteParameters this_obj_conv;
40176 this_obj_conv.inner = untag_ptr(this_obj);
40177 this_obj_conv.is_owned = ptr_is_owned(this_obj);
40178 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
40179 RouteParameters_free(this_obj_conv);
40182 uint64_t __attribute__((export_name("TS_RouteParameters_get_payment_params"))) TS_RouteParameters_get_payment_params(uint64_t this_ptr) {
40183 LDKRouteParameters this_ptr_conv;
40184 this_ptr_conv.inner = untag_ptr(this_ptr);
40185 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40186 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40187 this_ptr_conv.is_owned = false;
40188 LDKPaymentParameters ret_var = RouteParameters_get_payment_params(&this_ptr_conv);
40189 uint64_t ret_ref = 0;
40190 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40191 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40195 void __attribute__((export_name("TS_RouteParameters_set_payment_params"))) TS_RouteParameters_set_payment_params(uint64_t this_ptr, uint64_t val) {
40196 LDKRouteParameters this_ptr_conv;
40197 this_ptr_conv.inner = untag_ptr(this_ptr);
40198 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40199 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40200 this_ptr_conv.is_owned = false;
40201 LDKPaymentParameters val_conv;
40202 val_conv.inner = untag_ptr(val);
40203 val_conv.is_owned = ptr_is_owned(val);
40204 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
40205 val_conv = PaymentParameters_clone(&val_conv);
40206 RouteParameters_set_payment_params(&this_ptr_conv, val_conv);
40209 int64_t __attribute__((export_name("TS_RouteParameters_get_final_value_msat"))) TS_RouteParameters_get_final_value_msat(uint64_t this_ptr) {
40210 LDKRouteParameters this_ptr_conv;
40211 this_ptr_conv.inner = untag_ptr(this_ptr);
40212 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40213 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40214 this_ptr_conv.is_owned = false;
40215 int64_t ret_conv = RouteParameters_get_final_value_msat(&this_ptr_conv);
40219 void __attribute__((export_name("TS_RouteParameters_set_final_value_msat"))) TS_RouteParameters_set_final_value_msat(uint64_t this_ptr, int64_t val) {
40220 LDKRouteParameters this_ptr_conv;
40221 this_ptr_conv.inner = untag_ptr(this_ptr);
40222 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40223 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40224 this_ptr_conv.is_owned = false;
40225 RouteParameters_set_final_value_msat(&this_ptr_conv, val);
40228 int32_t __attribute__((export_name("TS_RouteParameters_get_final_cltv_expiry_delta"))) TS_RouteParameters_get_final_cltv_expiry_delta(uint64_t this_ptr) {
40229 LDKRouteParameters this_ptr_conv;
40230 this_ptr_conv.inner = untag_ptr(this_ptr);
40231 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40232 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40233 this_ptr_conv.is_owned = false;
40234 int32_t ret_conv = RouteParameters_get_final_cltv_expiry_delta(&this_ptr_conv);
40238 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) {
40239 LDKRouteParameters this_ptr_conv;
40240 this_ptr_conv.inner = untag_ptr(this_ptr);
40241 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40242 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40243 this_ptr_conv.is_owned = false;
40244 RouteParameters_set_final_cltv_expiry_delta(&this_ptr_conv, val);
40247 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) {
40248 LDKPaymentParameters payment_params_arg_conv;
40249 payment_params_arg_conv.inner = untag_ptr(payment_params_arg);
40250 payment_params_arg_conv.is_owned = ptr_is_owned(payment_params_arg);
40251 CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_params_arg_conv);
40252 payment_params_arg_conv = PaymentParameters_clone(&payment_params_arg_conv);
40253 LDKRouteParameters ret_var = RouteParameters_new(payment_params_arg_conv, final_value_msat_arg, final_cltv_expiry_delta_arg);
40254 uint64_t ret_ref = 0;
40255 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40256 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40260 static inline uint64_t RouteParameters_clone_ptr(LDKRouteParameters *NONNULL_PTR arg) {
40261 LDKRouteParameters ret_var = RouteParameters_clone(arg);
40262 uint64_t ret_ref = 0;
40263 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40264 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40267 int64_t __attribute__((export_name("TS_RouteParameters_clone_ptr"))) TS_RouteParameters_clone_ptr(uint64_t arg) {
40268 LDKRouteParameters arg_conv;
40269 arg_conv.inner = untag_ptr(arg);
40270 arg_conv.is_owned = ptr_is_owned(arg);
40271 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
40272 arg_conv.is_owned = false;
40273 int64_t ret_conv = RouteParameters_clone_ptr(&arg_conv);
40277 uint64_t __attribute__((export_name("TS_RouteParameters_clone"))) TS_RouteParameters_clone(uint64_t orig) {
40278 LDKRouteParameters orig_conv;
40279 orig_conv.inner = untag_ptr(orig);
40280 orig_conv.is_owned = ptr_is_owned(orig);
40281 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
40282 orig_conv.is_owned = false;
40283 LDKRouteParameters ret_var = RouteParameters_clone(&orig_conv);
40284 uint64_t ret_ref = 0;
40285 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40286 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40290 int8_tArray __attribute__((export_name("TS_RouteParameters_write"))) TS_RouteParameters_write(uint64_t obj) {
40291 LDKRouteParameters obj_conv;
40292 obj_conv.inner = untag_ptr(obj);
40293 obj_conv.is_owned = ptr_is_owned(obj);
40294 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
40295 obj_conv.is_owned = false;
40296 LDKCVec_u8Z ret_var = RouteParameters_write(&obj_conv);
40297 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
40298 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
40299 CVec_u8Z_free(ret_var);
40303 uint64_t __attribute__((export_name("TS_RouteParameters_read"))) TS_RouteParameters_read(int8_tArray ser) {
40304 LDKu8slice ser_ref;
40305 ser_ref.datalen = ser->arr_len;
40306 ser_ref.data = ser->elems;
40307 LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
40308 *ret_conv = RouteParameters_read(ser_ref);
40310 return tag_ptr(ret_conv, true);
40313 void __attribute__((export_name("TS_PaymentParameters_free"))) TS_PaymentParameters_free(uint64_t this_obj) {
40314 LDKPaymentParameters this_obj_conv;
40315 this_obj_conv.inner = untag_ptr(this_obj);
40316 this_obj_conv.is_owned = ptr_is_owned(this_obj);
40317 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
40318 PaymentParameters_free(this_obj_conv);
40321 int8_tArray __attribute__((export_name("TS_PaymentParameters_get_payee_pubkey"))) TS_PaymentParameters_get_payee_pubkey(uint64_t this_ptr) {
40322 LDKPaymentParameters this_ptr_conv;
40323 this_ptr_conv.inner = untag_ptr(this_ptr);
40324 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40325 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40326 this_ptr_conv.is_owned = false;
40327 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
40328 memcpy(ret_arr->elems, PaymentParameters_get_payee_pubkey(&this_ptr_conv).compressed_form, 33);
40332 void __attribute__((export_name("TS_PaymentParameters_set_payee_pubkey"))) TS_PaymentParameters_set_payee_pubkey(uint64_t this_ptr, int8_tArray val) {
40333 LDKPaymentParameters this_ptr_conv;
40334 this_ptr_conv.inner = untag_ptr(this_ptr);
40335 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40336 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40337 this_ptr_conv.is_owned = false;
40338 LDKPublicKey val_ref;
40339 CHECK(val->arr_len == 33);
40340 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
40341 PaymentParameters_set_payee_pubkey(&this_ptr_conv, val_ref);
40344 uint64_t __attribute__((export_name("TS_PaymentParameters_get_features"))) TS_PaymentParameters_get_features(uint64_t this_ptr) {
40345 LDKPaymentParameters this_ptr_conv;
40346 this_ptr_conv.inner = untag_ptr(this_ptr);
40347 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40348 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40349 this_ptr_conv.is_owned = false;
40350 LDKInvoiceFeatures ret_var = PaymentParameters_get_features(&this_ptr_conv);
40351 uint64_t ret_ref = 0;
40352 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40353 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40357 void __attribute__((export_name("TS_PaymentParameters_set_features"))) TS_PaymentParameters_set_features(uint64_t this_ptr, uint64_t val) {
40358 LDKPaymentParameters this_ptr_conv;
40359 this_ptr_conv.inner = untag_ptr(this_ptr);
40360 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40361 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40362 this_ptr_conv.is_owned = false;
40363 LDKInvoiceFeatures val_conv;
40364 val_conv.inner = untag_ptr(val);
40365 val_conv.is_owned = ptr_is_owned(val);
40366 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
40367 val_conv = InvoiceFeatures_clone(&val_conv);
40368 PaymentParameters_set_features(&this_ptr_conv, val_conv);
40371 uint64_tArray __attribute__((export_name("TS_PaymentParameters_get_route_hints"))) TS_PaymentParameters_get_route_hints(uint64_t this_ptr) {
40372 LDKPaymentParameters this_ptr_conv;
40373 this_ptr_conv.inner = untag_ptr(this_ptr);
40374 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40375 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40376 this_ptr_conv.is_owned = false;
40377 LDKCVec_RouteHintZ ret_var = PaymentParameters_get_route_hints(&this_ptr_conv);
40378 uint64_tArray ret_arr = NULL;
40379 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
40380 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
40381 for (size_t l = 0; l < ret_var.datalen; l++) {
40382 LDKRouteHint ret_conv_11_var = ret_var.data[l];
40383 uint64_t ret_conv_11_ref = 0;
40384 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_11_var);
40385 ret_conv_11_ref = tag_ptr(ret_conv_11_var.inner, ret_conv_11_var.is_owned);
40386 ret_arr_ptr[l] = ret_conv_11_ref;
40389 FREE(ret_var.data);
40393 void __attribute__((export_name("TS_PaymentParameters_set_route_hints"))) TS_PaymentParameters_set_route_hints(uint64_t this_ptr, uint64_tArray val) {
40394 LDKPaymentParameters this_ptr_conv;
40395 this_ptr_conv.inner = untag_ptr(this_ptr);
40396 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40397 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40398 this_ptr_conv.is_owned = false;
40399 LDKCVec_RouteHintZ val_constr;
40400 val_constr.datalen = val->arr_len;
40401 if (val_constr.datalen > 0)
40402 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
40404 val_constr.data = NULL;
40405 uint64_t* val_vals = val->elems;
40406 for (size_t l = 0; l < val_constr.datalen; l++) {
40407 uint64_t val_conv_11 = val_vals[l];
40408 LDKRouteHint val_conv_11_conv;
40409 val_conv_11_conv.inner = untag_ptr(val_conv_11);
40410 val_conv_11_conv.is_owned = ptr_is_owned(val_conv_11);
40411 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_11_conv);
40412 val_conv_11_conv = RouteHint_clone(&val_conv_11_conv);
40413 val_constr.data[l] = val_conv_11_conv;
40416 PaymentParameters_set_route_hints(&this_ptr_conv, val_constr);
40419 uint64_t __attribute__((export_name("TS_PaymentParameters_get_expiry_time"))) TS_PaymentParameters_get_expiry_time(uint64_t this_ptr) {
40420 LDKPaymentParameters this_ptr_conv;
40421 this_ptr_conv.inner = untag_ptr(this_ptr);
40422 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40423 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40424 this_ptr_conv.is_owned = false;
40425 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
40426 *ret_copy = PaymentParameters_get_expiry_time(&this_ptr_conv);
40427 uint64_t ret_ref = tag_ptr(ret_copy, true);
40431 void __attribute__((export_name("TS_PaymentParameters_set_expiry_time"))) TS_PaymentParameters_set_expiry_time(uint64_t this_ptr, uint64_t val) {
40432 LDKPaymentParameters this_ptr_conv;
40433 this_ptr_conv.inner = untag_ptr(this_ptr);
40434 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40435 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40436 this_ptr_conv.is_owned = false;
40437 void* val_ptr = untag_ptr(val);
40438 CHECK_ACCESS(val_ptr);
40439 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
40440 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
40441 PaymentParameters_set_expiry_time(&this_ptr_conv, val_conv);
40444 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) {
40445 LDKPaymentParameters this_ptr_conv;
40446 this_ptr_conv.inner = untag_ptr(this_ptr);
40447 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40448 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40449 this_ptr_conv.is_owned = false;
40450 int32_t ret_conv = PaymentParameters_get_max_total_cltv_expiry_delta(&this_ptr_conv);
40454 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) {
40455 LDKPaymentParameters this_ptr_conv;
40456 this_ptr_conv.inner = untag_ptr(this_ptr);
40457 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40458 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40459 this_ptr_conv.is_owned = false;
40460 PaymentParameters_set_max_total_cltv_expiry_delta(&this_ptr_conv, val);
40463 int8_t __attribute__((export_name("TS_PaymentParameters_get_max_path_count"))) TS_PaymentParameters_get_max_path_count(uint64_t this_ptr) {
40464 LDKPaymentParameters this_ptr_conv;
40465 this_ptr_conv.inner = untag_ptr(this_ptr);
40466 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40467 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40468 this_ptr_conv.is_owned = false;
40469 int8_t ret_conv = PaymentParameters_get_max_path_count(&this_ptr_conv);
40473 void __attribute__((export_name("TS_PaymentParameters_set_max_path_count"))) TS_PaymentParameters_set_max_path_count(uint64_t this_ptr, int8_t val) {
40474 LDKPaymentParameters this_ptr_conv;
40475 this_ptr_conv.inner = untag_ptr(this_ptr);
40476 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40477 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40478 this_ptr_conv.is_owned = false;
40479 PaymentParameters_set_max_path_count(&this_ptr_conv, val);
40482 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) {
40483 LDKPaymentParameters this_ptr_conv;
40484 this_ptr_conv.inner = untag_ptr(this_ptr);
40485 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40486 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40487 this_ptr_conv.is_owned = false;
40488 int8_t ret_conv = PaymentParameters_get_max_channel_saturation_power_of_half(&this_ptr_conv);
40492 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) {
40493 LDKPaymentParameters this_ptr_conv;
40494 this_ptr_conv.inner = untag_ptr(this_ptr);
40495 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40496 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40497 this_ptr_conv.is_owned = false;
40498 PaymentParameters_set_max_channel_saturation_power_of_half(&this_ptr_conv, val);
40501 int64_tArray __attribute__((export_name("TS_PaymentParameters_get_previously_failed_channels"))) TS_PaymentParameters_get_previously_failed_channels(uint64_t this_ptr) {
40502 LDKPaymentParameters this_ptr_conv;
40503 this_ptr_conv.inner = untag_ptr(this_ptr);
40504 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40505 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40506 this_ptr_conv.is_owned = false;
40507 LDKCVec_u64Z ret_var = PaymentParameters_get_previously_failed_channels(&this_ptr_conv);
40508 int64_tArray ret_arr = NULL;
40509 ret_arr = init_int64_tArray(ret_var.datalen, __LINE__);
40510 int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8);
40511 for (size_t i = 0; i < ret_var.datalen; i++) {
40512 int64_t ret_conv_8_conv = ret_var.data[i];
40513 ret_arr_ptr[i] = ret_conv_8_conv;
40516 FREE(ret_var.data);
40520 void __attribute__((export_name("TS_PaymentParameters_set_previously_failed_channels"))) TS_PaymentParameters_set_previously_failed_channels(uint64_t this_ptr, int64_tArray val) {
40521 LDKPaymentParameters this_ptr_conv;
40522 this_ptr_conv.inner = untag_ptr(this_ptr);
40523 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40524 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40525 this_ptr_conv.is_owned = false;
40526 LDKCVec_u64Z val_constr;
40527 val_constr.datalen = val->arr_len;
40528 if (val_constr.datalen > 0)
40529 val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
40531 val_constr.data = NULL;
40532 int64_t* val_vals = val->elems;
40533 for (size_t i = 0; i < val_constr.datalen; i++) {
40534 int64_t val_conv_8 = val_vals[i];
40535 val_constr.data[i] = val_conv_8;
40538 PaymentParameters_set_previously_failed_channels(&this_ptr_conv, val_constr);
40541 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) {
40542 LDKPublicKey payee_pubkey_arg_ref;
40543 CHECK(payee_pubkey_arg->arr_len == 33);
40544 memcpy(payee_pubkey_arg_ref.compressed_form, payee_pubkey_arg->elems, 33); FREE(payee_pubkey_arg);
40545 LDKInvoiceFeatures features_arg_conv;
40546 features_arg_conv.inner = untag_ptr(features_arg);
40547 features_arg_conv.is_owned = ptr_is_owned(features_arg);
40548 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv);
40549 features_arg_conv = InvoiceFeatures_clone(&features_arg_conv);
40550 LDKCVec_RouteHintZ route_hints_arg_constr;
40551 route_hints_arg_constr.datalen = route_hints_arg->arr_len;
40552 if (route_hints_arg_constr.datalen > 0)
40553 route_hints_arg_constr.data = MALLOC(route_hints_arg_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
40555 route_hints_arg_constr.data = NULL;
40556 uint64_t* route_hints_arg_vals = route_hints_arg->elems;
40557 for (size_t l = 0; l < route_hints_arg_constr.datalen; l++) {
40558 uint64_t route_hints_arg_conv_11 = route_hints_arg_vals[l];
40559 LDKRouteHint route_hints_arg_conv_11_conv;
40560 route_hints_arg_conv_11_conv.inner = untag_ptr(route_hints_arg_conv_11);
40561 route_hints_arg_conv_11_conv.is_owned = ptr_is_owned(route_hints_arg_conv_11);
40562 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_hints_arg_conv_11_conv);
40563 route_hints_arg_conv_11_conv = RouteHint_clone(&route_hints_arg_conv_11_conv);
40564 route_hints_arg_constr.data[l] = route_hints_arg_conv_11_conv;
40566 FREE(route_hints_arg);
40567 void* expiry_time_arg_ptr = untag_ptr(expiry_time_arg);
40568 CHECK_ACCESS(expiry_time_arg_ptr);
40569 LDKCOption_u64Z expiry_time_arg_conv = *(LDKCOption_u64Z*)(expiry_time_arg_ptr);
40570 expiry_time_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(expiry_time_arg));
40571 LDKCVec_u64Z previously_failed_channels_arg_constr;
40572 previously_failed_channels_arg_constr.datalen = previously_failed_channels_arg->arr_len;
40573 if (previously_failed_channels_arg_constr.datalen > 0)
40574 previously_failed_channels_arg_constr.data = MALLOC(previously_failed_channels_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
40576 previously_failed_channels_arg_constr.data = NULL;
40577 int64_t* previously_failed_channels_arg_vals = previously_failed_channels_arg->elems;
40578 for (size_t i = 0; i < previously_failed_channels_arg_constr.datalen; i++) {
40579 int64_t previously_failed_channels_arg_conv_8 = previously_failed_channels_arg_vals[i];
40580 previously_failed_channels_arg_constr.data[i] = previously_failed_channels_arg_conv_8;
40582 FREE(previously_failed_channels_arg);
40583 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);
40584 uint64_t ret_ref = 0;
40585 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40586 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40590 static inline uint64_t PaymentParameters_clone_ptr(LDKPaymentParameters *NONNULL_PTR arg) {
40591 LDKPaymentParameters ret_var = PaymentParameters_clone(arg);
40592 uint64_t ret_ref = 0;
40593 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40594 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40597 int64_t __attribute__((export_name("TS_PaymentParameters_clone_ptr"))) TS_PaymentParameters_clone_ptr(uint64_t arg) {
40598 LDKPaymentParameters arg_conv;
40599 arg_conv.inner = untag_ptr(arg);
40600 arg_conv.is_owned = ptr_is_owned(arg);
40601 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
40602 arg_conv.is_owned = false;
40603 int64_t ret_conv = PaymentParameters_clone_ptr(&arg_conv);
40607 uint64_t __attribute__((export_name("TS_PaymentParameters_clone"))) TS_PaymentParameters_clone(uint64_t orig) {
40608 LDKPaymentParameters orig_conv;
40609 orig_conv.inner = untag_ptr(orig);
40610 orig_conv.is_owned = ptr_is_owned(orig);
40611 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
40612 orig_conv.is_owned = false;
40613 LDKPaymentParameters ret_var = PaymentParameters_clone(&orig_conv);
40614 uint64_t ret_ref = 0;
40615 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40616 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40620 int64_t __attribute__((export_name("TS_PaymentParameters_hash"))) TS_PaymentParameters_hash(uint64_t o) {
40621 LDKPaymentParameters o_conv;
40622 o_conv.inner = untag_ptr(o);
40623 o_conv.is_owned = ptr_is_owned(o);
40624 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
40625 o_conv.is_owned = false;
40626 int64_t ret_conv = PaymentParameters_hash(&o_conv);
40630 jboolean __attribute__((export_name("TS_PaymentParameters_eq"))) TS_PaymentParameters_eq(uint64_t a, uint64_t b) {
40631 LDKPaymentParameters a_conv;
40632 a_conv.inner = untag_ptr(a);
40633 a_conv.is_owned = ptr_is_owned(a);
40634 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
40635 a_conv.is_owned = false;
40636 LDKPaymentParameters b_conv;
40637 b_conv.inner = untag_ptr(b);
40638 b_conv.is_owned = ptr_is_owned(b);
40639 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
40640 b_conv.is_owned = false;
40641 jboolean ret_conv = PaymentParameters_eq(&a_conv, &b_conv);
40645 int8_tArray __attribute__((export_name("TS_PaymentParameters_write"))) TS_PaymentParameters_write(uint64_t obj) {
40646 LDKPaymentParameters obj_conv;
40647 obj_conv.inner = untag_ptr(obj);
40648 obj_conv.is_owned = ptr_is_owned(obj);
40649 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
40650 obj_conv.is_owned = false;
40651 LDKCVec_u8Z ret_var = PaymentParameters_write(&obj_conv);
40652 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
40653 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
40654 CVec_u8Z_free(ret_var);
40658 uint64_t __attribute__((export_name("TS_PaymentParameters_read"))) TS_PaymentParameters_read(int8_tArray ser) {
40659 LDKu8slice ser_ref;
40660 ser_ref.datalen = ser->arr_len;
40661 ser_ref.data = ser->elems;
40662 LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
40663 *ret_conv = PaymentParameters_read(ser_ref);
40665 return tag_ptr(ret_conv, true);
40668 uint64_t __attribute__((export_name("TS_PaymentParameters_from_node_id"))) TS_PaymentParameters_from_node_id(int8_tArray payee_pubkey) {
40669 LDKPublicKey payee_pubkey_ref;
40670 CHECK(payee_pubkey->arr_len == 33);
40671 memcpy(payee_pubkey_ref.compressed_form, payee_pubkey->elems, 33); FREE(payee_pubkey);
40672 LDKPaymentParameters ret_var = PaymentParameters_from_node_id(payee_pubkey_ref);
40673 uint64_t ret_ref = 0;
40674 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40675 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40679 uint64_t __attribute__((export_name("TS_PaymentParameters_for_keysend"))) TS_PaymentParameters_for_keysend(int8_tArray payee_pubkey) {
40680 LDKPublicKey payee_pubkey_ref;
40681 CHECK(payee_pubkey->arr_len == 33);
40682 memcpy(payee_pubkey_ref.compressed_form, payee_pubkey->elems, 33); FREE(payee_pubkey);
40683 LDKPaymentParameters ret_var = PaymentParameters_for_keysend(payee_pubkey_ref);
40684 uint64_t ret_ref = 0;
40685 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40686 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40690 void __attribute__((export_name("TS_RouteHint_free"))) TS_RouteHint_free(uint64_t this_obj) {
40691 LDKRouteHint this_obj_conv;
40692 this_obj_conv.inner = untag_ptr(this_obj);
40693 this_obj_conv.is_owned = ptr_is_owned(this_obj);
40694 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
40695 RouteHint_free(this_obj_conv);
40698 uint64_tArray __attribute__((export_name("TS_RouteHint_get_a"))) TS_RouteHint_get_a(uint64_t this_ptr) {
40699 LDKRouteHint this_ptr_conv;
40700 this_ptr_conv.inner = untag_ptr(this_ptr);
40701 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40702 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40703 this_ptr_conv.is_owned = false;
40704 LDKCVec_RouteHintHopZ ret_var = RouteHint_get_a(&this_ptr_conv);
40705 uint64_tArray ret_arr = NULL;
40706 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
40707 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
40708 for (size_t o = 0; o < ret_var.datalen; o++) {
40709 LDKRouteHintHop ret_conv_14_var = ret_var.data[o];
40710 uint64_t ret_conv_14_ref = 0;
40711 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var);
40712 ret_conv_14_ref = tag_ptr(ret_conv_14_var.inner, ret_conv_14_var.is_owned);
40713 ret_arr_ptr[o] = ret_conv_14_ref;
40716 FREE(ret_var.data);
40720 void __attribute__((export_name("TS_RouteHint_set_a"))) TS_RouteHint_set_a(uint64_t this_ptr, uint64_tArray val) {
40721 LDKRouteHint this_ptr_conv;
40722 this_ptr_conv.inner = untag_ptr(this_ptr);
40723 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40724 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40725 this_ptr_conv.is_owned = false;
40726 LDKCVec_RouteHintHopZ val_constr;
40727 val_constr.datalen = val->arr_len;
40728 if (val_constr.datalen > 0)
40729 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements");
40731 val_constr.data = NULL;
40732 uint64_t* val_vals = val->elems;
40733 for (size_t o = 0; o < val_constr.datalen; o++) {
40734 uint64_t val_conv_14 = val_vals[o];
40735 LDKRouteHintHop val_conv_14_conv;
40736 val_conv_14_conv.inner = untag_ptr(val_conv_14);
40737 val_conv_14_conv.is_owned = ptr_is_owned(val_conv_14);
40738 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_14_conv);
40739 val_conv_14_conv = RouteHintHop_clone(&val_conv_14_conv);
40740 val_constr.data[o] = val_conv_14_conv;
40743 RouteHint_set_a(&this_ptr_conv, val_constr);
40746 uint64_t __attribute__((export_name("TS_RouteHint_new"))) TS_RouteHint_new(uint64_tArray a_arg) {
40747 LDKCVec_RouteHintHopZ a_arg_constr;
40748 a_arg_constr.datalen = a_arg->arr_len;
40749 if (a_arg_constr.datalen > 0)
40750 a_arg_constr.data = MALLOC(a_arg_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements");
40752 a_arg_constr.data = NULL;
40753 uint64_t* a_arg_vals = a_arg->elems;
40754 for (size_t o = 0; o < a_arg_constr.datalen; o++) {
40755 uint64_t a_arg_conv_14 = a_arg_vals[o];
40756 LDKRouteHintHop a_arg_conv_14_conv;
40757 a_arg_conv_14_conv.inner = untag_ptr(a_arg_conv_14);
40758 a_arg_conv_14_conv.is_owned = ptr_is_owned(a_arg_conv_14);
40759 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_arg_conv_14_conv);
40760 a_arg_conv_14_conv = RouteHintHop_clone(&a_arg_conv_14_conv);
40761 a_arg_constr.data[o] = a_arg_conv_14_conv;
40764 LDKRouteHint ret_var = RouteHint_new(a_arg_constr);
40765 uint64_t ret_ref = 0;
40766 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40767 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40771 static inline uint64_t RouteHint_clone_ptr(LDKRouteHint *NONNULL_PTR arg) {
40772 LDKRouteHint ret_var = RouteHint_clone(arg);
40773 uint64_t ret_ref = 0;
40774 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40775 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40778 int64_t __attribute__((export_name("TS_RouteHint_clone_ptr"))) TS_RouteHint_clone_ptr(uint64_t arg) {
40779 LDKRouteHint arg_conv;
40780 arg_conv.inner = untag_ptr(arg);
40781 arg_conv.is_owned = ptr_is_owned(arg);
40782 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
40783 arg_conv.is_owned = false;
40784 int64_t ret_conv = RouteHint_clone_ptr(&arg_conv);
40788 uint64_t __attribute__((export_name("TS_RouteHint_clone"))) TS_RouteHint_clone(uint64_t orig) {
40789 LDKRouteHint orig_conv;
40790 orig_conv.inner = untag_ptr(orig);
40791 orig_conv.is_owned = ptr_is_owned(orig);
40792 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
40793 orig_conv.is_owned = false;
40794 LDKRouteHint ret_var = RouteHint_clone(&orig_conv);
40795 uint64_t ret_ref = 0;
40796 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40797 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40801 int64_t __attribute__((export_name("TS_RouteHint_hash"))) TS_RouteHint_hash(uint64_t o) {
40802 LDKRouteHint o_conv;
40803 o_conv.inner = untag_ptr(o);
40804 o_conv.is_owned = ptr_is_owned(o);
40805 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
40806 o_conv.is_owned = false;
40807 int64_t ret_conv = RouteHint_hash(&o_conv);
40811 jboolean __attribute__((export_name("TS_RouteHint_eq"))) TS_RouteHint_eq(uint64_t a, uint64_t b) {
40812 LDKRouteHint a_conv;
40813 a_conv.inner = untag_ptr(a);
40814 a_conv.is_owned = ptr_is_owned(a);
40815 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
40816 a_conv.is_owned = false;
40817 LDKRouteHint b_conv;
40818 b_conv.inner = untag_ptr(b);
40819 b_conv.is_owned = ptr_is_owned(b);
40820 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
40821 b_conv.is_owned = false;
40822 jboolean ret_conv = RouteHint_eq(&a_conv, &b_conv);
40826 int8_tArray __attribute__((export_name("TS_RouteHint_write"))) TS_RouteHint_write(uint64_t obj) {
40827 LDKRouteHint obj_conv;
40828 obj_conv.inner = untag_ptr(obj);
40829 obj_conv.is_owned = ptr_is_owned(obj);
40830 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
40831 obj_conv.is_owned = false;
40832 LDKCVec_u8Z ret_var = RouteHint_write(&obj_conv);
40833 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
40834 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
40835 CVec_u8Z_free(ret_var);
40839 uint64_t __attribute__((export_name("TS_RouteHint_read"))) TS_RouteHint_read(int8_tArray ser) {
40840 LDKu8slice ser_ref;
40841 ser_ref.datalen = ser->arr_len;
40842 ser_ref.data = ser->elems;
40843 LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
40844 *ret_conv = RouteHint_read(ser_ref);
40846 return tag_ptr(ret_conv, true);
40849 void __attribute__((export_name("TS_RouteHintHop_free"))) TS_RouteHintHop_free(uint64_t this_obj) {
40850 LDKRouteHintHop this_obj_conv;
40851 this_obj_conv.inner = untag_ptr(this_obj);
40852 this_obj_conv.is_owned = ptr_is_owned(this_obj);
40853 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
40854 RouteHintHop_free(this_obj_conv);
40857 int8_tArray __attribute__((export_name("TS_RouteHintHop_get_src_node_id"))) TS_RouteHintHop_get_src_node_id(uint64_t this_ptr) {
40858 LDKRouteHintHop this_ptr_conv;
40859 this_ptr_conv.inner = untag_ptr(this_ptr);
40860 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40861 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40862 this_ptr_conv.is_owned = false;
40863 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
40864 memcpy(ret_arr->elems, RouteHintHop_get_src_node_id(&this_ptr_conv).compressed_form, 33);
40868 void __attribute__((export_name("TS_RouteHintHop_set_src_node_id"))) TS_RouteHintHop_set_src_node_id(uint64_t this_ptr, int8_tArray val) {
40869 LDKRouteHintHop this_ptr_conv;
40870 this_ptr_conv.inner = untag_ptr(this_ptr);
40871 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40872 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40873 this_ptr_conv.is_owned = false;
40874 LDKPublicKey val_ref;
40875 CHECK(val->arr_len == 33);
40876 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
40877 RouteHintHop_set_src_node_id(&this_ptr_conv, val_ref);
40880 int64_t __attribute__((export_name("TS_RouteHintHop_get_short_channel_id"))) TS_RouteHintHop_get_short_channel_id(uint64_t this_ptr) {
40881 LDKRouteHintHop this_ptr_conv;
40882 this_ptr_conv.inner = untag_ptr(this_ptr);
40883 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40884 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40885 this_ptr_conv.is_owned = false;
40886 int64_t ret_conv = RouteHintHop_get_short_channel_id(&this_ptr_conv);
40890 void __attribute__((export_name("TS_RouteHintHop_set_short_channel_id"))) TS_RouteHintHop_set_short_channel_id(uint64_t this_ptr, int64_t val) {
40891 LDKRouteHintHop this_ptr_conv;
40892 this_ptr_conv.inner = untag_ptr(this_ptr);
40893 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40894 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40895 this_ptr_conv.is_owned = false;
40896 RouteHintHop_set_short_channel_id(&this_ptr_conv, val);
40899 uint64_t __attribute__((export_name("TS_RouteHintHop_get_fees"))) TS_RouteHintHop_get_fees(uint64_t this_ptr) {
40900 LDKRouteHintHop this_ptr_conv;
40901 this_ptr_conv.inner = untag_ptr(this_ptr);
40902 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40903 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40904 this_ptr_conv.is_owned = false;
40905 LDKRoutingFees ret_var = RouteHintHop_get_fees(&this_ptr_conv);
40906 uint64_t ret_ref = 0;
40907 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40908 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40912 void __attribute__((export_name("TS_RouteHintHop_set_fees"))) TS_RouteHintHop_set_fees(uint64_t this_ptr, uint64_t val) {
40913 LDKRouteHintHop this_ptr_conv;
40914 this_ptr_conv.inner = untag_ptr(this_ptr);
40915 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40916 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40917 this_ptr_conv.is_owned = false;
40918 LDKRoutingFees val_conv;
40919 val_conv.inner = untag_ptr(val);
40920 val_conv.is_owned = ptr_is_owned(val);
40921 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
40922 val_conv = RoutingFees_clone(&val_conv);
40923 RouteHintHop_set_fees(&this_ptr_conv, val_conv);
40926 int16_t __attribute__((export_name("TS_RouteHintHop_get_cltv_expiry_delta"))) TS_RouteHintHop_get_cltv_expiry_delta(uint64_t this_ptr) {
40927 LDKRouteHintHop this_ptr_conv;
40928 this_ptr_conv.inner = untag_ptr(this_ptr);
40929 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40930 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40931 this_ptr_conv.is_owned = false;
40932 int16_t ret_conv = RouteHintHop_get_cltv_expiry_delta(&this_ptr_conv);
40936 void __attribute__((export_name("TS_RouteHintHop_set_cltv_expiry_delta"))) TS_RouteHintHop_set_cltv_expiry_delta(uint64_t this_ptr, int16_t val) {
40937 LDKRouteHintHop this_ptr_conv;
40938 this_ptr_conv.inner = untag_ptr(this_ptr);
40939 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40940 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40941 this_ptr_conv.is_owned = false;
40942 RouteHintHop_set_cltv_expiry_delta(&this_ptr_conv, val);
40945 uint64_t __attribute__((export_name("TS_RouteHintHop_get_htlc_minimum_msat"))) TS_RouteHintHop_get_htlc_minimum_msat(uint64_t this_ptr) {
40946 LDKRouteHintHop this_ptr_conv;
40947 this_ptr_conv.inner = untag_ptr(this_ptr);
40948 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40949 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40950 this_ptr_conv.is_owned = false;
40951 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
40952 *ret_copy = RouteHintHop_get_htlc_minimum_msat(&this_ptr_conv);
40953 uint64_t ret_ref = tag_ptr(ret_copy, true);
40957 void __attribute__((export_name("TS_RouteHintHop_set_htlc_minimum_msat"))) TS_RouteHintHop_set_htlc_minimum_msat(uint64_t this_ptr, uint64_t val) {
40958 LDKRouteHintHop this_ptr_conv;
40959 this_ptr_conv.inner = untag_ptr(this_ptr);
40960 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40961 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40962 this_ptr_conv.is_owned = false;
40963 void* val_ptr = untag_ptr(val);
40964 CHECK_ACCESS(val_ptr);
40965 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
40966 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
40967 RouteHintHop_set_htlc_minimum_msat(&this_ptr_conv, val_conv);
40970 uint64_t __attribute__((export_name("TS_RouteHintHop_get_htlc_maximum_msat"))) TS_RouteHintHop_get_htlc_maximum_msat(uint64_t this_ptr) {
40971 LDKRouteHintHop this_ptr_conv;
40972 this_ptr_conv.inner = untag_ptr(this_ptr);
40973 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40974 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40975 this_ptr_conv.is_owned = false;
40976 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
40977 *ret_copy = RouteHintHop_get_htlc_maximum_msat(&this_ptr_conv);
40978 uint64_t ret_ref = tag_ptr(ret_copy, true);
40982 void __attribute__((export_name("TS_RouteHintHop_set_htlc_maximum_msat"))) TS_RouteHintHop_set_htlc_maximum_msat(uint64_t this_ptr, uint64_t val) {
40983 LDKRouteHintHop this_ptr_conv;
40984 this_ptr_conv.inner = untag_ptr(this_ptr);
40985 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40986 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40987 this_ptr_conv.is_owned = false;
40988 void* val_ptr = untag_ptr(val);
40989 CHECK_ACCESS(val_ptr);
40990 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
40991 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
40992 RouteHintHop_set_htlc_maximum_msat(&this_ptr_conv, val_conv);
40995 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) {
40996 LDKPublicKey src_node_id_arg_ref;
40997 CHECK(src_node_id_arg->arr_len == 33);
40998 memcpy(src_node_id_arg_ref.compressed_form, src_node_id_arg->elems, 33); FREE(src_node_id_arg);
40999 LDKRoutingFees fees_arg_conv;
41000 fees_arg_conv.inner = untag_ptr(fees_arg);
41001 fees_arg_conv.is_owned = ptr_is_owned(fees_arg);
41002 CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv);
41003 fees_arg_conv = RoutingFees_clone(&fees_arg_conv);
41004 void* htlc_minimum_msat_arg_ptr = untag_ptr(htlc_minimum_msat_arg);
41005 CHECK_ACCESS(htlc_minimum_msat_arg_ptr);
41006 LDKCOption_u64Z htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_minimum_msat_arg_ptr);
41007 htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_minimum_msat_arg));
41008 void* htlc_maximum_msat_arg_ptr = untag_ptr(htlc_maximum_msat_arg);
41009 CHECK_ACCESS(htlc_maximum_msat_arg_ptr);
41010 LDKCOption_u64Z htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_maximum_msat_arg_ptr);
41011 htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_maximum_msat_arg));
41012 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);
41013 uint64_t ret_ref = 0;
41014 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41015 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41019 static inline uint64_t RouteHintHop_clone_ptr(LDKRouteHintHop *NONNULL_PTR arg) {
41020 LDKRouteHintHop ret_var = RouteHintHop_clone(arg);
41021 uint64_t ret_ref = 0;
41022 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41023 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41026 int64_t __attribute__((export_name("TS_RouteHintHop_clone_ptr"))) TS_RouteHintHop_clone_ptr(uint64_t arg) {
41027 LDKRouteHintHop arg_conv;
41028 arg_conv.inner = untag_ptr(arg);
41029 arg_conv.is_owned = ptr_is_owned(arg);
41030 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
41031 arg_conv.is_owned = false;
41032 int64_t ret_conv = RouteHintHop_clone_ptr(&arg_conv);
41036 uint64_t __attribute__((export_name("TS_RouteHintHop_clone"))) TS_RouteHintHop_clone(uint64_t orig) {
41037 LDKRouteHintHop orig_conv;
41038 orig_conv.inner = untag_ptr(orig);
41039 orig_conv.is_owned = ptr_is_owned(orig);
41040 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
41041 orig_conv.is_owned = false;
41042 LDKRouteHintHop ret_var = RouteHintHop_clone(&orig_conv);
41043 uint64_t ret_ref = 0;
41044 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41045 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41049 int64_t __attribute__((export_name("TS_RouteHintHop_hash"))) TS_RouteHintHop_hash(uint64_t o) {
41050 LDKRouteHintHop o_conv;
41051 o_conv.inner = untag_ptr(o);
41052 o_conv.is_owned = ptr_is_owned(o);
41053 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
41054 o_conv.is_owned = false;
41055 int64_t ret_conv = RouteHintHop_hash(&o_conv);
41059 jboolean __attribute__((export_name("TS_RouteHintHop_eq"))) TS_RouteHintHop_eq(uint64_t a, uint64_t b) {
41060 LDKRouteHintHop a_conv;
41061 a_conv.inner = untag_ptr(a);
41062 a_conv.is_owned = ptr_is_owned(a);
41063 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
41064 a_conv.is_owned = false;
41065 LDKRouteHintHop b_conv;
41066 b_conv.inner = untag_ptr(b);
41067 b_conv.is_owned = ptr_is_owned(b);
41068 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
41069 b_conv.is_owned = false;
41070 jboolean ret_conv = RouteHintHop_eq(&a_conv, &b_conv);
41074 int8_tArray __attribute__((export_name("TS_RouteHintHop_write"))) TS_RouteHintHop_write(uint64_t obj) {
41075 LDKRouteHintHop obj_conv;
41076 obj_conv.inner = untag_ptr(obj);
41077 obj_conv.is_owned = ptr_is_owned(obj);
41078 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41079 obj_conv.is_owned = false;
41080 LDKCVec_u8Z ret_var = RouteHintHop_write(&obj_conv);
41081 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
41082 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
41083 CVec_u8Z_free(ret_var);
41087 uint64_t __attribute__((export_name("TS_RouteHintHop_read"))) TS_RouteHintHop_read(int8_tArray ser) {
41088 LDKu8slice ser_ref;
41089 ser_ref.datalen = ser->arr_len;
41090 ser_ref.data = ser->elems;
41091 LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
41092 *ret_conv = RouteHintHop_read(ser_ref);
41094 return tag_ptr(ret_conv, true);
41097 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) {
41098 LDKPublicKey our_node_pubkey_ref;
41099 CHECK(our_node_pubkey->arr_len == 33);
41100 memcpy(our_node_pubkey_ref.compressed_form, our_node_pubkey->elems, 33); FREE(our_node_pubkey);
41101 LDKRouteParameters route_params_conv;
41102 route_params_conv.inner = untag_ptr(route_params);
41103 route_params_conv.is_owned = ptr_is_owned(route_params);
41104 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv);
41105 route_params_conv.is_owned = false;
41106 LDKNetworkGraph network_graph_conv;
41107 network_graph_conv.inner = untag_ptr(network_graph);
41108 network_graph_conv.is_owned = ptr_is_owned(network_graph);
41109 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
41110 network_graph_conv.is_owned = false;
41111 LDKCVec_ChannelDetailsZ first_hops_constr;
41112 LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL;
41113 if (first_hops != 0) {
41114 first_hops_constr.datalen = first_hops->arr_len;
41115 if (first_hops_constr.datalen > 0)
41116 first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
41118 first_hops_constr.data = NULL;
41119 uint64_t* first_hops_vals = first_hops->elems;
41120 for (size_t q = 0; q < first_hops_constr.datalen; q++) {
41121 uint64_t first_hops_conv_16 = first_hops_vals[q];
41122 LDKChannelDetails first_hops_conv_16_conv;
41123 first_hops_conv_16_conv.inner = untag_ptr(first_hops_conv_16);
41124 first_hops_conv_16_conv.is_owned = ptr_is_owned(first_hops_conv_16);
41125 CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv);
41126 first_hops_conv_16_conv.is_owned = false;
41127 first_hops_constr.data[q] = first_hops_conv_16_conv;
41130 first_hops_ptr = &first_hops_constr;
41132 void* logger_ptr = untag_ptr(logger);
41133 CHECK_ACCESS(logger_ptr);
41134 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
41135 if (logger_conv.free == LDKLogger_JCalls_free) {
41136 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
41137 LDKLogger_JCalls_cloned(&logger_conv);
41139 void* scorer_ptr = untag_ptr(scorer);
41140 if (ptr_is_owned(scorer)) { CHECK_ACCESS(scorer_ptr); }
41141 LDKScore* scorer_conv = (LDKScore*)scorer_ptr;
41142 unsigned char random_seed_bytes_arr[32];
41143 CHECK(random_seed_bytes->arr_len == 32);
41144 memcpy(random_seed_bytes_arr, random_seed_bytes->elems, 32); FREE(random_seed_bytes);
41145 unsigned char (*random_seed_bytes_ref)[32] = &random_seed_bytes_arr;
41146 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
41147 *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);
41148 if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
41149 return tag_ptr(ret_conv, true);
41152 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) {
41153 LDKPublicKey our_node_pubkey_ref;
41154 CHECK(our_node_pubkey->arr_len == 33);
41155 memcpy(our_node_pubkey_ref.compressed_form, our_node_pubkey->elems, 33); FREE(our_node_pubkey);
41156 LDKCVec_PublicKeyZ hops_constr;
41157 hops_constr.datalen = hops->arr_len;
41158 if (hops_constr.datalen > 0)
41159 hops_constr.data = MALLOC(hops_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements");
41161 hops_constr.data = NULL;
41162 int8_tArray* hops_vals = (void*) hops->elems;
41163 for (size_t m = 0; m < hops_constr.datalen; m++) {
41164 int8_tArray hops_conv_12 = hops_vals[m];
41165 LDKPublicKey hops_conv_12_ref;
41166 CHECK(hops_conv_12->arr_len == 33);
41167 memcpy(hops_conv_12_ref.compressed_form, hops_conv_12->elems, 33); FREE(hops_conv_12);
41168 hops_constr.data[m] = hops_conv_12_ref;
41171 LDKRouteParameters route_params_conv;
41172 route_params_conv.inner = untag_ptr(route_params);
41173 route_params_conv.is_owned = ptr_is_owned(route_params);
41174 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv);
41175 route_params_conv.is_owned = false;
41176 LDKNetworkGraph network_graph_conv;
41177 network_graph_conv.inner = untag_ptr(network_graph);
41178 network_graph_conv.is_owned = ptr_is_owned(network_graph);
41179 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
41180 network_graph_conv.is_owned = false;
41181 void* logger_ptr = untag_ptr(logger);
41182 CHECK_ACCESS(logger_ptr);
41183 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
41184 if (logger_conv.free == LDKLogger_JCalls_free) {
41185 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
41186 LDKLogger_JCalls_cloned(&logger_conv);
41188 unsigned char random_seed_bytes_arr[32];
41189 CHECK(random_seed_bytes->arr_len == 32);
41190 memcpy(random_seed_bytes_arr, random_seed_bytes->elems, 32); FREE(random_seed_bytes);
41191 unsigned char (*random_seed_bytes_ref)[32] = &random_seed_bytes_arr;
41192 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
41193 *ret_conv = build_route_from_hops(our_node_pubkey_ref, hops_constr, &route_params_conv, &network_graph_conv, logger_conv, random_seed_bytes_ref);
41194 return tag_ptr(ret_conv, true);
41197 void __attribute__((export_name("TS_Score_free"))) TS_Score_free(uint64_t this_ptr) {
41198 if (!ptr_is_owned(this_ptr)) return;
41199 void* this_ptr_ptr = untag_ptr(this_ptr);
41200 CHECK_ACCESS(this_ptr_ptr);
41201 LDKScore this_ptr_conv = *(LDKScore*)(this_ptr_ptr);
41202 FREE(untag_ptr(this_ptr));
41203 Score_free(this_ptr_conv);
41206 void __attribute__((export_name("TS_LockableScore_free"))) TS_LockableScore_free(uint64_t this_ptr) {
41207 if (!ptr_is_owned(this_ptr)) return;
41208 void* this_ptr_ptr = untag_ptr(this_ptr);
41209 CHECK_ACCESS(this_ptr_ptr);
41210 LDKLockableScore this_ptr_conv = *(LDKLockableScore*)(this_ptr_ptr);
41211 FREE(untag_ptr(this_ptr));
41212 LockableScore_free(this_ptr_conv);
41215 void __attribute__((export_name("TS_MultiThreadedLockableScore_free"))) TS_MultiThreadedLockableScore_free(uint64_t this_obj) {
41216 LDKMultiThreadedLockableScore this_obj_conv;
41217 this_obj_conv.inner = untag_ptr(this_obj);
41218 this_obj_conv.is_owned = ptr_is_owned(this_obj);
41219 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
41220 MultiThreadedLockableScore_free(this_obj_conv);
41223 int8_tArray __attribute__((export_name("TS_MultiThreadedLockableScore_write"))) TS_MultiThreadedLockableScore_write(uint64_t obj) {
41224 LDKMultiThreadedLockableScore obj_conv;
41225 obj_conv.inner = untag_ptr(obj);
41226 obj_conv.is_owned = ptr_is_owned(obj);
41227 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41228 obj_conv.is_owned = false;
41229 LDKCVec_u8Z ret_var = MultiThreadedLockableScore_write(&obj_conv);
41230 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
41231 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
41232 CVec_u8Z_free(ret_var);
41236 uint64_t __attribute__((export_name("TS_MultiThreadedLockableScore_new"))) TS_MultiThreadedLockableScore_new(uint64_t score) {
41237 void* score_ptr = untag_ptr(score);
41238 CHECK_ACCESS(score_ptr);
41239 LDKScore score_conv = *(LDKScore*)(score_ptr);
41240 if (score_conv.free == LDKScore_JCalls_free) {
41241 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
41242 LDKScore_JCalls_cloned(&score_conv);
41244 LDKMultiThreadedLockableScore ret_var = MultiThreadedLockableScore_new(score_conv);
41245 uint64_t ret_ref = 0;
41246 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41247 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41251 void __attribute__((export_name("TS_ChannelUsage_free"))) TS_ChannelUsage_free(uint64_t this_obj) {
41252 LDKChannelUsage this_obj_conv;
41253 this_obj_conv.inner = untag_ptr(this_obj);
41254 this_obj_conv.is_owned = ptr_is_owned(this_obj);
41255 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
41256 ChannelUsage_free(this_obj_conv);
41259 int64_t __attribute__((export_name("TS_ChannelUsage_get_amount_msat"))) TS_ChannelUsage_get_amount_msat(uint64_t this_ptr) {
41260 LDKChannelUsage this_ptr_conv;
41261 this_ptr_conv.inner = untag_ptr(this_ptr);
41262 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41263 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41264 this_ptr_conv.is_owned = false;
41265 int64_t ret_conv = ChannelUsage_get_amount_msat(&this_ptr_conv);
41269 void __attribute__((export_name("TS_ChannelUsage_set_amount_msat"))) TS_ChannelUsage_set_amount_msat(uint64_t this_ptr, int64_t val) {
41270 LDKChannelUsage this_ptr_conv;
41271 this_ptr_conv.inner = untag_ptr(this_ptr);
41272 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41273 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41274 this_ptr_conv.is_owned = false;
41275 ChannelUsage_set_amount_msat(&this_ptr_conv, val);
41278 int64_t __attribute__((export_name("TS_ChannelUsage_get_inflight_htlc_msat"))) TS_ChannelUsage_get_inflight_htlc_msat(uint64_t this_ptr) {
41279 LDKChannelUsage this_ptr_conv;
41280 this_ptr_conv.inner = untag_ptr(this_ptr);
41281 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41282 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41283 this_ptr_conv.is_owned = false;
41284 int64_t ret_conv = ChannelUsage_get_inflight_htlc_msat(&this_ptr_conv);
41288 void __attribute__((export_name("TS_ChannelUsage_set_inflight_htlc_msat"))) TS_ChannelUsage_set_inflight_htlc_msat(uint64_t this_ptr, int64_t val) {
41289 LDKChannelUsage this_ptr_conv;
41290 this_ptr_conv.inner = untag_ptr(this_ptr);
41291 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41292 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41293 this_ptr_conv.is_owned = false;
41294 ChannelUsage_set_inflight_htlc_msat(&this_ptr_conv, val);
41297 uint64_t __attribute__((export_name("TS_ChannelUsage_get_effective_capacity"))) TS_ChannelUsage_get_effective_capacity(uint64_t this_ptr) {
41298 LDKChannelUsage this_ptr_conv;
41299 this_ptr_conv.inner = untag_ptr(this_ptr);
41300 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41301 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41302 this_ptr_conv.is_owned = false;
41303 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
41304 *ret_copy = ChannelUsage_get_effective_capacity(&this_ptr_conv);
41305 uint64_t ret_ref = tag_ptr(ret_copy, true);
41309 void __attribute__((export_name("TS_ChannelUsage_set_effective_capacity"))) TS_ChannelUsage_set_effective_capacity(uint64_t this_ptr, uint64_t val) {
41310 LDKChannelUsage this_ptr_conv;
41311 this_ptr_conv.inner = untag_ptr(this_ptr);
41312 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41313 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41314 this_ptr_conv.is_owned = false;
41315 void* val_ptr = untag_ptr(val);
41316 CHECK_ACCESS(val_ptr);
41317 LDKEffectiveCapacity val_conv = *(LDKEffectiveCapacity*)(val_ptr);
41318 val_conv = EffectiveCapacity_clone((LDKEffectiveCapacity*)untag_ptr(val));
41319 ChannelUsage_set_effective_capacity(&this_ptr_conv, val_conv);
41322 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) {
41323 void* effective_capacity_arg_ptr = untag_ptr(effective_capacity_arg);
41324 CHECK_ACCESS(effective_capacity_arg_ptr);
41325 LDKEffectiveCapacity effective_capacity_arg_conv = *(LDKEffectiveCapacity*)(effective_capacity_arg_ptr);
41326 effective_capacity_arg_conv = EffectiveCapacity_clone((LDKEffectiveCapacity*)untag_ptr(effective_capacity_arg));
41327 LDKChannelUsage ret_var = ChannelUsage_new(amount_msat_arg, inflight_htlc_msat_arg, effective_capacity_arg_conv);
41328 uint64_t ret_ref = 0;
41329 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41330 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41334 static inline uint64_t ChannelUsage_clone_ptr(LDKChannelUsage *NONNULL_PTR arg) {
41335 LDKChannelUsage ret_var = ChannelUsage_clone(arg);
41336 uint64_t ret_ref = 0;
41337 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41338 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41341 int64_t __attribute__((export_name("TS_ChannelUsage_clone_ptr"))) TS_ChannelUsage_clone_ptr(uint64_t arg) {
41342 LDKChannelUsage arg_conv;
41343 arg_conv.inner = untag_ptr(arg);
41344 arg_conv.is_owned = ptr_is_owned(arg);
41345 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
41346 arg_conv.is_owned = false;
41347 int64_t ret_conv = ChannelUsage_clone_ptr(&arg_conv);
41351 uint64_t __attribute__((export_name("TS_ChannelUsage_clone"))) TS_ChannelUsage_clone(uint64_t orig) {
41352 LDKChannelUsage orig_conv;
41353 orig_conv.inner = untag_ptr(orig);
41354 orig_conv.is_owned = ptr_is_owned(orig);
41355 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
41356 orig_conv.is_owned = false;
41357 LDKChannelUsage ret_var = ChannelUsage_clone(&orig_conv);
41358 uint64_t ret_ref = 0;
41359 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41360 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41364 void __attribute__((export_name("TS_FixedPenaltyScorer_free"))) TS_FixedPenaltyScorer_free(uint64_t this_obj) {
41365 LDKFixedPenaltyScorer this_obj_conv;
41366 this_obj_conv.inner = untag_ptr(this_obj);
41367 this_obj_conv.is_owned = ptr_is_owned(this_obj);
41368 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
41369 FixedPenaltyScorer_free(this_obj_conv);
41372 static inline uint64_t FixedPenaltyScorer_clone_ptr(LDKFixedPenaltyScorer *NONNULL_PTR arg) {
41373 LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_clone(arg);
41374 uint64_t ret_ref = 0;
41375 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41376 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41379 int64_t __attribute__((export_name("TS_FixedPenaltyScorer_clone_ptr"))) TS_FixedPenaltyScorer_clone_ptr(uint64_t arg) {
41380 LDKFixedPenaltyScorer arg_conv;
41381 arg_conv.inner = untag_ptr(arg);
41382 arg_conv.is_owned = ptr_is_owned(arg);
41383 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
41384 arg_conv.is_owned = false;
41385 int64_t ret_conv = FixedPenaltyScorer_clone_ptr(&arg_conv);
41389 uint64_t __attribute__((export_name("TS_FixedPenaltyScorer_clone"))) TS_FixedPenaltyScorer_clone(uint64_t orig) {
41390 LDKFixedPenaltyScorer orig_conv;
41391 orig_conv.inner = untag_ptr(orig);
41392 orig_conv.is_owned = ptr_is_owned(orig);
41393 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
41394 orig_conv.is_owned = false;
41395 LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_clone(&orig_conv);
41396 uint64_t ret_ref = 0;
41397 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41398 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41402 uint64_t __attribute__((export_name("TS_FixedPenaltyScorer_with_penalty"))) TS_FixedPenaltyScorer_with_penalty(int64_t penalty_msat) {
41403 LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_with_penalty(penalty_msat);
41404 uint64_t ret_ref = 0;
41405 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41406 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41410 uint64_t __attribute__((export_name("TS_FixedPenaltyScorer_as_Score"))) TS_FixedPenaltyScorer_as_Score(uint64_t this_arg) {
41411 LDKFixedPenaltyScorer this_arg_conv;
41412 this_arg_conv.inner = untag_ptr(this_arg);
41413 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41414 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41415 this_arg_conv.is_owned = false;
41416 LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore");
41417 *ret_ret = FixedPenaltyScorer_as_Score(&this_arg_conv);
41418 return tag_ptr(ret_ret, true);
41421 int8_tArray __attribute__((export_name("TS_FixedPenaltyScorer_write"))) TS_FixedPenaltyScorer_write(uint64_t obj) {
41422 LDKFixedPenaltyScorer obj_conv;
41423 obj_conv.inner = untag_ptr(obj);
41424 obj_conv.is_owned = ptr_is_owned(obj);
41425 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41426 obj_conv.is_owned = false;
41427 LDKCVec_u8Z ret_var = FixedPenaltyScorer_write(&obj_conv);
41428 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
41429 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
41430 CVec_u8Z_free(ret_var);
41434 uint64_t __attribute__((export_name("TS_FixedPenaltyScorer_read"))) TS_FixedPenaltyScorer_read(int8_tArray ser, int64_t arg) {
41435 LDKu8slice ser_ref;
41436 ser_ref.datalen = ser->arr_len;
41437 ser_ref.data = ser->elems;
41438 LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
41439 *ret_conv = FixedPenaltyScorer_read(ser_ref, arg);
41441 return tag_ptr(ret_conv, true);
41444 void __attribute__((export_name("TS_ProbabilisticScorer_free"))) TS_ProbabilisticScorer_free(uint64_t this_obj) {
41445 LDKProbabilisticScorer this_obj_conv;
41446 this_obj_conv.inner = untag_ptr(this_obj);
41447 this_obj_conv.is_owned = ptr_is_owned(this_obj);
41448 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
41449 ProbabilisticScorer_free(this_obj_conv);
41452 void __attribute__((export_name("TS_ProbabilisticScoringParameters_free"))) TS_ProbabilisticScoringParameters_free(uint64_t this_obj) {
41453 LDKProbabilisticScoringParameters this_obj_conv;
41454 this_obj_conv.inner = untag_ptr(this_obj);
41455 this_obj_conv.is_owned = ptr_is_owned(this_obj);
41456 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
41457 ProbabilisticScoringParameters_free(this_obj_conv);
41460 int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_base_penalty_msat"))) TS_ProbabilisticScoringParameters_get_base_penalty_msat(uint64_t this_ptr) {
41461 LDKProbabilisticScoringParameters this_ptr_conv;
41462 this_ptr_conv.inner = untag_ptr(this_ptr);
41463 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41464 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41465 this_ptr_conv.is_owned = false;
41466 int64_t ret_conv = ProbabilisticScoringParameters_get_base_penalty_msat(&this_ptr_conv);
41470 void __attribute__((export_name("TS_ProbabilisticScoringParameters_set_base_penalty_msat"))) TS_ProbabilisticScoringParameters_set_base_penalty_msat(uint64_t this_ptr, int64_t val) {
41471 LDKProbabilisticScoringParameters this_ptr_conv;
41472 this_ptr_conv.inner = untag_ptr(this_ptr);
41473 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41474 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41475 this_ptr_conv.is_owned = false;
41476 ProbabilisticScoringParameters_set_base_penalty_msat(&this_ptr_conv, val);
41479 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) {
41480 LDKProbabilisticScoringParameters this_ptr_conv;
41481 this_ptr_conv.inner = untag_ptr(this_ptr);
41482 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41483 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41484 this_ptr_conv.is_owned = false;
41485 int64_t ret_conv = ProbabilisticScoringParameters_get_base_penalty_amount_multiplier_msat(&this_ptr_conv);
41489 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) {
41490 LDKProbabilisticScoringParameters this_ptr_conv;
41491 this_ptr_conv.inner = untag_ptr(this_ptr);
41492 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41493 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41494 this_ptr_conv.is_owned = false;
41495 ProbabilisticScoringParameters_set_base_penalty_amount_multiplier_msat(&this_ptr_conv, val);
41498 int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_liquidity_penalty_multiplier_msat"))) TS_ProbabilisticScoringParameters_get_liquidity_penalty_multiplier_msat(uint64_t this_ptr) {
41499 LDKProbabilisticScoringParameters this_ptr_conv;
41500 this_ptr_conv.inner = untag_ptr(this_ptr);
41501 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41502 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41503 this_ptr_conv.is_owned = false;
41504 int64_t ret_conv = ProbabilisticScoringParameters_get_liquidity_penalty_multiplier_msat(&this_ptr_conv);
41508 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) {
41509 LDKProbabilisticScoringParameters this_ptr_conv;
41510 this_ptr_conv.inner = untag_ptr(this_ptr);
41511 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41512 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41513 this_ptr_conv.is_owned = false;
41514 ProbabilisticScoringParameters_set_liquidity_penalty_multiplier_msat(&this_ptr_conv, val);
41517 int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_liquidity_offset_half_life"))) TS_ProbabilisticScoringParameters_get_liquidity_offset_half_life(uint64_t this_ptr) {
41518 LDKProbabilisticScoringParameters this_ptr_conv;
41519 this_ptr_conv.inner = untag_ptr(this_ptr);
41520 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41521 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41522 this_ptr_conv.is_owned = false;
41523 int64_t ret_conv = ProbabilisticScoringParameters_get_liquidity_offset_half_life(&this_ptr_conv);
41527 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) {
41528 LDKProbabilisticScoringParameters this_ptr_conv;
41529 this_ptr_conv.inner = untag_ptr(this_ptr);
41530 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41531 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41532 this_ptr_conv.is_owned = false;
41533 ProbabilisticScoringParameters_set_liquidity_offset_half_life(&this_ptr_conv, val);
41536 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) {
41537 LDKProbabilisticScoringParameters this_ptr_conv;
41538 this_ptr_conv.inner = untag_ptr(this_ptr);
41539 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41540 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41541 this_ptr_conv.is_owned = false;
41542 int64_t ret_conv = ProbabilisticScoringParameters_get_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv);
41546 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) {
41547 LDKProbabilisticScoringParameters this_ptr_conv;
41548 this_ptr_conv.inner = untag_ptr(this_ptr);
41549 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41550 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41551 this_ptr_conv.is_owned = false;
41552 ProbabilisticScoringParameters_set_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv, val);
41555 int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_anti_probing_penalty_msat"))) TS_ProbabilisticScoringParameters_get_anti_probing_penalty_msat(uint64_t this_ptr) {
41556 LDKProbabilisticScoringParameters this_ptr_conv;
41557 this_ptr_conv.inner = untag_ptr(this_ptr);
41558 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41559 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41560 this_ptr_conv.is_owned = false;
41561 int64_t ret_conv = ProbabilisticScoringParameters_get_anti_probing_penalty_msat(&this_ptr_conv);
41565 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) {
41566 LDKProbabilisticScoringParameters this_ptr_conv;
41567 this_ptr_conv.inner = untag_ptr(this_ptr);
41568 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41569 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41570 this_ptr_conv.is_owned = false;
41571 ProbabilisticScoringParameters_set_anti_probing_penalty_msat(&this_ptr_conv, val);
41574 int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_considered_impossible_penalty_msat"))) TS_ProbabilisticScoringParameters_get_considered_impossible_penalty_msat(uint64_t this_ptr) {
41575 LDKProbabilisticScoringParameters this_ptr_conv;
41576 this_ptr_conv.inner = untag_ptr(this_ptr);
41577 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41578 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41579 this_ptr_conv.is_owned = false;
41580 int64_t ret_conv = ProbabilisticScoringParameters_get_considered_impossible_penalty_msat(&this_ptr_conv);
41584 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) {
41585 LDKProbabilisticScoringParameters this_ptr_conv;
41586 this_ptr_conv.inner = untag_ptr(this_ptr);
41587 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41588 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41589 this_ptr_conv.is_owned = false;
41590 ProbabilisticScoringParameters_set_considered_impossible_penalty_msat(&this_ptr_conv, val);
41593 static inline uint64_t ProbabilisticScoringParameters_clone_ptr(LDKProbabilisticScoringParameters *NONNULL_PTR arg) {
41594 LDKProbabilisticScoringParameters ret_var = ProbabilisticScoringParameters_clone(arg);
41595 uint64_t ret_ref = 0;
41596 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41597 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41600 int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_clone_ptr"))) TS_ProbabilisticScoringParameters_clone_ptr(uint64_t arg) {
41601 LDKProbabilisticScoringParameters arg_conv;
41602 arg_conv.inner = untag_ptr(arg);
41603 arg_conv.is_owned = ptr_is_owned(arg);
41604 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
41605 arg_conv.is_owned = false;
41606 int64_t ret_conv = ProbabilisticScoringParameters_clone_ptr(&arg_conv);
41610 uint64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_clone"))) TS_ProbabilisticScoringParameters_clone(uint64_t orig) {
41611 LDKProbabilisticScoringParameters orig_conv;
41612 orig_conv.inner = untag_ptr(orig);
41613 orig_conv.is_owned = ptr_is_owned(orig);
41614 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
41615 orig_conv.is_owned = false;
41616 LDKProbabilisticScoringParameters ret_var = ProbabilisticScoringParameters_clone(&orig_conv);
41617 uint64_t ret_ref = 0;
41618 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41619 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41623 uint64_t __attribute__((export_name("TS_ProbabilisticScorer_new"))) TS_ProbabilisticScorer_new(uint64_t params, uint64_t network_graph, uint64_t logger) {
41624 LDKProbabilisticScoringParameters params_conv;
41625 params_conv.inner = untag_ptr(params);
41626 params_conv.is_owned = ptr_is_owned(params);
41627 CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv);
41628 params_conv = ProbabilisticScoringParameters_clone(¶ms_conv);
41629 LDKNetworkGraph network_graph_conv;
41630 network_graph_conv.inner = untag_ptr(network_graph);
41631 network_graph_conv.is_owned = ptr_is_owned(network_graph);
41632 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
41633 network_graph_conv.is_owned = false;
41634 void* logger_ptr = untag_ptr(logger);
41635 CHECK_ACCESS(logger_ptr);
41636 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
41637 if (logger_conv.free == LDKLogger_JCalls_free) {
41638 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
41639 LDKLogger_JCalls_cloned(&logger_conv);
41641 LDKProbabilisticScorer ret_var = ProbabilisticScorer_new(params_conv, &network_graph_conv, logger_conv);
41642 uint64_t ret_ref = 0;
41643 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41644 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41648 void __attribute__((export_name("TS_ProbabilisticScorer_debug_log_liquidity_stats"))) TS_ProbabilisticScorer_debug_log_liquidity_stats(uint64_t this_arg) {
41649 LDKProbabilisticScorer this_arg_conv;
41650 this_arg_conv.inner = untag_ptr(this_arg);
41651 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41652 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41653 this_arg_conv.is_owned = false;
41654 ProbabilisticScorer_debug_log_liquidity_stats(&this_arg_conv);
41657 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) {
41658 LDKProbabilisticScorer this_arg_conv;
41659 this_arg_conv.inner = untag_ptr(this_arg);
41660 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41661 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41662 this_arg_conv.is_owned = false;
41663 LDKNodeId target_conv;
41664 target_conv.inner = untag_ptr(target);
41665 target_conv.is_owned = ptr_is_owned(target);
41666 CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv);
41667 target_conv.is_owned = false;
41668 LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ");
41669 *ret_copy = ProbabilisticScorer_estimated_channel_liquidity_range(&this_arg_conv, scid, &target_conv);
41670 uint64_t ret_ref = tag_ptr(ret_copy, true);
41674 void __attribute__((export_name("TS_ProbabilisticScorer_add_banned"))) TS_ProbabilisticScorer_add_banned(uint64_t this_arg, uint64_t node_id) {
41675 LDKProbabilisticScorer this_arg_conv;
41676 this_arg_conv.inner = untag_ptr(this_arg);
41677 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41678 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41679 this_arg_conv.is_owned = false;
41680 LDKNodeId node_id_conv;
41681 node_id_conv.inner = untag_ptr(node_id);
41682 node_id_conv.is_owned = ptr_is_owned(node_id);
41683 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv);
41684 node_id_conv.is_owned = false;
41685 ProbabilisticScorer_add_banned(&this_arg_conv, &node_id_conv);
41688 void __attribute__((export_name("TS_ProbabilisticScorer_remove_banned"))) TS_ProbabilisticScorer_remove_banned(uint64_t this_arg, uint64_t node_id) {
41689 LDKProbabilisticScorer this_arg_conv;
41690 this_arg_conv.inner = untag_ptr(this_arg);
41691 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41692 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41693 this_arg_conv.is_owned = false;
41694 LDKNodeId node_id_conv;
41695 node_id_conv.inner = untag_ptr(node_id);
41696 node_id_conv.is_owned = ptr_is_owned(node_id);
41697 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv);
41698 node_id_conv.is_owned = false;
41699 ProbabilisticScorer_remove_banned(&this_arg_conv, &node_id_conv);
41702 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) {
41703 LDKProbabilisticScorer this_arg_conv;
41704 this_arg_conv.inner = untag_ptr(this_arg);
41705 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41706 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41707 this_arg_conv.is_owned = false;
41708 LDKNodeId node_id_conv;
41709 node_id_conv.inner = untag_ptr(node_id);
41710 node_id_conv.is_owned = ptr_is_owned(node_id);
41711 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv);
41712 node_id_conv.is_owned = false;
41713 ProbabilisticScorer_set_manual_penalty(&this_arg_conv, &node_id_conv, penalty);
41716 void __attribute__((export_name("TS_ProbabilisticScorer_remove_manual_penalty"))) TS_ProbabilisticScorer_remove_manual_penalty(uint64_t this_arg, uint64_t node_id) {
41717 LDKProbabilisticScorer this_arg_conv;
41718 this_arg_conv.inner = untag_ptr(this_arg);
41719 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41720 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41721 this_arg_conv.is_owned = false;
41722 LDKNodeId node_id_conv;
41723 node_id_conv.inner = untag_ptr(node_id);
41724 node_id_conv.is_owned = ptr_is_owned(node_id);
41725 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv);
41726 node_id_conv.is_owned = false;
41727 ProbabilisticScorer_remove_manual_penalty(&this_arg_conv, &node_id_conv);
41730 void __attribute__((export_name("TS_ProbabilisticScorer_clear_manual_penalties"))) TS_ProbabilisticScorer_clear_manual_penalties(uint64_t this_arg) {
41731 LDKProbabilisticScorer this_arg_conv;
41732 this_arg_conv.inner = untag_ptr(this_arg);
41733 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41734 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41735 this_arg_conv.is_owned = false;
41736 ProbabilisticScorer_clear_manual_penalties(&this_arg_conv);
41739 void __attribute__((export_name("TS_ProbabilisticScoringParameters_add_banned_from_list"))) TS_ProbabilisticScoringParameters_add_banned_from_list(uint64_t this_arg, uint64_tArray node_ids) {
41740 LDKProbabilisticScoringParameters this_arg_conv;
41741 this_arg_conv.inner = untag_ptr(this_arg);
41742 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41743 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41744 this_arg_conv.is_owned = false;
41745 LDKCVec_NodeIdZ node_ids_constr;
41746 node_ids_constr.datalen = node_ids->arr_len;
41747 if (node_ids_constr.datalen > 0)
41748 node_ids_constr.data = MALLOC(node_ids_constr.datalen * sizeof(LDKNodeId), "LDKCVec_NodeIdZ Elements");
41750 node_ids_constr.data = NULL;
41751 uint64_t* node_ids_vals = node_ids->elems;
41752 for (size_t i = 0; i < node_ids_constr.datalen; i++) {
41753 uint64_t node_ids_conv_8 = node_ids_vals[i];
41754 LDKNodeId node_ids_conv_8_conv;
41755 node_ids_conv_8_conv.inner = untag_ptr(node_ids_conv_8);
41756 node_ids_conv_8_conv.is_owned = ptr_is_owned(node_ids_conv_8);
41757 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_ids_conv_8_conv);
41758 node_ids_conv_8_conv = NodeId_clone(&node_ids_conv_8_conv);
41759 node_ids_constr.data[i] = node_ids_conv_8_conv;
41762 ProbabilisticScoringParameters_add_banned_from_list(&this_arg_conv, node_ids_constr);
41765 uint64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_default"))) TS_ProbabilisticScoringParameters_default() {
41766 LDKProbabilisticScoringParameters ret_var = ProbabilisticScoringParameters_default();
41767 uint64_t ret_ref = 0;
41768 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41769 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41773 uint64_t __attribute__((export_name("TS_ProbabilisticScorer_as_Score"))) TS_ProbabilisticScorer_as_Score(uint64_t this_arg) {
41774 LDKProbabilisticScorer this_arg_conv;
41775 this_arg_conv.inner = untag_ptr(this_arg);
41776 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41777 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41778 this_arg_conv.is_owned = false;
41779 LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore");
41780 *ret_ret = ProbabilisticScorer_as_Score(&this_arg_conv);
41781 return tag_ptr(ret_ret, true);
41784 int8_tArray __attribute__((export_name("TS_ProbabilisticScorer_write"))) TS_ProbabilisticScorer_write(uint64_t obj) {
41785 LDKProbabilisticScorer obj_conv;
41786 obj_conv.inner = untag_ptr(obj);
41787 obj_conv.is_owned = ptr_is_owned(obj);
41788 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41789 obj_conv.is_owned = false;
41790 LDKCVec_u8Z ret_var = ProbabilisticScorer_write(&obj_conv);
41791 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
41792 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
41793 CVec_u8Z_free(ret_var);
41797 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) {
41798 LDKu8slice ser_ref;
41799 ser_ref.datalen = ser->arr_len;
41800 ser_ref.data = ser->elems;
41801 LDKProbabilisticScoringParameters arg_a_conv;
41802 arg_a_conv.inner = untag_ptr(arg_a);
41803 arg_a_conv.is_owned = ptr_is_owned(arg_a);
41804 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_a_conv);
41805 arg_a_conv = ProbabilisticScoringParameters_clone(&arg_a_conv);
41806 LDKNetworkGraph arg_b_conv;
41807 arg_b_conv.inner = untag_ptr(arg_b);
41808 arg_b_conv.is_owned = ptr_is_owned(arg_b);
41809 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_b_conv);
41810 arg_b_conv.is_owned = false;
41811 void* arg_c_ptr = untag_ptr(arg_c);
41812 CHECK_ACCESS(arg_c_ptr);
41813 LDKLogger arg_c_conv = *(LDKLogger*)(arg_c_ptr);
41814 if (arg_c_conv.free == LDKLogger_JCalls_free) {
41815 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
41816 LDKLogger_JCalls_cloned(&arg_c_conv);
41818 LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ");
41819 *ret_conv = ProbabilisticScorer_read(ser_ref, arg_a_conv, &arg_b_conv, arg_c_conv);
41821 return tag_ptr(ret_conv, true);
41824 void __attribute__((export_name("TS_ParseError_free"))) TS_ParseError_free(uint64_t this_ptr) {
41825 if (!ptr_is_owned(this_ptr)) return;
41826 void* this_ptr_ptr = untag_ptr(this_ptr);
41827 CHECK_ACCESS(this_ptr_ptr);
41828 LDKParseError this_ptr_conv = *(LDKParseError*)(this_ptr_ptr);
41829 FREE(untag_ptr(this_ptr));
41830 ParseError_free(this_ptr_conv);
41833 static inline uint64_t ParseError_clone_ptr(LDKParseError *NONNULL_PTR arg) {
41834 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41835 *ret_copy = ParseError_clone(arg);
41836 uint64_t ret_ref = tag_ptr(ret_copy, true);
41839 int64_t __attribute__((export_name("TS_ParseError_clone_ptr"))) TS_ParseError_clone_ptr(uint64_t arg) {
41840 LDKParseError* arg_conv = (LDKParseError*)untag_ptr(arg);
41841 int64_t ret_conv = ParseError_clone_ptr(arg_conv);
41845 uint64_t __attribute__((export_name("TS_ParseError_clone"))) TS_ParseError_clone(uint64_t orig) {
41846 LDKParseError* orig_conv = (LDKParseError*)untag_ptr(orig);
41847 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41848 *ret_copy = ParseError_clone(orig_conv);
41849 uint64_t ret_ref = tag_ptr(ret_copy, true);
41853 uint64_t __attribute__((export_name("TS_ParseError_bech32_error"))) TS_ParseError_bech32_error(uint64_t a) {
41854 void* a_ptr = untag_ptr(a);
41855 CHECK_ACCESS(a_ptr);
41856 LDKBech32Error a_conv = *(LDKBech32Error*)(a_ptr);
41857 a_conv = Bech32Error_clone((LDKBech32Error*)untag_ptr(a));
41858 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41859 *ret_copy = ParseError_bech32_error(a_conv);
41860 uint64_t ret_ref = tag_ptr(ret_copy, true);
41864 uint64_t __attribute__((export_name("TS_ParseError_parse_amount_error"))) TS_ParseError_parse_amount_error(int32_t a) {
41866 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41867 *ret_copy = ParseError_parse_amount_error((LDKError){ ._dummy = 0 });
41868 uint64_t ret_ref = tag_ptr(ret_copy, true);
41872 uint64_t __attribute__((export_name("TS_ParseError_malformed_signature"))) TS_ParseError_malformed_signature(uint32_t a) {
41873 LDKSecp256k1Error a_conv = LDKSecp256k1Error_from_js(a);
41874 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41875 *ret_copy = ParseError_malformed_signature(a_conv);
41876 uint64_t ret_ref = tag_ptr(ret_copy, true);
41880 uint64_t __attribute__((export_name("TS_ParseError_bad_prefix"))) TS_ParseError_bad_prefix() {
41881 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41882 *ret_copy = ParseError_bad_prefix();
41883 uint64_t ret_ref = tag_ptr(ret_copy, true);
41887 uint64_t __attribute__((export_name("TS_ParseError_unknown_currency"))) TS_ParseError_unknown_currency() {
41888 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41889 *ret_copy = ParseError_unknown_currency();
41890 uint64_t ret_ref = tag_ptr(ret_copy, true);
41894 uint64_t __attribute__((export_name("TS_ParseError_unknown_si_prefix"))) TS_ParseError_unknown_si_prefix() {
41895 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41896 *ret_copy = ParseError_unknown_si_prefix();
41897 uint64_t ret_ref = tag_ptr(ret_copy, true);
41901 uint64_t __attribute__((export_name("TS_ParseError_malformed_hrp"))) TS_ParseError_malformed_hrp() {
41902 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41903 *ret_copy = ParseError_malformed_hrp();
41904 uint64_t ret_ref = tag_ptr(ret_copy, true);
41908 uint64_t __attribute__((export_name("TS_ParseError_too_short_data_part"))) TS_ParseError_too_short_data_part() {
41909 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41910 *ret_copy = ParseError_too_short_data_part();
41911 uint64_t ret_ref = tag_ptr(ret_copy, true);
41915 uint64_t __attribute__((export_name("TS_ParseError_unexpected_end_of_tagged_fields"))) TS_ParseError_unexpected_end_of_tagged_fields() {
41916 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41917 *ret_copy = ParseError_unexpected_end_of_tagged_fields();
41918 uint64_t ret_ref = tag_ptr(ret_copy, true);
41922 uint64_t __attribute__((export_name("TS_ParseError_description_decode_error"))) TS_ParseError_description_decode_error(int32_t a) {
41924 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41925 *ret_copy = ParseError_description_decode_error((LDKError){ ._dummy = 0 });
41926 uint64_t ret_ref = tag_ptr(ret_copy, true);
41930 uint64_t __attribute__((export_name("TS_ParseError_padding_error"))) TS_ParseError_padding_error() {
41931 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41932 *ret_copy = ParseError_padding_error();
41933 uint64_t ret_ref = tag_ptr(ret_copy, true);
41937 uint64_t __attribute__((export_name("TS_ParseError_integer_overflow_error"))) TS_ParseError_integer_overflow_error() {
41938 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41939 *ret_copy = ParseError_integer_overflow_error();
41940 uint64_t ret_ref = tag_ptr(ret_copy, true);
41944 uint64_t __attribute__((export_name("TS_ParseError_invalid_seg_wit_program_length"))) TS_ParseError_invalid_seg_wit_program_length() {
41945 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41946 *ret_copy = ParseError_invalid_seg_wit_program_length();
41947 uint64_t ret_ref = tag_ptr(ret_copy, true);
41951 uint64_t __attribute__((export_name("TS_ParseError_invalid_pub_key_hash_length"))) TS_ParseError_invalid_pub_key_hash_length() {
41952 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41953 *ret_copy = ParseError_invalid_pub_key_hash_length();
41954 uint64_t ret_ref = tag_ptr(ret_copy, true);
41958 uint64_t __attribute__((export_name("TS_ParseError_invalid_script_hash_length"))) TS_ParseError_invalid_script_hash_length() {
41959 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41960 *ret_copy = ParseError_invalid_script_hash_length();
41961 uint64_t ret_ref = tag_ptr(ret_copy, true);
41965 uint64_t __attribute__((export_name("TS_ParseError_invalid_recovery_id"))) TS_ParseError_invalid_recovery_id() {
41966 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41967 *ret_copy = ParseError_invalid_recovery_id();
41968 uint64_t ret_ref = tag_ptr(ret_copy, true);
41972 uint64_t __attribute__((export_name("TS_ParseError_invalid_slice_length"))) TS_ParseError_invalid_slice_length(jstring a) {
41973 LDKStr a_conv = str_ref_to_owned_c(a);
41974 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41975 *ret_copy = ParseError_invalid_slice_length(a_conv);
41976 uint64_t ret_ref = tag_ptr(ret_copy, true);
41980 uint64_t __attribute__((export_name("TS_ParseError_skip"))) TS_ParseError_skip() {
41981 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41982 *ret_copy = ParseError_skip();
41983 uint64_t ret_ref = tag_ptr(ret_copy, true);
41987 void __attribute__((export_name("TS_ParseOrSemanticError_free"))) TS_ParseOrSemanticError_free(uint64_t this_ptr) {
41988 if (!ptr_is_owned(this_ptr)) return;
41989 void* this_ptr_ptr = untag_ptr(this_ptr);
41990 CHECK_ACCESS(this_ptr_ptr);
41991 LDKParseOrSemanticError this_ptr_conv = *(LDKParseOrSemanticError*)(this_ptr_ptr);
41992 FREE(untag_ptr(this_ptr));
41993 ParseOrSemanticError_free(this_ptr_conv);
41996 static inline uint64_t ParseOrSemanticError_clone_ptr(LDKParseOrSemanticError *NONNULL_PTR arg) {
41997 LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError");
41998 *ret_copy = ParseOrSemanticError_clone(arg);
41999 uint64_t ret_ref = tag_ptr(ret_copy, true);
42002 int64_t __attribute__((export_name("TS_ParseOrSemanticError_clone_ptr"))) TS_ParseOrSemanticError_clone_ptr(uint64_t arg) {
42003 LDKParseOrSemanticError* arg_conv = (LDKParseOrSemanticError*)untag_ptr(arg);
42004 int64_t ret_conv = ParseOrSemanticError_clone_ptr(arg_conv);
42008 uint64_t __attribute__((export_name("TS_ParseOrSemanticError_clone"))) TS_ParseOrSemanticError_clone(uint64_t orig) {
42009 LDKParseOrSemanticError* orig_conv = (LDKParseOrSemanticError*)untag_ptr(orig);
42010 LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError");
42011 *ret_copy = ParseOrSemanticError_clone(orig_conv);
42012 uint64_t ret_ref = tag_ptr(ret_copy, true);
42016 uint64_t __attribute__((export_name("TS_ParseOrSemanticError_parse_error"))) TS_ParseOrSemanticError_parse_error(uint64_t a) {
42017 void* a_ptr = untag_ptr(a);
42018 CHECK_ACCESS(a_ptr);
42019 LDKParseError a_conv = *(LDKParseError*)(a_ptr);
42020 a_conv = ParseError_clone((LDKParseError*)untag_ptr(a));
42021 LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError");
42022 *ret_copy = ParseOrSemanticError_parse_error(a_conv);
42023 uint64_t ret_ref = tag_ptr(ret_copy, true);
42027 uint64_t __attribute__((export_name("TS_ParseOrSemanticError_semantic_error"))) TS_ParseOrSemanticError_semantic_error(uint32_t a) {
42028 LDKSemanticError a_conv = LDKSemanticError_from_js(a);
42029 LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError");
42030 *ret_copy = ParseOrSemanticError_semantic_error(a_conv);
42031 uint64_t ret_ref = tag_ptr(ret_copy, true);
42035 void __attribute__((export_name("TS_Invoice_free"))) TS_Invoice_free(uint64_t this_obj) {
42036 LDKInvoice this_obj_conv;
42037 this_obj_conv.inner = untag_ptr(this_obj);
42038 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42039 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42040 Invoice_free(this_obj_conv);
42043 jboolean __attribute__((export_name("TS_Invoice_eq"))) TS_Invoice_eq(uint64_t a, uint64_t b) {
42045 a_conv.inner = untag_ptr(a);
42046 a_conv.is_owned = ptr_is_owned(a);
42047 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42048 a_conv.is_owned = false;
42050 b_conv.inner = untag_ptr(b);
42051 b_conv.is_owned = ptr_is_owned(b);
42052 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42053 b_conv.is_owned = false;
42054 jboolean ret_conv = Invoice_eq(&a_conv, &b_conv);
42058 static inline uint64_t Invoice_clone_ptr(LDKInvoice *NONNULL_PTR arg) {
42059 LDKInvoice ret_var = Invoice_clone(arg);
42060 uint64_t ret_ref = 0;
42061 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42062 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42065 int64_t __attribute__((export_name("TS_Invoice_clone_ptr"))) TS_Invoice_clone_ptr(uint64_t arg) {
42066 LDKInvoice arg_conv;
42067 arg_conv.inner = untag_ptr(arg);
42068 arg_conv.is_owned = ptr_is_owned(arg);
42069 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42070 arg_conv.is_owned = false;
42071 int64_t ret_conv = Invoice_clone_ptr(&arg_conv);
42075 uint64_t __attribute__((export_name("TS_Invoice_clone"))) TS_Invoice_clone(uint64_t orig) {
42076 LDKInvoice orig_conv;
42077 orig_conv.inner = untag_ptr(orig);
42078 orig_conv.is_owned = ptr_is_owned(orig);
42079 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42080 orig_conv.is_owned = false;
42081 LDKInvoice ret_var = Invoice_clone(&orig_conv);
42082 uint64_t ret_ref = 0;
42083 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42084 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42088 void __attribute__((export_name("TS_SignedRawInvoice_free"))) TS_SignedRawInvoice_free(uint64_t this_obj) {
42089 LDKSignedRawInvoice this_obj_conv;
42090 this_obj_conv.inner = untag_ptr(this_obj);
42091 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42092 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42093 SignedRawInvoice_free(this_obj_conv);
42096 jboolean __attribute__((export_name("TS_SignedRawInvoice_eq"))) TS_SignedRawInvoice_eq(uint64_t a, uint64_t b) {
42097 LDKSignedRawInvoice a_conv;
42098 a_conv.inner = untag_ptr(a);
42099 a_conv.is_owned = ptr_is_owned(a);
42100 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42101 a_conv.is_owned = false;
42102 LDKSignedRawInvoice b_conv;
42103 b_conv.inner = untag_ptr(b);
42104 b_conv.is_owned = ptr_is_owned(b);
42105 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42106 b_conv.is_owned = false;
42107 jboolean ret_conv = SignedRawInvoice_eq(&a_conv, &b_conv);
42111 static inline uint64_t SignedRawInvoice_clone_ptr(LDKSignedRawInvoice *NONNULL_PTR arg) {
42112 LDKSignedRawInvoice ret_var = SignedRawInvoice_clone(arg);
42113 uint64_t ret_ref = 0;
42114 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42115 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42118 int64_t __attribute__((export_name("TS_SignedRawInvoice_clone_ptr"))) TS_SignedRawInvoice_clone_ptr(uint64_t arg) {
42119 LDKSignedRawInvoice arg_conv;
42120 arg_conv.inner = untag_ptr(arg);
42121 arg_conv.is_owned = ptr_is_owned(arg);
42122 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42123 arg_conv.is_owned = false;
42124 int64_t ret_conv = SignedRawInvoice_clone_ptr(&arg_conv);
42128 uint64_t __attribute__((export_name("TS_SignedRawInvoice_clone"))) TS_SignedRawInvoice_clone(uint64_t orig) {
42129 LDKSignedRawInvoice orig_conv;
42130 orig_conv.inner = untag_ptr(orig);
42131 orig_conv.is_owned = ptr_is_owned(orig);
42132 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42133 orig_conv.is_owned = false;
42134 LDKSignedRawInvoice ret_var = SignedRawInvoice_clone(&orig_conv);
42135 uint64_t ret_ref = 0;
42136 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42137 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42141 void __attribute__((export_name("TS_RawInvoice_free"))) TS_RawInvoice_free(uint64_t this_obj) {
42142 LDKRawInvoice this_obj_conv;
42143 this_obj_conv.inner = untag_ptr(this_obj);
42144 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42145 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42146 RawInvoice_free(this_obj_conv);
42149 uint64_t __attribute__((export_name("TS_RawInvoice_get_data"))) TS_RawInvoice_get_data(uint64_t this_ptr) {
42150 LDKRawInvoice this_ptr_conv;
42151 this_ptr_conv.inner = untag_ptr(this_ptr);
42152 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42153 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42154 this_ptr_conv.is_owned = false;
42155 LDKRawDataPart ret_var = RawInvoice_get_data(&this_ptr_conv);
42156 uint64_t ret_ref = 0;
42157 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42158 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42162 void __attribute__((export_name("TS_RawInvoice_set_data"))) TS_RawInvoice_set_data(uint64_t this_ptr, uint64_t val) {
42163 LDKRawInvoice this_ptr_conv;
42164 this_ptr_conv.inner = untag_ptr(this_ptr);
42165 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42166 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42167 this_ptr_conv.is_owned = false;
42168 LDKRawDataPart val_conv;
42169 val_conv.inner = untag_ptr(val);
42170 val_conv.is_owned = ptr_is_owned(val);
42171 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
42172 val_conv = RawDataPart_clone(&val_conv);
42173 RawInvoice_set_data(&this_ptr_conv, val_conv);
42176 jboolean __attribute__((export_name("TS_RawInvoice_eq"))) TS_RawInvoice_eq(uint64_t a, uint64_t b) {
42177 LDKRawInvoice a_conv;
42178 a_conv.inner = untag_ptr(a);
42179 a_conv.is_owned = ptr_is_owned(a);
42180 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42181 a_conv.is_owned = false;
42182 LDKRawInvoice b_conv;
42183 b_conv.inner = untag_ptr(b);
42184 b_conv.is_owned = ptr_is_owned(b);
42185 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42186 b_conv.is_owned = false;
42187 jboolean ret_conv = RawInvoice_eq(&a_conv, &b_conv);
42191 static inline uint64_t RawInvoice_clone_ptr(LDKRawInvoice *NONNULL_PTR arg) {
42192 LDKRawInvoice ret_var = RawInvoice_clone(arg);
42193 uint64_t ret_ref = 0;
42194 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42195 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42198 int64_t __attribute__((export_name("TS_RawInvoice_clone_ptr"))) TS_RawInvoice_clone_ptr(uint64_t arg) {
42199 LDKRawInvoice arg_conv;
42200 arg_conv.inner = untag_ptr(arg);
42201 arg_conv.is_owned = ptr_is_owned(arg);
42202 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42203 arg_conv.is_owned = false;
42204 int64_t ret_conv = RawInvoice_clone_ptr(&arg_conv);
42208 uint64_t __attribute__((export_name("TS_RawInvoice_clone"))) TS_RawInvoice_clone(uint64_t orig) {
42209 LDKRawInvoice orig_conv;
42210 orig_conv.inner = untag_ptr(orig);
42211 orig_conv.is_owned = ptr_is_owned(orig);
42212 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42213 orig_conv.is_owned = false;
42214 LDKRawInvoice ret_var = RawInvoice_clone(&orig_conv);
42215 uint64_t ret_ref = 0;
42216 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42217 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42221 void __attribute__((export_name("TS_RawDataPart_free"))) TS_RawDataPart_free(uint64_t this_obj) {
42222 LDKRawDataPart this_obj_conv;
42223 this_obj_conv.inner = untag_ptr(this_obj);
42224 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42225 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42226 RawDataPart_free(this_obj_conv);
42229 uint64_t __attribute__((export_name("TS_RawDataPart_get_timestamp"))) TS_RawDataPart_get_timestamp(uint64_t this_ptr) {
42230 LDKRawDataPart this_ptr_conv;
42231 this_ptr_conv.inner = untag_ptr(this_ptr);
42232 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42233 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42234 this_ptr_conv.is_owned = false;
42235 LDKPositiveTimestamp ret_var = RawDataPart_get_timestamp(&this_ptr_conv);
42236 uint64_t ret_ref = 0;
42237 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42238 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42242 void __attribute__((export_name("TS_RawDataPart_set_timestamp"))) TS_RawDataPart_set_timestamp(uint64_t this_ptr, uint64_t val) {
42243 LDKRawDataPart this_ptr_conv;
42244 this_ptr_conv.inner = untag_ptr(this_ptr);
42245 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42246 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42247 this_ptr_conv.is_owned = false;
42248 LDKPositiveTimestamp val_conv;
42249 val_conv.inner = untag_ptr(val);
42250 val_conv.is_owned = ptr_is_owned(val);
42251 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
42252 val_conv = PositiveTimestamp_clone(&val_conv);
42253 RawDataPart_set_timestamp(&this_ptr_conv, val_conv);
42256 jboolean __attribute__((export_name("TS_RawDataPart_eq"))) TS_RawDataPart_eq(uint64_t a, uint64_t b) {
42257 LDKRawDataPart a_conv;
42258 a_conv.inner = untag_ptr(a);
42259 a_conv.is_owned = ptr_is_owned(a);
42260 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42261 a_conv.is_owned = false;
42262 LDKRawDataPart b_conv;
42263 b_conv.inner = untag_ptr(b);
42264 b_conv.is_owned = ptr_is_owned(b);
42265 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42266 b_conv.is_owned = false;
42267 jboolean ret_conv = RawDataPart_eq(&a_conv, &b_conv);
42271 static inline uint64_t RawDataPart_clone_ptr(LDKRawDataPart *NONNULL_PTR arg) {
42272 LDKRawDataPart ret_var = RawDataPart_clone(arg);
42273 uint64_t ret_ref = 0;
42274 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42275 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42278 int64_t __attribute__((export_name("TS_RawDataPart_clone_ptr"))) TS_RawDataPart_clone_ptr(uint64_t arg) {
42279 LDKRawDataPart arg_conv;
42280 arg_conv.inner = untag_ptr(arg);
42281 arg_conv.is_owned = ptr_is_owned(arg);
42282 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42283 arg_conv.is_owned = false;
42284 int64_t ret_conv = RawDataPart_clone_ptr(&arg_conv);
42288 uint64_t __attribute__((export_name("TS_RawDataPart_clone"))) TS_RawDataPart_clone(uint64_t orig) {
42289 LDKRawDataPart orig_conv;
42290 orig_conv.inner = untag_ptr(orig);
42291 orig_conv.is_owned = ptr_is_owned(orig);
42292 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42293 orig_conv.is_owned = false;
42294 LDKRawDataPart ret_var = RawDataPart_clone(&orig_conv);
42295 uint64_t ret_ref = 0;
42296 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42297 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42301 void __attribute__((export_name("TS_PositiveTimestamp_free"))) TS_PositiveTimestamp_free(uint64_t this_obj) {
42302 LDKPositiveTimestamp this_obj_conv;
42303 this_obj_conv.inner = untag_ptr(this_obj);
42304 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42305 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42306 PositiveTimestamp_free(this_obj_conv);
42309 jboolean __attribute__((export_name("TS_PositiveTimestamp_eq"))) TS_PositiveTimestamp_eq(uint64_t a, uint64_t b) {
42310 LDKPositiveTimestamp a_conv;
42311 a_conv.inner = untag_ptr(a);
42312 a_conv.is_owned = ptr_is_owned(a);
42313 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42314 a_conv.is_owned = false;
42315 LDKPositiveTimestamp b_conv;
42316 b_conv.inner = untag_ptr(b);
42317 b_conv.is_owned = ptr_is_owned(b);
42318 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42319 b_conv.is_owned = false;
42320 jboolean ret_conv = PositiveTimestamp_eq(&a_conv, &b_conv);
42324 static inline uint64_t PositiveTimestamp_clone_ptr(LDKPositiveTimestamp *NONNULL_PTR arg) {
42325 LDKPositiveTimestamp ret_var = PositiveTimestamp_clone(arg);
42326 uint64_t ret_ref = 0;
42327 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42328 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42331 int64_t __attribute__((export_name("TS_PositiveTimestamp_clone_ptr"))) TS_PositiveTimestamp_clone_ptr(uint64_t arg) {
42332 LDKPositiveTimestamp arg_conv;
42333 arg_conv.inner = untag_ptr(arg);
42334 arg_conv.is_owned = ptr_is_owned(arg);
42335 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42336 arg_conv.is_owned = false;
42337 int64_t ret_conv = PositiveTimestamp_clone_ptr(&arg_conv);
42341 uint64_t __attribute__((export_name("TS_PositiveTimestamp_clone"))) TS_PositiveTimestamp_clone(uint64_t orig) {
42342 LDKPositiveTimestamp orig_conv;
42343 orig_conv.inner = untag_ptr(orig);
42344 orig_conv.is_owned = ptr_is_owned(orig);
42345 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42346 orig_conv.is_owned = false;
42347 LDKPositiveTimestamp ret_var = PositiveTimestamp_clone(&orig_conv);
42348 uint64_t ret_ref = 0;
42349 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42350 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42354 uint32_t __attribute__((export_name("TS_SiPrefix_clone"))) TS_SiPrefix_clone(uint64_t orig) {
42355 LDKSiPrefix* orig_conv = (LDKSiPrefix*)untag_ptr(orig);
42356 uint32_t ret_conv = LDKSiPrefix_to_js(SiPrefix_clone(orig_conv));
42360 uint32_t __attribute__((export_name("TS_SiPrefix_milli"))) TS_SiPrefix_milli() {
42361 uint32_t ret_conv = LDKSiPrefix_to_js(SiPrefix_milli());
42365 uint32_t __attribute__((export_name("TS_SiPrefix_micro"))) TS_SiPrefix_micro() {
42366 uint32_t ret_conv = LDKSiPrefix_to_js(SiPrefix_micro());
42370 uint32_t __attribute__((export_name("TS_SiPrefix_nano"))) TS_SiPrefix_nano() {
42371 uint32_t ret_conv = LDKSiPrefix_to_js(SiPrefix_nano());
42375 uint32_t __attribute__((export_name("TS_SiPrefix_pico"))) TS_SiPrefix_pico() {
42376 uint32_t ret_conv = LDKSiPrefix_to_js(SiPrefix_pico());
42380 jboolean __attribute__((export_name("TS_SiPrefix_eq"))) TS_SiPrefix_eq(uint64_t a, uint64_t b) {
42381 LDKSiPrefix* a_conv = (LDKSiPrefix*)untag_ptr(a);
42382 LDKSiPrefix* b_conv = (LDKSiPrefix*)untag_ptr(b);
42383 jboolean ret_conv = SiPrefix_eq(a_conv, b_conv);
42387 int64_t __attribute__((export_name("TS_SiPrefix_multiplier"))) TS_SiPrefix_multiplier(uint64_t this_arg) {
42388 LDKSiPrefix* this_arg_conv = (LDKSiPrefix*)untag_ptr(this_arg);
42389 int64_t ret_conv = SiPrefix_multiplier(this_arg_conv);
42393 uint32_t __attribute__((export_name("TS_Currency_clone"))) TS_Currency_clone(uint64_t orig) {
42394 LDKCurrency* orig_conv = (LDKCurrency*)untag_ptr(orig);
42395 uint32_t ret_conv = LDKCurrency_to_js(Currency_clone(orig_conv));
42399 uint32_t __attribute__((export_name("TS_Currency_bitcoin"))) TS_Currency_bitcoin() {
42400 uint32_t ret_conv = LDKCurrency_to_js(Currency_bitcoin());
42404 uint32_t __attribute__((export_name("TS_Currency_bitcoin_testnet"))) TS_Currency_bitcoin_testnet() {
42405 uint32_t ret_conv = LDKCurrency_to_js(Currency_bitcoin_testnet());
42409 uint32_t __attribute__((export_name("TS_Currency_regtest"))) TS_Currency_regtest() {
42410 uint32_t ret_conv = LDKCurrency_to_js(Currency_regtest());
42414 uint32_t __attribute__((export_name("TS_Currency_simnet"))) TS_Currency_simnet() {
42415 uint32_t ret_conv = LDKCurrency_to_js(Currency_simnet());
42419 uint32_t __attribute__((export_name("TS_Currency_signet"))) TS_Currency_signet() {
42420 uint32_t ret_conv = LDKCurrency_to_js(Currency_signet());
42424 int64_t __attribute__((export_name("TS_Currency_hash"))) TS_Currency_hash(uint64_t o) {
42425 LDKCurrency* o_conv = (LDKCurrency*)untag_ptr(o);
42426 int64_t ret_conv = Currency_hash(o_conv);
42430 jboolean __attribute__((export_name("TS_Currency_eq"))) TS_Currency_eq(uint64_t a, uint64_t b) {
42431 LDKCurrency* a_conv = (LDKCurrency*)untag_ptr(a);
42432 LDKCurrency* b_conv = (LDKCurrency*)untag_ptr(b);
42433 jboolean ret_conv = Currency_eq(a_conv, b_conv);
42437 void __attribute__((export_name("TS_Sha256_free"))) TS_Sha256_free(uint64_t this_obj) {
42438 LDKSha256 this_obj_conv;
42439 this_obj_conv.inner = untag_ptr(this_obj);
42440 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42441 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42442 Sha256_free(this_obj_conv);
42445 static inline uint64_t Sha256_clone_ptr(LDKSha256 *NONNULL_PTR arg) {
42446 LDKSha256 ret_var = Sha256_clone(arg);
42447 uint64_t ret_ref = 0;
42448 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42449 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42452 int64_t __attribute__((export_name("TS_Sha256_clone_ptr"))) TS_Sha256_clone_ptr(uint64_t arg) {
42453 LDKSha256 arg_conv;
42454 arg_conv.inner = untag_ptr(arg);
42455 arg_conv.is_owned = ptr_is_owned(arg);
42456 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42457 arg_conv.is_owned = false;
42458 int64_t ret_conv = Sha256_clone_ptr(&arg_conv);
42462 uint64_t __attribute__((export_name("TS_Sha256_clone"))) TS_Sha256_clone(uint64_t orig) {
42463 LDKSha256 orig_conv;
42464 orig_conv.inner = untag_ptr(orig);
42465 orig_conv.is_owned = ptr_is_owned(orig);
42466 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42467 orig_conv.is_owned = false;
42468 LDKSha256 ret_var = Sha256_clone(&orig_conv);
42469 uint64_t ret_ref = 0;
42470 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42471 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42475 int64_t __attribute__((export_name("TS_Sha256_hash"))) TS_Sha256_hash(uint64_t o) {
42477 o_conv.inner = untag_ptr(o);
42478 o_conv.is_owned = ptr_is_owned(o);
42479 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
42480 o_conv.is_owned = false;
42481 int64_t ret_conv = Sha256_hash(&o_conv);
42485 jboolean __attribute__((export_name("TS_Sha256_eq"))) TS_Sha256_eq(uint64_t a, uint64_t b) {
42487 a_conv.inner = untag_ptr(a);
42488 a_conv.is_owned = ptr_is_owned(a);
42489 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42490 a_conv.is_owned = false;
42492 b_conv.inner = untag_ptr(b);
42493 b_conv.is_owned = ptr_is_owned(b);
42494 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42495 b_conv.is_owned = false;
42496 jboolean ret_conv = Sha256_eq(&a_conv, &b_conv);
42500 void __attribute__((export_name("TS_Description_free"))) TS_Description_free(uint64_t this_obj) {
42501 LDKDescription this_obj_conv;
42502 this_obj_conv.inner = untag_ptr(this_obj);
42503 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42504 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42505 Description_free(this_obj_conv);
42508 static inline uint64_t Description_clone_ptr(LDKDescription *NONNULL_PTR arg) {
42509 LDKDescription ret_var = Description_clone(arg);
42510 uint64_t ret_ref = 0;
42511 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42512 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42515 int64_t __attribute__((export_name("TS_Description_clone_ptr"))) TS_Description_clone_ptr(uint64_t arg) {
42516 LDKDescription arg_conv;
42517 arg_conv.inner = untag_ptr(arg);
42518 arg_conv.is_owned = ptr_is_owned(arg);
42519 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42520 arg_conv.is_owned = false;
42521 int64_t ret_conv = Description_clone_ptr(&arg_conv);
42525 uint64_t __attribute__((export_name("TS_Description_clone"))) TS_Description_clone(uint64_t orig) {
42526 LDKDescription orig_conv;
42527 orig_conv.inner = untag_ptr(orig);
42528 orig_conv.is_owned = ptr_is_owned(orig);
42529 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42530 orig_conv.is_owned = false;
42531 LDKDescription ret_var = Description_clone(&orig_conv);
42532 uint64_t ret_ref = 0;
42533 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42534 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42538 int64_t __attribute__((export_name("TS_Description_hash"))) TS_Description_hash(uint64_t o) {
42539 LDKDescription o_conv;
42540 o_conv.inner = untag_ptr(o);
42541 o_conv.is_owned = ptr_is_owned(o);
42542 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
42543 o_conv.is_owned = false;
42544 int64_t ret_conv = Description_hash(&o_conv);
42548 jboolean __attribute__((export_name("TS_Description_eq"))) TS_Description_eq(uint64_t a, uint64_t b) {
42549 LDKDescription a_conv;
42550 a_conv.inner = untag_ptr(a);
42551 a_conv.is_owned = ptr_is_owned(a);
42552 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42553 a_conv.is_owned = false;
42554 LDKDescription b_conv;
42555 b_conv.inner = untag_ptr(b);
42556 b_conv.is_owned = ptr_is_owned(b);
42557 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42558 b_conv.is_owned = false;
42559 jboolean ret_conv = Description_eq(&a_conv, &b_conv);
42563 void __attribute__((export_name("TS_PayeePubKey_free"))) TS_PayeePubKey_free(uint64_t this_obj) {
42564 LDKPayeePubKey this_obj_conv;
42565 this_obj_conv.inner = untag_ptr(this_obj);
42566 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42567 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42568 PayeePubKey_free(this_obj_conv);
42571 int8_tArray __attribute__((export_name("TS_PayeePubKey_get_a"))) TS_PayeePubKey_get_a(uint64_t this_ptr) {
42572 LDKPayeePubKey this_ptr_conv;
42573 this_ptr_conv.inner = untag_ptr(this_ptr);
42574 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42575 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42576 this_ptr_conv.is_owned = false;
42577 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
42578 memcpy(ret_arr->elems, PayeePubKey_get_a(&this_ptr_conv).compressed_form, 33);
42582 void __attribute__((export_name("TS_PayeePubKey_set_a"))) TS_PayeePubKey_set_a(uint64_t this_ptr, int8_tArray val) {
42583 LDKPayeePubKey this_ptr_conv;
42584 this_ptr_conv.inner = untag_ptr(this_ptr);
42585 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42586 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42587 this_ptr_conv.is_owned = false;
42588 LDKPublicKey val_ref;
42589 CHECK(val->arr_len == 33);
42590 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
42591 PayeePubKey_set_a(&this_ptr_conv, val_ref);
42594 uint64_t __attribute__((export_name("TS_PayeePubKey_new"))) TS_PayeePubKey_new(int8_tArray a_arg) {
42595 LDKPublicKey a_arg_ref;
42596 CHECK(a_arg->arr_len == 33);
42597 memcpy(a_arg_ref.compressed_form, a_arg->elems, 33); FREE(a_arg);
42598 LDKPayeePubKey ret_var = PayeePubKey_new(a_arg_ref);
42599 uint64_t ret_ref = 0;
42600 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42601 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42605 static inline uint64_t PayeePubKey_clone_ptr(LDKPayeePubKey *NONNULL_PTR arg) {
42606 LDKPayeePubKey ret_var = PayeePubKey_clone(arg);
42607 uint64_t ret_ref = 0;
42608 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42609 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42612 int64_t __attribute__((export_name("TS_PayeePubKey_clone_ptr"))) TS_PayeePubKey_clone_ptr(uint64_t arg) {
42613 LDKPayeePubKey arg_conv;
42614 arg_conv.inner = untag_ptr(arg);
42615 arg_conv.is_owned = ptr_is_owned(arg);
42616 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42617 arg_conv.is_owned = false;
42618 int64_t ret_conv = PayeePubKey_clone_ptr(&arg_conv);
42622 uint64_t __attribute__((export_name("TS_PayeePubKey_clone"))) TS_PayeePubKey_clone(uint64_t orig) {
42623 LDKPayeePubKey orig_conv;
42624 orig_conv.inner = untag_ptr(orig);
42625 orig_conv.is_owned = ptr_is_owned(orig);
42626 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42627 orig_conv.is_owned = false;
42628 LDKPayeePubKey ret_var = PayeePubKey_clone(&orig_conv);
42629 uint64_t ret_ref = 0;
42630 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42631 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42635 int64_t __attribute__((export_name("TS_PayeePubKey_hash"))) TS_PayeePubKey_hash(uint64_t o) {
42636 LDKPayeePubKey o_conv;
42637 o_conv.inner = untag_ptr(o);
42638 o_conv.is_owned = ptr_is_owned(o);
42639 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
42640 o_conv.is_owned = false;
42641 int64_t ret_conv = PayeePubKey_hash(&o_conv);
42645 jboolean __attribute__((export_name("TS_PayeePubKey_eq"))) TS_PayeePubKey_eq(uint64_t a, uint64_t b) {
42646 LDKPayeePubKey a_conv;
42647 a_conv.inner = untag_ptr(a);
42648 a_conv.is_owned = ptr_is_owned(a);
42649 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42650 a_conv.is_owned = false;
42651 LDKPayeePubKey b_conv;
42652 b_conv.inner = untag_ptr(b);
42653 b_conv.is_owned = ptr_is_owned(b);
42654 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42655 b_conv.is_owned = false;
42656 jboolean ret_conv = PayeePubKey_eq(&a_conv, &b_conv);
42660 void __attribute__((export_name("TS_ExpiryTime_free"))) TS_ExpiryTime_free(uint64_t this_obj) {
42661 LDKExpiryTime this_obj_conv;
42662 this_obj_conv.inner = untag_ptr(this_obj);
42663 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42664 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42665 ExpiryTime_free(this_obj_conv);
42668 static inline uint64_t ExpiryTime_clone_ptr(LDKExpiryTime *NONNULL_PTR arg) {
42669 LDKExpiryTime ret_var = ExpiryTime_clone(arg);
42670 uint64_t ret_ref = 0;
42671 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42672 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42675 int64_t __attribute__((export_name("TS_ExpiryTime_clone_ptr"))) TS_ExpiryTime_clone_ptr(uint64_t arg) {
42676 LDKExpiryTime arg_conv;
42677 arg_conv.inner = untag_ptr(arg);
42678 arg_conv.is_owned = ptr_is_owned(arg);
42679 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42680 arg_conv.is_owned = false;
42681 int64_t ret_conv = ExpiryTime_clone_ptr(&arg_conv);
42685 uint64_t __attribute__((export_name("TS_ExpiryTime_clone"))) TS_ExpiryTime_clone(uint64_t orig) {
42686 LDKExpiryTime orig_conv;
42687 orig_conv.inner = untag_ptr(orig);
42688 orig_conv.is_owned = ptr_is_owned(orig);
42689 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42690 orig_conv.is_owned = false;
42691 LDKExpiryTime ret_var = ExpiryTime_clone(&orig_conv);
42692 uint64_t ret_ref = 0;
42693 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42694 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42698 int64_t __attribute__((export_name("TS_ExpiryTime_hash"))) TS_ExpiryTime_hash(uint64_t o) {
42699 LDKExpiryTime o_conv;
42700 o_conv.inner = untag_ptr(o);
42701 o_conv.is_owned = ptr_is_owned(o);
42702 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
42703 o_conv.is_owned = false;
42704 int64_t ret_conv = ExpiryTime_hash(&o_conv);
42708 jboolean __attribute__((export_name("TS_ExpiryTime_eq"))) TS_ExpiryTime_eq(uint64_t a, uint64_t b) {
42709 LDKExpiryTime a_conv;
42710 a_conv.inner = untag_ptr(a);
42711 a_conv.is_owned = ptr_is_owned(a);
42712 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42713 a_conv.is_owned = false;
42714 LDKExpiryTime b_conv;
42715 b_conv.inner = untag_ptr(b);
42716 b_conv.is_owned = ptr_is_owned(b);
42717 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42718 b_conv.is_owned = false;
42719 jboolean ret_conv = ExpiryTime_eq(&a_conv, &b_conv);
42723 void __attribute__((export_name("TS_MinFinalCltvExpiry_free"))) TS_MinFinalCltvExpiry_free(uint64_t this_obj) {
42724 LDKMinFinalCltvExpiry this_obj_conv;
42725 this_obj_conv.inner = untag_ptr(this_obj);
42726 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42727 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42728 MinFinalCltvExpiry_free(this_obj_conv);
42731 int64_t __attribute__((export_name("TS_MinFinalCltvExpiry_get_a"))) TS_MinFinalCltvExpiry_get_a(uint64_t this_ptr) {
42732 LDKMinFinalCltvExpiry this_ptr_conv;
42733 this_ptr_conv.inner = untag_ptr(this_ptr);
42734 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42735 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42736 this_ptr_conv.is_owned = false;
42737 int64_t ret_conv = MinFinalCltvExpiry_get_a(&this_ptr_conv);
42741 void __attribute__((export_name("TS_MinFinalCltvExpiry_set_a"))) TS_MinFinalCltvExpiry_set_a(uint64_t this_ptr, int64_t val) {
42742 LDKMinFinalCltvExpiry this_ptr_conv;
42743 this_ptr_conv.inner = untag_ptr(this_ptr);
42744 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42745 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42746 this_ptr_conv.is_owned = false;
42747 MinFinalCltvExpiry_set_a(&this_ptr_conv, val);
42750 uint64_t __attribute__((export_name("TS_MinFinalCltvExpiry_new"))) TS_MinFinalCltvExpiry_new(int64_t a_arg) {
42751 LDKMinFinalCltvExpiry ret_var = MinFinalCltvExpiry_new(a_arg);
42752 uint64_t ret_ref = 0;
42753 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42754 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42758 static inline uint64_t MinFinalCltvExpiry_clone_ptr(LDKMinFinalCltvExpiry *NONNULL_PTR arg) {
42759 LDKMinFinalCltvExpiry ret_var = MinFinalCltvExpiry_clone(arg);
42760 uint64_t ret_ref = 0;
42761 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42762 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42765 int64_t __attribute__((export_name("TS_MinFinalCltvExpiry_clone_ptr"))) TS_MinFinalCltvExpiry_clone_ptr(uint64_t arg) {
42766 LDKMinFinalCltvExpiry arg_conv;
42767 arg_conv.inner = untag_ptr(arg);
42768 arg_conv.is_owned = ptr_is_owned(arg);
42769 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42770 arg_conv.is_owned = false;
42771 int64_t ret_conv = MinFinalCltvExpiry_clone_ptr(&arg_conv);
42775 uint64_t __attribute__((export_name("TS_MinFinalCltvExpiry_clone"))) TS_MinFinalCltvExpiry_clone(uint64_t orig) {
42776 LDKMinFinalCltvExpiry orig_conv;
42777 orig_conv.inner = untag_ptr(orig);
42778 orig_conv.is_owned = ptr_is_owned(orig);
42779 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42780 orig_conv.is_owned = false;
42781 LDKMinFinalCltvExpiry ret_var = MinFinalCltvExpiry_clone(&orig_conv);
42782 uint64_t ret_ref = 0;
42783 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42784 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42788 int64_t __attribute__((export_name("TS_MinFinalCltvExpiry_hash"))) TS_MinFinalCltvExpiry_hash(uint64_t o) {
42789 LDKMinFinalCltvExpiry o_conv;
42790 o_conv.inner = untag_ptr(o);
42791 o_conv.is_owned = ptr_is_owned(o);
42792 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
42793 o_conv.is_owned = false;
42794 int64_t ret_conv = MinFinalCltvExpiry_hash(&o_conv);
42798 jboolean __attribute__((export_name("TS_MinFinalCltvExpiry_eq"))) TS_MinFinalCltvExpiry_eq(uint64_t a, uint64_t b) {
42799 LDKMinFinalCltvExpiry a_conv;
42800 a_conv.inner = untag_ptr(a);
42801 a_conv.is_owned = ptr_is_owned(a);
42802 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42803 a_conv.is_owned = false;
42804 LDKMinFinalCltvExpiry b_conv;
42805 b_conv.inner = untag_ptr(b);
42806 b_conv.is_owned = ptr_is_owned(b);
42807 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42808 b_conv.is_owned = false;
42809 jboolean ret_conv = MinFinalCltvExpiry_eq(&a_conv, &b_conv);
42813 void __attribute__((export_name("TS_Fallback_free"))) TS_Fallback_free(uint64_t this_ptr) {
42814 if (!ptr_is_owned(this_ptr)) return;
42815 void* this_ptr_ptr = untag_ptr(this_ptr);
42816 CHECK_ACCESS(this_ptr_ptr);
42817 LDKFallback this_ptr_conv = *(LDKFallback*)(this_ptr_ptr);
42818 FREE(untag_ptr(this_ptr));
42819 Fallback_free(this_ptr_conv);
42822 static inline uint64_t Fallback_clone_ptr(LDKFallback *NONNULL_PTR arg) {
42823 LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
42824 *ret_copy = Fallback_clone(arg);
42825 uint64_t ret_ref = tag_ptr(ret_copy, true);
42828 int64_t __attribute__((export_name("TS_Fallback_clone_ptr"))) TS_Fallback_clone_ptr(uint64_t arg) {
42829 LDKFallback* arg_conv = (LDKFallback*)untag_ptr(arg);
42830 int64_t ret_conv = Fallback_clone_ptr(arg_conv);
42834 uint64_t __attribute__((export_name("TS_Fallback_clone"))) TS_Fallback_clone(uint64_t orig) {
42835 LDKFallback* orig_conv = (LDKFallback*)untag_ptr(orig);
42836 LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
42837 *ret_copy = Fallback_clone(orig_conv);
42838 uint64_t ret_ref = tag_ptr(ret_copy, true);
42842 uint64_t __attribute__((export_name("TS_Fallback_seg_wit_program"))) TS_Fallback_seg_wit_program(int8_t version, int8_tArray program) {
42844 LDKCVec_u8Z program_ref;
42845 program_ref.datalen = program->arr_len;
42846 program_ref.data = MALLOC(program_ref.datalen, "LDKCVec_u8Z Bytes");
42847 memcpy(program_ref.data, program->elems, program_ref.datalen); FREE(program);
42848 LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
42849 *ret_copy = Fallback_seg_wit_program((LDKu5){ ._0 = version }, program_ref);
42850 uint64_t ret_ref = tag_ptr(ret_copy, true);
42854 uint64_t __attribute__((export_name("TS_Fallback_pub_key_hash"))) TS_Fallback_pub_key_hash(int8_tArray a) {
42855 LDKTwentyBytes a_ref;
42856 CHECK(a->arr_len == 20);
42857 memcpy(a_ref.data, a->elems, 20); FREE(a);
42858 LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
42859 *ret_copy = Fallback_pub_key_hash(a_ref);
42860 uint64_t ret_ref = tag_ptr(ret_copy, true);
42864 uint64_t __attribute__((export_name("TS_Fallback_script_hash"))) TS_Fallback_script_hash(int8_tArray a) {
42865 LDKTwentyBytes a_ref;
42866 CHECK(a->arr_len == 20);
42867 memcpy(a_ref.data, a->elems, 20); FREE(a);
42868 LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
42869 *ret_copy = Fallback_script_hash(a_ref);
42870 uint64_t ret_ref = tag_ptr(ret_copy, true);
42874 int64_t __attribute__((export_name("TS_Fallback_hash"))) TS_Fallback_hash(uint64_t o) {
42875 LDKFallback* o_conv = (LDKFallback*)untag_ptr(o);
42876 int64_t ret_conv = Fallback_hash(o_conv);
42880 jboolean __attribute__((export_name("TS_Fallback_eq"))) TS_Fallback_eq(uint64_t a, uint64_t b) {
42881 LDKFallback* a_conv = (LDKFallback*)untag_ptr(a);
42882 LDKFallback* b_conv = (LDKFallback*)untag_ptr(b);
42883 jboolean ret_conv = Fallback_eq(a_conv, b_conv);
42887 void __attribute__((export_name("TS_InvoiceSignature_free"))) TS_InvoiceSignature_free(uint64_t this_obj) {
42888 LDKInvoiceSignature this_obj_conv;
42889 this_obj_conv.inner = untag_ptr(this_obj);
42890 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42891 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42892 InvoiceSignature_free(this_obj_conv);
42895 static inline uint64_t InvoiceSignature_clone_ptr(LDKInvoiceSignature *NONNULL_PTR arg) {
42896 LDKInvoiceSignature ret_var = InvoiceSignature_clone(arg);
42897 uint64_t ret_ref = 0;
42898 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42899 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42902 int64_t __attribute__((export_name("TS_InvoiceSignature_clone_ptr"))) TS_InvoiceSignature_clone_ptr(uint64_t arg) {
42903 LDKInvoiceSignature arg_conv;
42904 arg_conv.inner = untag_ptr(arg);
42905 arg_conv.is_owned = ptr_is_owned(arg);
42906 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42907 arg_conv.is_owned = false;
42908 int64_t ret_conv = InvoiceSignature_clone_ptr(&arg_conv);
42912 uint64_t __attribute__((export_name("TS_InvoiceSignature_clone"))) TS_InvoiceSignature_clone(uint64_t orig) {
42913 LDKInvoiceSignature orig_conv;
42914 orig_conv.inner = untag_ptr(orig);
42915 orig_conv.is_owned = ptr_is_owned(orig);
42916 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42917 orig_conv.is_owned = false;
42918 LDKInvoiceSignature ret_var = InvoiceSignature_clone(&orig_conv);
42919 uint64_t ret_ref = 0;
42920 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42921 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42925 jboolean __attribute__((export_name("TS_InvoiceSignature_eq"))) TS_InvoiceSignature_eq(uint64_t a, uint64_t b) {
42926 LDKInvoiceSignature a_conv;
42927 a_conv.inner = untag_ptr(a);
42928 a_conv.is_owned = ptr_is_owned(a);
42929 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42930 a_conv.is_owned = false;
42931 LDKInvoiceSignature b_conv;
42932 b_conv.inner = untag_ptr(b);
42933 b_conv.is_owned = ptr_is_owned(b);
42934 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42935 b_conv.is_owned = false;
42936 jboolean ret_conv = InvoiceSignature_eq(&a_conv, &b_conv);
42940 void __attribute__((export_name("TS_PrivateRoute_free"))) TS_PrivateRoute_free(uint64_t this_obj) {
42941 LDKPrivateRoute this_obj_conv;
42942 this_obj_conv.inner = untag_ptr(this_obj);
42943 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42944 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42945 PrivateRoute_free(this_obj_conv);
42948 static inline uint64_t PrivateRoute_clone_ptr(LDKPrivateRoute *NONNULL_PTR arg) {
42949 LDKPrivateRoute ret_var = PrivateRoute_clone(arg);
42950 uint64_t ret_ref = 0;
42951 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42952 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42955 int64_t __attribute__((export_name("TS_PrivateRoute_clone_ptr"))) TS_PrivateRoute_clone_ptr(uint64_t arg) {
42956 LDKPrivateRoute arg_conv;
42957 arg_conv.inner = untag_ptr(arg);
42958 arg_conv.is_owned = ptr_is_owned(arg);
42959 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42960 arg_conv.is_owned = false;
42961 int64_t ret_conv = PrivateRoute_clone_ptr(&arg_conv);
42965 uint64_t __attribute__((export_name("TS_PrivateRoute_clone"))) TS_PrivateRoute_clone(uint64_t orig) {
42966 LDKPrivateRoute orig_conv;
42967 orig_conv.inner = untag_ptr(orig);
42968 orig_conv.is_owned = ptr_is_owned(orig);
42969 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42970 orig_conv.is_owned = false;
42971 LDKPrivateRoute ret_var = PrivateRoute_clone(&orig_conv);
42972 uint64_t ret_ref = 0;
42973 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42974 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42978 int64_t __attribute__((export_name("TS_PrivateRoute_hash"))) TS_PrivateRoute_hash(uint64_t o) {
42979 LDKPrivateRoute o_conv;
42980 o_conv.inner = untag_ptr(o);
42981 o_conv.is_owned = ptr_is_owned(o);
42982 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
42983 o_conv.is_owned = false;
42984 int64_t ret_conv = PrivateRoute_hash(&o_conv);
42988 jboolean __attribute__((export_name("TS_PrivateRoute_eq"))) TS_PrivateRoute_eq(uint64_t a, uint64_t b) {
42989 LDKPrivateRoute a_conv;
42990 a_conv.inner = untag_ptr(a);
42991 a_conv.is_owned = ptr_is_owned(a);
42992 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42993 a_conv.is_owned = false;
42994 LDKPrivateRoute b_conv;
42995 b_conv.inner = untag_ptr(b);
42996 b_conv.is_owned = ptr_is_owned(b);
42997 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42998 b_conv.is_owned = false;
42999 jboolean ret_conv = PrivateRoute_eq(&a_conv, &b_conv);
43003 uint64_t __attribute__((export_name("TS_SignedRawInvoice_into_parts"))) TS_SignedRawInvoice_into_parts(uint64_t this_arg) {
43004 LDKSignedRawInvoice this_arg_conv;
43005 this_arg_conv.inner = untag_ptr(this_arg);
43006 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43007 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43008 this_arg_conv = SignedRawInvoice_clone(&this_arg_conv);
43009 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
43010 *ret_conv = SignedRawInvoice_into_parts(this_arg_conv);
43011 return tag_ptr(ret_conv, true);
43014 uint64_t __attribute__((export_name("TS_SignedRawInvoice_raw_invoice"))) TS_SignedRawInvoice_raw_invoice(uint64_t this_arg) {
43015 LDKSignedRawInvoice this_arg_conv;
43016 this_arg_conv.inner = untag_ptr(this_arg);
43017 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43018 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43019 this_arg_conv.is_owned = false;
43020 LDKRawInvoice ret_var = SignedRawInvoice_raw_invoice(&this_arg_conv);
43021 uint64_t ret_ref = 0;
43022 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43023 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43027 int8_tArray __attribute__((export_name("TS_SignedRawInvoice_hash"))) TS_SignedRawInvoice_hash(uint64_t this_arg) {
43028 LDKSignedRawInvoice this_arg_conv;
43029 this_arg_conv.inner = untag_ptr(this_arg);
43030 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43031 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43032 this_arg_conv.is_owned = false;
43033 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
43034 memcpy(ret_arr->elems, *SignedRawInvoice_hash(&this_arg_conv), 32);
43038 uint64_t __attribute__((export_name("TS_SignedRawInvoice_signature"))) TS_SignedRawInvoice_signature(uint64_t this_arg) {
43039 LDKSignedRawInvoice this_arg_conv;
43040 this_arg_conv.inner = untag_ptr(this_arg);
43041 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43042 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43043 this_arg_conv.is_owned = false;
43044 LDKInvoiceSignature ret_var = SignedRawInvoice_signature(&this_arg_conv);
43045 uint64_t ret_ref = 0;
43046 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43047 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43051 uint64_t __attribute__((export_name("TS_SignedRawInvoice_recover_payee_pub_key"))) TS_SignedRawInvoice_recover_payee_pub_key(uint64_t this_arg) {
43052 LDKSignedRawInvoice this_arg_conv;
43053 this_arg_conv.inner = untag_ptr(this_arg);
43054 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43055 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43056 this_arg_conv.is_owned = false;
43057 LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
43058 *ret_conv = SignedRawInvoice_recover_payee_pub_key(&this_arg_conv);
43059 return tag_ptr(ret_conv, true);
43062 jboolean __attribute__((export_name("TS_SignedRawInvoice_check_signature"))) TS_SignedRawInvoice_check_signature(uint64_t this_arg) {
43063 LDKSignedRawInvoice this_arg_conv;
43064 this_arg_conv.inner = untag_ptr(this_arg);
43065 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43066 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43067 this_arg_conv.is_owned = false;
43068 jboolean ret_conv = SignedRawInvoice_check_signature(&this_arg_conv);
43072 int8_tArray __attribute__((export_name("TS_RawInvoice_hash"))) TS_RawInvoice_hash(uint64_t this_arg) {
43073 LDKRawInvoice this_arg_conv;
43074 this_arg_conv.inner = untag_ptr(this_arg);
43075 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43076 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43077 this_arg_conv.is_owned = false;
43078 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
43079 memcpy(ret_arr->elems, RawInvoice_hash(&this_arg_conv).data, 32);
43083 uint64_t __attribute__((export_name("TS_RawInvoice_payment_hash"))) TS_RawInvoice_payment_hash(uint64_t this_arg) {
43084 LDKRawInvoice this_arg_conv;
43085 this_arg_conv.inner = untag_ptr(this_arg);
43086 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43087 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43088 this_arg_conv.is_owned = false;
43089 LDKSha256 ret_var = RawInvoice_payment_hash(&this_arg_conv);
43090 uint64_t ret_ref = 0;
43091 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43092 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43096 uint64_t __attribute__((export_name("TS_RawInvoice_description"))) TS_RawInvoice_description(uint64_t this_arg) {
43097 LDKRawInvoice this_arg_conv;
43098 this_arg_conv.inner = untag_ptr(this_arg);
43099 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43100 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43101 this_arg_conv.is_owned = false;
43102 LDKDescription ret_var = RawInvoice_description(&this_arg_conv);
43103 uint64_t ret_ref = 0;
43104 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43105 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43109 uint64_t __attribute__((export_name("TS_RawInvoice_payee_pub_key"))) TS_RawInvoice_payee_pub_key(uint64_t this_arg) {
43110 LDKRawInvoice this_arg_conv;
43111 this_arg_conv.inner = untag_ptr(this_arg);
43112 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43113 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43114 this_arg_conv.is_owned = false;
43115 LDKPayeePubKey ret_var = RawInvoice_payee_pub_key(&this_arg_conv);
43116 uint64_t ret_ref = 0;
43117 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43118 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43122 uint64_t __attribute__((export_name("TS_RawInvoice_description_hash"))) TS_RawInvoice_description_hash(uint64_t this_arg) {
43123 LDKRawInvoice this_arg_conv;
43124 this_arg_conv.inner = untag_ptr(this_arg);
43125 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43126 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43127 this_arg_conv.is_owned = false;
43128 LDKSha256 ret_var = RawInvoice_description_hash(&this_arg_conv);
43129 uint64_t ret_ref = 0;
43130 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43131 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43135 uint64_t __attribute__((export_name("TS_RawInvoice_expiry_time"))) TS_RawInvoice_expiry_time(uint64_t this_arg) {
43136 LDKRawInvoice this_arg_conv;
43137 this_arg_conv.inner = untag_ptr(this_arg);
43138 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43139 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43140 this_arg_conv.is_owned = false;
43141 LDKExpiryTime ret_var = RawInvoice_expiry_time(&this_arg_conv);
43142 uint64_t ret_ref = 0;
43143 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43144 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43148 uint64_t __attribute__((export_name("TS_RawInvoice_min_final_cltv_expiry"))) TS_RawInvoice_min_final_cltv_expiry(uint64_t this_arg) {
43149 LDKRawInvoice this_arg_conv;
43150 this_arg_conv.inner = untag_ptr(this_arg);
43151 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43152 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43153 this_arg_conv.is_owned = false;
43154 LDKMinFinalCltvExpiry ret_var = RawInvoice_min_final_cltv_expiry(&this_arg_conv);
43155 uint64_t ret_ref = 0;
43156 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43157 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43161 int8_tArray __attribute__((export_name("TS_RawInvoice_payment_secret"))) TS_RawInvoice_payment_secret(uint64_t this_arg) {
43162 LDKRawInvoice this_arg_conv;
43163 this_arg_conv.inner = untag_ptr(this_arg);
43164 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43165 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43166 this_arg_conv.is_owned = false;
43167 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
43168 memcpy(ret_arr->elems, RawInvoice_payment_secret(&this_arg_conv).data, 32);
43172 uint64_t __attribute__((export_name("TS_RawInvoice_features"))) TS_RawInvoice_features(uint64_t this_arg) {
43173 LDKRawInvoice this_arg_conv;
43174 this_arg_conv.inner = untag_ptr(this_arg);
43175 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43176 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43177 this_arg_conv.is_owned = false;
43178 LDKInvoiceFeatures ret_var = RawInvoice_features(&this_arg_conv);
43179 uint64_t ret_ref = 0;
43180 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43181 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43185 uint64_tArray __attribute__((export_name("TS_RawInvoice_private_routes"))) TS_RawInvoice_private_routes(uint64_t this_arg) {
43186 LDKRawInvoice this_arg_conv;
43187 this_arg_conv.inner = untag_ptr(this_arg);
43188 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43189 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43190 this_arg_conv.is_owned = false;
43191 LDKCVec_PrivateRouteZ ret_var = RawInvoice_private_routes(&this_arg_conv);
43192 uint64_tArray ret_arr = NULL;
43193 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
43194 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
43195 for (size_t o = 0; o < ret_var.datalen; o++) {
43196 LDKPrivateRoute ret_conv_14_var = ret_var.data[o];
43197 uint64_t ret_conv_14_ref = 0;
43198 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var);
43199 ret_conv_14_ref = tag_ptr(ret_conv_14_var.inner, ret_conv_14_var.is_owned);
43200 ret_arr_ptr[o] = ret_conv_14_ref;
43203 FREE(ret_var.data);
43207 uint64_t __attribute__((export_name("TS_RawInvoice_amount_pico_btc"))) TS_RawInvoice_amount_pico_btc(uint64_t this_arg) {
43208 LDKRawInvoice this_arg_conv;
43209 this_arg_conv.inner = untag_ptr(this_arg);
43210 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43211 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43212 this_arg_conv.is_owned = false;
43213 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
43214 *ret_copy = RawInvoice_amount_pico_btc(&this_arg_conv);
43215 uint64_t ret_ref = tag_ptr(ret_copy, true);
43219 uint32_t __attribute__((export_name("TS_RawInvoice_currency"))) TS_RawInvoice_currency(uint64_t this_arg) {
43220 LDKRawInvoice this_arg_conv;
43221 this_arg_conv.inner = untag_ptr(this_arg);
43222 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43223 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43224 this_arg_conv.is_owned = false;
43225 uint32_t ret_conv = LDKCurrency_to_js(RawInvoice_currency(&this_arg_conv));
43229 uint64_t __attribute__((export_name("TS_PositiveTimestamp_from_unix_timestamp"))) TS_PositiveTimestamp_from_unix_timestamp(int64_t unix_seconds) {
43230 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
43231 *ret_conv = PositiveTimestamp_from_unix_timestamp(unix_seconds);
43232 return tag_ptr(ret_conv, true);
43235 uint64_t __attribute__((export_name("TS_PositiveTimestamp_from_duration_since_epoch"))) TS_PositiveTimestamp_from_duration_since_epoch(int64_t duration) {
43236 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
43237 *ret_conv = PositiveTimestamp_from_duration_since_epoch(duration);
43238 return tag_ptr(ret_conv, true);
43241 int64_t __attribute__((export_name("TS_PositiveTimestamp_as_unix_timestamp"))) TS_PositiveTimestamp_as_unix_timestamp(uint64_t this_arg) {
43242 LDKPositiveTimestamp this_arg_conv;
43243 this_arg_conv.inner = untag_ptr(this_arg);
43244 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43245 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43246 this_arg_conv.is_owned = false;
43247 int64_t ret_conv = PositiveTimestamp_as_unix_timestamp(&this_arg_conv);
43251 int64_t __attribute__((export_name("TS_PositiveTimestamp_as_duration_since_epoch"))) TS_PositiveTimestamp_as_duration_since_epoch(uint64_t this_arg) {
43252 LDKPositiveTimestamp this_arg_conv;
43253 this_arg_conv.inner = untag_ptr(this_arg);
43254 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43255 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43256 this_arg_conv.is_owned = false;
43257 int64_t ret_conv = PositiveTimestamp_as_duration_since_epoch(&this_arg_conv);
43261 uint64_t __attribute__((export_name("TS_Invoice_into_signed_raw"))) TS_Invoice_into_signed_raw(uint64_t this_arg) {
43262 LDKInvoice this_arg_conv;
43263 this_arg_conv.inner = untag_ptr(this_arg);
43264 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43265 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43266 this_arg_conv = Invoice_clone(&this_arg_conv);
43267 LDKSignedRawInvoice ret_var = Invoice_into_signed_raw(this_arg_conv);
43268 uint64_t ret_ref = 0;
43269 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43270 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43274 uint64_t __attribute__((export_name("TS_Invoice_check_signature"))) TS_Invoice_check_signature(uint64_t this_arg) {
43275 LDKInvoice this_arg_conv;
43276 this_arg_conv.inner = untag_ptr(this_arg);
43277 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43278 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43279 this_arg_conv.is_owned = false;
43280 LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
43281 *ret_conv = Invoice_check_signature(&this_arg_conv);
43282 return tag_ptr(ret_conv, true);
43285 uint64_t __attribute__((export_name("TS_Invoice_from_signed"))) TS_Invoice_from_signed(uint64_t signed_invoice) {
43286 LDKSignedRawInvoice signed_invoice_conv;
43287 signed_invoice_conv.inner = untag_ptr(signed_invoice);
43288 signed_invoice_conv.is_owned = ptr_is_owned(signed_invoice);
43289 CHECK_INNER_FIELD_ACCESS_OR_NULL(signed_invoice_conv);
43290 signed_invoice_conv = SignedRawInvoice_clone(&signed_invoice_conv);
43291 LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
43292 *ret_conv = Invoice_from_signed(signed_invoice_conv);
43293 return tag_ptr(ret_conv, true);
43296 int64_t __attribute__((export_name("TS_Invoice_duration_since_epoch"))) TS_Invoice_duration_since_epoch(uint64_t this_arg) {
43297 LDKInvoice this_arg_conv;
43298 this_arg_conv.inner = untag_ptr(this_arg);
43299 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43300 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43301 this_arg_conv.is_owned = false;
43302 int64_t ret_conv = Invoice_duration_since_epoch(&this_arg_conv);
43306 int8_tArray __attribute__((export_name("TS_Invoice_payment_hash"))) TS_Invoice_payment_hash(uint64_t this_arg) {
43307 LDKInvoice this_arg_conv;
43308 this_arg_conv.inner = untag_ptr(this_arg);
43309 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43310 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43311 this_arg_conv.is_owned = false;
43312 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
43313 memcpy(ret_arr->elems, *Invoice_payment_hash(&this_arg_conv), 32);
43317 int8_tArray __attribute__((export_name("TS_Invoice_payee_pub_key"))) TS_Invoice_payee_pub_key(uint64_t this_arg) {
43318 LDKInvoice this_arg_conv;
43319 this_arg_conv.inner = untag_ptr(this_arg);
43320 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43321 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43322 this_arg_conv.is_owned = false;
43323 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
43324 memcpy(ret_arr->elems, Invoice_payee_pub_key(&this_arg_conv).compressed_form, 33);
43328 int8_tArray __attribute__((export_name("TS_Invoice_payment_secret"))) TS_Invoice_payment_secret(uint64_t this_arg) {
43329 LDKInvoice this_arg_conv;
43330 this_arg_conv.inner = untag_ptr(this_arg);
43331 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43332 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43333 this_arg_conv.is_owned = false;
43334 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
43335 memcpy(ret_arr->elems, *Invoice_payment_secret(&this_arg_conv), 32);
43339 uint64_t __attribute__((export_name("TS_Invoice_features"))) TS_Invoice_features(uint64_t this_arg) {
43340 LDKInvoice this_arg_conv;
43341 this_arg_conv.inner = untag_ptr(this_arg);
43342 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43343 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43344 this_arg_conv.is_owned = false;
43345 LDKInvoiceFeatures ret_var = Invoice_features(&this_arg_conv);
43346 uint64_t ret_ref = 0;
43347 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43348 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43352 int8_tArray __attribute__((export_name("TS_Invoice_recover_payee_pub_key"))) TS_Invoice_recover_payee_pub_key(uint64_t this_arg) {
43353 LDKInvoice this_arg_conv;
43354 this_arg_conv.inner = untag_ptr(this_arg);
43355 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43356 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43357 this_arg_conv.is_owned = false;
43358 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
43359 memcpy(ret_arr->elems, Invoice_recover_payee_pub_key(&this_arg_conv).compressed_form, 33);
43363 int64_t __attribute__((export_name("TS_Invoice_expiry_time"))) TS_Invoice_expiry_time(uint64_t this_arg) {
43364 LDKInvoice this_arg_conv;
43365 this_arg_conv.inner = untag_ptr(this_arg);
43366 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43367 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43368 this_arg_conv.is_owned = false;
43369 int64_t ret_conv = Invoice_expiry_time(&this_arg_conv);
43373 jboolean __attribute__((export_name("TS_Invoice_would_expire"))) TS_Invoice_would_expire(uint64_t this_arg, int64_t at_time) {
43374 LDKInvoice this_arg_conv;
43375 this_arg_conv.inner = untag_ptr(this_arg);
43376 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43377 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43378 this_arg_conv.is_owned = false;
43379 jboolean ret_conv = Invoice_would_expire(&this_arg_conv, at_time);
43383 int64_t __attribute__((export_name("TS_Invoice_min_final_cltv_expiry"))) TS_Invoice_min_final_cltv_expiry(uint64_t this_arg) {
43384 LDKInvoice this_arg_conv;
43385 this_arg_conv.inner = untag_ptr(this_arg);
43386 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43387 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43388 this_arg_conv.is_owned = false;
43389 int64_t ret_conv = Invoice_min_final_cltv_expiry(&this_arg_conv);
43393 uint64_tArray __attribute__((export_name("TS_Invoice_private_routes"))) TS_Invoice_private_routes(uint64_t this_arg) {
43394 LDKInvoice this_arg_conv;
43395 this_arg_conv.inner = untag_ptr(this_arg);
43396 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43397 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43398 this_arg_conv.is_owned = false;
43399 LDKCVec_PrivateRouteZ ret_var = Invoice_private_routes(&this_arg_conv);
43400 uint64_tArray ret_arr = NULL;
43401 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
43402 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
43403 for (size_t o = 0; o < ret_var.datalen; o++) {
43404 LDKPrivateRoute ret_conv_14_var = ret_var.data[o];
43405 uint64_t ret_conv_14_ref = 0;
43406 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var);
43407 ret_conv_14_ref = tag_ptr(ret_conv_14_var.inner, ret_conv_14_var.is_owned);
43408 ret_arr_ptr[o] = ret_conv_14_ref;
43411 FREE(ret_var.data);
43415 uint64_tArray __attribute__((export_name("TS_Invoice_route_hints"))) TS_Invoice_route_hints(uint64_t this_arg) {
43416 LDKInvoice this_arg_conv;
43417 this_arg_conv.inner = untag_ptr(this_arg);
43418 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43419 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43420 this_arg_conv.is_owned = false;
43421 LDKCVec_RouteHintZ ret_var = Invoice_route_hints(&this_arg_conv);
43422 uint64_tArray ret_arr = NULL;
43423 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
43424 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
43425 for (size_t l = 0; l < ret_var.datalen; l++) {
43426 LDKRouteHint ret_conv_11_var = ret_var.data[l];
43427 uint64_t ret_conv_11_ref = 0;
43428 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_11_var);
43429 ret_conv_11_ref = tag_ptr(ret_conv_11_var.inner, ret_conv_11_var.is_owned);
43430 ret_arr_ptr[l] = ret_conv_11_ref;
43433 FREE(ret_var.data);
43437 uint32_t __attribute__((export_name("TS_Invoice_currency"))) TS_Invoice_currency(uint64_t this_arg) {
43438 LDKInvoice this_arg_conv;
43439 this_arg_conv.inner = untag_ptr(this_arg);
43440 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43441 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43442 this_arg_conv.is_owned = false;
43443 uint32_t ret_conv = LDKCurrency_to_js(Invoice_currency(&this_arg_conv));
43447 uint64_t __attribute__((export_name("TS_Invoice_amount_milli_satoshis"))) TS_Invoice_amount_milli_satoshis(uint64_t this_arg) {
43448 LDKInvoice this_arg_conv;
43449 this_arg_conv.inner = untag_ptr(this_arg);
43450 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43451 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43452 this_arg_conv.is_owned = false;
43453 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
43454 *ret_copy = Invoice_amount_milli_satoshis(&this_arg_conv);
43455 uint64_t ret_ref = tag_ptr(ret_copy, true);
43459 uint64_t __attribute__((export_name("TS_Description_new"))) TS_Description_new(jstring description) {
43460 LDKStr description_conv = str_ref_to_owned_c(description);
43461 LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
43462 *ret_conv = Description_new(description_conv);
43463 return tag_ptr(ret_conv, true);
43466 jstring __attribute__((export_name("TS_Description_into_inner"))) TS_Description_into_inner(uint64_t this_arg) {
43467 LDKDescription this_arg_conv;
43468 this_arg_conv.inner = untag_ptr(this_arg);
43469 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43470 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43471 this_arg_conv = Description_clone(&this_arg_conv);
43472 LDKStr ret_str = Description_into_inner(this_arg_conv);
43473 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
43478 uint64_t __attribute__((export_name("TS_ExpiryTime_from_seconds"))) TS_ExpiryTime_from_seconds(int64_t seconds) {
43479 LDKExpiryTime ret_var = ExpiryTime_from_seconds(seconds);
43480 uint64_t ret_ref = 0;
43481 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43482 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43486 uint64_t __attribute__((export_name("TS_ExpiryTime_from_duration"))) TS_ExpiryTime_from_duration(int64_t duration) {
43487 LDKExpiryTime ret_var = ExpiryTime_from_duration(duration);
43488 uint64_t ret_ref = 0;
43489 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43490 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43494 int64_t __attribute__((export_name("TS_ExpiryTime_as_seconds"))) TS_ExpiryTime_as_seconds(uint64_t this_arg) {
43495 LDKExpiryTime this_arg_conv;
43496 this_arg_conv.inner = untag_ptr(this_arg);
43497 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43498 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43499 this_arg_conv.is_owned = false;
43500 int64_t ret_conv = ExpiryTime_as_seconds(&this_arg_conv);
43504 int64_t __attribute__((export_name("TS_ExpiryTime_as_duration"))) TS_ExpiryTime_as_duration(uint64_t this_arg) {
43505 LDKExpiryTime this_arg_conv;
43506 this_arg_conv.inner = untag_ptr(this_arg);
43507 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43508 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43509 this_arg_conv.is_owned = false;
43510 int64_t ret_conv = ExpiryTime_as_duration(&this_arg_conv);
43514 uint64_t __attribute__((export_name("TS_PrivateRoute_new"))) TS_PrivateRoute_new(uint64_t hops) {
43515 LDKRouteHint hops_conv;
43516 hops_conv.inner = untag_ptr(hops);
43517 hops_conv.is_owned = ptr_is_owned(hops);
43518 CHECK_INNER_FIELD_ACCESS_OR_NULL(hops_conv);
43519 hops_conv = RouteHint_clone(&hops_conv);
43520 LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
43521 *ret_conv = PrivateRoute_new(hops_conv);
43522 return tag_ptr(ret_conv, true);
43525 uint64_t __attribute__((export_name("TS_PrivateRoute_into_inner"))) TS_PrivateRoute_into_inner(uint64_t this_arg) {
43526 LDKPrivateRoute this_arg_conv;
43527 this_arg_conv.inner = untag_ptr(this_arg);
43528 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43529 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43530 this_arg_conv = PrivateRoute_clone(&this_arg_conv);
43531 LDKRouteHint ret_var = PrivateRoute_into_inner(this_arg_conv);
43532 uint64_t ret_ref = 0;
43533 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43534 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43538 uint32_t __attribute__((export_name("TS_CreationError_clone"))) TS_CreationError_clone(uint64_t orig) {
43539 LDKCreationError* orig_conv = (LDKCreationError*)untag_ptr(orig);
43540 uint32_t ret_conv = LDKCreationError_to_js(CreationError_clone(orig_conv));
43544 uint32_t __attribute__((export_name("TS_CreationError_description_too_long"))) TS_CreationError_description_too_long() {
43545 uint32_t ret_conv = LDKCreationError_to_js(CreationError_description_too_long());
43549 uint32_t __attribute__((export_name("TS_CreationError_route_too_long"))) TS_CreationError_route_too_long() {
43550 uint32_t ret_conv = LDKCreationError_to_js(CreationError_route_too_long());
43554 uint32_t __attribute__((export_name("TS_CreationError_timestamp_out_of_bounds"))) TS_CreationError_timestamp_out_of_bounds() {
43555 uint32_t ret_conv = LDKCreationError_to_js(CreationError_timestamp_out_of_bounds());
43559 uint32_t __attribute__((export_name("TS_CreationError_invalid_amount"))) TS_CreationError_invalid_amount() {
43560 uint32_t ret_conv = LDKCreationError_to_js(CreationError_invalid_amount());
43564 uint32_t __attribute__((export_name("TS_CreationError_missing_route_hints"))) TS_CreationError_missing_route_hints() {
43565 uint32_t ret_conv = LDKCreationError_to_js(CreationError_missing_route_hints());
43569 jboolean __attribute__((export_name("TS_CreationError_eq"))) TS_CreationError_eq(uint64_t a, uint64_t b) {
43570 LDKCreationError* a_conv = (LDKCreationError*)untag_ptr(a);
43571 LDKCreationError* b_conv = (LDKCreationError*)untag_ptr(b);
43572 jboolean ret_conv = CreationError_eq(a_conv, b_conv);
43576 jstring __attribute__((export_name("TS_CreationError_to_str"))) TS_CreationError_to_str(uint64_t o) {
43577 LDKCreationError* o_conv = (LDKCreationError*)untag_ptr(o);
43578 LDKStr ret_str = CreationError_to_str(o_conv);
43579 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
43584 uint32_t __attribute__((export_name("TS_SemanticError_clone"))) TS_SemanticError_clone(uint64_t orig) {
43585 LDKSemanticError* orig_conv = (LDKSemanticError*)untag_ptr(orig);
43586 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_clone(orig_conv));
43590 uint32_t __attribute__((export_name("TS_SemanticError_no_payment_hash"))) TS_SemanticError_no_payment_hash() {
43591 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_no_payment_hash());
43595 uint32_t __attribute__((export_name("TS_SemanticError_multiple_payment_hashes"))) TS_SemanticError_multiple_payment_hashes() {
43596 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_multiple_payment_hashes());
43600 uint32_t __attribute__((export_name("TS_SemanticError_no_description"))) TS_SemanticError_no_description() {
43601 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_no_description());
43605 uint32_t __attribute__((export_name("TS_SemanticError_multiple_descriptions"))) TS_SemanticError_multiple_descriptions() {
43606 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_multiple_descriptions());
43610 uint32_t __attribute__((export_name("TS_SemanticError_no_payment_secret"))) TS_SemanticError_no_payment_secret() {
43611 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_no_payment_secret());
43615 uint32_t __attribute__((export_name("TS_SemanticError_multiple_payment_secrets"))) TS_SemanticError_multiple_payment_secrets() {
43616 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_multiple_payment_secrets());
43620 uint32_t __attribute__((export_name("TS_SemanticError_invalid_features"))) TS_SemanticError_invalid_features() {
43621 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_invalid_features());
43625 uint32_t __attribute__((export_name("TS_SemanticError_invalid_recovery_id"))) TS_SemanticError_invalid_recovery_id() {
43626 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_invalid_recovery_id());
43630 uint32_t __attribute__((export_name("TS_SemanticError_invalid_signature"))) TS_SemanticError_invalid_signature() {
43631 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_invalid_signature());
43635 uint32_t __attribute__((export_name("TS_SemanticError_imprecise_amount"))) TS_SemanticError_imprecise_amount() {
43636 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_imprecise_amount());
43640 jboolean __attribute__((export_name("TS_SemanticError_eq"))) TS_SemanticError_eq(uint64_t a, uint64_t b) {
43641 LDKSemanticError* a_conv = (LDKSemanticError*)untag_ptr(a);
43642 LDKSemanticError* b_conv = (LDKSemanticError*)untag_ptr(b);
43643 jboolean ret_conv = SemanticError_eq(a_conv, b_conv);
43647 jstring __attribute__((export_name("TS_SemanticError_to_str"))) TS_SemanticError_to_str(uint64_t o) {
43648 LDKSemanticError* o_conv = (LDKSemanticError*)untag_ptr(o);
43649 LDKStr ret_str = SemanticError_to_str(o_conv);
43650 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
43655 void __attribute__((export_name("TS_SignOrCreationError_free"))) TS_SignOrCreationError_free(uint64_t this_ptr) {
43656 if (!ptr_is_owned(this_ptr)) return;
43657 void* this_ptr_ptr = untag_ptr(this_ptr);
43658 CHECK_ACCESS(this_ptr_ptr);
43659 LDKSignOrCreationError this_ptr_conv = *(LDKSignOrCreationError*)(this_ptr_ptr);
43660 FREE(untag_ptr(this_ptr));
43661 SignOrCreationError_free(this_ptr_conv);
43664 static inline uint64_t SignOrCreationError_clone_ptr(LDKSignOrCreationError *NONNULL_PTR arg) {
43665 LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
43666 *ret_copy = SignOrCreationError_clone(arg);
43667 uint64_t ret_ref = tag_ptr(ret_copy, true);
43670 int64_t __attribute__((export_name("TS_SignOrCreationError_clone_ptr"))) TS_SignOrCreationError_clone_ptr(uint64_t arg) {
43671 LDKSignOrCreationError* arg_conv = (LDKSignOrCreationError*)untag_ptr(arg);
43672 int64_t ret_conv = SignOrCreationError_clone_ptr(arg_conv);
43676 uint64_t __attribute__((export_name("TS_SignOrCreationError_clone"))) TS_SignOrCreationError_clone(uint64_t orig) {
43677 LDKSignOrCreationError* orig_conv = (LDKSignOrCreationError*)untag_ptr(orig);
43678 LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
43679 *ret_copy = SignOrCreationError_clone(orig_conv);
43680 uint64_t ret_ref = tag_ptr(ret_copy, true);
43684 uint64_t __attribute__((export_name("TS_SignOrCreationError_sign_error"))) TS_SignOrCreationError_sign_error() {
43685 LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
43686 *ret_copy = SignOrCreationError_sign_error();
43687 uint64_t ret_ref = tag_ptr(ret_copy, true);
43691 uint64_t __attribute__((export_name("TS_SignOrCreationError_creation_error"))) TS_SignOrCreationError_creation_error(uint32_t a) {
43692 LDKCreationError a_conv = LDKCreationError_from_js(a);
43693 LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
43694 *ret_copy = SignOrCreationError_creation_error(a_conv);
43695 uint64_t ret_ref = tag_ptr(ret_copy, true);
43699 jboolean __attribute__((export_name("TS_SignOrCreationError_eq"))) TS_SignOrCreationError_eq(uint64_t a, uint64_t b) {
43700 LDKSignOrCreationError* a_conv = (LDKSignOrCreationError*)untag_ptr(a);
43701 LDKSignOrCreationError* b_conv = (LDKSignOrCreationError*)untag_ptr(b);
43702 jboolean ret_conv = SignOrCreationError_eq(a_conv, b_conv);
43706 jstring __attribute__((export_name("TS_SignOrCreationError_to_str"))) TS_SignOrCreationError_to_str(uint64_t o) {
43707 LDKSignOrCreationError* o_conv = (LDKSignOrCreationError*)untag_ptr(o);
43708 LDKStr ret_str = SignOrCreationError_to_str(o_conv);
43709 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
43714 void __attribute__((export_name("TS_InvoicePayer_free"))) TS_InvoicePayer_free(uint64_t this_obj) {
43715 LDKInvoicePayer this_obj_conv;
43716 this_obj_conv.inner = untag_ptr(this_obj);
43717 this_obj_conv.is_owned = ptr_is_owned(this_obj);
43718 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
43719 InvoicePayer_free(this_obj_conv);
43722 void __attribute__((export_name("TS_Payer_free"))) TS_Payer_free(uint64_t this_ptr) {
43723 if (!ptr_is_owned(this_ptr)) return;
43724 void* this_ptr_ptr = untag_ptr(this_ptr);
43725 CHECK_ACCESS(this_ptr_ptr);
43726 LDKPayer this_ptr_conv = *(LDKPayer*)(this_ptr_ptr);
43727 FREE(untag_ptr(this_ptr));
43728 Payer_free(this_ptr_conv);
43731 void __attribute__((export_name("TS_Router_free"))) TS_Router_free(uint64_t this_ptr) {
43732 if (!ptr_is_owned(this_ptr)) return;
43733 void* this_ptr_ptr = untag_ptr(this_ptr);
43734 CHECK_ACCESS(this_ptr_ptr);
43735 LDKRouter this_ptr_conv = *(LDKRouter*)(this_ptr_ptr);
43736 FREE(untag_ptr(this_ptr));
43737 Router_free(this_ptr_conv);
43740 void __attribute__((export_name("TS_Retry_free"))) TS_Retry_free(uint64_t this_ptr) {
43741 if (!ptr_is_owned(this_ptr)) return;
43742 void* this_ptr_ptr = untag_ptr(this_ptr);
43743 CHECK_ACCESS(this_ptr_ptr);
43744 LDKRetry this_ptr_conv = *(LDKRetry*)(this_ptr_ptr);
43745 FREE(untag_ptr(this_ptr));
43746 Retry_free(this_ptr_conv);
43749 static inline uint64_t Retry_clone_ptr(LDKRetry *NONNULL_PTR arg) {
43750 LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry");
43751 *ret_copy = Retry_clone(arg);
43752 uint64_t ret_ref = tag_ptr(ret_copy, true);
43755 int64_t __attribute__((export_name("TS_Retry_clone_ptr"))) TS_Retry_clone_ptr(uint64_t arg) {
43756 LDKRetry* arg_conv = (LDKRetry*)untag_ptr(arg);
43757 int64_t ret_conv = Retry_clone_ptr(arg_conv);
43761 uint64_t __attribute__((export_name("TS_Retry_clone"))) TS_Retry_clone(uint64_t orig) {
43762 LDKRetry* orig_conv = (LDKRetry*)untag_ptr(orig);
43763 LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry");
43764 *ret_copy = Retry_clone(orig_conv);
43765 uint64_t ret_ref = tag_ptr(ret_copy, true);
43769 uint64_t __attribute__((export_name("TS_Retry_attempts"))) TS_Retry_attempts(uint32_t a) {
43770 LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry");
43771 *ret_copy = Retry_attempts(a);
43772 uint64_t ret_ref = tag_ptr(ret_copy, true);
43776 jboolean __attribute__((export_name("TS_Retry_eq"))) TS_Retry_eq(uint64_t a, uint64_t b) {
43777 LDKRetry* a_conv = (LDKRetry*)untag_ptr(a);
43778 LDKRetry* b_conv = (LDKRetry*)untag_ptr(b);
43779 jboolean ret_conv = Retry_eq(a_conv, b_conv);
43783 int64_t __attribute__((export_name("TS_Retry_hash"))) TS_Retry_hash(uint64_t o) {
43784 LDKRetry* o_conv = (LDKRetry*)untag_ptr(o);
43785 int64_t ret_conv = Retry_hash(o_conv);
43789 void __attribute__((export_name("TS_PaymentError_free"))) TS_PaymentError_free(uint64_t this_ptr) {
43790 if (!ptr_is_owned(this_ptr)) return;
43791 void* this_ptr_ptr = untag_ptr(this_ptr);
43792 CHECK_ACCESS(this_ptr_ptr);
43793 LDKPaymentError this_ptr_conv = *(LDKPaymentError*)(this_ptr_ptr);
43794 FREE(untag_ptr(this_ptr));
43795 PaymentError_free(this_ptr_conv);
43798 static inline uint64_t PaymentError_clone_ptr(LDKPaymentError *NONNULL_PTR arg) {
43799 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
43800 *ret_copy = PaymentError_clone(arg);
43801 uint64_t ret_ref = tag_ptr(ret_copy, true);
43804 int64_t __attribute__((export_name("TS_PaymentError_clone_ptr"))) TS_PaymentError_clone_ptr(uint64_t arg) {
43805 LDKPaymentError* arg_conv = (LDKPaymentError*)untag_ptr(arg);
43806 int64_t ret_conv = PaymentError_clone_ptr(arg_conv);
43810 uint64_t __attribute__((export_name("TS_PaymentError_clone"))) TS_PaymentError_clone(uint64_t orig) {
43811 LDKPaymentError* orig_conv = (LDKPaymentError*)untag_ptr(orig);
43812 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
43813 *ret_copy = PaymentError_clone(orig_conv);
43814 uint64_t ret_ref = tag_ptr(ret_copy, true);
43818 uint64_t __attribute__((export_name("TS_PaymentError_invoice"))) TS_PaymentError_invoice(jstring a) {
43819 LDKStr a_conv = str_ref_to_owned_c(a);
43820 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
43821 *ret_copy = PaymentError_invoice(a_conv);
43822 uint64_t ret_ref = tag_ptr(ret_copy, true);
43826 uint64_t __attribute__((export_name("TS_PaymentError_routing"))) TS_PaymentError_routing(uint64_t a) {
43827 LDKLightningError a_conv;
43828 a_conv.inner = untag_ptr(a);
43829 a_conv.is_owned = ptr_is_owned(a);
43830 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
43831 a_conv = LightningError_clone(&a_conv);
43832 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
43833 *ret_copy = PaymentError_routing(a_conv);
43834 uint64_t ret_ref = tag_ptr(ret_copy, true);
43838 uint64_t __attribute__((export_name("TS_PaymentError_sending"))) TS_PaymentError_sending(uint64_t a) {
43839 void* a_ptr = untag_ptr(a);
43840 CHECK_ACCESS(a_ptr);
43841 LDKPaymentSendFailure a_conv = *(LDKPaymentSendFailure*)(a_ptr);
43842 a_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(a));
43843 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
43844 *ret_copy = PaymentError_sending(a_conv);
43845 uint64_t ret_ref = tag_ptr(ret_copy, true);
43849 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) {
43850 void* payer_ptr = untag_ptr(payer);
43851 CHECK_ACCESS(payer_ptr);
43852 LDKPayer payer_conv = *(LDKPayer*)(payer_ptr);
43853 if (payer_conv.free == LDKPayer_JCalls_free) {
43854 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
43855 LDKPayer_JCalls_cloned(&payer_conv);
43857 void* router_ptr = untag_ptr(router);
43858 CHECK_ACCESS(router_ptr);
43859 LDKRouter router_conv = *(LDKRouter*)(router_ptr);
43860 if (router_conv.free == LDKRouter_JCalls_free) {
43861 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
43862 LDKRouter_JCalls_cloned(&router_conv);
43864 LDKMultiThreadedLockableScore scorer_conv;
43865 scorer_conv.inner = untag_ptr(scorer);
43866 scorer_conv.is_owned = ptr_is_owned(scorer);
43867 CHECK_INNER_FIELD_ACCESS_OR_NULL(scorer_conv);
43868 scorer_conv.is_owned = false;
43869 void* logger_ptr = untag_ptr(logger);
43870 CHECK_ACCESS(logger_ptr);
43871 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
43872 if (logger_conv.free == LDKLogger_JCalls_free) {
43873 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
43874 LDKLogger_JCalls_cloned(&logger_conv);
43876 void* event_handler_ptr = untag_ptr(event_handler);
43877 CHECK_ACCESS(event_handler_ptr);
43878 LDKEventHandler event_handler_conv = *(LDKEventHandler*)(event_handler_ptr);
43879 if (event_handler_conv.free == LDKEventHandler_JCalls_free) {
43880 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
43881 LDKEventHandler_JCalls_cloned(&event_handler_conv);
43883 void* retry_ptr = untag_ptr(retry);
43884 CHECK_ACCESS(retry_ptr);
43885 LDKRetry retry_conv = *(LDKRetry*)(retry_ptr);
43886 retry_conv = Retry_clone((LDKRetry*)untag_ptr(retry));
43887 LDKInvoicePayer ret_var = InvoicePayer_new(payer_conv, router_conv, &scorer_conv, logger_conv, event_handler_conv, retry_conv);
43888 uint64_t ret_ref = 0;
43889 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43890 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43894 uint64_t __attribute__((export_name("TS_InvoicePayer_pay_invoice"))) TS_InvoicePayer_pay_invoice(uint64_t this_arg, uint64_t invoice) {
43895 LDKInvoicePayer this_arg_conv;
43896 this_arg_conv.inner = untag_ptr(this_arg);
43897 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43898 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43899 this_arg_conv.is_owned = false;
43900 LDKInvoice invoice_conv;
43901 invoice_conv.inner = untag_ptr(invoice);
43902 invoice_conv.is_owned = ptr_is_owned(invoice);
43903 CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv);
43904 invoice_conv.is_owned = false;
43905 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
43906 *ret_conv = InvoicePayer_pay_invoice(&this_arg_conv, &invoice_conv);
43907 return tag_ptr(ret_conv, true);
43910 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) {
43911 LDKInvoicePayer this_arg_conv;
43912 this_arg_conv.inner = untag_ptr(this_arg);
43913 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43914 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43915 this_arg_conv.is_owned = false;
43916 LDKInvoice invoice_conv;
43917 invoice_conv.inner = untag_ptr(invoice);
43918 invoice_conv.is_owned = ptr_is_owned(invoice);
43919 CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv);
43920 invoice_conv.is_owned = false;
43921 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
43922 *ret_conv = InvoicePayer_pay_zero_value_invoice(&this_arg_conv, &invoice_conv, amount_msats);
43923 return tag_ptr(ret_conv, true);
43926 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) {
43927 LDKInvoicePayer this_arg_conv;
43928 this_arg_conv.inner = untag_ptr(this_arg);
43929 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43930 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43931 this_arg_conv.is_owned = false;
43932 LDKPublicKey pubkey_ref;
43933 CHECK(pubkey->arr_len == 33);
43934 memcpy(pubkey_ref.compressed_form, pubkey->elems, 33); FREE(pubkey);
43935 LDKThirtyTwoBytes payment_preimage_ref;
43936 CHECK(payment_preimage->arr_len == 32);
43937 memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage);
43938 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
43939 *ret_conv = InvoicePayer_pay_pubkey(&this_arg_conv, pubkey_ref, payment_preimage_ref, amount_msats, final_cltv_expiry_delta);
43940 return tag_ptr(ret_conv, true);
43943 void __attribute__((export_name("TS_InvoicePayer_remove_cached_payment"))) TS_InvoicePayer_remove_cached_payment(uint64_t this_arg, int8_tArray payment_hash) {
43944 LDKInvoicePayer this_arg_conv;
43945 this_arg_conv.inner = untag_ptr(this_arg);
43946 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43947 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43948 this_arg_conv.is_owned = false;
43949 unsigned char payment_hash_arr[32];
43950 CHECK(payment_hash->arr_len == 32);
43951 memcpy(payment_hash_arr, payment_hash->elems, 32); FREE(payment_hash);
43952 unsigned char (*payment_hash_ref)[32] = &payment_hash_arr;
43953 InvoicePayer_remove_cached_payment(&this_arg_conv, payment_hash_ref);
43956 uint64_t __attribute__((export_name("TS_InvoicePayer_as_EventHandler"))) TS_InvoicePayer_as_EventHandler(uint64_t this_arg) {
43957 LDKInvoicePayer this_arg_conv;
43958 this_arg_conv.inner = untag_ptr(this_arg);
43959 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43960 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43961 this_arg_conv.is_owned = false;
43962 LDKEventHandler* ret_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
43963 *ret_ret = InvoicePayer_as_EventHandler(&this_arg_conv);
43964 return tag_ptr(ret_ret, true);
43967 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) {
43968 LDKChannelManager channelmanager_conv;
43969 channelmanager_conv.inner = untag_ptr(channelmanager);
43970 channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
43971 CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv);
43972 channelmanager_conv.is_owned = false;
43973 void* keys_manager_ptr = untag_ptr(keys_manager);
43974 CHECK_ACCESS(keys_manager_ptr);
43975 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
43976 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
43977 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
43978 LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
43980 LDKCurrency network_conv = LDKCurrency_from_js(network);
43981 void* amt_msat_ptr = untag_ptr(amt_msat);
43982 CHECK_ACCESS(amt_msat_ptr);
43983 LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr);
43984 amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat));
43985 LDKSha256 description_hash_conv;
43986 description_hash_conv.inner = untag_ptr(description_hash);
43987 description_hash_conv.is_owned = ptr_is_owned(description_hash);
43988 CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv);
43989 description_hash_conv = Sha256_clone(&description_hash_conv);
43990 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
43991 *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);
43992 return tag_ptr(ret_conv, true);
43995 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) {
43996 LDKChannelManager channelmanager_conv;
43997 channelmanager_conv.inner = untag_ptr(channelmanager);
43998 channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
43999 CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv);
44000 channelmanager_conv.is_owned = false;
44001 void* keys_manager_ptr = untag_ptr(keys_manager);
44002 CHECK_ACCESS(keys_manager_ptr);
44003 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
44004 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
44005 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
44006 LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
44008 LDKCurrency network_conv = LDKCurrency_from_js(network);
44009 void* amt_msat_ptr = untag_ptr(amt_msat);
44010 CHECK_ACCESS(amt_msat_ptr);
44011 LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr);
44012 amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat));
44013 LDKStr description_conv = str_ref_to_owned_c(description);
44014 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
44015 *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);
44016 return tag_ptr(ret_conv, true);
44019 void __attribute__((export_name("TS_DefaultRouter_free"))) TS_DefaultRouter_free(uint64_t this_obj) {
44020 LDKDefaultRouter this_obj_conv;
44021 this_obj_conv.inner = untag_ptr(this_obj);
44022 this_obj_conv.is_owned = ptr_is_owned(this_obj);
44023 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
44024 DefaultRouter_free(this_obj_conv);
44027 uint64_t __attribute__((export_name("TS_DefaultRouter_new"))) TS_DefaultRouter_new(uint64_t network_graph, uint64_t logger, int8_tArray random_seed_bytes) {
44028 LDKNetworkGraph network_graph_conv;
44029 network_graph_conv.inner = untag_ptr(network_graph);
44030 network_graph_conv.is_owned = ptr_is_owned(network_graph);
44031 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
44032 network_graph_conv.is_owned = false;
44033 void* logger_ptr = untag_ptr(logger);
44034 CHECK_ACCESS(logger_ptr);
44035 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
44036 if (logger_conv.free == LDKLogger_JCalls_free) {
44037 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
44038 LDKLogger_JCalls_cloned(&logger_conv);
44040 LDKThirtyTwoBytes random_seed_bytes_ref;
44041 CHECK(random_seed_bytes->arr_len == 32);
44042 memcpy(random_seed_bytes_ref.data, random_seed_bytes->elems, 32); FREE(random_seed_bytes);
44043 LDKDefaultRouter ret_var = DefaultRouter_new(&network_graph_conv, logger_conv, random_seed_bytes_ref);
44044 uint64_t ret_ref = 0;
44045 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
44046 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
44050 uint64_t __attribute__((export_name("TS_DefaultRouter_as_Router"))) TS_DefaultRouter_as_Router(uint64_t this_arg) {
44051 LDKDefaultRouter this_arg_conv;
44052 this_arg_conv.inner = untag_ptr(this_arg);
44053 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44054 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44055 this_arg_conv.is_owned = false;
44056 LDKRouter* ret_ret = MALLOC(sizeof(LDKRouter), "LDKRouter");
44057 *ret_ret = DefaultRouter_as_Router(&this_arg_conv);
44058 return tag_ptr(ret_ret, true);
44061 uint64_t __attribute__((export_name("TS_ChannelManager_as_Payer"))) TS_ChannelManager_as_Payer(uint64_t this_arg) {
44062 LDKChannelManager this_arg_conv;
44063 this_arg_conv.inner = untag_ptr(this_arg);
44064 this_arg_conv.is_owned = ptr_is_owned(this_arg);
44065 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
44066 this_arg_conv.is_owned = false;
44067 LDKPayer* ret_ret = MALLOC(sizeof(LDKPayer), "LDKPayer");
44068 *ret_ret = ChannelManager_as_Payer(&this_arg_conv);
44069 return tag_ptr(ret_ret, true);
44072 uint64_t __attribute__((export_name("TS_SiPrefix_from_str"))) TS_SiPrefix_from_str(jstring s) {
44073 LDKStr s_conv = str_ref_to_owned_c(s);
44074 LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
44075 *ret_conv = SiPrefix_from_str(s_conv);
44076 return tag_ptr(ret_conv, true);
44079 uint64_t __attribute__((export_name("TS_Invoice_from_str"))) TS_Invoice_from_str(jstring s) {
44080 LDKStr s_conv = str_ref_to_owned_c(s);
44081 LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
44082 *ret_conv = Invoice_from_str(s_conv);
44083 return tag_ptr(ret_conv, true);
44086 uint64_t __attribute__((export_name("TS_SignedRawInvoice_from_str"))) TS_SignedRawInvoice_from_str(jstring s) {
44087 LDKStr s_conv = str_ref_to_owned_c(s);
44088 LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
44089 *ret_conv = SignedRawInvoice_from_str(s_conv);
44090 return tag_ptr(ret_conv, true);
44093 jstring __attribute__((export_name("TS_ParseError_to_str"))) TS_ParseError_to_str(uint64_t o) {
44094 LDKParseError* o_conv = (LDKParseError*)untag_ptr(o);
44095 LDKStr ret_str = ParseError_to_str(o_conv);
44096 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
44101 jstring __attribute__((export_name("TS_ParseOrSemanticError_to_str"))) TS_ParseOrSemanticError_to_str(uint64_t o) {
44102 LDKParseOrSemanticError* o_conv = (LDKParseOrSemanticError*)untag_ptr(o);
44103 LDKStr ret_str = ParseOrSemanticError_to_str(o_conv);
44104 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
44109 jstring __attribute__((export_name("TS_Invoice_to_str"))) TS_Invoice_to_str(uint64_t o) {
44111 o_conv.inner = untag_ptr(o);
44112 o_conv.is_owned = ptr_is_owned(o);
44113 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
44114 o_conv.is_owned = false;
44115 LDKStr ret_str = Invoice_to_str(&o_conv);
44116 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
44121 jstring __attribute__((export_name("TS_SignedRawInvoice_to_str"))) TS_SignedRawInvoice_to_str(uint64_t o) {
44122 LDKSignedRawInvoice o_conv;
44123 o_conv.inner = untag_ptr(o);
44124 o_conv.is_owned = ptr_is_owned(o);
44125 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
44126 o_conv.is_owned = false;
44127 LDKStr ret_str = SignedRawInvoice_to_str(&o_conv);
44128 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
44133 jstring __attribute__((export_name("TS_Currency_to_str"))) TS_Currency_to_str(uint64_t o) {
44134 LDKCurrency* o_conv = (LDKCurrency*)untag_ptr(o);
44135 LDKStr ret_str = Currency_to_str(o_conv);
44136 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
44141 jstring __attribute__((export_name("TS_SiPrefix_to_str"))) TS_SiPrefix_to_str(uint64_t o) {
44142 LDKSiPrefix* o_conv = (LDKSiPrefix*)untag_ptr(o);
44143 LDKStr ret_str = SiPrefix_to_str(o_conv);
44144 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);