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 CHECK(owner->result_ok);
497 return CounterpartyCommitmentSecrets_clone(&*owner->contents.result);
499 uint64_t __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_ok"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_ok(uint64_t owner) {
500 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(owner);
501 LDKCounterpartyCommitmentSecrets ret_var = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_ok(owner_conv);
502 uint64_t ret_ref = 0;
503 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
504 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
508 static inline struct LDKDecodeError CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR owner){
509 CHECK(!owner->result_ok);
510 return DecodeError_clone(&*owner->contents.err);
512 uint64_t __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err(uint64_t owner) {
513 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(owner);
514 LDKDecodeError ret_var = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_get_err(owner_conv);
515 uint64_t ret_ref = 0;
516 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
517 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
521 static inline struct LDKSecretKey CResult_SecretKeyErrorZ_get_ok(LDKCResult_SecretKeyErrorZ *NONNULL_PTR owner){
522 CHECK(owner->result_ok);
523 return *owner->contents.result;
525 int8_tArray __attribute__((export_name("TS_CResult_SecretKeyErrorZ_get_ok"))) TS_CResult_SecretKeyErrorZ_get_ok(uint64_t owner) {
526 LDKCResult_SecretKeyErrorZ* owner_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(owner);
527 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
528 memcpy(ret_arr->elems, CResult_SecretKeyErrorZ_get_ok(owner_conv).bytes, 32);
532 static inline enum LDKSecp256k1Error CResult_SecretKeyErrorZ_get_err(LDKCResult_SecretKeyErrorZ *NONNULL_PTR owner){
533 CHECK(!owner->result_ok);
534 return *owner->contents.err;
536 uint32_t __attribute__((export_name("TS_CResult_SecretKeyErrorZ_get_err"))) TS_CResult_SecretKeyErrorZ_get_err(uint64_t owner) {
537 LDKCResult_SecretKeyErrorZ* owner_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(owner);
538 uint32_t ret_conv = LDKSecp256k1Error_to_js(CResult_SecretKeyErrorZ_get_err(owner_conv));
542 static inline struct LDKPublicKey CResult_PublicKeyErrorZ_get_ok(LDKCResult_PublicKeyErrorZ *NONNULL_PTR owner){
543 CHECK(owner->result_ok);
544 return *owner->contents.result;
546 int8_tArray __attribute__((export_name("TS_CResult_PublicKeyErrorZ_get_ok"))) TS_CResult_PublicKeyErrorZ_get_ok(uint64_t owner) {
547 LDKCResult_PublicKeyErrorZ* owner_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(owner);
548 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
549 memcpy(ret_arr->elems, CResult_PublicKeyErrorZ_get_ok(owner_conv).compressed_form, 33);
553 static inline enum LDKSecp256k1Error CResult_PublicKeyErrorZ_get_err(LDKCResult_PublicKeyErrorZ *NONNULL_PTR owner){
554 CHECK(!owner->result_ok);
555 return *owner->contents.err;
557 uint32_t __attribute__((export_name("TS_CResult_PublicKeyErrorZ_get_err"))) TS_CResult_PublicKeyErrorZ_get_err(uint64_t owner) {
558 LDKCResult_PublicKeyErrorZ* owner_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(owner);
559 uint32_t ret_conv = LDKSecp256k1Error_to_js(CResult_PublicKeyErrorZ_get_err(owner_conv));
563 static inline struct LDKTxCreationKeys CResult_TxCreationKeysDecodeErrorZ_get_ok(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR owner){
564 CHECK(owner->result_ok);
565 return TxCreationKeys_clone(&*owner->contents.result);
567 uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_get_ok"))) TS_CResult_TxCreationKeysDecodeErrorZ_get_ok(uint64_t owner) {
568 LDKCResult_TxCreationKeysDecodeErrorZ* owner_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(owner);
569 LDKTxCreationKeys ret_var = CResult_TxCreationKeysDecodeErrorZ_get_ok(owner_conv);
570 uint64_t ret_ref = 0;
571 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
572 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
576 static inline struct LDKDecodeError CResult_TxCreationKeysDecodeErrorZ_get_err(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR owner){
577 CHECK(!owner->result_ok);
578 return DecodeError_clone(&*owner->contents.err);
580 uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_get_err"))) TS_CResult_TxCreationKeysDecodeErrorZ_get_err(uint64_t owner) {
581 LDKCResult_TxCreationKeysDecodeErrorZ* owner_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(owner);
582 LDKDecodeError ret_var = CResult_TxCreationKeysDecodeErrorZ_get_err(owner_conv);
583 uint64_t ret_ref = 0;
584 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
585 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
589 static inline struct LDKChannelPublicKeys CResult_ChannelPublicKeysDecodeErrorZ_get_ok(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR owner){
590 CHECK(owner->result_ok);
591 return ChannelPublicKeys_clone(&*owner->contents.result);
593 uint64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_get_ok"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_get_ok(uint64_t owner) {
594 LDKCResult_ChannelPublicKeysDecodeErrorZ* owner_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(owner);
595 LDKChannelPublicKeys ret_var = CResult_ChannelPublicKeysDecodeErrorZ_get_ok(owner_conv);
596 uint64_t ret_ref = 0;
597 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
598 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
602 static inline struct LDKDecodeError CResult_ChannelPublicKeysDecodeErrorZ_get_err(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR owner){
603 CHECK(!owner->result_ok);
604 return DecodeError_clone(&*owner->contents.err);
606 uint64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_get_err"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_get_err(uint64_t owner) {
607 LDKCResult_ChannelPublicKeysDecodeErrorZ* owner_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(owner);
608 LDKDecodeError ret_var = CResult_ChannelPublicKeysDecodeErrorZ_get_err(owner_conv);
609 uint64_t ret_ref = 0;
610 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
611 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
615 static inline struct LDKTxCreationKeys CResult_TxCreationKeysErrorZ_get_ok(LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR owner){
616 CHECK(owner->result_ok);
617 return TxCreationKeys_clone(&*owner->contents.result);
619 uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_get_ok"))) TS_CResult_TxCreationKeysErrorZ_get_ok(uint64_t owner) {
620 LDKCResult_TxCreationKeysErrorZ* owner_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(owner);
621 LDKTxCreationKeys ret_var = CResult_TxCreationKeysErrorZ_get_ok(owner_conv);
622 uint64_t ret_ref = 0;
623 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
624 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
628 static inline enum LDKSecp256k1Error CResult_TxCreationKeysErrorZ_get_err(LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR owner){
629 CHECK(!owner->result_ok);
630 return *owner->contents.err;
632 uint32_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_get_err"))) TS_CResult_TxCreationKeysErrorZ_get_err(uint64_t owner) {
633 LDKCResult_TxCreationKeysErrorZ* owner_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(owner);
634 uint32_t ret_conv = LDKSecp256k1Error_to_js(CResult_TxCreationKeysErrorZ_get_err(owner_conv));
638 uint32_t __attribute__((export_name("TS_LDKCOption_u32Z_ty_from_ptr"))) TS_LDKCOption_u32Z_ty_from_ptr(uint64_t ptr) {
639 LDKCOption_u32Z *obj = (LDKCOption_u32Z*)untag_ptr(ptr);
641 case LDKCOption_u32Z_Some: return 0;
642 case LDKCOption_u32Z_None: return 1;
646 int32_t __attribute__((export_name("TS_LDKCOption_u32Z_Some_get_some"))) TS_LDKCOption_u32Z_Some_get_some(uint64_t ptr) {
647 LDKCOption_u32Z *obj = (LDKCOption_u32Z*)untag_ptr(ptr);
648 assert(obj->tag == LDKCOption_u32Z_Some);
649 int32_t some_conv = obj->some;
652 static inline struct LDKHTLCOutputInCommitment CResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR owner){
653 CHECK(owner->result_ok);
654 return HTLCOutputInCommitment_clone(&*owner->contents.result);
656 uint64_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok(uint64_t owner) {
657 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* owner_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(owner);
658 LDKHTLCOutputInCommitment ret_var = CResult_HTLCOutputInCommitmentDecodeErrorZ_get_ok(owner_conv);
659 uint64_t ret_ref = 0;
660 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
661 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
665 static inline struct LDKDecodeError CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR owner){
666 CHECK(!owner->result_ok);
667 return DecodeError_clone(&*owner->contents.err);
669 uint64_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(uint64_t owner) {
670 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* owner_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(owner);
671 LDKDecodeError ret_var = CResult_HTLCOutputInCommitmentDecodeErrorZ_get_err(owner_conv);
672 uint64_t ret_ref = 0;
673 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
674 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
678 static inline struct LDKCounterpartyChannelTransactionParameters CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner){
679 CHECK(owner->result_ok);
680 return CounterpartyChannelTransactionParameters_clone(&*owner->contents.result);
682 uint64_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok(uint64_t owner) {
683 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(owner);
684 LDKCounterpartyChannelTransactionParameters ret_var = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_ok(owner_conv);
685 uint64_t ret_ref = 0;
686 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
687 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
691 static inline struct LDKDecodeError CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner){
692 CHECK(!owner->result_ok);
693 return DecodeError_clone(&*owner->contents.err);
695 uint64_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(uint64_t owner) {
696 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(owner);
697 LDKDecodeError ret_var = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_get_err(owner_conv);
698 uint64_t ret_ref = 0;
699 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
700 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
704 static inline struct LDKChannelTransactionParameters CResult_ChannelTransactionParametersDecodeErrorZ_get_ok(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner){
705 CHECK(owner->result_ok);
706 return ChannelTransactionParameters_clone(&*owner->contents.result);
708 uint64_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_get_ok"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_get_ok(uint64_t owner) {
709 LDKCResult_ChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(owner);
710 LDKChannelTransactionParameters ret_var = CResult_ChannelTransactionParametersDecodeErrorZ_get_ok(owner_conv);
711 uint64_t ret_ref = 0;
712 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
713 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
717 static inline struct LDKDecodeError CResult_ChannelTransactionParametersDecodeErrorZ_get_err(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR owner){
718 CHECK(!owner->result_ok);
719 return DecodeError_clone(&*owner->contents.err);
721 uint64_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_get_err"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_get_err(uint64_t owner) {
722 LDKCResult_ChannelTransactionParametersDecodeErrorZ* owner_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(owner);
723 LDKDecodeError ret_var = CResult_ChannelTransactionParametersDecodeErrorZ_get_err(owner_conv);
724 uint64_t ret_ref = 0;
725 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
726 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
730 static inline struct LDKHolderCommitmentTransaction CResult_HolderCommitmentTransactionDecodeErrorZ_get_ok(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
731 CHECK(owner->result_ok);
732 return HolderCommitmentTransaction_clone(&*owner->contents.result);
734 uint64_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_get_ok"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_get_ok(uint64_t owner) {
735 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
736 LDKHolderCommitmentTransaction ret_var = CResult_HolderCommitmentTransactionDecodeErrorZ_get_ok(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 LDKDecodeError CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
744 CHECK(!owner->result_ok);
745 return DecodeError_clone(&*owner->contents.err);
747 uint64_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_get_err"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(uint64_t owner) {
748 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
749 LDKDecodeError ret_var = CResult_HolderCommitmentTransactionDecodeErrorZ_get_err(owner_conv);
750 uint64_t ret_ref = 0;
751 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
752 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
756 static inline struct LDKBuiltCommitmentTransaction CResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
757 CHECK(owner->result_ok);
758 return BuiltCommitmentTransaction_clone(&*owner->contents.result);
760 uint64_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok(uint64_t owner) {
761 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
762 LDKBuiltCommitmentTransaction ret_var = CResult_BuiltCommitmentTransactionDecodeErrorZ_get_ok(owner_conv);
763 uint64_t ret_ref = 0;
764 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
765 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
769 static inline struct LDKDecodeError CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
770 CHECK(!owner->result_ok);
771 return DecodeError_clone(&*owner->contents.err);
773 uint64_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(uint64_t owner) {
774 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
775 LDKDecodeError ret_var = CResult_BuiltCommitmentTransactionDecodeErrorZ_get_err(owner_conv);
776 uint64_t ret_ref = 0;
777 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
778 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
782 static inline struct LDKTrustedClosingTransaction *CResult_TrustedClosingTransactionNoneZ_get_ok(LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR owner){
783 CHECK(owner->result_ok);
784 return &*owner->contents.result;
786 uint64_t __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_get_ok"))) TS_CResult_TrustedClosingTransactionNoneZ_get_ok(uint64_t owner) {
787 LDKCResult_TrustedClosingTransactionNoneZ* owner_conv = (LDKCResult_TrustedClosingTransactionNoneZ*)untag_ptr(owner);
788 LDKTrustedClosingTransaction ret_var = *CResult_TrustedClosingTransactionNoneZ_get_ok(owner_conv);
789 uint64_t ret_ref = 0;
790 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
791 ret_ref = tag_ptr(ret_var.inner, false);
795 static inline void CResult_TrustedClosingTransactionNoneZ_get_err(LDKCResult_TrustedClosingTransactionNoneZ *NONNULL_PTR owner){
796 CHECK(!owner->result_ok);
797 return *owner->contents.err;
799 void __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_get_err"))) TS_CResult_TrustedClosingTransactionNoneZ_get_err(uint64_t owner) {
800 LDKCResult_TrustedClosingTransactionNoneZ* owner_conv = (LDKCResult_TrustedClosingTransactionNoneZ*)untag_ptr(owner);
801 CResult_TrustedClosingTransactionNoneZ_get_err(owner_conv);
804 static inline struct LDKCommitmentTransaction CResult_CommitmentTransactionDecodeErrorZ_get_ok(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
805 CHECK(owner->result_ok);
806 return CommitmentTransaction_clone(&*owner->contents.result);
808 uint64_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_get_ok"))) TS_CResult_CommitmentTransactionDecodeErrorZ_get_ok(uint64_t owner) {
809 LDKCResult_CommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
810 LDKCommitmentTransaction ret_var = CResult_CommitmentTransactionDecodeErrorZ_get_ok(owner_conv);
811 uint64_t ret_ref = 0;
812 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
813 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
817 static inline struct LDKDecodeError CResult_CommitmentTransactionDecodeErrorZ_get_err(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR owner){
818 CHECK(!owner->result_ok);
819 return DecodeError_clone(&*owner->contents.err);
821 uint64_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_get_err"))) TS_CResult_CommitmentTransactionDecodeErrorZ_get_err(uint64_t owner) {
822 LDKCResult_CommitmentTransactionDecodeErrorZ* owner_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(owner);
823 LDKDecodeError ret_var = CResult_CommitmentTransactionDecodeErrorZ_get_err(owner_conv);
824 uint64_t ret_ref = 0;
825 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
826 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
830 static inline struct LDKTrustedCommitmentTransaction *CResult_TrustedCommitmentTransactionNoneZ_get_ok(LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR owner){
831 CHECK(owner->result_ok);
832 return &*owner->contents.result;
834 uint64_t __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNoneZ_get_ok"))) TS_CResult_TrustedCommitmentTransactionNoneZ_get_ok(uint64_t owner) {
835 LDKCResult_TrustedCommitmentTransactionNoneZ* owner_conv = (LDKCResult_TrustedCommitmentTransactionNoneZ*)untag_ptr(owner);
836 LDKTrustedCommitmentTransaction ret_var = *CResult_TrustedCommitmentTransactionNoneZ_get_ok(owner_conv);
837 uint64_t ret_ref = 0;
838 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
839 ret_ref = tag_ptr(ret_var.inner, false);
843 static inline void CResult_TrustedCommitmentTransactionNoneZ_get_err(LDKCResult_TrustedCommitmentTransactionNoneZ *NONNULL_PTR owner){
844 CHECK(!owner->result_ok);
845 return *owner->contents.err;
847 void __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNoneZ_get_err"))) TS_CResult_TrustedCommitmentTransactionNoneZ_get_err(uint64_t owner) {
848 LDKCResult_TrustedCommitmentTransactionNoneZ* owner_conv = (LDKCResult_TrustedCommitmentTransactionNoneZ*)untag_ptr(owner);
849 CResult_TrustedCommitmentTransactionNoneZ_get_err(owner_conv);
852 static inline struct LDKCVec_SignatureZ CResult_CVec_SignatureZNoneZ_get_ok(LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR owner){
853 CHECK(owner->result_ok);
854 return *owner->contents.result;
856 ptrArray __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_get_ok"))) TS_CResult_CVec_SignatureZNoneZ_get_ok(uint64_t owner) {
857 LDKCResult_CVec_SignatureZNoneZ* owner_conv = (LDKCResult_CVec_SignatureZNoneZ*)untag_ptr(owner);
858 LDKCVec_SignatureZ ret_var = CResult_CVec_SignatureZNoneZ_get_ok(owner_conv);
859 ptrArray ret_arr = NULL;
860 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
861 int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8);
862 for (size_t m = 0; m < ret_var.datalen; m++) {
863 int8_tArray ret_conv_12_arr = init_int8_tArray(64, __LINE__);
864 memcpy(ret_conv_12_arr->elems, ret_var.data[m].compact_form, 64);
865 ret_arr_ptr[m] = ret_conv_12_arr;
871 static inline void CResult_CVec_SignatureZNoneZ_get_err(LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR owner){
872 CHECK(!owner->result_ok);
873 return *owner->contents.err;
875 void __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_get_err"))) TS_CResult_CVec_SignatureZNoneZ_get_err(uint64_t owner) {
876 LDKCResult_CVec_SignatureZNoneZ* owner_conv = (LDKCResult_CVec_SignatureZNoneZ*)untag_ptr(owner);
877 CResult_CVec_SignatureZNoneZ_get_err(owner_conv);
880 static inline struct LDKShutdownScript CResult_ShutdownScriptDecodeErrorZ_get_ok(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR owner){
881 CHECK(owner->result_ok);
882 return ShutdownScript_clone(&*owner->contents.result);
884 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_get_ok"))) TS_CResult_ShutdownScriptDecodeErrorZ_get_ok(uint64_t owner) {
885 LDKCResult_ShutdownScriptDecodeErrorZ* owner_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(owner);
886 LDKShutdownScript ret_var = CResult_ShutdownScriptDecodeErrorZ_get_ok(owner_conv);
887 uint64_t ret_ref = 0;
888 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
889 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
893 static inline struct LDKDecodeError CResult_ShutdownScriptDecodeErrorZ_get_err(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR owner){
894 CHECK(!owner->result_ok);
895 return DecodeError_clone(&*owner->contents.err);
897 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_get_err"))) TS_CResult_ShutdownScriptDecodeErrorZ_get_err(uint64_t owner) {
898 LDKCResult_ShutdownScriptDecodeErrorZ* owner_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(owner);
899 LDKDecodeError ret_var = CResult_ShutdownScriptDecodeErrorZ_get_err(owner_conv);
900 uint64_t ret_ref = 0;
901 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
902 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
906 static inline struct LDKShutdownScript CResult_ShutdownScriptInvalidShutdownScriptZ_get_ok(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR owner){
907 CHECK(owner->result_ok);
908 return ShutdownScript_clone(&*owner->contents.result);
910 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_get_ok"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_get_ok(uint64_t owner) {
911 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* owner_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(owner);
912 LDKShutdownScript ret_var = CResult_ShutdownScriptInvalidShutdownScriptZ_get_ok(owner_conv);
913 uint64_t ret_ref = 0;
914 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
915 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
919 static inline struct LDKInvalidShutdownScript CResult_ShutdownScriptInvalidShutdownScriptZ_get_err(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR owner){
920 CHECK(!owner->result_ok);
921 return InvalidShutdownScript_clone(&*owner->contents.err);
923 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_get_err"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_get_err(uint64_t owner) {
924 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* owner_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(owner);
925 LDKInvalidShutdownScript ret_var = CResult_ShutdownScriptInvalidShutdownScriptZ_get_err(owner_conv);
926 uint64_t ret_ref = 0;
927 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
928 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
932 static inline struct LDKRouteHop CResult_RouteHopDecodeErrorZ_get_ok(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR owner){
933 CHECK(owner->result_ok);
934 return RouteHop_clone(&*owner->contents.result);
936 uint64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_get_ok"))) TS_CResult_RouteHopDecodeErrorZ_get_ok(uint64_t owner) {
937 LDKCResult_RouteHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(owner);
938 LDKRouteHop ret_var = CResult_RouteHopDecodeErrorZ_get_ok(owner_conv);
939 uint64_t ret_ref = 0;
940 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
941 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
945 static inline struct LDKDecodeError CResult_RouteHopDecodeErrorZ_get_err(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR owner){
946 CHECK(!owner->result_ok);
947 return DecodeError_clone(&*owner->contents.err);
949 uint64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_get_err"))) TS_CResult_RouteHopDecodeErrorZ_get_err(uint64_t owner) {
950 LDKCResult_RouteHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(owner);
951 LDKDecodeError ret_var = CResult_RouteHopDecodeErrorZ_get_err(owner_conv);
952 uint64_t ret_ref = 0;
953 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
954 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
958 static inline LDKCVec_RouteHopZ CVec_RouteHopZ_clone(const LDKCVec_RouteHopZ *orig) {
959 LDKCVec_RouteHopZ ret = { .data = MALLOC(sizeof(LDKRouteHop) * orig->datalen, "LDKCVec_RouteHopZ clone bytes"), .datalen = orig->datalen };
960 for (size_t i = 0; i < ret.datalen; i++) {
961 ret.data[i] = RouteHop_clone(&orig->data[i]);
965 static inline LDKCVec_CVec_RouteHopZZ CVec_CVec_RouteHopZZ_clone(const LDKCVec_CVec_RouteHopZZ *orig) {
966 LDKCVec_CVec_RouteHopZZ ret = { .data = MALLOC(sizeof(LDKCVec_RouteHopZ) * orig->datalen, "LDKCVec_CVec_RouteHopZZ clone bytes"), .datalen = orig->datalen };
967 for (size_t i = 0; i < ret.datalen; i++) {
968 ret.data[i] = CVec_RouteHopZ_clone(&orig->data[i]);
972 static inline struct LDKRoute CResult_RouteDecodeErrorZ_get_ok(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR owner){
973 CHECK(owner->result_ok);
974 return Route_clone(&*owner->contents.result);
976 uint64_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_get_ok"))) TS_CResult_RouteDecodeErrorZ_get_ok(uint64_t owner) {
977 LDKCResult_RouteDecodeErrorZ* owner_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(owner);
978 LDKRoute ret_var = CResult_RouteDecodeErrorZ_get_ok(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 struct LDKDecodeError CResult_RouteDecodeErrorZ_get_err(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR owner){
986 CHECK(!owner->result_ok);
987 return DecodeError_clone(&*owner->contents.err);
989 uint64_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_get_err"))) TS_CResult_RouteDecodeErrorZ_get_err(uint64_t owner) {
990 LDKCResult_RouteDecodeErrorZ* owner_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(owner);
991 LDKDecodeError ret_var = CResult_RouteDecodeErrorZ_get_err(owner_conv);
992 uint64_t ret_ref = 0;
993 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
994 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
998 static inline struct LDKRouteParameters CResult_RouteParametersDecodeErrorZ_get_ok(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR owner){
999 CHECK(owner->result_ok);
1000 return RouteParameters_clone(&*owner->contents.result);
1002 uint64_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_get_ok"))) TS_CResult_RouteParametersDecodeErrorZ_get_ok(uint64_t owner) {
1003 LDKCResult_RouteParametersDecodeErrorZ* owner_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(owner);
1004 LDKRouteParameters ret_var = CResult_RouteParametersDecodeErrorZ_get_ok(owner_conv);
1005 uint64_t ret_ref = 0;
1006 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1007 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1011 static inline struct LDKDecodeError CResult_RouteParametersDecodeErrorZ_get_err(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR owner){
1012 CHECK(!owner->result_ok);
1013 return DecodeError_clone(&*owner->contents.err);
1015 uint64_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_get_err"))) TS_CResult_RouteParametersDecodeErrorZ_get_err(uint64_t owner) {
1016 LDKCResult_RouteParametersDecodeErrorZ* owner_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(owner);
1017 LDKDecodeError ret_var = CResult_RouteParametersDecodeErrorZ_get_err(owner_conv);
1018 uint64_t ret_ref = 0;
1019 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1020 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1024 static inline LDKCVec_RouteHintZ CVec_RouteHintZ_clone(const LDKCVec_RouteHintZ *orig) {
1025 LDKCVec_RouteHintZ ret = { .data = MALLOC(sizeof(LDKRouteHint) * orig->datalen, "LDKCVec_RouteHintZ clone bytes"), .datalen = orig->datalen };
1026 for (size_t i = 0; i < ret.datalen; i++) {
1027 ret.data[i] = RouteHint_clone(&orig->data[i]);
1031 uint32_t __attribute__((export_name("TS_LDKCOption_u64Z_ty_from_ptr"))) TS_LDKCOption_u64Z_ty_from_ptr(uint64_t ptr) {
1032 LDKCOption_u64Z *obj = (LDKCOption_u64Z*)untag_ptr(ptr);
1034 case LDKCOption_u64Z_Some: return 0;
1035 case LDKCOption_u64Z_None: return 1;
1039 int64_t __attribute__((export_name("TS_LDKCOption_u64Z_Some_get_some"))) TS_LDKCOption_u64Z_Some_get_some(uint64_t ptr) {
1040 LDKCOption_u64Z *obj = (LDKCOption_u64Z*)untag_ptr(ptr);
1041 assert(obj->tag == LDKCOption_u64Z_Some);
1042 int64_t some_conv = obj->some;
1045 static inline LDKCVec_u64Z CVec_u64Z_clone(const LDKCVec_u64Z *orig) {
1046 LDKCVec_u64Z ret = { .data = MALLOC(sizeof(int64_t) * orig->datalen, "LDKCVec_u64Z clone bytes"), .datalen = orig->datalen };
1047 memcpy(ret.data, orig->data, sizeof(int64_t) * ret.datalen);
1050 static inline struct LDKPaymentParameters CResult_PaymentParametersDecodeErrorZ_get_ok(LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR owner){
1051 CHECK(owner->result_ok);
1052 return PaymentParameters_clone(&*owner->contents.result);
1054 uint64_t __attribute__((export_name("TS_CResult_PaymentParametersDecodeErrorZ_get_ok"))) TS_CResult_PaymentParametersDecodeErrorZ_get_ok(uint64_t owner) {
1055 LDKCResult_PaymentParametersDecodeErrorZ* owner_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(owner);
1056 LDKPaymentParameters ret_var = CResult_PaymentParametersDecodeErrorZ_get_ok(owner_conv);
1057 uint64_t ret_ref = 0;
1058 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1059 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1063 static inline struct LDKDecodeError CResult_PaymentParametersDecodeErrorZ_get_err(LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR owner){
1064 CHECK(!owner->result_ok);
1065 return DecodeError_clone(&*owner->contents.err);
1067 uint64_t __attribute__((export_name("TS_CResult_PaymentParametersDecodeErrorZ_get_err"))) TS_CResult_PaymentParametersDecodeErrorZ_get_err(uint64_t owner) {
1068 LDKCResult_PaymentParametersDecodeErrorZ* owner_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(owner);
1069 LDKDecodeError ret_var = CResult_PaymentParametersDecodeErrorZ_get_err(owner_conv);
1070 uint64_t ret_ref = 0;
1071 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1072 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1076 static inline LDKCVec_RouteHintHopZ CVec_RouteHintHopZ_clone(const LDKCVec_RouteHintHopZ *orig) {
1077 LDKCVec_RouteHintHopZ ret = { .data = MALLOC(sizeof(LDKRouteHintHop) * orig->datalen, "LDKCVec_RouteHintHopZ clone bytes"), .datalen = orig->datalen };
1078 for (size_t i = 0; i < ret.datalen; i++) {
1079 ret.data[i] = RouteHintHop_clone(&orig->data[i]);
1083 static inline struct LDKRouteHint CResult_RouteHintDecodeErrorZ_get_ok(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR owner){
1084 CHECK(owner->result_ok);
1085 return RouteHint_clone(&*owner->contents.result);
1087 uint64_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_get_ok"))) TS_CResult_RouteHintDecodeErrorZ_get_ok(uint64_t owner) {
1088 LDKCResult_RouteHintDecodeErrorZ* owner_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(owner);
1089 LDKRouteHint ret_var = CResult_RouteHintDecodeErrorZ_get_ok(owner_conv);
1090 uint64_t ret_ref = 0;
1091 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1092 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1096 static inline struct LDKDecodeError CResult_RouteHintDecodeErrorZ_get_err(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR owner){
1097 CHECK(!owner->result_ok);
1098 return DecodeError_clone(&*owner->contents.err);
1100 uint64_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_get_err"))) TS_CResult_RouteHintDecodeErrorZ_get_err(uint64_t owner) {
1101 LDKCResult_RouteHintDecodeErrorZ* owner_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(owner);
1102 LDKDecodeError ret_var = CResult_RouteHintDecodeErrorZ_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 struct LDKRouteHintHop CResult_RouteHintHopDecodeErrorZ_get_ok(LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR owner){
1110 CHECK(owner->result_ok);
1111 return RouteHintHop_clone(&*owner->contents.result);
1113 uint64_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_get_ok"))) TS_CResult_RouteHintHopDecodeErrorZ_get_ok(uint64_t owner) {
1114 LDKCResult_RouteHintHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(owner);
1115 LDKRouteHintHop ret_var = CResult_RouteHintHopDecodeErrorZ_get_ok(owner_conv);
1116 uint64_t ret_ref = 0;
1117 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1118 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1122 static inline struct LDKDecodeError CResult_RouteHintHopDecodeErrorZ_get_err(LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR owner){
1123 CHECK(!owner->result_ok);
1124 return DecodeError_clone(&*owner->contents.err);
1126 uint64_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_get_err"))) TS_CResult_RouteHintHopDecodeErrorZ_get_err(uint64_t owner) {
1127 LDKCResult_RouteHintHopDecodeErrorZ* owner_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(owner);
1128 LDKDecodeError ret_var = CResult_RouteHintHopDecodeErrorZ_get_err(owner_conv);
1129 uint64_t ret_ref = 0;
1130 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1131 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1135 static inline LDKCVec_ChannelDetailsZ CVec_ChannelDetailsZ_clone(const LDKCVec_ChannelDetailsZ *orig) {
1136 LDKCVec_ChannelDetailsZ ret = { .data = MALLOC(sizeof(LDKChannelDetails) * orig->datalen, "LDKCVec_ChannelDetailsZ clone bytes"), .datalen = orig->datalen };
1137 for (size_t i = 0; i < ret.datalen; i++) {
1138 ret.data[i] = ChannelDetails_clone(&orig->data[i]);
1142 static inline struct LDKRoute CResult_RouteLightningErrorZ_get_ok(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner){
1143 CHECK(owner->result_ok);
1144 return Route_clone(&*owner->contents.result);
1146 uint64_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_get_ok"))) TS_CResult_RouteLightningErrorZ_get_ok(uint64_t owner) {
1147 LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(owner);
1148 LDKRoute ret_var = CResult_RouteLightningErrorZ_get_ok(owner_conv);
1149 uint64_t ret_ref = 0;
1150 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1151 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1155 static inline struct LDKLightningError CResult_RouteLightningErrorZ_get_err(LDKCResult_RouteLightningErrorZ *NONNULL_PTR owner){
1156 CHECK(!owner->result_ok);
1157 return LightningError_clone(&*owner->contents.err);
1159 uint64_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_get_err"))) TS_CResult_RouteLightningErrorZ_get_err(uint64_t owner) {
1160 LDKCResult_RouteLightningErrorZ* owner_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(owner);
1161 LDKLightningError ret_var = CResult_RouteLightningErrorZ_get_err(owner_conv);
1162 uint64_t ret_ref = 0;
1163 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1164 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1168 uint32_t __attribute__((export_name("TS_LDKPaymentPurpose_ty_from_ptr"))) TS_LDKPaymentPurpose_ty_from_ptr(uint64_t ptr) {
1169 LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr);
1171 case LDKPaymentPurpose_InvoicePayment: return 0;
1172 case LDKPaymentPurpose_SpontaneousPayment: return 1;
1176 int8_tArray __attribute__((export_name("TS_LDKPaymentPurpose_InvoicePayment_get_payment_preimage"))) TS_LDKPaymentPurpose_InvoicePayment_get_payment_preimage(uint64_t ptr) {
1177 LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr);
1178 assert(obj->tag == LDKPaymentPurpose_InvoicePayment);
1179 int8_tArray payment_preimage_arr = init_int8_tArray(32, __LINE__);
1180 memcpy(payment_preimage_arr->elems, obj->invoice_payment.payment_preimage.data, 32);
1181 return payment_preimage_arr;
1183 int8_tArray __attribute__((export_name("TS_LDKPaymentPurpose_InvoicePayment_get_payment_secret"))) TS_LDKPaymentPurpose_InvoicePayment_get_payment_secret(uint64_t ptr) {
1184 LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr);
1185 assert(obj->tag == LDKPaymentPurpose_InvoicePayment);
1186 int8_tArray payment_secret_arr = init_int8_tArray(32, __LINE__);
1187 memcpy(payment_secret_arr->elems, obj->invoice_payment.payment_secret.data, 32);
1188 return payment_secret_arr;
1190 int8_tArray __attribute__((export_name("TS_LDKPaymentPurpose_SpontaneousPayment_get_spontaneous_payment"))) TS_LDKPaymentPurpose_SpontaneousPayment_get_spontaneous_payment(uint64_t ptr) {
1191 LDKPaymentPurpose *obj = (LDKPaymentPurpose*)untag_ptr(ptr);
1192 assert(obj->tag == LDKPaymentPurpose_SpontaneousPayment);
1193 int8_tArray spontaneous_payment_arr = init_int8_tArray(32, __LINE__);
1194 memcpy(spontaneous_payment_arr->elems, obj->spontaneous_payment.data, 32);
1195 return spontaneous_payment_arr;
1197 static inline struct LDKPaymentPurpose CResult_PaymentPurposeDecodeErrorZ_get_ok(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR owner){
1198 CHECK(owner->result_ok);
1199 return PaymentPurpose_clone(&*owner->contents.result);
1201 uint64_t __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_get_ok"))) TS_CResult_PaymentPurposeDecodeErrorZ_get_ok(uint64_t owner) {
1202 LDKCResult_PaymentPurposeDecodeErrorZ* owner_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(owner);
1203 LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
1204 *ret_copy = CResult_PaymentPurposeDecodeErrorZ_get_ok(owner_conv);
1205 uint64_t ret_ref = tag_ptr(ret_copy, true);
1209 static inline struct LDKDecodeError CResult_PaymentPurposeDecodeErrorZ_get_err(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR owner){
1210 CHECK(!owner->result_ok);
1211 return DecodeError_clone(&*owner->contents.err);
1213 uint64_t __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_get_err"))) TS_CResult_PaymentPurposeDecodeErrorZ_get_err(uint64_t owner) {
1214 LDKCResult_PaymentPurposeDecodeErrorZ* owner_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(owner);
1215 LDKDecodeError ret_var = CResult_PaymentPurposeDecodeErrorZ_get_err(owner_conv);
1216 uint64_t ret_ref = 0;
1217 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1218 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1222 uint32_t __attribute__((export_name("TS_LDKClosureReason_ty_from_ptr"))) TS_LDKClosureReason_ty_from_ptr(uint64_t ptr) {
1223 LDKClosureReason *obj = (LDKClosureReason*)untag_ptr(ptr);
1225 case LDKClosureReason_CounterpartyForceClosed: return 0;
1226 case LDKClosureReason_HolderForceClosed: return 1;
1227 case LDKClosureReason_CooperativeClosure: return 2;
1228 case LDKClosureReason_CommitmentTxConfirmed: return 3;
1229 case LDKClosureReason_FundingTimedOut: return 4;
1230 case LDKClosureReason_ProcessingError: return 5;
1231 case LDKClosureReason_DisconnectedPeer: return 6;
1232 case LDKClosureReason_OutdatedChannelManager: return 7;
1236 jstring __attribute__((export_name("TS_LDKClosureReason_CounterpartyForceClosed_get_peer_msg"))) TS_LDKClosureReason_CounterpartyForceClosed_get_peer_msg(uint64_t ptr) {
1237 LDKClosureReason *obj = (LDKClosureReason*)untag_ptr(ptr);
1238 assert(obj->tag == LDKClosureReason_CounterpartyForceClosed);
1239 LDKStr peer_msg_str = obj->counterparty_force_closed.peer_msg;
1240 jstring peer_msg_conv = str_ref_to_ts(peer_msg_str.chars, peer_msg_str.len);
1241 return peer_msg_conv;
1243 jstring __attribute__((export_name("TS_LDKClosureReason_ProcessingError_get_err"))) TS_LDKClosureReason_ProcessingError_get_err(uint64_t ptr) {
1244 LDKClosureReason *obj = (LDKClosureReason*)untag_ptr(ptr);
1245 assert(obj->tag == LDKClosureReason_ProcessingError);
1246 LDKStr err_str = obj->processing_error.err;
1247 jstring err_conv = str_ref_to_ts(err_str.chars, err_str.len);
1250 uint32_t __attribute__((export_name("TS_LDKCOption_ClosureReasonZ_ty_from_ptr"))) TS_LDKCOption_ClosureReasonZ_ty_from_ptr(uint64_t ptr) {
1251 LDKCOption_ClosureReasonZ *obj = (LDKCOption_ClosureReasonZ*)untag_ptr(ptr);
1253 case LDKCOption_ClosureReasonZ_Some: return 0;
1254 case LDKCOption_ClosureReasonZ_None: return 1;
1258 uint64_t __attribute__((export_name("TS_LDKCOption_ClosureReasonZ_Some_get_some"))) TS_LDKCOption_ClosureReasonZ_Some_get_some(uint64_t ptr) {
1259 LDKCOption_ClosureReasonZ *obj = (LDKCOption_ClosureReasonZ*)untag_ptr(ptr);
1260 assert(obj->tag == LDKCOption_ClosureReasonZ_Some);
1261 uint64_t some_ref = tag_ptr(&obj->some, false);
1264 static inline struct LDKCOption_ClosureReasonZ CResult_COption_ClosureReasonZDecodeErrorZ_get_ok(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR owner){
1265 CHECK(owner->result_ok);
1266 return COption_ClosureReasonZ_clone(&*owner->contents.result);
1268 uint64_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_get_ok"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_get_ok(uint64_t owner) {
1269 LDKCResult_COption_ClosureReasonZDecodeErrorZ* owner_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(owner);
1270 LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
1271 *ret_copy = CResult_COption_ClosureReasonZDecodeErrorZ_get_ok(owner_conv);
1272 uint64_t ret_ref = tag_ptr(ret_copy, true);
1276 static inline struct LDKDecodeError CResult_COption_ClosureReasonZDecodeErrorZ_get_err(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR owner){
1277 CHECK(!owner->result_ok);
1278 return DecodeError_clone(&*owner->contents.err);
1280 uint64_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_get_err"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_get_err(uint64_t owner) {
1281 LDKCResult_COption_ClosureReasonZDecodeErrorZ* owner_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(owner);
1282 LDKDecodeError ret_var = CResult_COption_ClosureReasonZDecodeErrorZ_get_err(owner_conv);
1283 uint64_t ret_ref = 0;
1284 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1285 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1289 uint32_t __attribute__((export_name("TS_LDKHTLCDestination_ty_from_ptr"))) TS_LDKHTLCDestination_ty_from_ptr(uint64_t ptr) {
1290 LDKHTLCDestination *obj = (LDKHTLCDestination*)untag_ptr(ptr);
1292 case LDKHTLCDestination_NextHopChannel: return 0;
1293 case LDKHTLCDestination_UnknownNextHop: return 1;
1294 case LDKHTLCDestination_FailedPayment: return 2;
1298 int8_tArray __attribute__((export_name("TS_LDKHTLCDestination_NextHopChannel_get_node_id"))) TS_LDKHTLCDestination_NextHopChannel_get_node_id(uint64_t ptr) {
1299 LDKHTLCDestination *obj = (LDKHTLCDestination*)untag_ptr(ptr);
1300 assert(obj->tag == LDKHTLCDestination_NextHopChannel);
1301 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
1302 memcpy(node_id_arr->elems, obj->next_hop_channel.node_id.compressed_form, 33);
1305 int8_tArray __attribute__((export_name("TS_LDKHTLCDestination_NextHopChannel_get_channel_id"))) TS_LDKHTLCDestination_NextHopChannel_get_channel_id(uint64_t ptr) {
1306 LDKHTLCDestination *obj = (LDKHTLCDestination*)untag_ptr(ptr);
1307 assert(obj->tag == LDKHTLCDestination_NextHopChannel);
1308 int8_tArray channel_id_arr = init_int8_tArray(32, __LINE__);
1309 memcpy(channel_id_arr->elems, obj->next_hop_channel.channel_id.data, 32);
1310 return channel_id_arr;
1312 int64_t __attribute__((export_name("TS_LDKHTLCDestination_UnknownNextHop_get_requested_forward_scid"))) TS_LDKHTLCDestination_UnknownNextHop_get_requested_forward_scid(uint64_t ptr) {
1313 LDKHTLCDestination *obj = (LDKHTLCDestination*)untag_ptr(ptr);
1314 assert(obj->tag == LDKHTLCDestination_UnknownNextHop);
1315 int64_t requested_forward_scid_conv = obj->unknown_next_hop.requested_forward_scid;
1316 return requested_forward_scid_conv;
1318 int8_tArray __attribute__((export_name("TS_LDKHTLCDestination_FailedPayment_get_payment_hash"))) TS_LDKHTLCDestination_FailedPayment_get_payment_hash(uint64_t ptr) {
1319 LDKHTLCDestination *obj = (LDKHTLCDestination*)untag_ptr(ptr);
1320 assert(obj->tag == LDKHTLCDestination_FailedPayment);
1321 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
1322 memcpy(payment_hash_arr->elems, obj->failed_payment.payment_hash.data, 32);
1323 return payment_hash_arr;
1325 uint32_t __attribute__((export_name("TS_LDKCOption_HTLCDestinationZ_ty_from_ptr"))) TS_LDKCOption_HTLCDestinationZ_ty_from_ptr(uint64_t ptr) {
1326 LDKCOption_HTLCDestinationZ *obj = (LDKCOption_HTLCDestinationZ*)untag_ptr(ptr);
1328 case LDKCOption_HTLCDestinationZ_Some: return 0;
1329 case LDKCOption_HTLCDestinationZ_None: return 1;
1333 uint64_t __attribute__((export_name("TS_LDKCOption_HTLCDestinationZ_Some_get_some"))) TS_LDKCOption_HTLCDestinationZ_Some_get_some(uint64_t ptr) {
1334 LDKCOption_HTLCDestinationZ *obj = (LDKCOption_HTLCDestinationZ*)untag_ptr(ptr);
1335 assert(obj->tag == LDKCOption_HTLCDestinationZ_Some);
1336 uint64_t some_ref = tag_ptr(&obj->some, false);
1339 static inline struct LDKCOption_HTLCDestinationZ CResult_COption_HTLCDestinationZDecodeErrorZ_get_ok(LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR owner){
1340 CHECK(owner->result_ok);
1341 return COption_HTLCDestinationZ_clone(&*owner->contents.result);
1343 uint64_t __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_get_ok"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_get_ok(uint64_t owner) {
1344 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* owner_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(owner);
1345 LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ");
1346 *ret_copy = CResult_COption_HTLCDestinationZDecodeErrorZ_get_ok(owner_conv);
1347 uint64_t ret_ref = tag_ptr(ret_copy, true);
1351 static inline struct LDKDecodeError CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR owner){
1352 CHECK(!owner->result_ok);
1353 return DecodeError_clone(&*owner->contents.err);
1355 uint64_t __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_get_err"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(uint64_t owner) {
1356 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* owner_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(owner);
1357 LDKDecodeError ret_var = CResult_COption_HTLCDestinationZDecodeErrorZ_get_err(owner_conv);
1358 uint64_t ret_ref = 0;
1359 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1360 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1364 uint32_t __attribute__((export_name("TS_LDKNetworkUpdate_ty_from_ptr"))) TS_LDKNetworkUpdate_ty_from_ptr(uint64_t ptr) {
1365 LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr);
1367 case LDKNetworkUpdate_ChannelUpdateMessage: return 0;
1368 case LDKNetworkUpdate_ChannelFailure: return 1;
1369 case LDKNetworkUpdate_NodeFailure: return 2;
1373 uint64_t __attribute__((export_name("TS_LDKNetworkUpdate_ChannelUpdateMessage_get_msg"))) TS_LDKNetworkUpdate_ChannelUpdateMessage_get_msg(uint64_t ptr) {
1374 LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr);
1375 assert(obj->tag == LDKNetworkUpdate_ChannelUpdateMessage);
1376 LDKChannelUpdate msg_var = obj->channel_update_message.msg;
1377 uint64_t msg_ref = 0;
1378 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
1379 msg_ref = tag_ptr(msg_var.inner, false);
1382 int64_t __attribute__((export_name("TS_LDKNetworkUpdate_ChannelFailure_get_short_channel_id"))) TS_LDKNetworkUpdate_ChannelFailure_get_short_channel_id(uint64_t ptr) {
1383 LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr);
1384 assert(obj->tag == LDKNetworkUpdate_ChannelFailure);
1385 int64_t short_channel_id_conv = obj->channel_failure.short_channel_id;
1386 return short_channel_id_conv;
1388 jboolean __attribute__((export_name("TS_LDKNetworkUpdate_ChannelFailure_get_is_permanent"))) TS_LDKNetworkUpdate_ChannelFailure_get_is_permanent(uint64_t ptr) {
1389 LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr);
1390 assert(obj->tag == LDKNetworkUpdate_ChannelFailure);
1391 jboolean is_permanent_conv = obj->channel_failure.is_permanent;
1392 return is_permanent_conv;
1394 int8_tArray __attribute__((export_name("TS_LDKNetworkUpdate_NodeFailure_get_node_id"))) TS_LDKNetworkUpdate_NodeFailure_get_node_id(uint64_t ptr) {
1395 LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr);
1396 assert(obj->tag == LDKNetworkUpdate_NodeFailure);
1397 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
1398 memcpy(node_id_arr->elems, obj->node_failure.node_id.compressed_form, 33);
1401 jboolean __attribute__((export_name("TS_LDKNetworkUpdate_NodeFailure_get_is_permanent"))) TS_LDKNetworkUpdate_NodeFailure_get_is_permanent(uint64_t ptr) {
1402 LDKNetworkUpdate *obj = (LDKNetworkUpdate*)untag_ptr(ptr);
1403 assert(obj->tag == LDKNetworkUpdate_NodeFailure);
1404 jboolean is_permanent_conv = obj->node_failure.is_permanent;
1405 return is_permanent_conv;
1407 uint32_t __attribute__((export_name("TS_LDKCOption_NetworkUpdateZ_ty_from_ptr"))) TS_LDKCOption_NetworkUpdateZ_ty_from_ptr(uint64_t ptr) {
1408 LDKCOption_NetworkUpdateZ *obj = (LDKCOption_NetworkUpdateZ*)untag_ptr(ptr);
1410 case LDKCOption_NetworkUpdateZ_Some: return 0;
1411 case LDKCOption_NetworkUpdateZ_None: return 1;
1415 uint64_t __attribute__((export_name("TS_LDKCOption_NetworkUpdateZ_Some_get_some"))) TS_LDKCOption_NetworkUpdateZ_Some_get_some(uint64_t ptr) {
1416 LDKCOption_NetworkUpdateZ *obj = (LDKCOption_NetworkUpdateZ*)untag_ptr(ptr);
1417 assert(obj->tag == LDKCOption_NetworkUpdateZ_Some);
1418 uint64_t some_ref = tag_ptr(&obj->some, false);
1421 uint32_t __attribute__((export_name("TS_LDKSpendableOutputDescriptor_ty_from_ptr"))) TS_LDKSpendableOutputDescriptor_ty_from_ptr(uint64_t ptr) {
1422 LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)untag_ptr(ptr);
1424 case LDKSpendableOutputDescriptor_StaticOutput: return 0;
1425 case LDKSpendableOutputDescriptor_DelayedPaymentOutput: return 1;
1426 case LDKSpendableOutputDescriptor_StaticPaymentOutput: return 2;
1430 uint64_t __attribute__((export_name("TS_LDKSpendableOutputDescriptor_StaticOutput_get_outpoint"))) TS_LDKSpendableOutputDescriptor_StaticOutput_get_outpoint(uint64_t ptr) {
1431 LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)untag_ptr(ptr);
1432 assert(obj->tag == LDKSpendableOutputDescriptor_StaticOutput);
1433 LDKOutPoint outpoint_var = obj->static_output.outpoint;
1434 uint64_t outpoint_ref = 0;
1435 CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_var);
1436 outpoint_ref = tag_ptr(outpoint_var.inner, false);
1437 return outpoint_ref;
1439 uint64_t __attribute__((export_name("TS_LDKSpendableOutputDescriptor_StaticOutput_get_output"))) TS_LDKSpendableOutputDescriptor_StaticOutput_get_output(uint64_t ptr) {
1440 LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)untag_ptr(ptr);
1441 assert(obj->tag == LDKSpendableOutputDescriptor_StaticOutput);
1442 LDKTxOut* output_ref = &obj->static_output.output;
1443 return tag_ptr(output_ref, false);
1445 uint64_t __attribute__((export_name("TS_LDKSpendableOutputDescriptor_DelayedPaymentOutput_get_delayed_payment_output"))) TS_LDKSpendableOutputDescriptor_DelayedPaymentOutput_get_delayed_payment_output(uint64_t ptr) {
1446 LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)untag_ptr(ptr);
1447 assert(obj->tag == LDKSpendableOutputDescriptor_DelayedPaymentOutput);
1448 LDKDelayedPaymentOutputDescriptor delayed_payment_output_var = obj->delayed_payment_output;
1449 uint64_t delayed_payment_output_ref = 0;
1450 CHECK_INNER_FIELD_ACCESS_OR_NULL(delayed_payment_output_var);
1451 delayed_payment_output_ref = tag_ptr(delayed_payment_output_var.inner, false);
1452 return delayed_payment_output_ref;
1454 uint64_t __attribute__((export_name("TS_LDKSpendableOutputDescriptor_StaticPaymentOutput_get_static_payment_output"))) TS_LDKSpendableOutputDescriptor_StaticPaymentOutput_get_static_payment_output(uint64_t ptr) {
1455 LDKSpendableOutputDescriptor *obj = (LDKSpendableOutputDescriptor*)untag_ptr(ptr);
1456 assert(obj->tag == LDKSpendableOutputDescriptor_StaticPaymentOutput);
1457 LDKStaticPaymentOutputDescriptor static_payment_output_var = obj->static_payment_output;
1458 uint64_t static_payment_output_ref = 0;
1459 CHECK_INNER_FIELD_ACCESS_OR_NULL(static_payment_output_var);
1460 static_payment_output_ref = tag_ptr(static_payment_output_var.inner, false);
1461 return static_payment_output_ref;
1463 static inline LDKCVec_SpendableOutputDescriptorZ CVec_SpendableOutputDescriptorZ_clone(const LDKCVec_SpendableOutputDescriptorZ *orig) {
1464 LDKCVec_SpendableOutputDescriptorZ ret = { .data = MALLOC(sizeof(LDKSpendableOutputDescriptor) * orig->datalen, "LDKCVec_SpendableOutputDescriptorZ clone bytes"), .datalen = orig->datalen };
1465 for (size_t i = 0; i < ret.datalen; i++) {
1466 ret.data[i] = SpendableOutputDescriptor_clone(&orig->data[i]);
1470 uint32_t __attribute__((export_name("TS_LDKEvent_ty_from_ptr"))) TS_LDKEvent_ty_from_ptr(uint64_t ptr) {
1471 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1473 case LDKEvent_FundingGenerationReady: return 0;
1474 case LDKEvent_PaymentReceived: return 1;
1475 case LDKEvent_PaymentClaimed: return 2;
1476 case LDKEvent_PaymentSent: return 3;
1477 case LDKEvent_PaymentFailed: return 4;
1478 case LDKEvent_PaymentPathSuccessful: return 5;
1479 case LDKEvent_PaymentPathFailed: return 6;
1480 case LDKEvent_ProbeSuccessful: return 7;
1481 case LDKEvent_ProbeFailed: return 8;
1482 case LDKEvent_PendingHTLCsForwardable: return 9;
1483 case LDKEvent_SpendableOutputs: return 10;
1484 case LDKEvent_PaymentForwarded: return 11;
1485 case LDKEvent_ChannelClosed: return 12;
1486 case LDKEvent_DiscardFunding: return 13;
1487 case LDKEvent_OpenChannelRequest: return 14;
1488 case LDKEvent_HTLCHandlingFailed: return 15;
1492 int8_tArray __attribute__((export_name("TS_LDKEvent_FundingGenerationReady_get_temporary_channel_id"))) TS_LDKEvent_FundingGenerationReady_get_temporary_channel_id(uint64_t ptr) {
1493 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1494 assert(obj->tag == LDKEvent_FundingGenerationReady);
1495 int8_tArray temporary_channel_id_arr = init_int8_tArray(32, __LINE__);
1496 memcpy(temporary_channel_id_arr->elems, obj->funding_generation_ready.temporary_channel_id.data, 32);
1497 return temporary_channel_id_arr;
1499 int8_tArray __attribute__((export_name("TS_LDKEvent_FundingGenerationReady_get_counterparty_node_id"))) TS_LDKEvent_FundingGenerationReady_get_counterparty_node_id(uint64_t ptr) {
1500 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1501 assert(obj->tag == LDKEvent_FundingGenerationReady);
1502 int8_tArray counterparty_node_id_arr = init_int8_tArray(33, __LINE__);
1503 memcpy(counterparty_node_id_arr->elems, obj->funding_generation_ready.counterparty_node_id.compressed_form, 33);
1504 return counterparty_node_id_arr;
1506 int64_t __attribute__((export_name("TS_LDKEvent_FundingGenerationReady_get_channel_value_satoshis"))) TS_LDKEvent_FundingGenerationReady_get_channel_value_satoshis(uint64_t ptr) {
1507 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1508 assert(obj->tag == LDKEvent_FundingGenerationReady);
1509 int64_t channel_value_satoshis_conv = obj->funding_generation_ready.channel_value_satoshis;
1510 return channel_value_satoshis_conv;
1512 int8_tArray __attribute__((export_name("TS_LDKEvent_FundingGenerationReady_get_output_script"))) TS_LDKEvent_FundingGenerationReady_get_output_script(uint64_t ptr) {
1513 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1514 assert(obj->tag == LDKEvent_FundingGenerationReady);
1515 LDKCVec_u8Z output_script_var = obj->funding_generation_ready.output_script;
1516 int8_tArray output_script_arr = init_int8_tArray(output_script_var.datalen, __LINE__);
1517 memcpy(output_script_arr->elems, output_script_var.data, output_script_var.datalen);
1518 return output_script_arr;
1520 int64_t __attribute__((export_name("TS_LDKEvent_FundingGenerationReady_get_user_channel_id"))) TS_LDKEvent_FundingGenerationReady_get_user_channel_id(uint64_t ptr) {
1521 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1522 assert(obj->tag == LDKEvent_FundingGenerationReady);
1523 int64_t user_channel_id_conv = obj->funding_generation_ready.user_channel_id;
1524 return user_channel_id_conv;
1526 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentReceived_get_payment_hash"))) TS_LDKEvent_PaymentReceived_get_payment_hash(uint64_t ptr) {
1527 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1528 assert(obj->tag == LDKEvent_PaymentReceived);
1529 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
1530 memcpy(payment_hash_arr->elems, obj->payment_received.payment_hash.data, 32);
1531 return payment_hash_arr;
1533 int64_t __attribute__((export_name("TS_LDKEvent_PaymentReceived_get_amount_msat"))) TS_LDKEvent_PaymentReceived_get_amount_msat(uint64_t ptr) {
1534 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1535 assert(obj->tag == LDKEvent_PaymentReceived);
1536 int64_t amount_msat_conv = obj->payment_received.amount_msat;
1537 return amount_msat_conv;
1539 uint64_t __attribute__((export_name("TS_LDKEvent_PaymentReceived_get_purpose"))) TS_LDKEvent_PaymentReceived_get_purpose(uint64_t ptr) {
1540 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1541 assert(obj->tag == LDKEvent_PaymentReceived);
1542 uint64_t purpose_ref = tag_ptr(&obj->payment_received.purpose, false);
1545 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentClaimed_get_payment_hash"))) TS_LDKEvent_PaymentClaimed_get_payment_hash(uint64_t ptr) {
1546 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1547 assert(obj->tag == LDKEvent_PaymentClaimed);
1548 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
1549 memcpy(payment_hash_arr->elems, obj->payment_claimed.payment_hash.data, 32);
1550 return payment_hash_arr;
1552 int64_t __attribute__((export_name("TS_LDKEvent_PaymentClaimed_get_amount_msat"))) TS_LDKEvent_PaymentClaimed_get_amount_msat(uint64_t ptr) {
1553 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1554 assert(obj->tag == LDKEvent_PaymentClaimed);
1555 int64_t amount_msat_conv = obj->payment_claimed.amount_msat;
1556 return amount_msat_conv;
1558 uint64_t __attribute__((export_name("TS_LDKEvent_PaymentClaimed_get_purpose"))) TS_LDKEvent_PaymentClaimed_get_purpose(uint64_t ptr) {
1559 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1560 assert(obj->tag == LDKEvent_PaymentClaimed);
1561 uint64_t purpose_ref = tag_ptr(&obj->payment_claimed.purpose, false);
1564 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentSent_get_payment_id"))) TS_LDKEvent_PaymentSent_get_payment_id(uint64_t ptr) {
1565 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1566 assert(obj->tag == LDKEvent_PaymentSent);
1567 int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
1568 memcpy(payment_id_arr->elems, obj->payment_sent.payment_id.data, 32);
1569 return payment_id_arr;
1571 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentSent_get_payment_preimage"))) TS_LDKEvent_PaymentSent_get_payment_preimage(uint64_t ptr) {
1572 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1573 assert(obj->tag == LDKEvent_PaymentSent);
1574 int8_tArray payment_preimage_arr = init_int8_tArray(32, __LINE__);
1575 memcpy(payment_preimage_arr->elems, obj->payment_sent.payment_preimage.data, 32);
1576 return payment_preimage_arr;
1578 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentSent_get_payment_hash"))) TS_LDKEvent_PaymentSent_get_payment_hash(uint64_t ptr) {
1579 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1580 assert(obj->tag == LDKEvent_PaymentSent);
1581 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
1582 memcpy(payment_hash_arr->elems, obj->payment_sent.payment_hash.data, 32);
1583 return payment_hash_arr;
1585 uint64_t __attribute__((export_name("TS_LDKEvent_PaymentSent_get_fee_paid_msat"))) TS_LDKEvent_PaymentSent_get_fee_paid_msat(uint64_t ptr) {
1586 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1587 assert(obj->tag == LDKEvent_PaymentSent);
1588 uint64_t fee_paid_msat_ref = tag_ptr(&obj->payment_sent.fee_paid_msat, false);
1589 return fee_paid_msat_ref;
1591 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentFailed_get_payment_id"))) TS_LDKEvent_PaymentFailed_get_payment_id(uint64_t ptr) {
1592 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1593 assert(obj->tag == LDKEvent_PaymentFailed);
1594 int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
1595 memcpy(payment_id_arr->elems, obj->payment_failed.payment_id.data, 32);
1596 return payment_id_arr;
1598 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentFailed_get_payment_hash"))) TS_LDKEvent_PaymentFailed_get_payment_hash(uint64_t ptr) {
1599 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1600 assert(obj->tag == LDKEvent_PaymentFailed);
1601 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
1602 memcpy(payment_hash_arr->elems, obj->payment_failed.payment_hash.data, 32);
1603 return payment_hash_arr;
1605 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathSuccessful_get_payment_id"))) TS_LDKEvent_PaymentPathSuccessful_get_payment_id(uint64_t ptr) {
1606 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1607 assert(obj->tag == LDKEvent_PaymentPathSuccessful);
1608 int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
1609 memcpy(payment_id_arr->elems, obj->payment_path_successful.payment_id.data, 32);
1610 return payment_id_arr;
1612 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathSuccessful_get_payment_hash"))) TS_LDKEvent_PaymentPathSuccessful_get_payment_hash(uint64_t ptr) {
1613 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1614 assert(obj->tag == LDKEvent_PaymentPathSuccessful);
1615 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
1616 memcpy(payment_hash_arr->elems, obj->payment_path_successful.payment_hash.data, 32);
1617 return payment_hash_arr;
1619 uint64_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathSuccessful_get_path"))) TS_LDKEvent_PaymentPathSuccessful_get_path(uint64_t ptr) {
1620 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1621 assert(obj->tag == LDKEvent_PaymentPathSuccessful);
1622 LDKCVec_RouteHopZ path_var = obj->payment_path_successful.path;
1623 uint64_tArray path_arr = NULL;
1624 path_arr = init_uint64_tArray(path_var.datalen, __LINE__);
1625 uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8);
1626 for (size_t k = 0; k < path_var.datalen; k++) {
1627 LDKRouteHop path_conv_10_var = path_var.data[k];
1628 uint64_t path_conv_10_ref = 0;
1629 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
1630 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, false);
1631 path_arr_ptr[k] = path_conv_10_ref;
1636 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_payment_id"))) TS_LDKEvent_PaymentPathFailed_get_payment_id(uint64_t ptr) {
1637 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1638 assert(obj->tag == LDKEvent_PaymentPathFailed);
1639 int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
1640 memcpy(payment_id_arr->elems, obj->payment_path_failed.payment_id.data, 32);
1641 return payment_id_arr;
1643 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_payment_hash"))) TS_LDKEvent_PaymentPathFailed_get_payment_hash(uint64_t ptr) {
1644 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1645 assert(obj->tag == LDKEvent_PaymentPathFailed);
1646 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
1647 memcpy(payment_hash_arr->elems, obj->payment_path_failed.payment_hash.data, 32);
1648 return payment_hash_arr;
1650 jboolean __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_rejected_by_dest"))) TS_LDKEvent_PaymentPathFailed_get_rejected_by_dest(uint64_t ptr) {
1651 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1652 assert(obj->tag == LDKEvent_PaymentPathFailed);
1653 jboolean rejected_by_dest_conv = obj->payment_path_failed.rejected_by_dest;
1654 return rejected_by_dest_conv;
1656 uint64_t __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_network_update"))) TS_LDKEvent_PaymentPathFailed_get_network_update(uint64_t ptr) {
1657 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1658 assert(obj->tag == LDKEvent_PaymentPathFailed);
1659 uint64_t network_update_ref = tag_ptr(&obj->payment_path_failed.network_update, false);
1660 return network_update_ref;
1662 jboolean __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_all_paths_failed"))) TS_LDKEvent_PaymentPathFailed_get_all_paths_failed(uint64_t ptr) {
1663 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1664 assert(obj->tag == LDKEvent_PaymentPathFailed);
1665 jboolean all_paths_failed_conv = obj->payment_path_failed.all_paths_failed;
1666 return all_paths_failed_conv;
1668 uint64_tArray __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_path"))) TS_LDKEvent_PaymentPathFailed_get_path(uint64_t ptr) {
1669 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1670 assert(obj->tag == LDKEvent_PaymentPathFailed);
1671 LDKCVec_RouteHopZ path_var = obj->payment_path_failed.path;
1672 uint64_tArray path_arr = NULL;
1673 path_arr = init_uint64_tArray(path_var.datalen, __LINE__);
1674 uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8);
1675 for (size_t k = 0; k < path_var.datalen; k++) {
1676 LDKRouteHop path_conv_10_var = path_var.data[k];
1677 uint64_t path_conv_10_ref = 0;
1678 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
1679 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, false);
1680 path_arr_ptr[k] = path_conv_10_ref;
1685 uint64_t __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_short_channel_id"))) TS_LDKEvent_PaymentPathFailed_get_short_channel_id(uint64_t ptr) {
1686 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1687 assert(obj->tag == LDKEvent_PaymentPathFailed);
1688 uint64_t short_channel_id_ref = tag_ptr(&obj->payment_path_failed.short_channel_id, false);
1689 return short_channel_id_ref;
1691 uint64_t __attribute__((export_name("TS_LDKEvent_PaymentPathFailed_get_retry"))) TS_LDKEvent_PaymentPathFailed_get_retry(uint64_t ptr) {
1692 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1693 assert(obj->tag == LDKEvent_PaymentPathFailed);
1694 LDKRouteParameters retry_var = obj->payment_path_failed.retry;
1695 uint64_t retry_ref = 0;
1696 CHECK_INNER_FIELD_ACCESS_OR_NULL(retry_var);
1697 retry_ref = tag_ptr(retry_var.inner, false);
1700 int8_tArray __attribute__((export_name("TS_LDKEvent_ProbeSuccessful_get_payment_id"))) TS_LDKEvent_ProbeSuccessful_get_payment_id(uint64_t ptr) {
1701 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1702 assert(obj->tag == LDKEvent_ProbeSuccessful);
1703 int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
1704 memcpy(payment_id_arr->elems, obj->probe_successful.payment_id.data, 32);
1705 return payment_id_arr;
1707 int8_tArray __attribute__((export_name("TS_LDKEvent_ProbeSuccessful_get_payment_hash"))) TS_LDKEvent_ProbeSuccessful_get_payment_hash(uint64_t ptr) {
1708 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1709 assert(obj->tag == LDKEvent_ProbeSuccessful);
1710 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
1711 memcpy(payment_hash_arr->elems, obj->probe_successful.payment_hash.data, 32);
1712 return payment_hash_arr;
1714 uint64_tArray __attribute__((export_name("TS_LDKEvent_ProbeSuccessful_get_path"))) TS_LDKEvent_ProbeSuccessful_get_path(uint64_t ptr) {
1715 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1716 assert(obj->tag == LDKEvent_ProbeSuccessful);
1717 LDKCVec_RouteHopZ path_var = obj->probe_successful.path;
1718 uint64_tArray path_arr = NULL;
1719 path_arr = init_uint64_tArray(path_var.datalen, __LINE__);
1720 uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8);
1721 for (size_t k = 0; k < path_var.datalen; k++) {
1722 LDKRouteHop path_conv_10_var = path_var.data[k];
1723 uint64_t path_conv_10_ref = 0;
1724 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
1725 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, false);
1726 path_arr_ptr[k] = path_conv_10_ref;
1731 int8_tArray __attribute__((export_name("TS_LDKEvent_ProbeFailed_get_payment_id"))) TS_LDKEvent_ProbeFailed_get_payment_id(uint64_t ptr) {
1732 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1733 assert(obj->tag == LDKEvent_ProbeFailed);
1734 int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
1735 memcpy(payment_id_arr->elems, obj->probe_failed.payment_id.data, 32);
1736 return payment_id_arr;
1738 int8_tArray __attribute__((export_name("TS_LDKEvent_ProbeFailed_get_payment_hash"))) TS_LDKEvent_ProbeFailed_get_payment_hash(uint64_t ptr) {
1739 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1740 assert(obj->tag == LDKEvent_ProbeFailed);
1741 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
1742 memcpy(payment_hash_arr->elems, obj->probe_failed.payment_hash.data, 32);
1743 return payment_hash_arr;
1745 uint64_tArray __attribute__((export_name("TS_LDKEvent_ProbeFailed_get_path"))) TS_LDKEvent_ProbeFailed_get_path(uint64_t ptr) {
1746 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1747 assert(obj->tag == LDKEvent_ProbeFailed);
1748 LDKCVec_RouteHopZ path_var = obj->probe_failed.path;
1749 uint64_tArray path_arr = NULL;
1750 path_arr = init_uint64_tArray(path_var.datalen, __LINE__);
1751 uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8);
1752 for (size_t k = 0; k < path_var.datalen; k++) {
1753 LDKRouteHop path_conv_10_var = path_var.data[k];
1754 uint64_t path_conv_10_ref = 0;
1755 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
1756 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, false);
1757 path_arr_ptr[k] = path_conv_10_ref;
1762 uint64_t __attribute__((export_name("TS_LDKEvent_ProbeFailed_get_short_channel_id"))) TS_LDKEvent_ProbeFailed_get_short_channel_id(uint64_t ptr) {
1763 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1764 assert(obj->tag == LDKEvent_ProbeFailed);
1765 uint64_t short_channel_id_ref = tag_ptr(&obj->probe_failed.short_channel_id, false);
1766 return short_channel_id_ref;
1768 int64_t __attribute__((export_name("TS_LDKEvent_PendingHTLCsForwardable_get_time_forwardable"))) TS_LDKEvent_PendingHTLCsForwardable_get_time_forwardable(uint64_t ptr) {
1769 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1770 assert(obj->tag == LDKEvent_PendingHTLCsForwardable);
1771 int64_t time_forwardable_conv = obj->pending_htl_cs_forwardable.time_forwardable;
1772 return time_forwardable_conv;
1774 uint64_tArray __attribute__((export_name("TS_LDKEvent_SpendableOutputs_get_outputs"))) TS_LDKEvent_SpendableOutputs_get_outputs(uint64_t ptr) {
1775 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1776 assert(obj->tag == LDKEvent_SpendableOutputs);
1777 LDKCVec_SpendableOutputDescriptorZ outputs_var = obj->spendable_outputs.outputs;
1778 uint64_tArray outputs_arr = NULL;
1779 outputs_arr = init_uint64_tArray(outputs_var.datalen, __LINE__);
1780 uint64_t *outputs_arr_ptr = (uint64_t*)(((uint8_t*)outputs_arr) + 8);
1781 for (size_t b = 0; b < outputs_var.datalen; b++) {
1782 uint64_t outputs_conv_27_ref = tag_ptr(&outputs_var.data[b], false);
1783 outputs_arr_ptr[b] = outputs_conv_27_ref;
1788 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentForwarded_get_prev_channel_id"))) TS_LDKEvent_PaymentForwarded_get_prev_channel_id(uint64_t ptr) {
1789 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1790 assert(obj->tag == LDKEvent_PaymentForwarded);
1791 int8_tArray prev_channel_id_arr = init_int8_tArray(32, __LINE__);
1792 memcpy(prev_channel_id_arr->elems, obj->payment_forwarded.prev_channel_id.data, 32);
1793 return prev_channel_id_arr;
1795 int8_tArray __attribute__((export_name("TS_LDKEvent_PaymentForwarded_get_next_channel_id"))) TS_LDKEvent_PaymentForwarded_get_next_channel_id(uint64_t ptr) {
1796 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1797 assert(obj->tag == LDKEvent_PaymentForwarded);
1798 int8_tArray next_channel_id_arr = init_int8_tArray(32, __LINE__);
1799 memcpy(next_channel_id_arr->elems, obj->payment_forwarded.next_channel_id.data, 32);
1800 return next_channel_id_arr;
1802 uint64_t __attribute__((export_name("TS_LDKEvent_PaymentForwarded_get_fee_earned_msat"))) TS_LDKEvent_PaymentForwarded_get_fee_earned_msat(uint64_t ptr) {
1803 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1804 assert(obj->tag == LDKEvent_PaymentForwarded);
1805 uint64_t fee_earned_msat_ref = tag_ptr(&obj->payment_forwarded.fee_earned_msat, false);
1806 return fee_earned_msat_ref;
1808 jboolean __attribute__((export_name("TS_LDKEvent_PaymentForwarded_get_claim_from_onchain_tx"))) TS_LDKEvent_PaymentForwarded_get_claim_from_onchain_tx(uint64_t ptr) {
1809 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1810 assert(obj->tag == LDKEvent_PaymentForwarded);
1811 jboolean claim_from_onchain_tx_conv = obj->payment_forwarded.claim_from_onchain_tx;
1812 return claim_from_onchain_tx_conv;
1814 int8_tArray __attribute__((export_name("TS_LDKEvent_ChannelClosed_get_channel_id"))) TS_LDKEvent_ChannelClosed_get_channel_id(uint64_t ptr) {
1815 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1816 assert(obj->tag == LDKEvent_ChannelClosed);
1817 int8_tArray channel_id_arr = init_int8_tArray(32, __LINE__);
1818 memcpy(channel_id_arr->elems, obj->channel_closed.channel_id.data, 32);
1819 return channel_id_arr;
1821 int64_t __attribute__((export_name("TS_LDKEvent_ChannelClosed_get_user_channel_id"))) TS_LDKEvent_ChannelClosed_get_user_channel_id(uint64_t ptr) {
1822 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1823 assert(obj->tag == LDKEvent_ChannelClosed);
1824 int64_t user_channel_id_conv = obj->channel_closed.user_channel_id;
1825 return user_channel_id_conv;
1827 uint64_t __attribute__((export_name("TS_LDKEvent_ChannelClosed_get_reason"))) TS_LDKEvent_ChannelClosed_get_reason(uint64_t ptr) {
1828 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1829 assert(obj->tag == LDKEvent_ChannelClosed);
1830 uint64_t reason_ref = tag_ptr(&obj->channel_closed.reason, false);
1833 int8_tArray __attribute__((export_name("TS_LDKEvent_DiscardFunding_get_channel_id"))) TS_LDKEvent_DiscardFunding_get_channel_id(uint64_t ptr) {
1834 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1835 assert(obj->tag == LDKEvent_DiscardFunding);
1836 int8_tArray channel_id_arr = init_int8_tArray(32, __LINE__);
1837 memcpy(channel_id_arr->elems, obj->discard_funding.channel_id.data, 32);
1838 return channel_id_arr;
1840 int8_tArray __attribute__((export_name("TS_LDKEvent_DiscardFunding_get_transaction"))) TS_LDKEvent_DiscardFunding_get_transaction(uint64_t ptr) {
1841 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1842 assert(obj->tag == LDKEvent_DiscardFunding);
1843 LDKTransaction transaction_var = obj->discard_funding.transaction;
1844 int8_tArray transaction_arr = init_int8_tArray(transaction_var.datalen, __LINE__);
1845 memcpy(transaction_arr->elems, transaction_var.data, transaction_var.datalen);
1846 return transaction_arr;
1848 int8_tArray __attribute__((export_name("TS_LDKEvent_OpenChannelRequest_get_temporary_channel_id"))) TS_LDKEvent_OpenChannelRequest_get_temporary_channel_id(uint64_t ptr) {
1849 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1850 assert(obj->tag == LDKEvent_OpenChannelRequest);
1851 int8_tArray temporary_channel_id_arr = init_int8_tArray(32, __LINE__);
1852 memcpy(temporary_channel_id_arr->elems, obj->open_channel_request.temporary_channel_id.data, 32);
1853 return temporary_channel_id_arr;
1855 int8_tArray __attribute__((export_name("TS_LDKEvent_OpenChannelRequest_get_counterparty_node_id"))) TS_LDKEvent_OpenChannelRequest_get_counterparty_node_id(uint64_t ptr) {
1856 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1857 assert(obj->tag == LDKEvent_OpenChannelRequest);
1858 int8_tArray counterparty_node_id_arr = init_int8_tArray(33, __LINE__);
1859 memcpy(counterparty_node_id_arr->elems, obj->open_channel_request.counterparty_node_id.compressed_form, 33);
1860 return counterparty_node_id_arr;
1862 int64_t __attribute__((export_name("TS_LDKEvent_OpenChannelRequest_get_funding_satoshis"))) TS_LDKEvent_OpenChannelRequest_get_funding_satoshis(uint64_t ptr) {
1863 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1864 assert(obj->tag == LDKEvent_OpenChannelRequest);
1865 int64_t funding_satoshis_conv = obj->open_channel_request.funding_satoshis;
1866 return funding_satoshis_conv;
1868 int64_t __attribute__((export_name("TS_LDKEvent_OpenChannelRequest_get_push_msat"))) TS_LDKEvent_OpenChannelRequest_get_push_msat(uint64_t ptr) {
1869 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1870 assert(obj->tag == LDKEvent_OpenChannelRequest);
1871 int64_t push_msat_conv = obj->open_channel_request.push_msat;
1872 return push_msat_conv;
1874 uint64_t __attribute__((export_name("TS_LDKEvent_OpenChannelRequest_get_channel_type"))) TS_LDKEvent_OpenChannelRequest_get_channel_type(uint64_t ptr) {
1875 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1876 assert(obj->tag == LDKEvent_OpenChannelRequest);
1877 LDKChannelTypeFeatures channel_type_var = obj->open_channel_request.channel_type;
1878 uint64_t channel_type_ref = 0;
1879 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_var);
1880 channel_type_ref = tag_ptr(channel_type_var.inner, false);
1881 return channel_type_ref;
1883 int8_tArray __attribute__((export_name("TS_LDKEvent_HTLCHandlingFailed_get_prev_channel_id"))) TS_LDKEvent_HTLCHandlingFailed_get_prev_channel_id(uint64_t ptr) {
1884 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1885 assert(obj->tag == LDKEvent_HTLCHandlingFailed);
1886 int8_tArray prev_channel_id_arr = init_int8_tArray(32, __LINE__);
1887 memcpy(prev_channel_id_arr->elems, obj->htlc_handling_failed.prev_channel_id.data, 32);
1888 return prev_channel_id_arr;
1890 uint64_t __attribute__((export_name("TS_LDKEvent_HTLCHandlingFailed_get_failed_next_destination"))) TS_LDKEvent_HTLCHandlingFailed_get_failed_next_destination(uint64_t ptr) {
1891 LDKEvent *obj = (LDKEvent*)untag_ptr(ptr);
1892 assert(obj->tag == LDKEvent_HTLCHandlingFailed);
1893 uint64_t failed_next_destination_ref = tag_ptr(&obj->htlc_handling_failed.failed_next_destination, false);
1894 return failed_next_destination_ref;
1896 uint32_t __attribute__((export_name("TS_LDKCOption_EventZ_ty_from_ptr"))) TS_LDKCOption_EventZ_ty_from_ptr(uint64_t ptr) {
1897 LDKCOption_EventZ *obj = (LDKCOption_EventZ*)untag_ptr(ptr);
1899 case LDKCOption_EventZ_Some: return 0;
1900 case LDKCOption_EventZ_None: return 1;
1904 uint64_t __attribute__((export_name("TS_LDKCOption_EventZ_Some_get_some"))) TS_LDKCOption_EventZ_Some_get_some(uint64_t ptr) {
1905 LDKCOption_EventZ *obj = (LDKCOption_EventZ*)untag_ptr(ptr);
1906 assert(obj->tag == LDKCOption_EventZ_Some);
1907 uint64_t some_ref = tag_ptr(&obj->some, false);
1910 static inline struct LDKCOption_EventZ CResult_COption_EventZDecodeErrorZ_get_ok(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR owner){
1911 CHECK(owner->result_ok);
1912 return COption_EventZ_clone(&*owner->contents.result);
1914 uint64_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_get_ok"))) TS_CResult_COption_EventZDecodeErrorZ_get_ok(uint64_t owner) {
1915 LDKCResult_COption_EventZDecodeErrorZ* owner_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(owner);
1916 LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
1917 *ret_copy = CResult_COption_EventZDecodeErrorZ_get_ok(owner_conv);
1918 uint64_t ret_ref = tag_ptr(ret_copy, true);
1922 static inline struct LDKDecodeError CResult_COption_EventZDecodeErrorZ_get_err(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR owner){
1923 CHECK(!owner->result_ok);
1924 return DecodeError_clone(&*owner->contents.err);
1926 uint64_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_get_err"))) TS_CResult_COption_EventZDecodeErrorZ_get_err(uint64_t owner) {
1927 LDKCResult_COption_EventZDecodeErrorZ* owner_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(owner);
1928 LDKDecodeError ret_var = CResult_COption_EventZDecodeErrorZ_get_err(owner_conv);
1929 uint64_t ret_ref = 0;
1930 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
1931 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
1935 uint32_t __attribute__((export_name("TS_LDKErrorAction_ty_from_ptr"))) TS_LDKErrorAction_ty_from_ptr(uint64_t ptr) {
1936 LDKErrorAction *obj = (LDKErrorAction*)untag_ptr(ptr);
1938 case LDKErrorAction_DisconnectPeer: return 0;
1939 case LDKErrorAction_IgnoreError: return 1;
1940 case LDKErrorAction_IgnoreAndLog: return 2;
1941 case LDKErrorAction_IgnoreDuplicateGossip: return 3;
1942 case LDKErrorAction_SendErrorMessage: return 4;
1943 case LDKErrorAction_SendWarningMessage: return 5;
1947 uint64_t __attribute__((export_name("TS_LDKErrorAction_DisconnectPeer_get_msg"))) TS_LDKErrorAction_DisconnectPeer_get_msg(uint64_t ptr) {
1948 LDKErrorAction *obj = (LDKErrorAction*)untag_ptr(ptr);
1949 assert(obj->tag == LDKErrorAction_DisconnectPeer);
1950 LDKErrorMessage msg_var = obj->disconnect_peer.msg;
1951 uint64_t msg_ref = 0;
1952 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
1953 msg_ref = tag_ptr(msg_var.inner, false);
1956 uint32_t __attribute__((export_name("TS_LDKErrorAction_IgnoreAndLog_get_ignore_and_log"))) TS_LDKErrorAction_IgnoreAndLog_get_ignore_and_log(uint64_t ptr) {
1957 LDKErrorAction *obj = (LDKErrorAction*)untag_ptr(ptr);
1958 assert(obj->tag == LDKErrorAction_IgnoreAndLog);
1959 uint32_t ignore_and_log_conv = LDKLevel_to_js(obj->ignore_and_log);
1960 return ignore_and_log_conv;
1962 uint64_t __attribute__((export_name("TS_LDKErrorAction_SendErrorMessage_get_msg"))) TS_LDKErrorAction_SendErrorMessage_get_msg(uint64_t ptr) {
1963 LDKErrorAction *obj = (LDKErrorAction*)untag_ptr(ptr);
1964 assert(obj->tag == LDKErrorAction_SendErrorMessage);
1965 LDKErrorMessage msg_var = obj->send_error_message.msg;
1966 uint64_t msg_ref = 0;
1967 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
1968 msg_ref = tag_ptr(msg_var.inner, false);
1971 uint64_t __attribute__((export_name("TS_LDKErrorAction_SendWarningMessage_get_msg"))) TS_LDKErrorAction_SendWarningMessage_get_msg(uint64_t ptr) {
1972 LDKErrorAction *obj = (LDKErrorAction*)untag_ptr(ptr);
1973 assert(obj->tag == LDKErrorAction_SendWarningMessage);
1974 LDKWarningMessage msg_var = obj->send_warning_message.msg;
1975 uint64_t msg_ref = 0;
1976 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
1977 msg_ref = tag_ptr(msg_var.inner, false);
1980 uint32_t __attribute__((export_name("TS_LDKErrorAction_SendWarningMessage_get_log_level"))) TS_LDKErrorAction_SendWarningMessage_get_log_level(uint64_t ptr) {
1981 LDKErrorAction *obj = (LDKErrorAction*)untag_ptr(ptr);
1982 assert(obj->tag == LDKErrorAction_SendWarningMessage);
1983 uint32_t log_level_conv = LDKLevel_to_js(obj->send_warning_message.log_level);
1984 return log_level_conv;
1986 uint32_t __attribute__((export_name("TS_LDKMessageSendEvent_ty_from_ptr"))) TS_LDKMessageSendEvent_ty_from_ptr(uint64_t ptr) {
1987 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
1989 case LDKMessageSendEvent_SendAcceptChannel: return 0;
1990 case LDKMessageSendEvent_SendOpenChannel: return 1;
1991 case LDKMessageSendEvent_SendFundingCreated: return 2;
1992 case LDKMessageSendEvent_SendFundingSigned: return 3;
1993 case LDKMessageSendEvent_SendChannelReady: return 4;
1994 case LDKMessageSendEvent_SendAnnouncementSignatures: return 5;
1995 case LDKMessageSendEvent_UpdateHTLCs: return 6;
1996 case LDKMessageSendEvent_SendRevokeAndACK: return 7;
1997 case LDKMessageSendEvent_SendClosingSigned: return 8;
1998 case LDKMessageSendEvent_SendShutdown: return 9;
1999 case LDKMessageSendEvent_SendChannelReestablish: return 10;
2000 case LDKMessageSendEvent_BroadcastChannelAnnouncement: return 11;
2001 case LDKMessageSendEvent_BroadcastNodeAnnouncement: return 12;
2002 case LDKMessageSendEvent_BroadcastChannelUpdate: return 13;
2003 case LDKMessageSendEvent_SendChannelUpdate: return 14;
2004 case LDKMessageSendEvent_HandleError: return 15;
2005 case LDKMessageSendEvent_SendChannelRangeQuery: return 16;
2006 case LDKMessageSendEvent_SendShortIdsQuery: return 17;
2007 case LDKMessageSendEvent_SendReplyChannelRange: return 18;
2008 case LDKMessageSendEvent_SendGossipTimestampFilter: return 19;
2012 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendAcceptChannel_get_node_id"))) TS_LDKMessageSendEvent_SendAcceptChannel_get_node_id(uint64_t ptr) {
2013 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2014 assert(obj->tag == LDKMessageSendEvent_SendAcceptChannel);
2015 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2016 memcpy(node_id_arr->elems, obj->send_accept_channel.node_id.compressed_form, 33);
2019 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendAcceptChannel_get_msg"))) TS_LDKMessageSendEvent_SendAcceptChannel_get_msg(uint64_t ptr) {
2020 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2021 assert(obj->tag == LDKMessageSendEvent_SendAcceptChannel);
2022 LDKAcceptChannel msg_var = obj->send_accept_channel.msg;
2023 uint64_t msg_ref = 0;
2024 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2025 msg_ref = tag_ptr(msg_var.inner, false);
2028 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendOpenChannel_get_node_id"))) TS_LDKMessageSendEvent_SendOpenChannel_get_node_id(uint64_t ptr) {
2029 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2030 assert(obj->tag == LDKMessageSendEvent_SendOpenChannel);
2031 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2032 memcpy(node_id_arr->elems, obj->send_open_channel.node_id.compressed_form, 33);
2035 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendOpenChannel_get_msg"))) TS_LDKMessageSendEvent_SendOpenChannel_get_msg(uint64_t ptr) {
2036 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2037 assert(obj->tag == LDKMessageSendEvent_SendOpenChannel);
2038 LDKOpenChannel msg_var = obj->send_open_channel.msg;
2039 uint64_t msg_ref = 0;
2040 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2041 msg_ref = tag_ptr(msg_var.inner, false);
2044 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendFundingCreated_get_node_id"))) TS_LDKMessageSendEvent_SendFundingCreated_get_node_id(uint64_t ptr) {
2045 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2046 assert(obj->tag == LDKMessageSendEvent_SendFundingCreated);
2047 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2048 memcpy(node_id_arr->elems, obj->send_funding_created.node_id.compressed_form, 33);
2051 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendFundingCreated_get_msg"))) TS_LDKMessageSendEvent_SendFundingCreated_get_msg(uint64_t ptr) {
2052 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2053 assert(obj->tag == LDKMessageSendEvent_SendFundingCreated);
2054 LDKFundingCreated msg_var = obj->send_funding_created.msg;
2055 uint64_t msg_ref = 0;
2056 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2057 msg_ref = tag_ptr(msg_var.inner, false);
2060 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendFundingSigned_get_node_id"))) TS_LDKMessageSendEvent_SendFundingSigned_get_node_id(uint64_t ptr) {
2061 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2062 assert(obj->tag == LDKMessageSendEvent_SendFundingSigned);
2063 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2064 memcpy(node_id_arr->elems, obj->send_funding_signed.node_id.compressed_form, 33);
2067 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendFundingSigned_get_msg"))) TS_LDKMessageSendEvent_SendFundingSigned_get_msg(uint64_t ptr) {
2068 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2069 assert(obj->tag == LDKMessageSendEvent_SendFundingSigned);
2070 LDKFundingSigned msg_var = obj->send_funding_signed.msg;
2071 uint64_t msg_ref = 0;
2072 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2073 msg_ref = tag_ptr(msg_var.inner, false);
2076 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelReady_get_node_id"))) TS_LDKMessageSendEvent_SendChannelReady_get_node_id(uint64_t ptr) {
2077 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2078 assert(obj->tag == LDKMessageSendEvent_SendChannelReady);
2079 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2080 memcpy(node_id_arr->elems, obj->send_channel_ready.node_id.compressed_form, 33);
2083 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelReady_get_msg"))) TS_LDKMessageSendEvent_SendChannelReady_get_msg(uint64_t ptr) {
2084 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2085 assert(obj->tag == LDKMessageSendEvent_SendChannelReady);
2086 LDKChannelReady msg_var = obj->send_channel_ready.msg;
2087 uint64_t msg_ref = 0;
2088 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2089 msg_ref = tag_ptr(msg_var.inner, false);
2092 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendAnnouncementSignatures_get_node_id"))) TS_LDKMessageSendEvent_SendAnnouncementSignatures_get_node_id(uint64_t ptr) {
2093 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2094 assert(obj->tag == LDKMessageSendEvent_SendAnnouncementSignatures);
2095 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2096 memcpy(node_id_arr->elems, obj->send_announcement_signatures.node_id.compressed_form, 33);
2099 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendAnnouncementSignatures_get_msg"))) TS_LDKMessageSendEvent_SendAnnouncementSignatures_get_msg(uint64_t ptr) {
2100 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2101 assert(obj->tag == LDKMessageSendEvent_SendAnnouncementSignatures);
2102 LDKAnnouncementSignatures msg_var = obj->send_announcement_signatures.msg;
2103 uint64_t msg_ref = 0;
2104 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2105 msg_ref = tag_ptr(msg_var.inner, false);
2108 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_UpdateHTLCs_get_node_id"))) TS_LDKMessageSendEvent_UpdateHTLCs_get_node_id(uint64_t ptr) {
2109 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2110 assert(obj->tag == LDKMessageSendEvent_UpdateHTLCs);
2111 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2112 memcpy(node_id_arr->elems, obj->update_htl_cs.node_id.compressed_form, 33);
2115 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_UpdateHTLCs_get_updates"))) TS_LDKMessageSendEvent_UpdateHTLCs_get_updates(uint64_t ptr) {
2116 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2117 assert(obj->tag == LDKMessageSendEvent_UpdateHTLCs);
2118 LDKCommitmentUpdate updates_var = obj->update_htl_cs.updates;
2119 uint64_t updates_ref = 0;
2120 CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_var);
2121 updates_ref = tag_ptr(updates_var.inner, false);
2124 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendRevokeAndACK_get_node_id"))) TS_LDKMessageSendEvent_SendRevokeAndACK_get_node_id(uint64_t ptr) {
2125 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2126 assert(obj->tag == LDKMessageSendEvent_SendRevokeAndACK);
2127 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2128 memcpy(node_id_arr->elems, obj->send_revoke_and_ack.node_id.compressed_form, 33);
2131 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendRevokeAndACK_get_msg"))) TS_LDKMessageSendEvent_SendRevokeAndACK_get_msg(uint64_t ptr) {
2132 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2133 assert(obj->tag == LDKMessageSendEvent_SendRevokeAndACK);
2134 LDKRevokeAndACK msg_var = obj->send_revoke_and_ack.msg;
2135 uint64_t msg_ref = 0;
2136 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2137 msg_ref = tag_ptr(msg_var.inner, false);
2140 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendClosingSigned_get_node_id"))) TS_LDKMessageSendEvent_SendClosingSigned_get_node_id(uint64_t ptr) {
2141 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2142 assert(obj->tag == LDKMessageSendEvent_SendClosingSigned);
2143 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2144 memcpy(node_id_arr->elems, obj->send_closing_signed.node_id.compressed_form, 33);
2147 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendClosingSigned_get_msg"))) TS_LDKMessageSendEvent_SendClosingSigned_get_msg(uint64_t ptr) {
2148 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2149 assert(obj->tag == LDKMessageSendEvent_SendClosingSigned);
2150 LDKClosingSigned msg_var = obj->send_closing_signed.msg;
2151 uint64_t msg_ref = 0;
2152 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2153 msg_ref = tag_ptr(msg_var.inner, false);
2156 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendShutdown_get_node_id"))) TS_LDKMessageSendEvent_SendShutdown_get_node_id(uint64_t ptr) {
2157 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2158 assert(obj->tag == LDKMessageSendEvent_SendShutdown);
2159 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2160 memcpy(node_id_arr->elems, obj->send_shutdown.node_id.compressed_form, 33);
2163 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendShutdown_get_msg"))) TS_LDKMessageSendEvent_SendShutdown_get_msg(uint64_t ptr) {
2164 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2165 assert(obj->tag == LDKMessageSendEvent_SendShutdown);
2166 LDKShutdown msg_var = obj->send_shutdown.msg;
2167 uint64_t msg_ref = 0;
2168 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2169 msg_ref = tag_ptr(msg_var.inner, false);
2172 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelReestablish_get_node_id"))) TS_LDKMessageSendEvent_SendChannelReestablish_get_node_id(uint64_t ptr) {
2173 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2174 assert(obj->tag == LDKMessageSendEvent_SendChannelReestablish);
2175 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2176 memcpy(node_id_arr->elems, obj->send_channel_reestablish.node_id.compressed_form, 33);
2179 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelReestablish_get_msg"))) TS_LDKMessageSendEvent_SendChannelReestablish_get_msg(uint64_t ptr) {
2180 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2181 assert(obj->tag == LDKMessageSendEvent_SendChannelReestablish);
2182 LDKChannelReestablish msg_var = obj->send_channel_reestablish.msg;
2183 uint64_t msg_ref = 0;
2184 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2185 msg_ref = tag_ptr(msg_var.inner, false);
2188 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_BroadcastChannelAnnouncement_get_msg"))) TS_LDKMessageSendEvent_BroadcastChannelAnnouncement_get_msg(uint64_t ptr) {
2189 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2190 assert(obj->tag == LDKMessageSendEvent_BroadcastChannelAnnouncement);
2191 LDKChannelAnnouncement msg_var = obj->broadcast_channel_announcement.msg;
2192 uint64_t msg_ref = 0;
2193 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2194 msg_ref = tag_ptr(msg_var.inner, false);
2197 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_BroadcastChannelAnnouncement_get_update_msg"))) TS_LDKMessageSendEvent_BroadcastChannelAnnouncement_get_update_msg(uint64_t ptr) {
2198 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2199 assert(obj->tag == LDKMessageSendEvent_BroadcastChannelAnnouncement);
2200 LDKChannelUpdate update_msg_var = obj->broadcast_channel_announcement.update_msg;
2201 uint64_t update_msg_ref = 0;
2202 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_var);
2203 update_msg_ref = tag_ptr(update_msg_var.inner, false);
2204 return update_msg_ref;
2206 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_BroadcastNodeAnnouncement_get_msg"))) TS_LDKMessageSendEvent_BroadcastNodeAnnouncement_get_msg(uint64_t ptr) {
2207 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2208 assert(obj->tag == LDKMessageSendEvent_BroadcastNodeAnnouncement);
2209 LDKNodeAnnouncement msg_var = obj->broadcast_node_announcement.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 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_BroadcastChannelUpdate_get_msg"))) TS_LDKMessageSendEvent_BroadcastChannelUpdate_get_msg(uint64_t ptr) {
2216 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2217 assert(obj->tag == LDKMessageSendEvent_BroadcastChannelUpdate);
2218 LDKChannelUpdate msg_var = obj->broadcast_channel_update.msg;
2219 uint64_t msg_ref = 0;
2220 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2221 msg_ref = tag_ptr(msg_var.inner, false);
2224 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelUpdate_get_node_id"))) TS_LDKMessageSendEvent_SendChannelUpdate_get_node_id(uint64_t ptr) {
2225 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2226 assert(obj->tag == LDKMessageSendEvent_SendChannelUpdate);
2227 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2228 memcpy(node_id_arr->elems, obj->send_channel_update.node_id.compressed_form, 33);
2231 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelUpdate_get_msg"))) TS_LDKMessageSendEvent_SendChannelUpdate_get_msg(uint64_t ptr) {
2232 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2233 assert(obj->tag == LDKMessageSendEvent_SendChannelUpdate);
2234 LDKChannelUpdate msg_var = obj->send_channel_update.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 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_HandleError_get_node_id"))) TS_LDKMessageSendEvent_HandleError_get_node_id(uint64_t ptr) {
2241 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2242 assert(obj->tag == LDKMessageSendEvent_HandleError);
2243 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2244 memcpy(node_id_arr->elems, obj->handle_error.node_id.compressed_form, 33);
2247 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_HandleError_get_action"))) TS_LDKMessageSendEvent_HandleError_get_action(uint64_t ptr) {
2248 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2249 assert(obj->tag == LDKMessageSendEvent_HandleError);
2250 uint64_t action_ref = tag_ptr(&obj->handle_error.action, false);
2253 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelRangeQuery_get_node_id"))) TS_LDKMessageSendEvent_SendChannelRangeQuery_get_node_id(uint64_t ptr) {
2254 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2255 assert(obj->tag == LDKMessageSendEvent_SendChannelRangeQuery);
2256 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2257 memcpy(node_id_arr->elems, obj->send_channel_range_query.node_id.compressed_form, 33);
2260 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendChannelRangeQuery_get_msg"))) TS_LDKMessageSendEvent_SendChannelRangeQuery_get_msg(uint64_t ptr) {
2261 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2262 assert(obj->tag == LDKMessageSendEvent_SendChannelRangeQuery);
2263 LDKQueryChannelRange msg_var = obj->send_channel_range_query.msg;
2264 uint64_t msg_ref = 0;
2265 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2266 msg_ref = tag_ptr(msg_var.inner, false);
2269 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendShortIdsQuery_get_node_id"))) TS_LDKMessageSendEvent_SendShortIdsQuery_get_node_id(uint64_t ptr) {
2270 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2271 assert(obj->tag == LDKMessageSendEvent_SendShortIdsQuery);
2272 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2273 memcpy(node_id_arr->elems, obj->send_short_ids_query.node_id.compressed_form, 33);
2276 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendShortIdsQuery_get_msg"))) TS_LDKMessageSendEvent_SendShortIdsQuery_get_msg(uint64_t ptr) {
2277 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2278 assert(obj->tag == LDKMessageSendEvent_SendShortIdsQuery);
2279 LDKQueryShortChannelIds msg_var = obj->send_short_ids_query.msg;
2280 uint64_t msg_ref = 0;
2281 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2282 msg_ref = tag_ptr(msg_var.inner, false);
2285 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendReplyChannelRange_get_node_id"))) TS_LDKMessageSendEvent_SendReplyChannelRange_get_node_id(uint64_t ptr) {
2286 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2287 assert(obj->tag == LDKMessageSendEvent_SendReplyChannelRange);
2288 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2289 memcpy(node_id_arr->elems, obj->send_reply_channel_range.node_id.compressed_form, 33);
2292 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendReplyChannelRange_get_msg"))) TS_LDKMessageSendEvent_SendReplyChannelRange_get_msg(uint64_t ptr) {
2293 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2294 assert(obj->tag == LDKMessageSendEvent_SendReplyChannelRange);
2295 LDKReplyChannelRange msg_var = obj->send_reply_channel_range.msg;
2296 uint64_t msg_ref = 0;
2297 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2298 msg_ref = tag_ptr(msg_var.inner, false);
2301 int8_tArray __attribute__((export_name("TS_LDKMessageSendEvent_SendGossipTimestampFilter_get_node_id"))) TS_LDKMessageSendEvent_SendGossipTimestampFilter_get_node_id(uint64_t ptr) {
2302 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2303 assert(obj->tag == LDKMessageSendEvent_SendGossipTimestampFilter);
2304 int8_tArray node_id_arr = init_int8_tArray(33, __LINE__);
2305 memcpy(node_id_arr->elems, obj->send_gossip_timestamp_filter.node_id.compressed_form, 33);
2308 uint64_t __attribute__((export_name("TS_LDKMessageSendEvent_SendGossipTimestampFilter_get_msg"))) TS_LDKMessageSendEvent_SendGossipTimestampFilter_get_msg(uint64_t ptr) {
2309 LDKMessageSendEvent *obj = (LDKMessageSendEvent*)untag_ptr(ptr);
2310 assert(obj->tag == LDKMessageSendEvent_SendGossipTimestampFilter);
2311 LDKGossipTimestampFilter msg_var = obj->send_gossip_timestamp_filter.msg;
2312 uint64_t msg_ref = 0;
2313 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
2314 msg_ref = tag_ptr(msg_var.inner, false);
2317 static inline LDKCVec_MessageSendEventZ CVec_MessageSendEventZ_clone(const LDKCVec_MessageSendEventZ *orig) {
2318 LDKCVec_MessageSendEventZ ret = { .data = MALLOC(sizeof(LDKMessageSendEvent) * orig->datalen, "LDKCVec_MessageSendEventZ clone bytes"), .datalen = orig->datalen };
2319 for (size_t i = 0; i < ret.datalen; i++) {
2320 ret.data[i] = MessageSendEvent_clone(&orig->data[i]);
2324 static inline struct LDKTxOut CResult_TxOutAccessErrorZ_get_ok(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR owner){
2325 CHECK(owner->result_ok);
2326 return TxOut_clone(&*owner->contents.result);
2328 uint64_t __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_get_ok"))) TS_CResult_TxOutAccessErrorZ_get_ok(uint64_t owner) {
2329 LDKCResult_TxOutAccessErrorZ* owner_conv = (LDKCResult_TxOutAccessErrorZ*)untag_ptr(owner);
2330 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
2331 *ret_ref = CResult_TxOutAccessErrorZ_get_ok(owner_conv);
2332 return tag_ptr(ret_ref, true);
2335 static inline enum LDKAccessError CResult_TxOutAccessErrorZ_get_err(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR owner){
2336 CHECK(!owner->result_ok);
2337 return AccessError_clone(&*owner->contents.err);
2339 uint32_t __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_get_err"))) TS_CResult_TxOutAccessErrorZ_get_err(uint64_t owner) {
2340 LDKCResult_TxOutAccessErrorZ* owner_conv = (LDKCResult_TxOutAccessErrorZ*)untag_ptr(owner);
2341 uint32_t ret_conv = LDKAccessError_to_js(CResult_TxOutAccessErrorZ_get_err(owner_conv));
2345 static inline uintptr_t C2Tuple_usizeTransactionZ_get_a(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR owner){
2348 uint32_t __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_get_a"))) TS_C2Tuple_usizeTransactionZ_get_a(uint64_t owner) {
2349 LDKC2Tuple_usizeTransactionZ* owner_conv = (LDKC2Tuple_usizeTransactionZ*)untag_ptr(owner);
2350 uint32_t ret_conv = C2Tuple_usizeTransactionZ_get_a(owner_conv);
2354 static inline struct LDKTransaction C2Tuple_usizeTransactionZ_get_b(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR owner){
2357 int8_tArray __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_get_b"))) TS_C2Tuple_usizeTransactionZ_get_b(uint64_t owner) {
2358 LDKC2Tuple_usizeTransactionZ* owner_conv = (LDKC2Tuple_usizeTransactionZ*)untag_ptr(owner);
2359 LDKTransaction ret_var = C2Tuple_usizeTransactionZ_get_b(owner_conv);
2360 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
2361 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
2365 static inline LDKCVec_C2Tuple_usizeTransactionZZ CVec_C2Tuple_usizeTransactionZZ_clone(const LDKCVec_C2Tuple_usizeTransactionZZ *orig) {
2366 LDKCVec_C2Tuple_usizeTransactionZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ) * orig->datalen, "LDKCVec_C2Tuple_usizeTransactionZZ clone bytes"), .datalen = orig->datalen };
2367 for (size_t i = 0; i < ret.datalen; i++) {
2368 ret.data[i] = C2Tuple_usizeTransactionZ_clone(&orig->data[i]);
2372 static inline LDKCVec_TxidZ CVec_TxidZ_clone(const LDKCVec_TxidZ *orig) {
2373 LDKCVec_TxidZ ret = { .data = MALLOC(sizeof(LDKThirtyTwoBytes) * orig->datalen, "LDKCVec_TxidZ clone bytes"), .datalen = orig->datalen };
2374 for (size_t i = 0; i < ret.datalen; i++) {
2375 ret.data[i] = ThirtyTwoBytes_clone(&orig->data[i]);
2379 static inline void CResult_NoneChannelMonitorUpdateErrZ_get_ok(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR owner){
2380 CHECK(owner->result_ok);
2381 return *owner->contents.result;
2383 void __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_get_ok"))) TS_CResult_NoneChannelMonitorUpdateErrZ_get_ok(uint64_t owner) {
2384 LDKCResult_NoneChannelMonitorUpdateErrZ* owner_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)untag_ptr(owner);
2385 CResult_NoneChannelMonitorUpdateErrZ_get_ok(owner_conv);
2388 static inline enum LDKChannelMonitorUpdateErr CResult_NoneChannelMonitorUpdateErrZ_get_err(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR owner){
2389 CHECK(!owner->result_ok);
2390 return ChannelMonitorUpdateErr_clone(&*owner->contents.err);
2392 uint32_t __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_get_err"))) TS_CResult_NoneChannelMonitorUpdateErrZ_get_err(uint64_t owner) {
2393 LDKCResult_NoneChannelMonitorUpdateErrZ* owner_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)untag_ptr(owner);
2394 uint32_t ret_conv = LDKChannelMonitorUpdateErr_to_js(CResult_NoneChannelMonitorUpdateErrZ_get_err(owner_conv));
2398 uint32_t __attribute__((export_name("TS_LDKMonitorEvent_ty_from_ptr"))) TS_LDKMonitorEvent_ty_from_ptr(uint64_t ptr) {
2399 LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr);
2401 case LDKMonitorEvent_HTLCEvent: return 0;
2402 case LDKMonitorEvent_CommitmentTxConfirmed: return 1;
2403 case LDKMonitorEvent_UpdateCompleted: return 2;
2404 case LDKMonitorEvent_UpdateFailed: return 3;
2408 uint64_t __attribute__((export_name("TS_LDKMonitorEvent_HTLCEvent_get_htlc_event"))) TS_LDKMonitorEvent_HTLCEvent_get_htlc_event(uint64_t ptr) {
2409 LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr);
2410 assert(obj->tag == LDKMonitorEvent_HTLCEvent);
2411 LDKHTLCUpdate htlc_event_var = obj->htlc_event;
2412 uint64_t htlc_event_ref = 0;
2413 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_event_var);
2414 htlc_event_ref = tag_ptr(htlc_event_var.inner, false);
2415 return htlc_event_ref;
2417 uint64_t __attribute__((export_name("TS_LDKMonitorEvent_CommitmentTxConfirmed_get_commitment_tx_confirmed"))) TS_LDKMonitorEvent_CommitmentTxConfirmed_get_commitment_tx_confirmed(uint64_t ptr) {
2418 LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr);
2419 assert(obj->tag == LDKMonitorEvent_CommitmentTxConfirmed);
2420 LDKOutPoint commitment_tx_confirmed_var = obj->commitment_tx_confirmed;
2421 uint64_t commitment_tx_confirmed_ref = 0;
2422 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_confirmed_var);
2423 commitment_tx_confirmed_ref = tag_ptr(commitment_tx_confirmed_var.inner, false);
2424 return commitment_tx_confirmed_ref;
2426 uint64_t __attribute__((export_name("TS_LDKMonitorEvent_UpdateCompleted_get_funding_txo"))) TS_LDKMonitorEvent_UpdateCompleted_get_funding_txo(uint64_t ptr) {
2427 LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr);
2428 assert(obj->tag == LDKMonitorEvent_UpdateCompleted);
2429 LDKOutPoint funding_txo_var = obj->update_completed.funding_txo;
2430 uint64_t funding_txo_ref = 0;
2431 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var);
2432 funding_txo_ref = tag_ptr(funding_txo_var.inner, false);
2433 return funding_txo_ref;
2435 int64_t __attribute__((export_name("TS_LDKMonitorEvent_UpdateCompleted_get_monitor_update_id"))) TS_LDKMonitorEvent_UpdateCompleted_get_monitor_update_id(uint64_t ptr) {
2436 LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr);
2437 assert(obj->tag == LDKMonitorEvent_UpdateCompleted);
2438 int64_t monitor_update_id_conv = obj->update_completed.monitor_update_id;
2439 return monitor_update_id_conv;
2441 uint64_t __attribute__((export_name("TS_LDKMonitorEvent_UpdateFailed_get_update_failed"))) TS_LDKMonitorEvent_UpdateFailed_get_update_failed(uint64_t ptr) {
2442 LDKMonitorEvent *obj = (LDKMonitorEvent*)untag_ptr(ptr);
2443 assert(obj->tag == LDKMonitorEvent_UpdateFailed);
2444 LDKOutPoint update_failed_var = obj->update_failed;
2445 uint64_t update_failed_ref = 0;
2446 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_failed_var);
2447 update_failed_ref = tag_ptr(update_failed_var.inner, false);
2448 return update_failed_ref;
2450 static inline LDKCVec_MonitorEventZ CVec_MonitorEventZ_clone(const LDKCVec_MonitorEventZ *orig) {
2451 LDKCVec_MonitorEventZ ret = { .data = MALLOC(sizeof(LDKMonitorEvent) * orig->datalen, "LDKCVec_MonitorEventZ clone bytes"), .datalen = orig->datalen };
2452 for (size_t i = 0; i < ret.datalen; i++) {
2453 ret.data[i] = MonitorEvent_clone(&orig->data[i]);
2457 static inline struct LDKOutPoint C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner){
2458 return OutPoint_clone(&owner->a);
2460 uint64_t __attribute__((export_name("TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a(uint64_t owner) {
2461 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner);
2462 LDKOutPoint ret_var = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_a(owner_conv);
2463 uint64_t ret_ref = 0;
2464 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2465 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2469 static inline struct LDKCVec_MonitorEventZ C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner){
2470 return CVec_MonitorEventZ_clone(&owner->b);
2472 uint64_tArray __attribute__((export_name("TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b(uint64_t owner) {
2473 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner);
2474 LDKCVec_MonitorEventZ ret_var = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_b(owner_conv);
2475 uint64_tArray ret_arr = NULL;
2476 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
2477 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
2478 for (size_t o = 0; o < ret_var.datalen; o++) {
2479 LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
2480 *ret_conv_14_copy = ret_var.data[o];
2481 uint64_t ret_conv_14_ref = tag_ptr(ret_conv_14_copy, true);
2482 ret_arr_ptr[o] = ret_conv_14_ref;
2489 static inline struct LDKPublicKey C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR owner){
2492 int8_tArray __attribute__((export_name("TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c(uint64_t owner) {
2493 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* owner_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(owner);
2494 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
2495 memcpy(ret_arr->elems, C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_get_c(owner_conv).compressed_form, 33);
2499 static inline LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_clone(const LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ *orig) {
2500 LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ ret = { .data = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ) * orig->datalen, "LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ clone bytes"), .datalen = orig->datalen };
2501 for (size_t i = 0; i < ret.datalen; i++) {
2502 ret.data[i] = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(&orig->data[i]);
2506 uint32_t __attribute__((export_name("TS_LDKCOption_C2Tuple_usizeTransactionZZ_ty_from_ptr"))) TS_LDKCOption_C2Tuple_usizeTransactionZZ_ty_from_ptr(uint64_t ptr) {
2507 LDKCOption_C2Tuple_usizeTransactionZZ *obj = (LDKCOption_C2Tuple_usizeTransactionZZ*)untag_ptr(ptr);
2509 case LDKCOption_C2Tuple_usizeTransactionZZ_Some: return 0;
2510 case LDKCOption_C2Tuple_usizeTransactionZZ_None: return 1;
2514 uint64_t __attribute__((export_name("TS_LDKCOption_C2Tuple_usizeTransactionZZ_Some_get_some"))) TS_LDKCOption_C2Tuple_usizeTransactionZZ_Some_get_some(uint64_t ptr) {
2515 LDKCOption_C2Tuple_usizeTransactionZZ *obj = (LDKCOption_C2Tuple_usizeTransactionZZ*)untag_ptr(ptr);
2516 assert(obj->tag == LDKCOption_C2Tuple_usizeTransactionZZ_Some);
2517 LDKC2Tuple_usizeTransactionZ* some_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
2518 *some_conv = obj->some;
2519 *some_conv = C2Tuple_usizeTransactionZ_clone(some_conv);
2520 return tag_ptr(some_conv, true);
2522 static inline struct LDKFixedPenaltyScorer CResult_FixedPenaltyScorerDecodeErrorZ_get_ok(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR owner){
2523 CHECK(owner->result_ok);
2524 return FixedPenaltyScorer_clone(&*owner->contents.result);
2526 uint64_t __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_get_ok"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_get_ok(uint64_t owner) {
2527 LDKCResult_FixedPenaltyScorerDecodeErrorZ* owner_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(owner);
2528 LDKFixedPenaltyScorer ret_var = CResult_FixedPenaltyScorerDecodeErrorZ_get_ok(owner_conv);
2529 uint64_t ret_ref = 0;
2530 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2531 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2535 static inline struct LDKDecodeError CResult_FixedPenaltyScorerDecodeErrorZ_get_err(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR owner){
2536 CHECK(!owner->result_ok);
2537 return DecodeError_clone(&*owner->contents.err);
2539 uint64_t __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_get_err"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_get_err(uint64_t owner) {
2540 LDKCResult_FixedPenaltyScorerDecodeErrorZ* owner_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(owner);
2541 LDKDecodeError ret_var = CResult_FixedPenaltyScorerDecodeErrorZ_get_err(owner_conv);
2542 uint64_t ret_ref = 0;
2543 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2544 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2548 static inline uint64_t C2Tuple_u64u64Z_get_a(LDKC2Tuple_u64u64Z *NONNULL_PTR owner){
2551 int64_t __attribute__((export_name("TS_C2Tuple_u64u64Z_get_a"))) TS_C2Tuple_u64u64Z_get_a(uint64_t owner) {
2552 LDKC2Tuple_u64u64Z* owner_conv = (LDKC2Tuple_u64u64Z*)untag_ptr(owner);
2553 int64_t ret_conv = C2Tuple_u64u64Z_get_a(owner_conv);
2557 static inline uint64_t C2Tuple_u64u64Z_get_b(LDKC2Tuple_u64u64Z *NONNULL_PTR owner){
2560 int64_t __attribute__((export_name("TS_C2Tuple_u64u64Z_get_b"))) TS_C2Tuple_u64u64Z_get_b(uint64_t owner) {
2561 LDKC2Tuple_u64u64Z* owner_conv = (LDKC2Tuple_u64u64Z*)untag_ptr(owner);
2562 int64_t ret_conv = C2Tuple_u64u64Z_get_b(owner_conv);
2566 uint32_t __attribute__((export_name("TS_LDKCOption_C2Tuple_u64u64ZZ_ty_from_ptr"))) TS_LDKCOption_C2Tuple_u64u64ZZ_ty_from_ptr(uint64_t ptr) {
2567 LDKCOption_C2Tuple_u64u64ZZ *obj = (LDKCOption_C2Tuple_u64u64ZZ*)untag_ptr(ptr);
2569 case LDKCOption_C2Tuple_u64u64ZZ_Some: return 0;
2570 case LDKCOption_C2Tuple_u64u64ZZ_None: return 1;
2574 uint64_t __attribute__((export_name("TS_LDKCOption_C2Tuple_u64u64ZZ_Some_get_some"))) TS_LDKCOption_C2Tuple_u64u64ZZ_Some_get_some(uint64_t ptr) {
2575 LDKCOption_C2Tuple_u64u64ZZ *obj = (LDKCOption_C2Tuple_u64u64ZZ*)untag_ptr(ptr);
2576 assert(obj->tag == LDKCOption_C2Tuple_u64u64ZZ_Some);
2577 LDKC2Tuple_u64u64Z* some_conv = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
2578 *some_conv = obj->some;
2579 *some_conv = C2Tuple_u64u64Z_clone(some_conv);
2580 return tag_ptr(some_conv, true);
2582 static inline LDKCVec_NodeIdZ CVec_NodeIdZ_clone(const LDKCVec_NodeIdZ *orig) {
2583 LDKCVec_NodeIdZ ret = { .data = MALLOC(sizeof(LDKNodeId) * orig->datalen, "LDKCVec_NodeIdZ clone bytes"), .datalen = orig->datalen };
2584 for (size_t i = 0; i < ret.datalen; i++) {
2585 ret.data[i] = NodeId_clone(&orig->data[i]);
2589 typedef struct LDKLogger_JCalls {
2590 atomic_size_t refcnt;
2591 uint32_t instance_ptr;
2593 static void LDKLogger_JCalls_free(void* this_arg) {
2594 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
2595 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
2599 void log_LDKLogger_jcall(const void* this_arg, const LDKRecord * record) {
2600 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) this_arg;
2601 LDKRecord record_var = *record;
2602 uint64_t record_ref = 0;
2603 record_var = Record_clone(&record_var);
2604 CHECK_INNER_FIELD_ACCESS_OR_NULL(record_var);
2605 record_ref = tag_ptr(record_var.inner, record_var.is_owned);
2606 js_invoke_function_buuuuu(j_calls->instance_ptr, 0, record_ref, 0, 0, 0, 0, 0);
2608 static void LDKLogger_JCalls_cloned(LDKLogger* new_obj) {
2609 LDKLogger_JCalls *j_calls = (LDKLogger_JCalls*) new_obj->this_arg;
2610 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
2612 static inline LDKLogger LDKLogger_init (JSValue o) {
2613 LDKLogger_JCalls *calls = MALLOC(sizeof(LDKLogger_JCalls), "LDKLogger_JCalls");
2614 atomic_init(&calls->refcnt, 1);
2615 calls->instance_ptr = o;
2618 .this_arg = (void*) calls,
2619 .log = log_LDKLogger_jcall,
2620 .free = LDKLogger_JCalls_free,
2624 uint64_t __attribute__((export_name("TS_LDKLogger_new"))) TS_LDKLogger_new(JSValue o) {
2625 LDKLogger *res_ptr = MALLOC(sizeof(LDKLogger), "LDKLogger");
2626 *res_ptr = LDKLogger_init(o);
2627 return tag_ptr(res_ptr, true);
2629 static inline struct LDKProbabilisticScorer *CResult_ProbabilisticScorerDecodeErrorZ_get_ok(LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR owner){
2630 CHECK(owner->result_ok);
2631 return &*owner->contents.result;
2633 uint64_t __attribute__((export_name("TS_CResult_ProbabilisticScorerDecodeErrorZ_get_ok"))) TS_CResult_ProbabilisticScorerDecodeErrorZ_get_ok(uint64_t owner) {
2634 LDKCResult_ProbabilisticScorerDecodeErrorZ* owner_conv = (LDKCResult_ProbabilisticScorerDecodeErrorZ*)untag_ptr(owner);
2635 LDKProbabilisticScorer ret_var = *CResult_ProbabilisticScorerDecodeErrorZ_get_ok(owner_conv);
2636 uint64_t ret_ref = 0;
2637 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2638 ret_ref = tag_ptr(ret_var.inner, false);
2642 static inline struct LDKDecodeError CResult_ProbabilisticScorerDecodeErrorZ_get_err(LDKCResult_ProbabilisticScorerDecodeErrorZ *NONNULL_PTR owner){
2643 CHECK(!owner->result_ok);
2644 return DecodeError_clone(&*owner->contents.err);
2646 uint64_t __attribute__((export_name("TS_CResult_ProbabilisticScorerDecodeErrorZ_get_err"))) TS_CResult_ProbabilisticScorerDecodeErrorZ_get_err(uint64_t owner) {
2647 LDKCResult_ProbabilisticScorerDecodeErrorZ* owner_conv = (LDKCResult_ProbabilisticScorerDecodeErrorZ*)untag_ptr(owner);
2648 LDKDecodeError ret_var = CResult_ProbabilisticScorerDecodeErrorZ_get_err(owner_conv);
2649 uint64_t ret_ref = 0;
2650 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2651 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2655 static inline struct LDKInitFeatures CResult_InitFeaturesDecodeErrorZ_get_ok(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR owner){
2656 CHECK(owner->result_ok);
2657 return InitFeatures_clone(&*owner->contents.result);
2659 uint64_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_get_ok"))) TS_CResult_InitFeaturesDecodeErrorZ_get_ok(uint64_t owner) {
2660 LDKCResult_InitFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(owner);
2661 LDKInitFeatures ret_var = CResult_InitFeaturesDecodeErrorZ_get_ok(owner_conv);
2662 uint64_t ret_ref = 0;
2663 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2664 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2668 static inline struct LDKDecodeError CResult_InitFeaturesDecodeErrorZ_get_err(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR owner){
2669 CHECK(!owner->result_ok);
2670 return DecodeError_clone(&*owner->contents.err);
2672 uint64_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_get_err"))) TS_CResult_InitFeaturesDecodeErrorZ_get_err(uint64_t owner) {
2673 LDKCResult_InitFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(owner);
2674 LDKDecodeError ret_var = CResult_InitFeaturesDecodeErrorZ_get_err(owner_conv);
2675 uint64_t ret_ref = 0;
2676 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2677 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2681 static inline struct LDKChannelFeatures CResult_ChannelFeaturesDecodeErrorZ_get_ok(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR owner){
2682 CHECK(owner->result_ok);
2683 return ChannelFeatures_clone(&*owner->contents.result);
2685 uint64_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_get_ok"))) TS_CResult_ChannelFeaturesDecodeErrorZ_get_ok(uint64_t owner) {
2686 LDKCResult_ChannelFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(owner);
2687 LDKChannelFeatures ret_var = CResult_ChannelFeaturesDecodeErrorZ_get_ok(owner_conv);
2688 uint64_t ret_ref = 0;
2689 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2690 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2694 static inline struct LDKDecodeError CResult_ChannelFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR owner){
2695 CHECK(!owner->result_ok);
2696 return DecodeError_clone(&*owner->contents.err);
2698 uint64_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_get_err"))) TS_CResult_ChannelFeaturesDecodeErrorZ_get_err(uint64_t owner) {
2699 LDKCResult_ChannelFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(owner);
2700 LDKDecodeError ret_var = CResult_ChannelFeaturesDecodeErrorZ_get_err(owner_conv);
2701 uint64_t ret_ref = 0;
2702 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2703 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2707 static inline struct LDKNodeFeatures CResult_NodeFeaturesDecodeErrorZ_get_ok(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR owner){
2708 CHECK(owner->result_ok);
2709 return NodeFeatures_clone(&*owner->contents.result);
2711 uint64_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_get_ok"))) TS_CResult_NodeFeaturesDecodeErrorZ_get_ok(uint64_t owner) {
2712 LDKCResult_NodeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(owner);
2713 LDKNodeFeatures ret_var = CResult_NodeFeaturesDecodeErrorZ_get_ok(owner_conv);
2714 uint64_t ret_ref = 0;
2715 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2716 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2720 static inline struct LDKDecodeError CResult_NodeFeaturesDecodeErrorZ_get_err(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR owner){
2721 CHECK(!owner->result_ok);
2722 return DecodeError_clone(&*owner->contents.err);
2724 uint64_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_get_err"))) TS_CResult_NodeFeaturesDecodeErrorZ_get_err(uint64_t owner) {
2725 LDKCResult_NodeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(owner);
2726 LDKDecodeError ret_var = CResult_NodeFeaturesDecodeErrorZ_get_err(owner_conv);
2727 uint64_t ret_ref = 0;
2728 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2729 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2733 static inline struct LDKInvoiceFeatures CResult_InvoiceFeaturesDecodeErrorZ_get_ok(LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner){
2734 CHECK(owner->result_ok);
2735 return InvoiceFeatures_clone(&*owner->contents.result);
2737 uint64_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_get_ok"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_get_ok(uint64_t owner) {
2738 LDKCResult_InvoiceFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(owner);
2739 LDKInvoiceFeatures ret_var = CResult_InvoiceFeaturesDecodeErrorZ_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_InvoiceFeaturesDecodeErrorZ_get_err(LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR owner){
2747 CHECK(!owner->result_ok);
2748 return DecodeError_clone(&*owner->contents.err);
2750 uint64_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_get_err"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_get_err(uint64_t owner) {
2751 LDKCResult_InvoiceFeaturesDecodeErrorZ* owner_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(owner);
2752 LDKDecodeError ret_var = CResult_InvoiceFeaturesDecodeErrorZ_get_err(owner_conv);
2753 uint64_t ret_ref = 0;
2754 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2755 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2759 static inline struct LDKChannelTypeFeatures CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR owner){
2760 CHECK(owner->result_ok);
2761 return ChannelTypeFeatures_clone(&*owner->contents.result);
2763 uint64_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(uint64_t owner) {
2764 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(owner);
2765 LDKChannelTypeFeatures ret_var = CResult_ChannelTypeFeaturesDecodeErrorZ_get_ok(owner_conv);
2766 uint64_t ret_ref = 0;
2767 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2768 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2772 static inline struct LDKDecodeError CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR owner){
2773 CHECK(!owner->result_ok);
2774 return DecodeError_clone(&*owner->contents.err);
2776 uint64_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_get_err"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(uint64_t owner) {
2777 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* owner_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(owner);
2778 LDKDecodeError ret_var = CResult_ChannelTypeFeaturesDecodeErrorZ_get_err(owner_conv);
2779 uint64_t ret_ref = 0;
2780 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2781 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2785 static inline struct LDKNodeId CResult_NodeIdDecodeErrorZ_get_ok(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner){
2786 CHECK(owner->result_ok);
2787 return NodeId_clone(&*owner->contents.result);
2789 uint64_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_get_ok"))) TS_CResult_NodeIdDecodeErrorZ_get_ok(uint64_t owner) {
2790 LDKCResult_NodeIdDecodeErrorZ* owner_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(owner);
2791 LDKNodeId ret_var = CResult_NodeIdDecodeErrorZ_get_ok(owner_conv);
2792 uint64_t ret_ref = 0;
2793 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2794 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2798 static inline struct LDKDecodeError CResult_NodeIdDecodeErrorZ_get_err(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR owner){
2799 CHECK(!owner->result_ok);
2800 return DecodeError_clone(&*owner->contents.err);
2802 uint64_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_get_err"))) TS_CResult_NodeIdDecodeErrorZ_get_err(uint64_t owner) {
2803 LDKCResult_NodeIdDecodeErrorZ* owner_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(owner);
2804 LDKDecodeError ret_var = CResult_NodeIdDecodeErrorZ_get_err(owner_conv);
2805 uint64_t ret_ref = 0;
2806 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2807 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2811 static inline struct LDKCOption_NetworkUpdateZ CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR owner){
2812 CHECK(owner->result_ok);
2813 return COption_NetworkUpdateZ_clone(&*owner->contents.result);
2815 uint64_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(uint64_t owner) {
2816 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* owner_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(owner);
2817 LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
2818 *ret_copy = CResult_COption_NetworkUpdateZDecodeErrorZ_get_ok(owner_conv);
2819 uint64_t ret_ref = tag_ptr(ret_copy, true);
2823 static inline struct LDKDecodeError CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR owner){
2824 CHECK(!owner->result_ok);
2825 return DecodeError_clone(&*owner->contents.err);
2827 uint64_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_get_err"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(uint64_t owner) {
2828 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* owner_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(owner);
2829 LDKDecodeError ret_var = CResult_COption_NetworkUpdateZDecodeErrorZ_get_err(owner_conv);
2830 uint64_t ret_ref = 0;
2831 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2832 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2836 typedef struct LDKAccess_JCalls {
2837 atomic_size_t refcnt;
2838 uint32_t instance_ptr;
2840 static void LDKAccess_JCalls_free(void* this_arg) {
2841 LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg;
2842 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
2846 LDKCResult_TxOutAccessErrorZ get_utxo_LDKAccess_jcall(const void* this_arg, const uint8_t (* genesis_hash)[32], uint64_t short_channel_id) {
2847 LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) this_arg;
2848 int8_tArray genesis_hash_arr = init_int8_tArray(32, __LINE__);
2849 memcpy(genesis_hash_arr->elems, *genesis_hash, 32);
2850 int64_t short_channel_id_conv = short_channel_id;
2851 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);
2852 void* ret_ptr = untag_ptr(ret);
2853 CHECK_ACCESS(ret_ptr);
2854 LDKCResult_TxOutAccessErrorZ ret_conv = *(LDKCResult_TxOutAccessErrorZ*)(ret_ptr);
2855 FREE(untag_ptr(ret));
2858 static void LDKAccess_JCalls_cloned(LDKAccess* new_obj) {
2859 LDKAccess_JCalls *j_calls = (LDKAccess_JCalls*) new_obj->this_arg;
2860 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
2862 static inline LDKAccess LDKAccess_init (JSValue o) {
2863 LDKAccess_JCalls *calls = MALLOC(sizeof(LDKAccess_JCalls), "LDKAccess_JCalls");
2864 atomic_init(&calls->refcnt, 1);
2865 calls->instance_ptr = o;
2868 .this_arg = (void*) calls,
2869 .get_utxo = get_utxo_LDKAccess_jcall,
2870 .free = LDKAccess_JCalls_free,
2874 uint64_t __attribute__((export_name("TS_LDKAccess_new"))) TS_LDKAccess_new(JSValue o) {
2875 LDKAccess *res_ptr = MALLOC(sizeof(LDKAccess), "LDKAccess");
2876 *res_ptr = LDKAccess_init(o);
2877 return tag_ptr(res_ptr, true);
2879 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) {
2880 void* this_arg_ptr = untag_ptr(this_arg);
2881 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
2882 LDKAccess* this_arg_conv = (LDKAccess*)this_arg_ptr;
2883 unsigned char genesis_hash_arr[32];
2884 CHECK(genesis_hash->arr_len == 32);
2885 memcpy(genesis_hash_arr, genesis_hash->elems, 32); FREE(genesis_hash);
2886 unsigned char (*genesis_hash_ref)[32] = &genesis_hash_arr;
2887 LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
2888 *ret_conv = (this_arg_conv->get_utxo)(this_arg_conv->this_arg, genesis_hash_ref, short_channel_id);
2889 return tag_ptr(ret_conv, true);
2892 uint32_t __attribute__((export_name("TS_LDKCOption_AccessZ_ty_from_ptr"))) TS_LDKCOption_AccessZ_ty_from_ptr(uint64_t ptr) {
2893 LDKCOption_AccessZ *obj = (LDKCOption_AccessZ*)untag_ptr(ptr);
2895 case LDKCOption_AccessZ_Some: return 0;
2896 case LDKCOption_AccessZ_None: return 1;
2900 uint64_t __attribute__((export_name("TS_LDKCOption_AccessZ_Some_get_some"))) TS_LDKCOption_AccessZ_Some_get_some(uint64_t ptr) {
2901 LDKCOption_AccessZ *obj = (LDKCOption_AccessZ*)untag_ptr(ptr);
2902 assert(obj->tag == LDKCOption_AccessZ_Some);
2903 LDKAccess* some_ret = MALLOC(sizeof(LDKAccess), "LDKAccess");
2904 *some_ret = obj->some;
2905 // WARNING: We likely need to clone here, but no clone is available, so we just do it for Java instances
2906 if ((*some_ret).free == LDKAccess_JCalls_free) {
2907 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
2908 LDKAccess_JCalls_cloned(&(*some_ret));
2910 return tag_ptr(some_ret, true);
2912 static inline bool CResult_boolLightningErrorZ_get_ok(LDKCResult_boolLightningErrorZ *NONNULL_PTR owner){
2913 CHECK(owner->result_ok);
2914 return *owner->contents.result;
2916 jboolean __attribute__((export_name("TS_CResult_boolLightningErrorZ_get_ok"))) TS_CResult_boolLightningErrorZ_get_ok(uint64_t owner) {
2917 LDKCResult_boolLightningErrorZ* owner_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(owner);
2918 jboolean ret_conv = CResult_boolLightningErrorZ_get_ok(owner_conv);
2922 static inline struct LDKLightningError CResult_boolLightningErrorZ_get_err(LDKCResult_boolLightningErrorZ *NONNULL_PTR owner){
2923 CHECK(!owner->result_ok);
2924 return LightningError_clone(&*owner->contents.err);
2926 uint64_t __attribute__((export_name("TS_CResult_boolLightningErrorZ_get_err"))) TS_CResult_boolLightningErrorZ_get_err(uint64_t owner) {
2927 LDKCResult_boolLightningErrorZ* owner_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(owner);
2928 LDKLightningError ret_var = CResult_boolLightningErrorZ_get_err(owner_conv);
2929 uint64_t ret_ref = 0;
2930 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2931 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2935 static inline struct LDKChannelAnnouncement C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner){
2936 return ChannelAnnouncement_clone(&owner->a);
2938 uint64_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(uint64_t owner) {
2939 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(owner);
2940 LDKChannelAnnouncement ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_a(owner_conv);
2941 uint64_t ret_ref = 0;
2942 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2943 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2947 static inline struct LDKChannelUpdate C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner){
2948 return ChannelUpdate_clone(&owner->b);
2950 uint64_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(uint64_t owner) {
2951 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(owner);
2952 LDKChannelUpdate ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_b(owner_conv);
2953 uint64_t ret_ref = 0;
2954 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2955 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2959 static inline struct LDKChannelUpdate C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR owner){
2960 return ChannelUpdate_clone(&owner->c);
2962 uint64_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(uint64_t owner) {
2963 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* owner_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(owner);
2964 LDKChannelUpdate ret_var = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_get_c(owner_conv);
2965 uint64_t ret_ref = 0;
2966 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
2967 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
2971 static inline LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_clone(const LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ *orig) {
2972 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret = { .data = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ) * orig->datalen, "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ clone bytes"), .datalen = orig->datalen };
2973 for (size_t i = 0; i < ret.datalen; i++) {
2974 ret.data[i] = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(&orig->data[i]);
2978 static inline LDKCVec_NodeAnnouncementZ CVec_NodeAnnouncementZ_clone(const LDKCVec_NodeAnnouncementZ *orig) {
2979 LDKCVec_NodeAnnouncementZ ret = { .data = MALLOC(sizeof(LDKNodeAnnouncement) * orig->datalen, "LDKCVec_NodeAnnouncementZ clone bytes"), .datalen = orig->datalen };
2980 for (size_t i = 0; i < ret.datalen; i++) {
2981 ret.data[i] = NodeAnnouncement_clone(&orig->data[i]);
2985 static inline void CResult_NoneLightningErrorZ_get_ok(LDKCResult_NoneLightningErrorZ *NONNULL_PTR owner){
2986 CHECK(owner->result_ok);
2987 return *owner->contents.result;
2989 void __attribute__((export_name("TS_CResult_NoneLightningErrorZ_get_ok"))) TS_CResult_NoneLightningErrorZ_get_ok(uint64_t owner) {
2990 LDKCResult_NoneLightningErrorZ* owner_conv = (LDKCResult_NoneLightningErrorZ*)untag_ptr(owner);
2991 CResult_NoneLightningErrorZ_get_ok(owner_conv);
2994 static inline struct LDKLightningError CResult_NoneLightningErrorZ_get_err(LDKCResult_NoneLightningErrorZ *NONNULL_PTR owner){
2995 CHECK(!owner->result_ok);
2996 return LightningError_clone(&*owner->contents.err);
2998 uint64_t __attribute__((export_name("TS_CResult_NoneLightningErrorZ_get_err"))) TS_CResult_NoneLightningErrorZ_get_err(uint64_t owner) {
2999 LDKCResult_NoneLightningErrorZ* owner_conv = (LDKCResult_NoneLightningErrorZ*)untag_ptr(owner);
3000 LDKLightningError ret_var = CResult_NoneLightningErrorZ_get_err(owner_conv);
3001 uint64_t ret_ref = 0;
3002 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3003 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3007 static inline struct LDKChannelUpdateInfo CResult_ChannelUpdateInfoDecodeErrorZ_get_ok(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR owner){
3008 CHECK(owner->result_ok);
3009 return ChannelUpdateInfo_clone(&*owner->contents.result);
3011 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateInfoDecodeErrorZ_get_ok"))) TS_CResult_ChannelUpdateInfoDecodeErrorZ_get_ok(uint64_t owner) {
3012 LDKCResult_ChannelUpdateInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(owner);
3013 LDKChannelUpdateInfo ret_var = CResult_ChannelUpdateInfoDecodeErrorZ_get_ok(owner_conv);
3014 uint64_t ret_ref = 0;
3015 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3016 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3020 static inline struct LDKDecodeError CResult_ChannelUpdateInfoDecodeErrorZ_get_err(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR owner){
3021 CHECK(!owner->result_ok);
3022 return DecodeError_clone(&*owner->contents.err);
3024 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateInfoDecodeErrorZ_get_err"))) TS_CResult_ChannelUpdateInfoDecodeErrorZ_get_err(uint64_t owner) {
3025 LDKCResult_ChannelUpdateInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(owner);
3026 LDKDecodeError ret_var = CResult_ChannelUpdateInfoDecodeErrorZ_get_err(owner_conv);
3027 uint64_t ret_ref = 0;
3028 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3029 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3033 static inline struct LDKChannelInfo CResult_ChannelInfoDecodeErrorZ_get_ok(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR owner){
3034 CHECK(owner->result_ok);
3035 return ChannelInfo_clone(&*owner->contents.result);
3037 uint64_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_get_ok"))) TS_CResult_ChannelInfoDecodeErrorZ_get_ok(uint64_t owner) {
3038 LDKCResult_ChannelInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(owner);
3039 LDKChannelInfo ret_var = CResult_ChannelInfoDecodeErrorZ_get_ok(owner_conv);
3040 uint64_t ret_ref = 0;
3041 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3042 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3046 static inline struct LDKDecodeError CResult_ChannelInfoDecodeErrorZ_get_err(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR owner){
3047 CHECK(!owner->result_ok);
3048 return DecodeError_clone(&*owner->contents.err);
3050 uint64_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_get_err"))) TS_CResult_ChannelInfoDecodeErrorZ_get_err(uint64_t owner) {
3051 LDKCResult_ChannelInfoDecodeErrorZ* owner_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(owner);
3052 LDKDecodeError ret_var = CResult_ChannelInfoDecodeErrorZ_get_err(owner_conv);
3053 uint64_t ret_ref = 0;
3054 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3055 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3059 static inline struct LDKRoutingFees CResult_RoutingFeesDecodeErrorZ_get_ok(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR owner){
3060 CHECK(owner->result_ok);
3061 return RoutingFees_clone(&*owner->contents.result);
3063 uint64_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_get_ok"))) TS_CResult_RoutingFeesDecodeErrorZ_get_ok(uint64_t owner) {
3064 LDKCResult_RoutingFeesDecodeErrorZ* owner_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(owner);
3065 LDKRoutingFees ret_var = CResult_RoutingFeesDecodeErrorZ_get_ok(owner_conv);
3066 uint64_t ret_ref = 0;
3067 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3068 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3072 static inline struct LDKDecodeError CResult_RoutingFeesDecodeErrorZ_get_err(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR owner){
3073 CHECK(!owner->result_ok);
3074 return DecodeError_clone(&*owner->contents.err);
3076 uint64_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_get_err"))) TS_CResult_RoutingFeesDecodeErrorZ_get_err(uint64_t owner) {
3077 LDKCResult_RoutingFeesDecodeErrorZ* owner_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(owner);
3078 LDKDecodeError ret_var = CResult_RoutingFeesDecodeErrorZ_get_err(owner_conv);
3079 uint64_t ret_ref = 0;
3080 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3081 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3085 uint32_t __attribute__((export_name("TS_LDKNetAddress_ty_from_ptr"))) TS_LDKNetAddress_ty_from_ptr(uint64_t ptr) {
3086 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3088 case LDKNetAddress_IPv4: return 0;
3089 case LDKNetAddress_IPv6: return 1;
3090 case LDKNetAddress_OnionV2: return 2;
3091 case LDKNetAddress_OnionV3: return 3;
3092 case LDKNetAddress_Hostname: return 4;
3096 int8_tArray __attribute__((export_name("TS_LDKNetAddress_IPv4_get_addr"))) TS_LDKNetAddress_IPv4_get_addr(uint64_t ptr) {
3097 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3098 assert(obj->tag == LDKNetAddress_IPv4);
3099 int8_tArray addr_arr = init_int8_tArray(4, __LINE__);
3100 memcpy(addr_arr->elems, obj->i_pv4.addr.data, 4);
3103 int16_t __attribute__((export_name("TS_LDKNetAddress_IPv4_get_port"))) TS_LDKNetAddress_IPv4_get_port(uint64_t ptr) {
3104 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3105 assert(obj->tag == LDKNetAddress_IPv4);
3106 int16_t port_conv = obj->i_pv4.port;
3109 int8_tArray __attribute__((export_name("TS_LDKNetAddress_IPv6_get_addr"))) TS_LDKNetAddress_IPv6_get_addr(uint64_t ptr) {
3110 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3111 assert(obj->tag == LDKNetAddress_IPv6);
3112 int8_tArray addr_arr = init_int8_tArray(16, __LINE__);
3113 memcpy(addr_arr->elems, obj->i_pv6.addr.data, 16);
3116 int16_t __attribute__((export_name("TS_LDKNetAddress_IPv6_get_port"))) TS_LDKNetAddress_IPv6_get_port(uint64_t ptr) {
3117 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3118 assert(obj->tag == LDKNetAddress_IPv6);
3119 int16_t port_conv = obj->i_pv6.port;
3122 int8_tArray __attribute__((export_name("TS_LDKNetAddress_OnionV2_get_onion_v2"))) TS_LDKNetAddress_OnionV2_get_onion_v2(uint64_t ptr) {
3123 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3124 assert(obj->tag == LDKNetAddress_OnionV2);
3125 int8_tArray onion_v2_arr = init_int8_tArray(12, __LINE__);
3126 memcpy(onion_v2_arr->elems, obj->onion_v2.data, 12);
3127 return onion_v2_arr;
3129 int8_tArray __attribute__((export_name("TS_LDKNetAddress_OnionV3_get_ed25519_pubkey"))) TS_LDKNetAddress_OnionV3_get_ed25519_pubkey(uint64_t ptr) {
3130 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3131 assert(obj->tag == LDKNetAddress_OnionV3);
3132 int8_tArray ed25519_pubkey_arr = init_int8_tArray(32, __LINE__);
3133 memcpy(ed25519_pubkey_arr->elems, obj->onion_v3.ed25519_pubkey.data, 32);
3134 return ed25519_pubkey_arr;
3136 int16_t __attribute__((export_name("TS_LDKNetAddress_OnionV3_get_checksum"))) TS_LDKNetAddress_OnionV3_get_checksum(uint64_t ptr) {
3137 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3138 assert(obj->tag == LDKNetAddress_OnionV3);
3139 int16_t checksum_conv = obj->onion_v3.checksum;
3140 return checksum_conv;
3142 int8_t __attribute__((export_name("TS_LDKNetAddress_OnionV3_get_version"))) TS_LDKNetAddress_OnionV3_get_version(uint64_t ptr) {
3143 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3144 assert(obj->tag == LDKNetAddress_OnionV3);
3145 int8_t version_conv = obj->onion_v3.version;
3146 return version_conv;
3148 int16_t __attribute__((export_name("TS_LDKNetAddress_OnionV3_get_port"))) TS_LDKNetAddress_OnionV3_get_port(uint64_t ptr) {
3149 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3150 assert(obj->tag == LDKNetAddress_OnionV3);
3151 int16_t port_conv = obj->onion_v3.port;
3154 uint64_t __attribute__((export_name("TS_LDKNetAddress_Hostname_get_hostname"))) TS_LDKNetAddress_Hostname_get_hostname(uint64_t ptr) {
3155 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3156 assert(obj->tag == LDKNetAddress_Hostname);
3157 LDKHostname hostname_var = obj->hostname.hostname;
3158 uint64_t hostname_ref = 0;
3159 CHECK_INNER_FIELD_ACCESS_OR_NULL(hostname_var);
3160 hostname_ref = tag_ptr(hostname_var.inner, false);
3161 return hostname_ref;
3163 int16_t __attribute__((export_name("TS_LDKNetAddress_Hostname_get_port"))) TS_LDKNetAddress_Hostname_get_port(uint64_t ptr) {
3164 LDKNetAddress *obj = (LDKNetAddress*)untag_ptr(ptr);
3165 assert(obj->tag == LDKNetAddress_Hostname);
3166 int16_t port_conv = obj->hostname.port;
3169 static inline LDKCVec_NetAddressZ CVec_NetAddressZ_clone(const LDKCVec_NetAddressZ *orig) {
3170 LDKCVec_NetAddressZ ret = { .data = MALLOC(sizeof(LDKNetAddress) * orig->datalen, "LDKCVec_NetAddressZ clone bytes"), .datalen = orig->datalen };
3171 for (size_t i = 0; i < ret.datalen; i++) {
3172 ret.data[i] = NetAddress_clone(&orig->data[i]);
3176 static inline struct LDKNodeAnnouncementInfo CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR owner){
3177 CHECK(owner->result_ok);
3178 return NodeAnnouncementInfo_clone(&*owner->contents.result);
3180 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(uint64_t owner) {
3181 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(owner);
3182 LDKNodeAnnouncementInfo ret_var = CResult_NodeAnnouncementInfoDecodeErrorZ_get_ok(owner_conv);
3183 uint64_t ret_ref = 0;
3184 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3185 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3189 static inline struct LDKDecodeError CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR owner){
3190 CHECK(!owner->result_ok);
3191 return DecodeError_clone(&*owner->contents.err);
3193 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_get_err"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(uint64_t owner) {
3194 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(owner);
3195 LDKDecodeError ret_var = CResult_NodeAnnouncementInfoDecodeErrorZ_get_err(owner_conv);
3196 uint64_t ret_ref = 0;
3197 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3198 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3202 static inline struct LDKNodeAlias CResult_NodeAliasDecodeErrorZ_get_ok(LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR owner){
3203 CHECK(owner->result_ok);
3204 return NodeAlias_clone(&*owner->contents.result);
3206 uint64_t __attribute__((export_name("TS_CResult_NodeAliasDecodeErrorZ_get_ok"))) TS_CResult_NodeAliasDecodeErrorZ_get_ok(uint64_t owner) {
3207 LDKCResult_NodeAliasDecodeErrorZ* owner_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(owner);
3208 LDKNodeAlias ret_var = CResult_NodeAliasDecodeErrorZ_get_ok(owner_conv);
3209 uint64_t ret_ref = 0;
3210 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3211 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3215 static inline struct LDKDecodeError CResult_NodeAliasDecodeErrorZ_get_err(LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR owner){
3216 CHECK(!owner->result_ok);
3217 return DecodeError_clone(&*owner->contents.err);
3219 uint64_t __attribute__((export_name("TS_CResult_NodeAliasDecodeErrorZ_get_err"))) TS_CResult_NodeAliasDecodeErrorZ_get_err(uint64_t owner) {
3220 LDKCResult_NodeAliasDecodeErrorZ* owner_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(owner);
3221 LDKDecodeError ret_var = CResult_NodeAliasDecodeErrorZ_get_err(owner_conv);
3222 uint64_t ret_ref = 0;
3223 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3224 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3228 static inline struct LDKNodeInfo CResult_NodeInfoDecodeErrorZ_get_ok(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR owner){
3229 CHECK(owner->result_ok);
3230 return NodeInfo_clone(&*owner->contents.result);
3232 uint64_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_get_ok"))) TS_CResult_NodeInfoDecodeErrorZ_get_ok(uint64_t owner) {
3233 LDKCResult_NodeInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(owner);
3234 LDKNodeInfo ret_var = CResult_NodeInfoDecodeErrorZ_get_ok(owner_conv);
3235 uint64_t ret_ref = 0;
3236 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3237 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3241 static inline struct LDKDecodeError CResult_NodeInfoDecodeErrorZ_get_err(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR owner){
3242 CHECK(!owner->result_ok);
3243 return DecodeError_clone(&*owner->contents.err);
3245 uint64_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_get_err"))) TS_CResult_NodeInfoDecodeErrorZ_get_err(uint64_t owner) {
3246 LDKCResult_NodeInfoDecodeErrorZ* owner_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(owner);
3247 LDKDecodeError ret_var = CResult_NodeInfoDecodeErrorZ_get_err(owner_conv);
3248 uint64_t ret_ref = 0;
3249 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3250 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3254 static inline struct LDKNetworkGraph *CResult_NetworkGraphDecodeErrorZ_get_ok(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR owner){
3255 CHECK(owner->result_ok);
3256 return &*owner->contents.result;
3258 uint64_t __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_get_ok"))) TS_CResult_NetworkGraphDecodeErrorZ_get_ok(uint64_t owner) {
3259 LDKCResult_NetworkGraphDecodeErrorZ* owner_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)untag_ptr(owner);
3260 LDKNetworkGraph ret_var = *CResult_NetworkGraphDecodeErrorZ_get_ok(owner_conv);
3261 uint64_t ret_ref = 0;
3262 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3263 ret_ref = tag_ptr(ret_var.inner, false);
3267 static inline struct LDKDecodeError CResult_NetworkGraphDecodeErrorZ_get_err(LDKCResult_NetworkGraphDecodeErrorZ *NONNULL_PTR owner){
3268 CHECK(!owner->result_ok);
3269 return DecodeError_clone(&*owner->contents.err);
3271 uint64_t __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_get_err"))) TS_CResult_NetworkGraphDecodeErrorZ_get_err(uint64_t owner) {
3272 LDKCResult_NetworkGraphDecodeErrorZ* owner_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)untag_ptr(owner);
3273 LDKDecodeError ret_var = CResult_NetworkGraphDecodeErrorZ_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 uint32_t __attribute__((export_name("TS_LDKCOption_CVec_NetAddressZZ_ty_from_ptr"))) TS_LDKCOption_CVec_NetAddressZZ_ty_from_ptr(uint64_t ptr) {
3281 LDKCOption_CVec_NetAddressZZ *obj = (LDKCOption_CVec_NetAddressZZ*)untag_ptr(ptr);
3283 case LDKCOption_CVec_NetAddressZZ_Some: return 0;
3284 case LDKCOption_CVec_NetAddressZZ_None: return 1;
3288 uint64_tArray __attribute__((export_name("TS_LDKCOption_CVec_NetAddressZZ_Some_get_some"))) TS_LDKCOption_CVec_NetAddressZZ_Some_get_some(uint64_t ptr) {
3289 LDKCOption_CVec_NetAddressZZ *obj = (LDKCOption_CVec_NetAddressZZ*)untag_ptr(ptr);
3290 assert(obj->tag == LDKCOption_CVec_NetAddressZZ_Some);
3291 LDKCVec_NetAddressZ some_var = obj->some;
3292 uint64_tArray some_arr = NULL;
3293 some_arr = init_uint64_tArray(some_var.datalen, __LINE__);
3294 uint64_t *some_arr_ptr = (uint64_t*)(((uint8_t*)some_arr) + 8);
3295 for (size_t m = 0; m < some_var.datalen; m++) {
3296 uint64_t some_conv_12_ref = tag_ptr(&some_var.data[m], false);
3297 some_arr_ptr[m] = some_conv_12_ref;
3302 static inline struct LDKDelayedPaymentOutputDescriptor CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
3303 CHECK(owner->result_ok);
3304 return DelayedPaymentOutputDescriptor_clone(&*owner->contents.result);
3306 uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(uint64_t owner) {
3307 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
3308 LDKDelayedPaymentOutputDescriptor ret_var = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_ok(owner_conv);
3309 uint64_t ret_ref = 0;
3310 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3311 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3315 static inline struct LDKDecodeError CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
3316 CHECK(!owner->result_ok);
3317 return DecodeError_clone(&*owner->contents.err);
3319 uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(uint64_t owner) {
3320 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
3321 LDKDecodeError ret_var = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_get_err(owner_conv);
3322 uint64_t ret_ref = 0;
3323 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3324 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3328 static inline struct LDKStaticPaymentOutputDescriptor CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
3329 CHECK(owner->result_ok);
3330 return StaticPaymentOutputDescriptor_clone(&*owner->contents.result);
3332 uint64_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(uint64_t owner) {
3333 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
3334 LDKStaticPaymentOutputDescriptor ret_var = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_ok(owner_conv);
3335 uint64_t ret_ref = 0;
3336 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3337 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3341 static inline struct LDKDecodeError CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
3342 CHECK(!owner->result_ok);
3343 return DecodeError_clone(&*owner->contents.err);
3345 uint64_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(uint64_t owner) {
3346 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
3347 LDKDecodeError ret_var = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_get_err(owner_conv);
3348 uint64_t ret_ref = 0;
3349 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3350 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3354 static inline struct LDKSpendableOutputDescriptor CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
3355 CHECK(owner->result_ok);
3356 return SpendableOutputDescriptor_clone(&*owner->contents.result);
3358 uint64_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(uint64_t owner) {
3359 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
3360 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
3361 *ret_copy = CResult_SpendableOutputDescriptorDecodeErrorZ_get_ok(owner_conv);
3362 uint64_t ret_ref = tag_ptr(ret_copy, true);
3366 static inline struct LDKDecodeError CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR owner){
3367 CHECK(!owner->result_ok);
3368 return DecodeError_clone(&*owner->contents.err);
3370 uint64_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_get_err"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(uint64_t owner) {
3371 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* owner_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(owner);
3372 LDKDecodeError ret_var = CResult_SpendableOutputDescriptorDecodeErrorZ_get_err(owner_conv);
3373 uint64_t ret_ref = 0;
3374 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3375 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3379 static inline LDKCVec_PaymentPreimageZ CVec_PaymentPreimageZ_clone(const LDKCVec_PaymentPreimageZ *orig) {
3380 LDKCVec_PaymentPreimageZ ret = { .data = MALLOC(sizeof(LDKThirtyTwoBytes) * orig->datalen, "LDKCVec_PaymentPreimageZ clone bytes"), .datalen = orig->datalen };
3381 for (size_t i = 0; i < ret.datalen; i++) {
3382 ret.data[i] = ThirtyTwoBytes_clone(&orig->data[i]);
3386 static inline struct LDKSignature C2Tuple_SignatureCVec_SignatureZZ_get_a(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR owner){
3389 int8_tArray __attribute__((export_name("TS_C2Tuple_SignatureCVec_SignatureZZ_get_a"))) TS_C2Tuple_SignatureCVec_SignatureZZ_get_a(uint64_t owner) {
3390 LDKC2Tuple_SignatureCVec_SignatureZZ* owner_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)untag_ptr(owner);
3391 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
3392 memcpy(ret_arr->elems, C2Tuple_SignatureCVec_SignatureZZ_get_a(owner_conv).compact_form, 64);
3396 static inline struct LDKCVec_SignatureZ C2Tuple_SignatureCVec_SignatureZZ_get_b(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR owner){
3399 ptrArray __attribute__((export_name("TS_C2Tuple_SignatureCVec_SignatureZZ_get_b"))) TS_C2Tuple_SignatureCVec_SignatureZZ_get_b(uint64_t owner) {
3400 LDKC2Tuple_SignatureCVec_SignatureZZ* owner_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)untag_ptr(owner);
3401 LDKCVec_SignatureZ ret_var = C2Tuple_SignatureCVec_SignatureZZ_get_b(owner_conv);
3402 ptrArray ret_arr = NULL;
3403 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
3404 int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8);
3405 for (size_t m = 0; m < ret_var.datalen; m++) {
3406 int8_tArray ret_conv_12_arr = init_int8_tArray(64, __LINE__);
3407 memcpy(ret_conv_12_arr->elems, ret_var.data[m].compact_form, 64);
3408 ret_arr_ptr[m] = ret_conv_12_arr;
3414 static inline struct LDKC2Tuple_SignatureCVec_SignatureZZ CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR owner){
3415 CHECK(owner->result_ok);
3416 return C2Tuple_SignatureCVec_SignatureZZ_clone(&*owner->contents.result);
3418 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(uint64_t owner) {
3419 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)untag_ptr(owner);
3420 LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
3421 *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_ok(owner_conv);
3422 return tag_ptr(ret_conv, true);
3425 static inline void CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR owner){
3426 CHECK(!owner->result_ok);
3427 return *owner->contents.err;
3429 void __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err(uint64_t owner) {
3430 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)untag_ptr(owner);
3431 CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_get_err(owner_conv);
3434 static inline struct LDKSignature CResult_SignatureNoneZ_get_ok(LDKCResult_SignatureNoneZ *NONNULL_PTR owner){
3435 CHECK(owner->result_ok);
3436 return *owner->contents.result;
3438 int8_tArray __attribute__((export_name("TS_CResult_SignatureNoneZ_get_ok"))) TS_CResult_SignatureNoneZ_get_ok(uint64_t owner) {
3439 LDKCResult_SignatureNoneZ* owner_conv = (LDKCResult_SignatureNoneZ*)untag_ptr(owner);
3440 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
3441 memcpy(ret_arr->elems, CResult_SignatureNoneZ_get_ok(owner_conv).compact_form, 64);
3445 static inline void CResult_SignatureNoneZ_get_err(LDKCResult_SignatureNoneZ *NONNULL_PTR owner){
3446 CHECK(!owner->result_ok);
3447 return *owner->contents.err;
3449 void __attribute__((export_name("TS_CResult_SignatureNoneZ_get_err"))) TS_CResult_SignatureNoneZ_get_err(uint64_t owner) {
3450 LDKCResult_SignatureNoneZ* owner_conv = (LDKCResult_SignatureNoneZ*)untag_ptr(owner);
3451 CResult_SignatureNoneZ_get_err(owner_conv);
3454 static inline struct LDKSignature C2Tuple_SignatureSignatureZ_get_a(LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR owner){
3457 int8_tArray __attribute__((export_name("TS_C2Tuple_SignatureSignatureZ_get_a"))) TS_C2Tuple_SignatureSignatureZ_get_a(uint64_t owner) {
3458 LDKC2Tuple_SignatureSignatureZ* owner_conv = (LDKC2Tuple_SignatureSignatureZ*)untag_ptr(owner);
3459 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
3460 memcpy(ret_arr->elems, C2Tuple_SignatureSignatureZ_get_a(owner_conv).compact_form, 64);
3464 static inline struct LDKSignature C2Tuple_SignatureSignatureZ_get_b(LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR owner){
3467 int8_tArray __attribute__((export_name("TS_C2Tuple_SignatureSignatureZ_get_b"))) TS_C2Tuple_SignatureSignatureZ_get_b(uint64_t owner) {
3468 LDKC2Tuple_SignatureSignatureZ* owner_conv = (LDKC2Tuple_SignatureSignatureZ*)untag_ptr(owner);
3469 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
3470 memcpy(ret_arr->elems, C2Tuple_SignatureSignatureZ_get_b(owner_conv).compact_form, 64);
3474 static inline struct LDKC2Tuple_SignatureSignatureZ CResult_C2Tuple_SignatureSignatureZNoneZ_get_ok(LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR owner){
3475 CHECK(owner->result_ok);
3476 return C2Tuple_SignatureSignatureZ_clone(&*owner->contents.result);
3478 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureSignatureZNoneZ_get_ok"))) TS_CResult_C2Tuple_SignatureSignatureZNoneZ_get_ok(uint64_t owner) {
3479 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)untag_ptr(owner);
3480 LDKC2Tuple_SignatureSignatureZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureSignatureZ), "LDKC2Tuple_SignatureSignatureZ");
3481 *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_get_ok(owner_conv);
3482 return tag_ptr(ret_conv, true);
3485 static inline void CResult_C2Tuple_SignatureSignatureZNoneZ_get_err(LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR owner){
3486 CHECK(!owner->result_ok);
3487 return *owner->contents.err;
3489 void __attribute__((export_name("TS_CResult_C2Tuple_SignatureSignatureZNoneZ_get_err"))) TS_CResult_C2Tuple_SignatureSignatureZNoneZ_get_err(uint64_t owner) {
3490 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* owner_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)untag_ptr(owner);
3491 CResult_C2Tuple_SignatureSignatureZNoneZ_get_err(owner_conv);
3494 static inline struct LDKSecretKey CResult_SecretKeyNoneZ_get_ok(LDKCResult_SecretKeyNoneZ *NONNULL_PTR owner){
3495 CHECK(owner->result_ok);
3496 return *owner->contents.result;
3498 int8_tArray __attribute__((export_name("TS_CResult_SecretKeyNoneZ_get_ok"))) TS_CResult_SecretKeyNoneZ_get_ok(uint64_t owner) {
3499 LDKCResult_SecretKeyNoneZ* owner_conv = (LDKCResult_SecretKeyNoneZ*)untag_ptr(owner);
3500 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
3501 memcpy(ret_arr->elems, CResult_SecretKeyNoneZ_get_ok(owner_conv).bytes, 32);
3505 static inline void CResult_SecretKeyNoneZ_get_err(LDKCResult_SecretKeyNoneZ *NONNULL_PTR owner){
3506 CHECK(!owner->result_ok);
3507 return *owner->contents.err;
3509 void __attribute__((export_name("TS_CResult_SecretKeyNoneZ_get_err"))) TS_CResult_SecretKeyNoneZ_get_err(uint64_t owner) {
3510 LDKCResult_SecretKeyNoneZ* owner_conv = (LDKCResult_SecretKeyNoneZ*)untag_ptr(owner);
3511 CResult_SecretKeyNoneZ_get_err(owner_conv);
3514 typedef struct LDKBaseSign_JCalls {
3515 atomic_size_t refcnt;
3516 uint32_t instance_ptr;
3517 } LDKBaseSign_JCalls;
3518 static void LDKBaseSign_JCalls_free(void* this_arg) {
3519 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3520 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
3524 LDKPublicKey get_per_commitment_point_LDKBaseSign_jcall(const void* this_arg, uint64_t idx) {
3525 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3526 int64_t idx_conv = idx;
3527 int8_tArray ret = (int8_tArray)js_invoke_function_buuuuu(j_calls->instance_ptr, 2, idx_conv, 0, 0, 0, 0, 0);
3528 LDKPublicKey ret_ref;
3529 CHECK(ret->arr_len == 33);
3530 memcpy(ret_ref.compressed_form, ret->elems, 33); FREE(ret);
3533 LDKThirtyTwoBytes release_commitment_secret_LDKBaseSign_jcall(const void* this_arg, uint64_t idx) {
3534 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3535 int64_t idx_conv = idx;
3536 int8_tArray ret = (int8_tArray)js_invoke_function_buuuuu(j_calls->instance_ptr, 3, idx_conv, 0, 0, 0, 0, 0);
3537 LDKThirtyTwoBytes ret_ref;
3538 CHECK(ret->arr_len == 32);
3539 memcpy(ret_ref.data, ret->elems, 32); FREE(ret);
3542 LDKCResult_NoneNoneZ validate_holder_commitment_LDKBaseSign_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * holder_tx, LDKCVec_PaymentPreimageZ preimages) {
3543 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3544 LDKHolderCommitmentTransaction holder_tx_var = *holder_tx;
3545 uint64_t holder_tx_ref = 0;
3546 holder_tx_var = HolderCommitmentTransaction_clone(&holder_tx_var);
3547 CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_tx_var);
3548 holder_tx_ref = tag_ptr(holder_tx_var.inner, holder_tx_var.is_owned);
3549 LDKCVec_PaymentPreimageZ preimages_var = preimages;
3550 ptrArray preimages_arr = NULL;
3551 preimages_arr = init_ptrArray(preimages_var.datalen, __LINE__);
3552 int8_tArray *preimages_arr_ptr = (int8_tArray*)(((uint8_t*)preimages_arr) + 8);
3553 for (size_t m = 0; m < preimages_var.datalen; m++) {
3554 int8_tArray preimages_conv_12_arr = init_int8_tArray(32, __LINE__);
3555 memcpy(preimages_conv_12_arr->elems, preimages_var.data[m].data, 32);
3556 preimages_arr_ptr[m] = preimages_conv_12_arr;
3559 FREE(preimages_var.data);
3560 uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 4, holder_tx_ref, (uint32_t)preimages_arr, 0, 0, 0, 0);
3561 void* ret_ptr = untag_ptr(ret);
3562 CHECK_ACCESS(ret_ptr);
3563 LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
3564 FREE(untag_ptr(ret));
3567 LDKThirtyTwoBytes channel_keys_id_LDKBaseSign_jcall(const void* this_arg) {
3568 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3569 int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 5, 0, 0, 0, 0, 0, 0);
3570 LDKThirtyTwoBytes ret_ref;
3571 CHECK(ret->arr_len == 32);
3572 memcpy(ret_ref.data, ret->elems, 32); FREE(ret);
3575 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_counterparty_commitment_LDKBaseSign_jcall(const void* this_arg, const LDKCommitmentTransaction * commitment_tx, LDKCVec_PaymentPreimageZ preimages) {
3576 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3577 LDKCommitmentTransaction commitment_tx_var = *commitment_tx;
3578 uint64_t commitment_tx_ref = 0;
3579 commitment_tx_var = CommitmentTransaction_clone(&commitment_tx_var);
3580 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_var);
3581 commitment_tx_ref = tag_ptr(commitment_tx_var.inner, commitment_tx_var.is_owned);
3582 LDKCVec_PaymentPreimageZ preimages_var = preimages;
3583 ptrArray preimages_arr = NULL;
3584 preimages_arr = init_ptrArray(preimages_var.datalen, __LINE__);
3585 int8_tArray *preimages_arr_ptr = (int8_tArray*)(((uint8_t*)preimages_arr) + 8);
3586 for (size_t m = 0; m < preimages_var.datalen; m++) {
3587 int8_tArray preimages_conv_12_arr = init_int8_tArray(32, __LINE__);
3588 memcpy(preimages_conv_12_arr->elems, preimages_var.data[m].data, 32);
3589 preimages_arr_ptr[m] = preimages_conv_12_arr;
3592 FREE(preimages_var.data);
3593 uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 6, commitment_tx_ref, (uint32_t)preimages_arr, 0, 0, 0, 0);
3594 void* ret_ptr = untag_ptr(ret);
3595 CHECK_ACCESS(ret_ptr);
3596 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(ret_ptr);
3597 FREE(untag_ptr(ret));
3600 LDKCResult_NoneNoneZ validate_counterparty_revocation_LDKBaseSign_jcall(const void* this_arg, uint64_t idx, const uint8_t (* secret)[32]) {
3601 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3602 int64_t idx_conv = idx;
3603 int8_tArray secret_arr = init_int8_tArray(32, __LINE__);
3604 memcpy(secret_arr->elems, *secret, 32);
3605 uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 7, idx_conv, (uint32_t)secret_arr, 0, 0, 0, 0);
3606 void* ret_ptr = untag_ptr(ret);
3607 CHECK_ACCESS(ret_ptr);
3608 LDKCResult_NoneNoneZ ret_conv = *(LDKCResult_NoneNoneZ*)(ret_ptr);
3609 FREE(untag_ptr(ret));
3612 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ sign_holder_commitment_and_htlcs_LDKBaseSign_jcall(const void* this_arg, const LDKHolderCommitmentTransaction * commitment_tx) {
3613 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3614 LDKHolderCommitmentTransaction commitment_tx_var = *commitment_tx;
3615 uint64_t commitment_tx_ref = 0;
3616 commitment_tx_var = HolderCommitmentTransaction_clone(&commitment_tx_var);
3617 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_var);
3618 commitment_tx_ref = tag_ptr(commitment_tx_var.inner, commitment_tx_var.is_owned);
3619 uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 8, commitment_tx_ref, 0, 0, 0, 0, 0);
3620 void* ret_ptr = untag_ptr(ret);
3621 CHECK_ACCESS(ret_ptr);
3622 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(ret_ptr);
3623 FREE(untag_ptr(ret));
3626 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]) {
3627 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3628 LDKTransaction justice_tx_var = justice_tx;
3629 int8_tArray justice_tx_arr = init_int8_tArray(justice_tx_var.datalen, __LINE__);
3630 memcpy(justice_tx_arr->elems, justice_tx_var.data, justice_tx_var.datalen);
3631 Transaction_free(justice_tx_var);
3632 uint32_t input_conv = input;
3633 int64_t amount_conv = amount;
3634 int8_tArray per_commitment_key_arr = init_int8_tArray(32, __LINE__);
3635 memcpy(per_commitment_key_arr->elems, *per_commitment_key, 32);
3636 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);
3637 void* ret_ptr = untag_ptr(ret);
3638 CHECK_ACCESS(ret_ptr);
3639 LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
3640 FREE(untag_ptr(ret));
3643 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) {
3644 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3645 LDKTransaction justice_tx_var = justice_tx;
3646 int8_tArray justice_tx_arr = init_int8_tArray(justice_tx_var.datalen, __LINE__);
3647 memcpy(justice_tx_arr->elems, justice_tx_var.data, justice_tx_var.datalen);
3648 Transaction_free(justice_tx_var);
3649 uint32_t input_conv = input;
3650 int64_t amount_conv = amount;
3651 int8_tArray per_commitment_key_arr = init_int8_tArray(32, __LINE__);
3652 memcpy(per_commitment_key_arr->elems, *per_commitment_key, 32);
3653 LDKHTLCOutputInCommitment htlc_var = *htlc;
3654 uint64_t htlc_ref = 0;
3655 htlc_var = HTLCOutputInCommitment_clone(&htlc_var);
3656 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_var);
3657 htlc_ref = tag_ptr(htlc_var.inner, htlc_var.is_owned);
3658 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);
3659 void* ret_ptr = untag_ptr(ret);
3660 CHECK_ACCESS(ret_ptr);
3661 LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
3662 FREE(untag_ptr(ret));
3665 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) {
3666 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3667 LDKTransaction htlc_tx_var = htlc_tx;
3668 int8_tArray htlc_tx_arr = init_int8_tArray(htlc_tx_var.datalen, __LINE__);
3669 memcpy(htlc_tx_arr->elems, htlc_tx_var.data, htlc_tx_var.datalen);
3670 Transaction_free(htlc_tx_var);
3671 uint32_t input_conv = input;
3672 int64_t amount_conv = amount;
3673 int8_tArray per_commitment_point_arr = init_int8_tArray(33, __LINE__);
3674 memcpy(per_commitment_point_arr->elems, per_commitment_point.compressed_form, 33);
3675 LDKHTLCOutputInCommitment htlc_var = *htlc;
3676 uint64_t htlc_ref = 0;
3677 htlc_var = HTLCOutputInCommitment_clone(&htlc_var);
3678 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_var);
3679 htlc_ref = tag_ptr(htlc_var.inner, htlc_var.is_owned);
3680 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);
3681 void* ret_ptr = untag_ptr(ret);
3682 CHECK_ACCESS(ret_ptr);
3683 LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
3684 FREE(untag_ptr(ret));
3687 LDKCResult_SignatureNoneZ sign_closing_transaction_LDKBaseSign_jcall(const void* this_arg, const LDKClosingTransaction * closing_tx) {
3688 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3689 LDKClosingTransaction closing_tx_var = *closing_tx;
3690 uint64_t closing_tx_ref = 0;
3691 closing_tx_var = ClosingTransaction_clone(&closing_tx_var);
3692 CHECK_INNER_FIELD_ACCESS_OR_NULL(closing_tx_var);
3693 closing_tx_ref = tag_ptr(closing_tx_var.inner, closing_tx_var.is_owned);
3694 uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 12, closing_tx_ref, 0, 0, 0, 0, 0);
3695 void* ret_ptr = untag_ptr(ret);
3696 CHECK_ACCESS(ret_ptr);
3697 LDKCResult_SignatureNoneZ ret_conv = *(LDKCResult_SignatureNoneZ*)(ret_ptr);
3698 FREE(untag_ptr(ret));
3701 LDKCResult_C2Tuple_SignatureSignatureZNoneZ sign_channel_announcement_LDKBaseSign_jcall(const void* this_arg, const LDKUnsignedChannelAnnouncement * msg) {
3702 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3703 LDKUnsignedChannelAnnouncement msg_var = *msg;
3704 uint64_t msg_ref = 0;
3705 msg_var = UnsignedChannelAnnouncement_clone(&msg_var);
3706 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
3707 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
3708 uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 13, msg_ref, 0, 0, 0, 0, 0);
3709 void* ret_ptr = untag_ptr(ret);
3710 CHECK_ACCESS(ret_ptr);
3711 LDKCResult_C2Tuple_SignatureSignatureZNoneZ ret_conv = *(LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)(ret_ptr);
3712 FREE(untag_ptr(ret));
3715 void ready_channel_LDKBaseSign_jcall(void* this_arg, const LDKChannelTransactionParameters * channel_parameters) {
3716 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) this_arg;
3717 LDKChannelTransactionParameters channel_parameters_var = *channel_parameters;
3718 uint64_t channel_parameters_ref = 0;
3719 channel_parameters_var = ChannelTransactionParameters_clone(&channel_parameters_var);
3720 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_var);
3721 channel_parameters_ref = tag_ptr(channel_parameters_var.inner, channel_parameters_var.is_owned);
3722 js_invoke_function_buuuuu(j_calls->instance_ptr, 14, channel_parameters_ref, 0, 0, 0, 0, 0);
3724 static void LDKBaseSign_JCalls_cloned(LDKBaseSign* new_obj) {
3725 LDKBaseSign_JCalls *j_calls = (LDKBaseSign_JCalls*) new_obj->this_arg;
3726 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
3728 static inline LDKBaseSign LDKBaseSign_init (JSValue o, uint64_t pubkeys) {
3729 LDKBaseSign_JCalls *calls = MALLOC(sizeof(LDKBaseSign_JCalls), "LDKBaseSign_JCalls");
3730 atomic_init(&calls->refcnt, 1);
3731 calls->instance_ptr = o;
3733 LDKChannelPublicKeys pubkeys_conv;
3734 pubkeys_conv.inner = untag_ptr(pubkeys);
3735 pubkeys_conv.is_owned = ptr_is_owned(pubkeys);
3736 CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_conv);
3739 .this_arg = (void*) calls,
3740 .get_per_commitment_point = get_per_commitment_point_LDKBaseSign_jcall,
3741 .release_commitment_secret = release_commitment_secret_LDKBaseSign_jcall,
3742 .validate_holder_commitment = validate_holder_commitment_LDKBaseSign_jcall,
3743 .channel_keys_id = channel_keys_id_LDKBaseSign_jcall,
3744 .sign_counterparty_commitment = sign_counterparty_commitment_LDKBaseSign_jcall,
3745 .validate_counterparty_revocation = validate_counterparty_revocation_LDKBaseSign_jcall,
3746 .sign_holder_commitment_and_htlcs = sign_holder_commitment_and_htlcs_LDKBaseSign_jcall,
3747 .sign_justice_revoked_output = sign_justice_revoked_output_LDKBaseSign_jcall,
3748 .sign_justice_revoked_htlc = sign_justice_revoked_htlc_LDKBaseSign_jcall,
3749 .sign_counterparty_htlc_transaction = sign_counterparty_htlc_transaction_LDKBaseSign_jcall,
3750 .sign_closing_transaction = sign_closing_transaction_LDKBaseSign_jcall,
3751 .sign_channel_announcement = sign_channel_announcement_LDKBaseSign_jcall,
3752 .ready_channel = ready_channel_LDKBaseSign_jcall,
3753 .free = LDKBaseSign_JCalls_free,
3754 .pubkeys = pubkeys_conv,
3755 .set_pubkeys = NULL,
3759 uint64_t __attribute__((export_name("TS_LDKBaseSign_new"))) TS_LDKBaseSign_new(JSValue o, uint64_t pubkeys) {
3760 LDKBaseSign *res_ptr = MALLOC(sizeof(LDKBaseSign), "LDKBaseSign");
3761 *res_ptr = LDKBaseSign_init(o, pubkeys);
3762 return tag_ptr(res_ptr, true);
3764 int8_tArray __attribute__((export_name("TS_BaseSign_get_per_commitment_point"))) TS_BaseSign_get_per_commitment_point(uint64_t this_arg, int64_t idx) {
3765 void* this_arg_ptr = untag_ptr(this_arg);
3766 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
3767 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
3768 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
3769 memcpy(ret_arr->elems, (this_arg_conv->get_per_commitment_point)(this_arg_conv->this_arg, idx).compressed_form, 33);
3773 int8_tArray __attribute__((export_name("TS_BaseSign_release_commitment_secret"))) TS_BaseSign_release_commitment_secret(uint64_t this_arg, int64_t idx) {
3774 void* this_arg_ptr = untag_ptr(this_arg);
3775 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
3776 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
3777 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
3778 memcpy(ret_arr->elems, (this_arg_conv->release_commitment_secret)(this_arg_conv->this_arg, idx).data, 32);
3782 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) {
3783 void* this_arg_ptr = untag_ptr(this_arg);
3784 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
3785 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
3786 LDKHolderCommitmentTransaction holder_tx_conv;
3787 holder_tx_conv.inner = untag_ptr(holder_tx);
3788 holder_tx_conv.is_owned = ptr_is_owned(holder_tx);
3789 CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_tx_conv);
3790 holder_tx_conv.is_owned = false;
3791 LDKCVec_PaymentPreimageZ preimages_constr;
3792 preimages_constr.datalen = preimages->arr_len;
3793 if (preimages_constr.datalen > 0)
3794 preimages_constr.data = MALLOC(preimages_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_PaymentPreimageZ Elements");
3796 preimages_constr.data = NULL;
3797 int8_tArray* preimages_vals = (void*) preimages->elems;
3798 for (size_t m = 0; m < preimages_constr.datalen; m++) {
3799 int8_tArray preimages_conv_12 = preimages_vals[m];
3800 LDKThirtyTwoBytes preimages_conv_12_ref;
3801 CHECK(preimages_conv_12->arr_len == 32);
3802 memcpy(preimages_conv_12_ref.data, preimages_conv_12->elems, 32); FREE(preimages_conv_12);
3803 preimages_constr.data[m] = preimages_conv_12_ref;
3806 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
3807 *ret_conv = (this_arg_conv->validate_holder_commitment)(this_arg_conv->this_arg, &holder_tx_conv, preimages_constr);
3808 return tag_ptr(ret_conv, true);
3811 int8_tArray __attribute__((export_name("TS_BaseSign_channel_keys_id"))) TS_BaseSign_channel_keys_id(uint64_t this_arg) {
3812 void* this_arg_ptr = untag_ptr(this_arg);
3813 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
3814 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
3815 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
3816 memcpy(ret_arr->elems, (this_arg_conv->channel_keys_id)(this_arg_conv->this_arg).data, 32);
3820 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) {
3821 void* this_arg_ptr = untag_ptr(this_arg);
3822 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
3823 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
3824 LDKCommitmentTransaction commitment_tx_conv;
3825 commitment_tx_conv.inner = untag_ptr(commitment_tx);
3826 commitment_tx_conv.is_owned = ptr_is_owned(commitment_tx);
3827 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv);
3828 commitment_tx_conv.is_owned = false;
3829 LDKCVec_PaymentPreimageZ preimages_constr;
3830 preimages_constr.datalen = preimages->arr_len;
3831 if (preimages_constr.datalen > 0)
3832 preimages_constr.data = MALLOC(preimages_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_PaymentPreimageZ Elements");
3834 preimages_constr.data = NULL;
3835 int8_tArray* preimages_vals = (void*) preimages->elems;
3836 for (size_t m = 0; m < preimages_constr.datalen; m++) {
3837 int8_tArray preimages_conv_12 = preimages_vals[m];
3838 LDKThirtyTwoBytes preimages_conv_12_ref;
3839 CHECK(preimages_conv_12->arr_len == 32);
3840 memcpy(preimages_conv_12_ref.data, preimages_conv_12->elems, 32); FREE(preimages_conv_12);
3841 preimages_constr.data[m] = preimages_conv_12_ref;
3844 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
3845 *ret_conv = (this_arg_conv->sign_counterparty_commitment)(this_arg_conv->this_arg, &commitment_tx_conv, preimages_constr);
3846 return tag_ptr(ret_conv, true);
3849 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) {
3850 void* this_arg_ptr = untag_ptr(this_arg);
3851 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
3852 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
3853 unsigned char secret_arr[32];
3854 CHECK(secret->arr_len == 32);
3855 memcpy(secret_arr, secret->elems, 32); FREE(secret);
3856 unsigned char (*secret_ref)[32] = &secret_arr;
3857 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
3858 *ret_conv = (this_arg_conv->validate_counterparty_revocation)(this_arg_conv->this_arg, idx, secret_ref);
3859 return tag_ptr(ret_conv, true);
3862 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) {
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 LDKHolderCommitmentTransaction commitment_tx_conv;
3867 commitment_tx_conv.inner = untag_ptr(commitment_tx);
3868 commitment_tx_conv.is_owned = ptr_is_owned(commitment_tx);
3869 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv);
3870 commitment_tx_conv.is_owned = false;
3871 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
3872 *ret_conv = (this_arg_conv->sign_holder_commitment_and_htlcs)(this_arg_conv->this_arg, &commitment_tx_conv);
3873 return tag_ptr(ret_conv, true);
3876 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) {
3877 void* this_arg_ptr = untag_ptr(this_arg);
3878 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
3879 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
3880 LDKTransaction justice_tx_ref;
3881 justice_tx_ref.datalen = justice_tx->arr_len;
3882 justice_tx_ref.data = MALLOC(justice_tx_ref.datalen, "LDKTransaction Bytes");
3883 memcpy(justice_tx_ref.data, justice_tx->elems, justice_tx_ref.datalen); FREE(justice_tx);
3884 justice_tx_ref.data_is_owned = true;
3885 unsigned char per_commitment_key_arr[32];
3886 CHECK(per_commitment_key->arr_len == 32);
3887 memcpy(per_commitment_key_arr, per_commitment_key->elems, 32); FREE(per_commitment_key);
3888 unsigned char (*per_commitment_key_ref)[32] = &per_commitment_key_arr;
3889 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
3890 *ret_conv = (this_arg_conv->sign_justice_revoked_output)(this_arg_conv->this_arg, justice_tx_ref, input, amount, per_commitment_key_ref);
3891 return tag_ptr(ret_conv, true);
3894 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) {
3895 void* this_arg_ptr = untag_ptr(this_arg);
3896 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
3897 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
3898 LDKTransaction justice_tx_ref;
3899 justice_tx_ref.datalen = justice_tx->arr_len;
3900 justice_tx_ref.data = MALLOC(justice_tx_ref.datalen, "LDKTransaction Bytes");
3901 memcpy(justice_tx_ref.data, justice_tx->elems, justice_tx_ref.datalen); FREE(justice_tx);
3902 justice_tx_ref.data_is_owned = true;
3903 unsigned char per_commitment_key_arr[32];
3904 CHECK(per_commitment_key->arr_len == 32);
3905 memcpy(per_commitment_key_arr, per_commitment_key->elems, 32); FREE(per_commitment_key);
3906 unsigned char (*per_commitment_key_ref)[32] = &per_commitment_key_arr;
3907 LDKHTLCOutputInCommitment htlc_conv;
3908 htlc_conv.inner = untag_ptr(htlc);
3909 htlc_conv.is_owned = ptr_is_owned(htlc);
3910 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv);
3911 htlc_conv.is_owned = false;
3912 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
3913 *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);
3914 return tag_ptr(ret_conv, true);
3917 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) {
3918 void* this_arg_ptr = untag_ptr(this_arg);
3919 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
3920 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
3921 LDKTransaction htlc_tx_ref;
3922 htlc_tx_ref.datalen = htlc_tx->arr_len;
3923 htlc_tx_ref.data = MALLOC(htlc_tx_ref.datalen, "LDKTransaction Bytes");
3924 memcpy(htlc_tx_ref.data, htlc_tx->elems, htlc_tx_ref.datalen); FREE(htlc_tx);
3925 htlc_tx_ref.data_is_owned = true;
3926 LDKPublicKey per_commitment_point_ref;
3927 CHECK(per_commitment_point->arr_len == 33);
3928 memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point);
3929 LDKHTLCOutputInCommitment htlc_conv;
3930 htlc_conv.inner = untag_ptr(htlc);
3931 htlc_conv.is_owned = ptr_is_owned(htlc);
3932 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv);
3933 htlc_conv.is_owned = false;
3934 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
3935 *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);
3936 return tag_ptr(ret_conv, true);
3939 uint64_t __attribute__((export_name("TS_BaseSign_sign_closing_transaction"))) TS_BaseSign_sign_closing_transaction(uint64_t this_arg, uint64_t closing_tx) {
3940 void* this_arg_ptr = untag_ptr(this_arg);
3941 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
3942 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
3943 LDKClosingTransaction closing_tx_conv;
3944 closing_tx_conv.inner = untag_ptr(closing_tx);
3945 closing_tx_conv.is_owned = ptr_is_owned(closing_tx);
3946 CHECK_INNER_FIELD_ACCESS_OR_NULL(closing_tx_conv);
3947 closing_tx_conv.is_owned = false;
3948 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
3949 *ret_conv = (this_arg_conv->sign_closing_transaction)(this_arg_conv->this_arg, &closing_tx_conv);
3950 return tag_ptr(ret_conv, true);
3953 uint64_t __attribute__((export_name("TS_BaseSign_sign_channel_announcement"))) TS_BaseSign_sign_channel_announcement(uint64_t this_arg, uint64_t msg) {
3954 void* this_arg_ptr = untag_ptr(this_arg);
3955 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
3956 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
3957 LDKUnsignedChannelAnnouncement msg_conv;
3958 msg_conv.inner = untag_ptr(msg);
3959 msg_conv.is_owned = ptr_is_owned(msg);
3960 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
3961 msg_conv.is_owned = false;
3962 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ");
3963 *ret_conv = (this_arg_conv->sign_channel_announcement)(this_arg_conv->this_arg, &msg_conv);
3964 return tag_ptr(ret_conv, true);
3967 void __attribute__((export_name("TS_BaseSign_ready_channel"))) TS_BaseSign_ready_channel(uint64_t this_arg, uint64_t channel_parameters) {
3968 void* this_arg_ptr = untag_ptr(this_arg);
3969 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
3970 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
3971 LDKChannelTransactionParameters channel_parameters_conv;
3972 channel_parameters_conv.inner = untag_ptr(channel_parameters);
3973 channel_parameters_conv.is_owned = ptr_is_owned(channel_parameters);
3974 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv);
3975 channel_parameters_conv.is_owned = false;
3976 (this_arg_conv->ready_channel)(this_arg_conv->this_arg, &channel_parameters_conv);
3979 LDKChannelPublicKeys LDKBaseSign_set_get_pubkeys(LDKBaseSign* this_arg) {
3980 if (this_arg->set_pubkeys != NULL)
3981 this_arg->set_pubkeys(this_arg);
3982 return this_arg->pubkeys;
3984 uint64_t __attribute__((export_name("TS_BaseSign_get_pubkeys"))) TS_BaseSign_get_pubkeys(uint64_t this_arg) {
3985 void* this_arg_ptr = untag_ptr(this_arg);
3986 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
3987 LDKBaseSign* this_arg_conv = (LDKBaseSign*)this_arg_ptr;
3988 LDKChannelPublicKeys ret_var = LDKBaseSign_set_get_pubkeys(this_arg_conv);
3989 uint64_t ret_ref = 0;
3990 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
3991 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
3995 typedef struct LDKSign_JCalls {
3996 atomic_size_t refcnt;
3997 uint32_t instance_ptr;
3998 LDKBaseSign_JCalls* BaseSign;
4000 static void LDKSign_JCalls_free(void* this_arg) {
4001 LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
4002 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
4006 LDKCVec_u8Z write_LDKSign_jcall(const void* this_arg) {
4007 LDKSign_JCalls *j_calls = (LDKSign_JCalls*) this_arg;
4008 int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 15, 0, 0, 0, 0, 0, 0);
4009 LDKCVec_u8Z ret_ref;
4010 ret_ref.datalen = ret->arr_len;
4011 ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
4012 memcpy(ret_ref.data, ret->elems, ret_ref.datalen); FREE(ret);
4015 static void LDKSign_JCalls_cloned(LDKSign* new_obj) {
4016 LDKSign_JCalls *j_calls = (LDKSign_JCalls*) new_obj->this_arg;
4017 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
4018 atomic_fetch_add_explicit(&j_calls->BaseSign->refcnt, 1, memory_order_release);
4020 static inline LDKSign LDKSign_init (JSValue o, JSValue BaseSign, uint64_t pubkeys) {
4021 LDKSign_JCalls *calls = MALLOC(sizeof(LDKSign_JCalls), "LDKSign_JCalls");
4022 atomic_init(&calls->refcnt, 1);
4023 calls->instance_ptr = o;
4025 LDKChannelPublicKeys pubkeys_conv;
4026 pubkeys_conv.inner = untag_ptr(pubkeys);
4027 pubkeys_conv.is_owned = ptr_is_owned(pubkeys);
4028 CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_conv);
4031 .this_arg = (void*) calls,
4032 .write = write_LDKSign_jcall,
4033 .cloned = LDKSign_JCalls_cloned,
4034 .free = LDKSign_JCalls_free,
4035 .BaseSign = LDKBaseSign_init(BaseSign, pubkeys),
4037 calls->BaseSign = ret.BaseSign.this_arg;
4040 uint64_t __attribute__((export_name("TS_LDKSign_new"))) TS_LDKSign_new(JSValue o, JSValue BaseSign, uint64_t pubkeys) {
4041 LDKSign *res_ptr = MALLOC(sizeof(LDKSign), "LDKSign");
4042 *res_ptr = LDKSign_init(o, BaseSign, pubkeys);
4043 return tag_ptr(res_ptr, true);
4045 int8_tArray __attribute__((export_name("TS_Sign_write"))) TS_Sign_write(uint64_t this_arg) {
4046 void* this_arg_ptr = untag_ptr(this_arg);
4047 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4048 LDKSign* this_arg_conv = (LDKSign*)this_arg_ptr;
4049 LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
4050 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
4051 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
4052 CVec_u8Z_free(ret_var);
4056 static inline struct LDKSign CResult_SignDecodeErrorZ_get_ok(LDKCResult_SignDecodeErrorZ *NONNULL_PTR owner){
4057 CHECK(owner->result_ok);
4058 return Sign_clone(&*owner->contents.result);
4060 uint64_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_get_ok"))) TS_CResult_SignDecodeErrorZ_get_ok(uint64_t owner) {
4061 LDKCResult_SignDecodeErrorZ* owner_conv = (LDKCResult_SignDecodeErrorZ*)untag_ptr(owner);
4062 LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
4063 *ret_ret = CResult_SignDecodeErrorZ_get_ok(owner_conv);
4064 return tag_ptr(ret_ret, true);
4067 static inline struct LDKDecodeError CResult_SignDecodeErrorZ_get_err(LDKCResult_SignDecodeErrorZ *NONNULL_PTR owner){
4068 CHECK(!owner->result_ok);
4069 return DecodeError_clone(&*owner->contents.err);
4071 uint64_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_get_err"))) TS_CResult_SignDecodeErrorZ_get_err(uint64_t owner) {
4072 LDKCResult_SignDecodeErrorZ* owner_conv = (LDKCResult_SignDecodeErrorZ*)untag_ptr(owner);
4073 LDKDecodeError ret_var = CResult_SignDecodeErrorZ_get_err(owner_conv);
4074 uint64_t ret_ref = 0;
4075 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4076 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4080 static inline struct LDKRecoverableSignature CResult_RecoverableSignatureNoneZ_get_ok(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR owner){
4081 CHECK(owner->result_ok);
4082 return *owner->contents.result;
4084 int8_tArray __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_get_ok"))) TS_CResult_RecoverableSignatureNoneZ_get_ok(uint64_t owner) {
4085 LDKCResult_RecoverableSignatureNoneZ* owner_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(owner);
4086 int8_tArray ret_arr = init_int8_tArray(68, __LINE__);
4087 memcpy(ret_arr->elems, CResult_RecoverableSignatureNoneZ_get_ok(owner_conv).serialized_form, 68);
4091 static inline void CResult_RecoverableSignatureNoneZ_get_err(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR owner){
4092 CHECK(!owner->result_ok);
4093 return *owner->contents.err;
4095 void __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_get_err"))) TS_CResult_RecoverableSignatureNoneZ_get_err(uint64_t owner) {
4096 LDKCResult_RecoverableSignatureNoneZ* owner_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(owner);
4097 CResult_RecoverableSignatureNoneZ_get_err(owner_conv);
4100 static inline LDKCVec_CVec_u8ZZ CVec_CVec_u8ZZ_clone(const LDKCVec_CVec_u8ZZ *orig) {
4101 LDKCVec_CVec_u8ZZ ret = { .data = MALLOC(sizeof(LDKCVec_u8Z) * orig->datalen, "LDKCVec_CVec_u8ZZ clone bytes"), .datalen = orig->datalen };
4102 for (size_t i = 0; i < ret.datalen; i++) {
4103 ret.data[i] = CVec_u8Z_clone(&orig->data[i]);
4107 static inline struct LDKCVec_CVec_u8ZZ CResult_CVec_CVec_u8ZZNoneZ_get_ok(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR owner){
4108 CHECK(owner->result_ok);
4109 return CVec_CVec_u8ZZ_clone(&*owner->contents.result);
4111 ptrArray __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_get_ok"))) TS_CResult_CVec_CVec_u8ZZNoneZ_get_ok(uint64_t owner) {
4112 LDKCResult_CVec_CVec_u8ZZNoneZ* owner_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(owner);
4113 LDKCVec_CVec_u8ZZ ret_var = CResult_CVec_CVec_u8ZZNoneZ_get_ok(owner_conv);
4114 ptrArray ret_arr = NULL;
4115 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
4116 int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8);
4117 for (size_t m = 0; m < ret_var.datalen; m++) {
4118 LDKCVec_u8Z ret_conv_12_var = ret_var.data[m];
4119 int8_tArray ret_conv_12_arr = init_int8_tArray(ret_conv_12_var.datalen, __LINE__);
4120 memcpy(ret_conv_12_arr->elems, ret_conv_12_var.data, ret_conv_12_var.datalen);
4121 CVec_u8Z_free(ret_conv_12_var);
4122 ret_arr_ptr[m] = ret_conv_12_arr;
4129 static inline void CResult_CVec_CVec_u8ZZNoneZ_get_err(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR owner){
4130 CHECK(!owner->result_ok);
4131 return *owner->contents.err;
4133 void __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_get_err"))) TS_CResult_CVec_CVec_u8ZZNoneZ_get_err(uint64_t owner) {
4134 LDKCResult_CVec_CVec_u8ZZNoneZ* owner_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(owner);
4135 CResult_CVec_CVec_u8ZZNoneZ_get_err(owner_conv);
4138 static inline struct LDKInMemorySigner CResult_InMemorySignerDecodeErrorZ_get_ok(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR owner){
4139 CHECK(owner->result_ok);
4140 return InMemorySigner_clone(&*owner->contents.result);
4142 uint64_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_get_ok"))) TS_CResult_InMemorySignerDecodeErrorZ_get_ok(uint64_t owner) {
4143 LDKCResult_InMemorySignerDecodeErrorZ* owner_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(owner);
4144 LDKInMemorySigner ret_var = CResult_InMemorySignerDecodeErrorZ_get_ok(owner_conv);
4145 uint64_t ret_ref = 0;
4146 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4147 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4151 static inline struct LDKDecodeError CResult_InMemorySignerDecodeErrorZ_get_err(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR owner){
4152 CHECK(!owner->result_ok);
4153 return DecodeError_clone(&*owner->contents.err);
4155 uint64_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_get_err"))) TS_CResult_InMemorySignerDecodeErrorZ_get_err(uint64_t owner) {
4156 LDKCResult_InMemorySignerDecodeErrorZ* owner_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(owner);
4157 LDKDecodeError ret_var = CResult_InMemorySignerDecodeErrorZ_get_err(owner_conv);
4158 uint64_t ret_ref = 0;
4159 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4160 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4164 static inline LDKCVec_TxOutZ CVec_TxOutZ_clone(const LDKCVec_TxOutZ *orig) {
4165 LDKCVec_TxOutZ ret = { .data = MALLOC(sizeof(LDKTxOut) * orig->datalen, "LDKCVec_TxOutZ clone bytes"), .datalen = orig->datalen };
4166 for (size_t i = 0; i < ret.datalen; i++) {
4167 ret.data[i] = TxOut_clone(&orig->data[i]);
4171 static inline struct LDKTransaction CResult_TransactionNoneZ_get_ok(LDKCResult_TransactionNoneZ *NONNULL_PTR owner){
4172 CHECK(owner->result_ok);
4173 return *owner->contents.result;
4175 int8_tArray __attribute__((export_name("TS_CResult_TransactionNoneZ_get_ok"))) TS_CResult_TransactionNoneZ_get_ok(uint64_t owner) {
4176 LDKCResult_TransactionNoneZ* owner_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(owner);
4177 LDKTransaction ret_var = CResult_TransactionNoneZ_get_ok(owner_conv);
4178 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
4179 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
4183 static inline void CResult_TransactionNoneZ_get_err(LDKCResult_TransactionNoneZ *NONNULL_PTR owner){
4184 CHECK(!owner->result_ok);
4185 return *owner->contents.err;
4187 void __attribute__((export_name("TS_CResult_TransactionNoneZ_get_err"))) TS_CResult_TransactionNoneZ_get_err(uint64_t owner) {
4188 LDKCResult_TransactionNoneZ* owner_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(owner);
4189 CResult_TransactionNoneZ_get_err(owner_conv);
4192 uint32_t __attribute__((export_name("TS_LDKCOption_u16Z_ty_from_ptr"))) TS_LDKCOption_u16Z_ty_from_ptr(uint64_t ptr) {
4193 LDKCOption_u16Z *obj = (LDKCOption_u16Z*)untag_ptr(ptr);
4195 case LDKCOption_u16Z_Some: return 0;
4196 case LDKCOption_u16Z_None: return 1;
4200 int16_t __attribute__((export_name("TS_LDKCOption_u16Z_Some_get_some"))) TS_LDKCOption_u16Z_Some_get_some(uint64_t ptr) {
4201 LDKCOption_u16Z *obj = (LDKCOption_u16Z*)untag_ptr(ptr);
4202 assert(obj->tag == LDKCOption_u16Z_Some);
4203 int16_t some_conv = obj->some;
4206 uint32_t __attribute__((export_name("TS_LDKAPIError_ty_from_ptr"))) TS_LDKAPIError_ty_from_ptr(uint64_t ptr) {
4207 LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
4209 case LDKAPIError_APIMisuseError: return 0;
4210 case LDKAPIError_FeeRateTooHigh: return 1;
4211 case LDKAPIError_RouteError: return 2;
4212 case LDKAPIError_ChannelUnavailable: return 3;
4213 case LDKAPIError_MonitorUpdateFailed: return 4;
4214 case LDKAPIError_IncompatibleShutdownScript: return 5;
4218 jstring __attribute__((export_name("TS_LDKAPIError_APIMisuseError_get_err"))) TS_LDKAPIError_APIMisuseError_get_err(uint64_t ptr) {
4219 LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
4220 assert(obj->tag == LDKAPIError_APIMisuseError);
4221 LDKStr err_str = obj->api_misuse_error.err;
4222 jstring err_conv = str_ref_to_ts(err_str.chars, err_str.len);
4225 jstring __attribute__((export_name("TS_LDKAPIError_FeeRateTooHigh_get_err"))) TS_LDKAPIError_FeeRateTooHigh_get_err(uint64_t ptr) {
4226 LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
4227 assert(obj->tag == LDKAPIError_FeeRateTooHigh);
4228 LDKStr err_str = obj->fee_rate_too_high.err;
4229 jstring err_conv = str_ref_to_ts(err_str.chars, err_str.len);
4232 int32_t __attribute__((export_name("TS_LDKAPIError_FeeRateTooHigh_get_feerate"))) TS_LDKAPIError_FeeRateTooHigh_get_feerate(uint64_t ptr) {
4233 LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
4234 assert(obj->tag == LDKAPIError_FeeRateTooHigh);
4235 int32_t feerate_conv = obj->fee_rate_too_high.feerate;
4236 return feerate_conv;
4238 jstring __attribute__((export_name("TS_LDKAPIError_RouteError_get_err"))) TS_LDKAPIError_RouteError_get_err(uint64_t ptr) {
4239 LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
4240 assert(obj->tag == LDKAPIError_RouteError);
4241 LDKStr err_str = obj->route_error.err;
4242 jstring err_conv = str_ref_to_ts(err_str.chars, err_str.len);
4245 jstring __attribute__((export_name("TS_LDKAPIError_ChannelUnavailable_get_err"))) TS_LDKAPIError_ChannelUnavailable_get_err(uint64_t ptr) {
4246 LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
4247 assert(obj->tag == LDKAPIError_ChannelUnavailable);
4248 LDKStr err_str = obj->channel_unavailable.err;
4249 jstring err_conv = str_ref_to_ts(err_str.chars, err_str.len);
4252 uint64_t __attribute__((export_name("TS_LDKAPIError_IncompatibleShutdownScript_get_script"))) TS_LDKAPIError_IncompatibleShutdownScript_get_script(uint64_t ptr) {
4253 LDKAPIError *obj = (LDKAPIError*)untag_ptr(ptr);
4254 assert(obj->tag == LDKAPIError_IncompatibleShutdownScript);
4255 LDKShutdownScript script_var = obj->incompatible_shutdown_script.script;
4256 uint64_t script_ref = 0;
4257 CHECK_INNER_FIELD_ACCESS_OR_NULL(script_var);
4258 script_ref = tag_ptr(script_var.inner, false);
4261 static inline void CResult_NoneAPIErrorZ_get_ok(LDKCResult_NoneAPIErrorZ *NONNULL_PTR owner){
4262 CHECK(owner->result_ok);
4263 return *owner->contents.result;
4265 void __attribute__((export_name("TS_CResult_NoneAPIErrorZ_get_ok"))) TS_CResult_NoneAPIErrorZ_get_ok(uint64_t owner) {
4266 LDKCResult_NoneAPIErrorZ* owner_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(owner);
4267 CResult_NoneAPIErrorZ_get_ok(owner_conv);
4270 static inline struct LDKAPIError CResult_NoneAPIErrorZ_get_err(LDKCResult_NoneAPIErrorZ *NONNULL_PTR owner){
4271 CHECK(!owner->result_ok);
4272 return APIError_clone(&*owner->contents.err);
4274 uint64_t __attribute__((export_name("TS_CResult_NoneAPIErrorZ_get_err"))) TS_CResult_NoneAPIErrorZ_get_err(uint64_t owner) {
4275 LDKCResult_NoneAPIErrorZ* owner_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(owner);
4276 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
4277 *ret_copy = CResult_NoneAPIErrorZ_get_err(owner_conv);
4278 uint64_t ret_ref = tag_ptr(ret_copy, true);
4282 static inline LDKCVec_CResult_NoneAPIErrorZZ CVec_CResult_NoneAPIErrorZZ_clone(const LDKCVec_CResult_NoneAPIErrorZZ *orig) {
4283 LDKCVec_CResult_NoneAPIErrorZZ ret = { .data = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ) * orig->datalen, "LDKCVec_CResult_NoneAPIErrorZZ clone bytes"), .datalen = orig->datalen };
4284 for (size_t i = 0; i < ret.datalen; i++) {
4285 ret.data[i] = CResult_NoneAPIErrorZ_clone(&orig->data[i]);
4289 static inline LDKCVec_APIErrorZ CVec_APIErrorZ_clone(const LDKCVec_APIErrorZ *orig) {
4290 LDKCVec_APIErrorZ ret = { .data = MALLOC(sizeof(LDKAPIError) * orig->datalen, "LDKCVec_APIErrorZ clone bytes"), .datalen = orig->datalen };
4291 for (size_t i = 0; i < ret.datalen; i++) {
4292 ret.data[i] = APIError_clone(&orig->data[i]);
4296 static inline struct LDKThirtyTwoBytes CResult__u832APIErrorZ_get_ok(LDKCResult__u832APIErrorZ *NONNULL_PTR owner){
4297 CHECK(owner->result_ok);
4298 return ThirtyTwoBytes_clone(&*owner->contents.result);
4300 int8_tArray __attribute__((export_name("TS_CResult__u832APIErrorZ_get_ok"))) TS_CResult__u832APIErrorZ_get_ok(uint64_t owner) {
4301 LDKCResult__u832APIErrorZ* owner_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(owner);
4302 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
4303 memcpy(ret_arr->elems, CResult__u832APIErrorZ_get_ok(owner_conv).data, 32);
4307 static inline struct LDKAPIError CResult__u832APIErrorZ_get_err(LDKCResult__u832APIErrorZ *NONNULL_PTR owner){
4308 CHECK(!owner->result_ok);
4309 return APIError_clone(&*owner->contents.err);
4311 uint64_t __attribute__((export_name("TS_CResult__u832APIErrorZ_get_err"))) TS_CResult__u832APIErrorZ_get_err(uint64_t owner) {
4312 LDKCResult__u832APIErrorZ* owner_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(owner);
4313 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
4314 *ret_copy = CResult__u832APIErrorZ_get_err(owner_conv);
4315 uint64_t ret_ref = tag_ptr(ret_copy, true);
4319 uint32_t __attribute__((export_name("TS_LDKPaymentSendFailure_ty_from_ptr"))) TS_LDKPaymentSendFailure_ty_from_ptr(uint64_t ptr) {
4320 LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)untag_ptr(ptr);
4322 case LDKPaymentSendFailure_ParameterError: return 0;
4323 case LDKPaymentSendFailure_PathParameterError: return 1;
4324 case LDKPaymentSendFailure_AllFailedRetrySafe: return 2;
4325 case LDKPaymentSendFailure_PartialFailure: return 3;
4329 uint64_t __attribute__((export_name("TS_LDKPaymentSendFailure_ParameterError_get_parameter_error"))) TS_LDKPaymentSendFailure_ParameterError_get_parameter_error(uint64_t ptr) {
4330 LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)untag_ptr(ptr);
4331 assert(obj->tag == LDKPaymentSendFailure_ParameterError);
4332 uint64_t parameter_error_ref = tag_ptr(&obj->parameter_error, false);
4333 return parameter_error_ref;
4335 uint64_tArray __attribute__((export_name("TS_LDKPaymentSendFailure_PathParameterError_get_path_parameter_error"))) TS_LDKPaymentSendFailure_PathParameterError_get_path_parameter_error(uint64_t ptr) {
4336 LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)untag_ptr(ptr);
4337 assert(obj->tag == LDKPaymentSendFailure_PathParameterError);
4338 LDKCVec_CResult_NoneAPIErrorZZ path_parameter_error_var = obj->path_parameter_error;
4339 uint64_tArray path_parameter_error_arr = NULL;
4340 path_parameter_error_arr = init_uint64_tArray(path_parameter_error_var.datalen, __LINE__);
4341 uint64_t *path_parameter_error_arr_ptr = (uint64_t*)(((uint8_t*)path_parameter_error_arr) + 8);
4342 for (size_t w = 0; w < path_parameter_error_var.datalen; w++) {
4343 LDKCResult_NoneAPIErrorZ* path_parameter_error_conv_22_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
4344 *path_parameter_error_conv_22_conv = path_parameter_error_var.data[w];
4345 *path_parameter_error_conv_22_conv = CResult_NoneAPIErrorZ_clone(path_parameter_error_conv_22_conv);
4346 path_parameter_error_arr_ptr[w] = tag_ptr(path_parameter_error_conv_22_conv, true);
4349 return path_parameter_error_arr;
4351 uint64_tArray __attribute__((export_name("TS_LDKPaymentSendFailure_AllFailedRetrySafe_get_all_failed_retry_safe"))) TS_LDKPaymentSendFailure_AllFailedRetrySafe_get_all_failed_retry_safe(uint64_t ptr) {
4352 LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)untag_ptr(ptr);
4353 assert(obj->tag == LDKPaymentSendFailure_AllFailedRetrySafe);
4354 LDKCVec_APIErrorZ all_failed_retry_safe_var = obj->all_failed_retry_safe;
4355 uint64_tArray all_failed_retry_safe_arr = NULL;
4356 all_failed_retry_safe_arr = init_uint64_tArray(all_failed_retry_safe_var.datalen, __LINE__);
4357 uint64_t *all_failed_retry_safe_arr_ptr = (uint64_t*)(((uint8_t*)all_failed_retry_safe_arr) + 8);
4358 for (size_t k = 0; k < all_failed_retry_safe_var.datalen; k++) {
4359 uint64_t all_failed_retry_safe_conv_10_ref = tag_ptr(&all_failed_retry_safe_var.data[k], false);
4360 all_failed_retry_safe_arr_ptr[k] = all_failed_retry_safe_conv_10_ref;
4363 return all_failed_retry_safe_arr;
4365 uint64_tArray __attribute__((export_name("TS_LDKPaymentSendFailure_PartialFailure_get_results"))) TS_LDKPaymentSendFailure_PartialFailure_get_results(uint64_t ptr) {
4366 LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)untag_ptr(ptr);
4367 assert(obj->tag == LDKPaymentSendFailure_PartialFailure);
4368 LDKCVec_CResult_NoneAPIErrorZZ results_var = obj->partial_failure.results;
4369 uint64_tArray results_arr = NULL;
4370 results_arr = init_uint64_tArray(results_var.datalen, __LINE__);
4371 uint64_t *results_arr_ptr = (uint64_t*)(((uint8_t*)results_arr) + 8);
4372 for (size_t w = 0; w < results_var.datalen; w++) {
4373 LDKCResult_NoneAPIErrorZ* results_conv_22_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
4374 *results_conv_22_conv = results_var.data[w];
4375 *results_conv_22_conv = CResult_NoneAPIErrorZ_clone(results_conv_22_conv);
4376 results_arr_ptr[w] = tag_ptr(results_conv_22_conv, true);
4381 uint64_t __attribute__((export_name("TS_LDKPaymentSendFailure_PartialFailure_get_failed_paths_retry"))) TS_LDKPaymentSendFailure_PartialFailure_get_failed_paths_retry(uint64_t ptr) {
4382 LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)untag_ptr(ptr);
4383 assert(obj->tag == LDKPaymentSendFailure_PartialFailure);
4384 LDKRouteParameters failed_paths_retry_var = obj->partial_failure.failed_paths_retry;
4385 uint64_t failed_paths_retry_ref = 0;
4386 CHECK_INNER_FIELD_ACCESS_OR_NULL(failed_paths_retry_var);
4387 failed_paths_retry_ref = tag_ptr(failed_paths_retry_var.inner, false);
4388 return failed_paths_retry_ref;
4390 int8_tArray __attribute__((export_name("TS_LDKPaymentSendFailure_PartialFailure_get_payment_id"))) TS_LDKPaymentSendFailure_PartialFailure_get_payment_id(uint64_t ptr) {
4391 LDKPaymentSendFailure *obj = (LDKPaymentSendFailure*)untag_ptr(ptr);
4392 assert(obj->tag == LDKPaymentSendFailure_PartialFailure);
4393 int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
4394 memcpy(payment_id_arr->elems, obj->partial_failure.payment_id.data, 32);
4395 return payment_id_arr;
4397 static inline struct LDKThirtyTwoBytes CResult_PaymentIdPaymentSendFailureZ_get_ok(LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR owner){
4398 CHECK(owner->result_ok);
4399 return ThirtyTwoBytes_clone(&*owner->contents.result);
4401 int8_tArray __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_get_ok"))) TS_CResult_PaymentIdPaymentSendFailureZ_get_ok(uint64_t owner) {
4402 LDKCResult_PaymentIdPaymentSendFailureZ* owner_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)untag_ptr(owner);
4403 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
4404 memcpy(ret_arr->elems, CResult_PaymentIdPaymentSendFailureZ_get_ok(owner_conv).data, 32);
4408 static inline struct LDKPaymentSendFailure CResult_PaymentIdPaymentSendFailureZ_get_err(LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR owner){
4409 CHECK(!owner->result_ok);
4410 return PaymentSendFailure_clone(&*owner->contents.err);
4412 uint64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_get_err"))) TS_CResult_PaymentIdPaymentSendFailureZ_get_err(uint64_t owner) {
4413 LDKCResult_PaymentIdPaymentSendFailureZ* owner_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)untag_ptr(owner);
4414 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
4415 *ret_copy = CResult_PaymentIdPaymentSendFailureZ_get_err(owner_conv);
4416 uint64_t ret_ref = tag_ptr(ret_copy, true);
4420 static inline void CResult_NonePaymentSendFailureZ_get_ok(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR owner){
4421 CHECK(owner->result_ok);
4422 return *owner->contents.result;
4424 void __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_get_ok"))) TS_CResult_NonePaymentSendFailureZ_get_ok(uint64_t owner) {
4425 LDKCResult_NonePaymentSendFailureZ* owner_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(owner);
4426 CResult_NonePaymentSendFailureZ_get_ok(owner_conv);
4429 static inline struct LDKPaymentSendFailure CResult_NonePaymentSendFailureZ_get_err(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR owner){
4430 CHECK(!owner->result_ok);
4431 return PaymentSendFailure_clone(&*owner->contents.err);
4433 uint64_t __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_get_err"))) TS_CResult_NonePaymentSendFailureZ_get_err(uint64_t owner) {
4434 LDKCResult_NonePaymentSendFailureZ* owner_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(owner);
4435 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
4436 *ret_copy = CResult_NonePaymentSendFailureZ_get_err(owner_conv);
4437 uint64_t ret_ref = tag_ptr(ret_copy, true);
4441 static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentIdZ_get_a(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR owner){
4442 return ThirtyTwoBytes_clone(&owner->a);
4444 int8_tArray __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentIdZ_get_a"))) TS_C2Tuple_PaymentHashPaymentIdZ_get_a(uint64_t owner) {
4445 LDKC2Tuple_PaymentHashPaymentIdZ* owner_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)untag_ptr(owner);
4446 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
4447 memcpy(ret_arr->elems, C2Tuple_PaymentHashPaymentIdZ_get_a(owner_conv).data, 32);
4451 static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentIdZ_get_b(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR owner){
4452 return ThirtyTwoBytes_clone(&owner->b);
4454 int8_tArray __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentIdZ_get_b"))) TS_C2Tuple_PaymentHashPaymentIdZ_get_b(uint64_t owner) {
4455 LDKC2Tuple_PaymentHashPaymentIdZ* owner_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)untag_ptr(owner);
4456 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
4457 memcpy(ret_arr->elems, C2Tuple_PaymentHashPaymentIdZ_get_b(owner_conv).data, 32);
4461 static inline struct LDKC2Tuple_PaymentHashPaymentIdZ CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_ok(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR owner){
4462 CHECK(owner->result_ok);
4463 return C2Tuple_PaymentHashPaymentIdZ_clone(&*owner->contents.result);
4465 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_ok(uint64_t owner) {
4466 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)untag_ptr(owner);
4467 LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ");
4468 *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_ok(owner_conv);
4469 return tag_ptr(ret_conv, true);
4472 static inline struct LDKPaymentSendFailure CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_err(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR owner){
4473 CHECK(!owner->result_ok);
4474 return PaymentSendFailure_clone(&*owner->contents.err);
4476 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_err"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_err(uint64_t owner) {
4477 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)untag_ptr(owner);
4478 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
4479 *ret_copy = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_get_err(owner_conv);
4480 uint64_t ret_ref = tag_ptr(ret_copy, true);
4484 static inline LDKCVec_ThirtyTwoBytesZ CVec_ThirtyTwoBytesZ_clone(const LDKCVec_ThirtyTwoBytesZ *orig) {
4485 LDKCVec_ThirtyTwoBytesZ ret = { .data = MALLOC(sizeof(LDKThirtyTwoBytes) * orig->datalen, "LDKCVec_ThirtyTwoBytesZ clone bytes"), .datalen = orig->datalen };
4486 for (size_t i = 0; i < ret.datalen; i++) {
4487 ret.data[i] = ThirtyTwoBytes_clone(&orig->data[i]);
4491 static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentSecretZ_get_a(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR owner){
4492 return ThirtyTwoBytes_clone(&owner->a);
4494 int8_tArray __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentSecretZ_get_a"))) TS_C2Tuple_PaymentHashPaymentSecretZ_get_a(uint64_t owner) {
4495 LDKC2Tuple_PaymentHashPaymentSecretZ* owner_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(owner);
4496 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
4497 memcpy(ret_arr->elems, C2Tuple_PaymentHashPaymentSecretZ_get_a(owner_conv).data, 32);
4501 static inline struct LDKThirtyTwoBytes C2Tuple_PaymentHashPaymentSecretZ_get_b(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR owner){
4502 return ThirtyTwoBytes_clone(&owner->b);
4504 int8_tArray __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentSecretZ_get_b"))) TS_C2Tuple_PaymentHashPaymentSecretZ_get_b(uint64_t owner) {
4505 LDKC2Tuple_PaymentHashPaymentSecretZ* owner_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(owner);
4506 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
4507 memcpy(ret_arr->elems, C2Tuple_PaymentHashPaymentSecretZ_get_b(owner_conv).data, 32);
4511 static inline struct LDKC2Tuple_PaymentHashPaymentSecretZ CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_ok(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR owner){
4512 CHECK(owner->result_ok);
4513 return C2Tuple_PaymentHashPaymentSecretZ_clone(&*owner->contents.result);
4515 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_ok(uint64_t owner) {
4516 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)untag_ptr(owner);
4517 LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
4518 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_ok(owner_conv);
4519 return tag_ptr(ret_conv, true);
4522 static inline void CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_err(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR owner){
4523 CHECK(!owner->result_ok);
4524 return *owner->contents.err;
4526 void __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_err"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_err(uint64_t owner) {
4527 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)untag_ptr(owner);
4528 CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_get_err(owner_conv);
4531 static inline struct LDKC2Tuple_PaymentHashPaymentSecretZ CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_ok(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR owner){
4532 CHECK(owner->result_ok);
4533 return C2Tuple_PaymentHashPaymentSecretZ_clone(&*owner->contents.result);
4535 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_ok(uint64_t owner) {
4536 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)untag_ptr(owner);
4537 LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
4538 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_ok(owner_conv);
4539 return tag_ptr(ret_conv, true);
4542 static inline struct LDKAPIError CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_err(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR owner){
4543 CHECK(!owner->result_ok);
4544 return APIError_clone(&*owner->contents.err);
4546 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_err"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_err(uint64_t owner) {
4547 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* owner_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)untag_ptr(owner);
4548 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
4549 *ret_copy = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_get_err(owner_conv);
4550 uint64_t ret_ref = tag_ptr(ret_copy, true);
4554 static inline struct LDKThirtyTwoBytes CResult_PaymentSecretNoneZ_get_ok(LDKCResult_PaymentSecretNoneZ *NONNULL_PTR owner){
4555 CHECK(owner->result_ok);
4556 return ThirtyTwoBytes_clone(&*owner->contents.result);
4558 int8_tArray __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_get_ok"))) TS_CResult_PaymentSecretNoneZ_get_ok(uint64_t owner) {
4559 LDKCResult_PaymentSecretNoneZ* owner_conv = (LDKCResult_PaymentSecretNoneZ*)untag_ptr(owner);
4560 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
4561 memcpy(ret_arr->elems, CResult_PaymentSecretNoneZ_get_ok(owner_conv).data, 32);
4565 static inline void CResult_PaymentSecretNoneZ_get_err(LDKCResult_PaymentSecretNoneZ *NONNULL_PTR owner){
4566 CHECK(!owner->result_ok);
4567 return *owner->contents.err;
4569 void __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_get_err"))) TS_CResult_PaymentSecretNoneZ_get_err(uint64_t owner) {
4570 LDKCResult_PaymentSecretNoneZ* owner_conv = (LDKCResult_PaymentSecretNoneZ*)untag_ptr(owner);
4571 CResult_PaymentSecretNoneZ_get_err(owner_conv);
4574 static inline struct LDKThirtyTwoBytes CResult_PaymentSecretAPIErrorZ_get_ok(LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR owner){
4575 CHECK(owner->result_ok);
4576 return ThirtyTwoBytes_clone(&*owner->contents.result);
4578 int8_tArray __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_get_ok"))) TS_CResult_PaymentSecretAPIErrorZ_get_ok(uint64_t owner) {
4579 LDKCResult_PaymentSecretAPIErrorZ* owner_conv = (LDKCResult_PaymentSecretAPIErrorZ*)untag_ptr(owner);
4580 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
4581 memcpy(ret_arr->elems, CResult_PaymentSecretAPIErrorZ_get_ok(owner_conv).data, 32);
4585 static inline struct LDKAPIError CResult_PaymentSecretAPIErrorZ_get_err(LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR owner){
4586 CHECK(!owner->result_ok);
4587 return APIError_clone(&*owner->contents.err);
4589 uint64_t __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_get_err"))) TS_CResult_PaymentSecretAPIErrorZ_get_err(uint64_t owner) {
4590 LDKCResult_PaymentSecretAPIErrorZ* owner_conv = (LDKCResult_PaymentSecretAPIErrorZ*)untag_ptr(owner);
4591 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
4592 *ret_copy = CResult_PaymentSecretAPIErrorZ_get_err(owner_conv);
4593 uint64_t ret_ref = tag_ptr(ret_copy, true);
4597 static inline struct LDKThirtyTwoBytes CResult_PaymentPreimageAPIErrorZ_get_ok(LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR owner){
4598 CHECK(owner->result_ok);
4599 return ThirtyTwoBytes_clone(&*owner->contents.result);
4601 int8_tArray __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_get_ok"))) TS_CResult_PaymentPreimageAPIErrorZ_get_ok(uint64_t owner) {
4602 LDKCResult_PaymentPreimageAPIErrorZ* owner_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)untag_ptr(owner);
4603 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
4604 memcpy(ret_arr->elems, CResult_PaymentPreimageAPIErrorZ_get_ok(owner_conv).data, 32);
4608 static inline struct LDKAPIError CResult_PaymentPreimageAPIErrorZ_get_err(LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR owner){
4609 CHECK(!owner->result_ok);
4610 return APIError_clone(&*owner->contents.err);
4612 uint64_t __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_get_err"))) TS_CResult_PaymentPreimageAPIErrorZ_get_err(uint64_t owner) {
4613 LDKCResult_PaymentPreimageAPIErrorZ* owner_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)untag_ptr(owner);
4614 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
4615 *ret_copy = CResult_PaymentPreimageAPIErrorZ_get_err(owner_conv);
4616 uint64_t ret_ref = tag_ptr(ret_copy, true);
4620 static inline struct LDKCounterpartyForwardingInfo CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR owner){
4621 CHECK(owner->result_ok);
4622 return CounterpartyForwardingInfo_clone(&*owner->contents.result);
4624 uint64_t __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok(uint64_t owner) {
4625 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(owner);
4626 LDKCounterpartyForwardingInfo ret_var = CResult_CounterpartyForwardingInfoDecodeErrorZ_get_ok(owner_conv);
4627 uint64_t ret_ref = 0;
4628 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4629 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4633 static inline struct LDKDecodeError CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR owner){
4634 CHECK(!owner->result_ok);
4635 return DecodeError_clone(&*owner->contents.err);
4637 uint64_t __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(uint64_t owner) {
4638 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* owner_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(owner);
4639 LDKDecodeError ret_var = CResult_CounterpartyForwardingInfoDecodeErrorZ_get_err(owner_conv);
4640 uint64_t ret_ref = 0;
4641 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4642 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4646 static inline struct LDKChannelCounterparty CResult_ChannelCounterpartyDecodeErrorZ_get_ok(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR owner){
4647 CHECK(owner->result_ok);
4648 return ChannelCounterparty_clone(&*owner->contents.result);
4650 uint64_t __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_get_ok"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_get_ok(uint64_t owner) {
4651 LDKCResult_ChannelCounterpartyDecodeErrorZ* owner_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(owner);
4652 LDKChannelCounterparty ret_var = CResult_ChannelCounterpartyDecodeErrorZ_get_ok(owner_conv);
4653 uint64_t ret_ref = 0;
4654 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4655 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4659 static inline struct LDKDecodeError CResult_ChannelCounterpartyDecodeErrorZ_get_err(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR owner){
4660 CHECK(!owner->result_ok);
4661 return DecodeError_clone(&*owner->contents.err);
4663 uint64_t __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_get_err"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_get_err(uint64_t owner) {
4664 LDKCResult_ChannelCounterpartyDecodeErrorZ* owner_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(owner);
4665 LDKDecodeError ret_var = CResult_ChannelCounterpartyDecodeErrorZ_get_err(owner_conv);
4666 uint64_t ret_ref = 0;
4667 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4668 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4672 static inline struct LDKChannelDetails CResult_ChannelDetailsDecodeErrorZ_get_ok(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR owner){
4673 CHECK(owner->result_ok);
4674 return ChannelDetails_clone(&*owner->contents.result);
4676 uint64_t __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_get_ok"))) TS_CResult_ChannelDetailsDecodeErrorZ_get_ok(uint64_t owner) {
4677 LDKCResult_ChannelDetailsDecodeErrorZ* owner_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(owner);
4678 LDKChannelDetails ret_var = CResult_ChannelDetailsDecodeErrorZ_get_ok(owner_conv);
4679 uint64_t ret_ref = 0;
4680 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4681 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4685 static inline struct LDKDecodeError CResult_ChannelDetailsDecodeErrorZ_get_err(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR owner){
4686 CHECK(!owner->result_ok);
4687 return DecodeError_clone(&*owner->contents.err);
4689 uint64_t __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_get_err"))) TS_CResult_ChannelDetailsDecodeErrorZ_get_err(uint64_t owner) {
4690 LDKCResult_ChannelDetailsDecodeErrorZ* owner_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(owner);
4691 LDKDecodeError ret_var = CResult_ChannelDetailsDecodeErrorZ_get_err(owner_conv);
4692 uint64_t ret_ref = 0;
4693 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4694 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4698 static inline struct LDKPhantomRouteHints CResult_PhantomRouteHintsDecodeErrorZ_get_ok(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR owner){
4699 CHECK(owner->result_ok);
4700 return PhantomRouteHints_clone(&*owner->contents.result);
4702 uint64_t __attribute__((export_name("TS_CResult_PhantomRouteHintsDecodeErrorZ_get_ok"))) TS_CResult_PhantomRouteHintsDecodeErrorZ_get_ok(uint64_t owner) {
4703 LDKCResult_PhantomRouteHintsDecodeErrorZ* owner_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(owner);
4704 LDKPhantomRouteHints ret_var = CResult_PhantomRouteHintsDecodeErrorZ_get_ok(owner_conv);
4705 uint64_t ret_ref = 0;
4706 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4707 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4711 static inline struct LDKDecodeError CResult_PhantomRouteHintsDecodeErrorZ_get_err(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR owner){
4712 CHECK(!owner->result_ok);
4713 return DecodeError_clone(&*owner->contents.err);
4715 uint64_t __attribute__((export_name("TS_CResult_PhantomRouteHintsDecodeErrorZ_get_err"))) TS_CResult_PhantomRouteHintsDecodeErrorZ_get_err(uint64_t owner) {
4716 LDKCResult_PhantomRouteHintsDecodeErrorZ* owner_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(owner);
4717 LDKDecodeError ret_var = CResult_PhantomRouteHintsDecodeErrorZ_get_err(owner_conv);
4718 uint64_t ret_ref = 0;
4719 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
4720 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
4724 static inline LDKCVec_ChannelMonitorZ CVec_ChannelMonitorZ_clone(const LDKCVec_ChannelMonitorZ *orig) {
4725 LDKCVec_ChannelMonitorZ ret = { .data = MALLOC(sizeof(LDKChannelMonitor) * orig->datalen, "LDKCVec_ChannelMonitorZ clone bytes"), .datalen = orig->datalen };
4726 for (size_t i = 0; i < ret.datalen; i++) {
4727 ret.data[i] = ChannelMonitor_clone(&orig->data[i]);
4731 typedef struct LDKWatch_JCalls {
4732 atomic_size_t refcnt;
4733 uint32_t instance_ptr;
4735 static void LDKWatch_JCalls_free(void* this_arg) {
4736 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
4737 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
4741 LDKCResult_NoneChannelMonitorUpdateErrZ watch_channel_LDKWatch_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitor monitor) {
4742 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
4743 LDKOutPoint funding_txo_var = funding_txo;
4744 uint64_t funding_txo_ref = 0;
4745 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var);
4746 funding_txo_ref = tag_ptr(funding_txo_var.inner, funding_txo_var.is_owned);
4747 LDKChannelMonitor monitor_var = monitor;
4748 uint64_t monitor_ref = 0;
4749 CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_var);
4750 monitor_ref = tag_ptr(monitor_var.inner, monitor_var.is_owned);
4751 uint32_t ret = js_invoke_function_bbuuuu(j_calls->instance_ptr, 16, funding_txo_ref, monitor_ref, 0, 0, 0, 0);
4752 void* ret_ptr = untag_ptr(ret);
4753 CHECK_ACCESS(ret_ptr);
4754 LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
4755 FREE(untag_ptr(ret));
4758 LDKCResult_NoneChannelMonitorUpdateErrZ update_channel_LDKWatch_jcall(const void* this_arg, LDKOutPoint funding_txo, LDKChannelMonitorUpdate update) {
4759 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
4760 LDKOutPoint funding_txo_var = funding_txo;
4761 uint64_t funding_txo_ref = 0;
4762 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_var);
4763 funding_txo_ref = tag_ptr(funding_txo_var.inner, funding_txo_var.is_owned);
4764 LDKChannelMonitorUpdate update_var = update;
4765 uint64_t update_ref = 0;
4766 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_var);
4767 update_ref = tag_ptr(update_var.inner, update_var.is_owned);
4768 uint32_t ret = js_invoke_function_bbuuuu(j_calls->instance_ptr, 17, funding_txo_ref, update_ref, 0, 0, 0, 0);
4769 void* ret_ptr = untag_ptr(ret);
4770 CHECK_ACCESS(ret_ptr);
4771 LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
4772 FREE(untag_ptr(ret));
4775 LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ release_pending_monitor_events_LDKWatch_jcall(const void* this_arg) {
4776 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) this_arg;
4777 uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 18, 0, 0, 0, 0, 0, 0);
4778 LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ ret_constr;
4779 ret_constr.datalen = ret->arr_len;
4780 if (ret_constr.datalen > 0)
4781 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ Elements");
4783 ret_constr.data = NULL;
4784 uint64_t* ret_vals = ret->elems;
4785 for (size_t x = 0; x < ret_constr.datalen; x++) {
4786 uint64_t ret_conv_49 = ret_vals[x];
4787 void* ret_conv_49_ptr = untag_ptr(ret_conv_49);
4788 CHECK_ACCESS(ret_conv_49_ptr);
4789 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ ret_conv_49_conv = *(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)(ret_conv_49_ptr);
4790 FREE(untag_ptr(ret_conv_49));
4791 ret_constr.data[x] = ret_conv_49_conv;
4796 static void LDKWatch_JCalls_cloned(LDKWatch* new_obj) {
4797 LDKWatch_JCalls *j_calls = (LDKWatch_JCalls*) new_obj->this_arg;
4798 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
4800 static inline LDKWatch LDKWatch_init (JSValue o) {
4801 LDKWatch_JCalls *calls = MALLOC(sizeof(LDKWatch_JCalls), "LDKWatch_JCalls");
4802 atomic_init(&calls->refcnt, 1);
4803 calls->instance_ptr = o;
4806 .this_arg = (void*) calls,
4807 .watch_channel = watch_channel_LDKWatch_jcall,
4808 .update_channel = update_channel_LDKWatch_jcall,
4809 .release_pending_monitor_events = release_pending_monitor_events_LDKWatch_jcall,
4810 .free = LDKWatch_JCalls_free,
4814 uint64_t __attribute__((export_name("TS_LDKWatch_new"))) TS_LDKWatch_new(JSValue o) {
4815 LDKWatch *res_ptr = MALLOC(sizeof(LDKWatch), "LDKWatch");
4816 *res_ptr = LDKWatch_init(o);
4817 return tag_ptr(res_ptr, true);
4819 uint64_t __attribute__((export_name("TS_Watch_watch_channel"))) TS_Watch_watch_channel(uint64_t this_arg, uint64_t funding_txo, uint64_t monitor) {
4820 void* this_arg_ptr = untag_ptr(this_arg);
4821 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4822 LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
4823 LDKOutPoint funding_txo_conv;
4824 funding_txo_conv.inner = untag_ptr(funding_txo);
4825 funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
4826 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
4827 funding_txo_conv = OutPoint_clone(&funding_txo_conv);
4828 LDKChannelMonitor monitor_conv;
4829 monitor_conv.inner = untag_ptr(monitor);
4830 monitor_conv.is_owned = ptr_is_owned(monitor);
4831 CHECK_INNER_FIELD_ACCESS_OR_NULL(monitor_conv);
4832 monitor_conv = ChannelMonitor_clone(&monitor_conv);
4833 LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
4834 *ret_conv = (this_arg_conv->watch_channel)(this_arg_conv->this_arg, funding_txo_conv, monitor_conv);
4835 return tag_ptr(ret_conv, true);
4838 uint64_t __attribute__((export_name("TS_Watch_update_channel"))) TS_Watch_update_channel(uint64_t this_arg, uint64_t funding_txo, uint64_t update) {
4839 void* this_arg_ptr = untag_ptr(this_arg);
4840 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4841 LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
4842 LDKOutPoint funding_txo_conv;
4843 funding_txo_conv.inner = untag_ptr(funding_txo);
4844 funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
4845 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
4846 funding_txo_conv = OutPoint_clone(&funding_txo_conv);
4847 LDKChannelMonitorUpdate update_conv;
4848 update_conv.inner = untag_ptr(update);
4849 update_conv.is_owned = ptr_is_owned(update);
4850 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv);
4851 update_conv = ChannelMonitorUpdate_clone(&update_conv);
4852 LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
4853 *ret_conv = (this_arg_conv->update_channel)(this_arg_conv->this_arg, funding_txo_conv, update_conv);
4854 return tag_ptr(ret_conv, true);
4857 uint64_tArray __attribute__((export_name("TS_Watch_release_pending_monitor_events"))) TS_Watch_release_pending_monitor_events(uint64_t this_arg) {
4858 void* this_arg_ptr = untag_ptr(this_arg);
4859 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4860 LDKWatch* this_arg_conv = (LDKWatch*)this_arg_ptr;
4861 LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ ret_var = (this_arg_conv->release_pending_monitor_events)(this_arg_conv->this_arg);
4862 uint64_tArray ret_arr = NULL;
4863 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
4864 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
4865 for (size_t x = 0; x < ret_var.datalen; x++) {
4866 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* ret_conv_49_conv = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ");
4867 *ret_conv_49_conv = ret_var.data[x];
4868 ret_arr_ptr[x] = tag_ptr(ret_conv_49_conv, true);
4875 typedef struct LDKBroadcasterInterface_JCalls {
4876 atomic_size_t refcnt;
4877 uint32_t instance_ptr;
4878 } LDKBroadcasterInterface_JCalls;
4879 static void LDKBroadcasterInterface_JCalls_free(void* this_arg) {
4880 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
4881 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
4885 void broadcast_transaction_LDKBroadcasterInterface_jcall(const void* this_arg, LDKTransaction tx) {
4886 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) this_arg;
4887 LDKTransaction tx_var = tx;
4888 int8_tArray tx_arr = init_int8_tArray(tx_var.datalen, __LINE__);
4889 memcpy(tx_arr->elems, tx_var.data, tx_var.datalen);
4890 Transaction_free(tx_var);
4891 js_invoke_function_uuuuuu(j_calls->instance_ptr, 19, (uint32_t)tx_arr, 0, 0, 0, 0, 0);
4893 static void LDKBroadcasterInterface_JCalls_cloned(LDKBroadcasterInterface* new_obj) {
4894 LDKBroadcasterInterface_JCalls *j_calls = (LDKBroadcasterInterface_JCalls*) new_obj->this_arg;
4895 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
4897 static inline LDKBroadcasterInterface LDKBroadcasterInterface_init (JSValue o) {
4898 LDKBroadcasterInterface_JCalls *calls = MALLOC(sizeof(LDKBroadcasterInterface_JCalls), "LDKBroadcasterInterface_JCalls");
4899 atomic_init(&calls->refcnt, 1);
4900 calls->instance_ptr = o;
4902 LDKBroadcasterInterface ret = {
4903 .this_arg = (void*) calls,
4904 .broadcast_transaction = broadcast_transaction_LDKBroadcasterInterface_jcall,
4905 .free = LDKBroadcasterInterface_JCalls_free,
4909 uint64_t __attribute__((export_name("TS_LDKBroadcasterInterface_new"))) TS_LDKBroadcasterInterface_new(JSValue o) {
4910 LDKBroadcasterInterface *res_ptr = MALLOC(sizeof(LDKBroadcasterInterface), "LDKBroadcasterInterface");
4911 *res_ptr = LDKBroadcasterInterface_init(o);
4912 return tag_ptr(res_ptr, true);
4914 void __attribute__((export_name("TS_BroadcasterInterface_broadcast_transaction"))) TS_BroadcasterInterface_broadcast_transaction(uint64_t this_arg, int8_tArray tx) {
4915 void* this_arg_ptr = untag_ptr(this_arg);
4916 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
4917 LDKBroadcasterInterface* this_arg_conv = (LDKBroadcasterInterface*)this_arg_ptr;
4918 LDKTransaction tx_ref;
4919 tx_ref.datalen = tx->arr_len;
4920 tx_ref.data = MALLOC(tx_ref.datalen, "LDKTransaction Bytes");
4921 memcpy(tx_ref.data, tx->elems, tx_ref.datalen); FREE(tx);
4922 tx_ref.data_is_owned = true;
4923 (this_arg_conv->broadcast_transaction)(this_arg_conv->this_arg, tx_ref);
4926 typedef struct LDKKeysInterface_JCalls {
4927 atomic_size_t refcnt;
4928 uint32_t instance_ptr;
4929 } LDKKeysInterface_JCalls;
4930 static void LDKKeysInterface_JCalls_free(void* this_arg) {
4931 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
4932 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
4936 LDKCResult_SecretKeyNoneZ get_node_secret_LDKKeysInterface_jcall(const void* this_arg, LDKRecipient recipient) {
4937 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
4938 uint32_t recipient_conv = LDKRecipient_to_js(recipient);
4939 uint32_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 20, recipient_conv, 0, 0, 0, 0, 0);
4940 void* ret_ptr = untag_ptr(ret);
4941 CHECK_ACCESS(ret_ptr);
4942 LDKCResult_SecretKeyNoneZ ret_conv = *(LDKCResult_SecretKeyNoneZ*)(ret_ptr);
4943 FREE(untag_ptr(ret));
4946 LDKCVec_u8Z get_destination_script_LDKKeysInterface_jcall(const void* this_arg) {
4947 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
4948 int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 21, 0, 0, 0, 0, 0, 0);
4949 LDKCVec_u8Z ret_ref;
4950 ret_ref.datalen = ret->arr_len;
4951 ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
4952 memcpy(ret_ref.data, ret->elems, ret_ref.datalen); FREE(ret);
4955 LDKShutdownScript get_shutdown_scriptpubkey_LDKKeysInterface_jcall(const void* this_arg) {
4956 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
4957 uint32_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 22, 0, 0, 0, 0, 0, 0);
4958 LDKShutdownScript ret_conv;
4959 ret_conv.inner = untag_ptr(ret);
4960 ret_conv.is_owned = ptr_is_owned(ret);
4961 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv);
4964 LDKSign get_channel_signer_LDKKeysInterface_jcall(const void* this_arg, bool inbound, uint64_t channel_value_satoshis) {
4965 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
4966 jboolean inbound_conv = inbound;
4967 int64_t channel_value_satoshis_conv = channel_value_satoshis;
4968 uint32_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 23, inbound_conv, channel_value_satoshis_conv, 0, 0, 0, 0);
4969 void* ret_ptr = untag_ptr(ret);
4970 CHECK_ACCESS(ret_ptr);
4971 LDKSign ret_conv = *(LDKSign*)(ret_ptr);
4972 FREE(untag_ptr(ret));
4975 LDKThirtyTwoBytes get_secure_random_bytes_LDKKeysInterface_jcall(const void* this_arg) {
4976 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
4977 int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 24, 0, 0, 0, 0, 0, 0);
4978 LDKThirtyTwoBytes ret_ref;
4979 CHECK(ret->arr_len == 32);
4980 memcpy(ret_ref.data, ret->elems, 32); FREE(ret);
4983 LDKCResult_SignDecodeErrorZ read_chan_signer_LDKKeysInterface_jcall(const void* this_arg, LDKu8slice reader) {
4984 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
4985 LDKu8slice reader_var = reader;
4986 int8_tArray reader_arr = init_int8_tArray(reader_var.datalen, __LINE__);
4987 memcpy(reader_arr->elems, reader_var.data, reader_var.datalen);
4988 uint32_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 25, (uint32_t)reader_arr, 0, 0, 0, 0, 0);
4989 void* ret_ptr = untag_ptr(ret);
4990 CHECK_ACCESS(ret_ptr);
4991 LDKCResult_SignDecodeErrorZ ret_conv = *(LDKCResult_SignDecodeErrorZ*)(ret_ptr);
4992 FREE(untag_ptr(ret));
4995 LDKCResult_RecoverableSignatureNoneZ sign_invoice_LDKKeysInterface_jcall(const void* this_arg, LDKu8slice hrp_bytes, LDKCVec_u5Z invoice_data, LDKRecipient receipient) {
4996 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
4997 LDKu8slice hrp_bytes_var = hrp_bytes;
4998 int8_tArray hrp_bytes_arr = init_int8_tArray(hrp_bytes_var.datalen, __LINE__);
4999 memcpy(hrp_bytes_arr->elems, hrp_bytes_var.data, hrp_bytes_var.datalen);
5000 LDKCVec_u5Z invoice_data_var = invoice_data;
5001 ptrArray invoice_data_arr = NULL;
5002 invoice_data_arr = init_ptrArray(invoice_data_var.datalen, __LINE__);
5003 int8_t *invoice_data_arr_ptr = (int8_t*)(((uint8_t*)invoice_data_arr) + 8);
5004 for (size_t h = 0; h < invoice_data_var.datalen; h++) {
5005 uint8_t invoice_data_conv_7_val = invoice_data_var.data[h]._0;
5006 invoice_data_arr_ptr[h] = invoice_data_conv_7_val;
5009 FREE(invoice_data_var.data);
5010 uint32_t receipient_conv = LDKRecipient_to_js(receipient);
5011 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);
5012 void* ret_ptr = untag_ptr(ret);
5013 CHECK_ACCESS(ret_ptr);
5014 LDKCResult_RecoverableSignatureNoneZ ret_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(ret_ptr);
5015 FREE(untag_ptr(ret));
5018 LDKThirtyTwoBytes get_inbound_payment_key_material_LDKKeysInterface_jcall(const void* this_arg) {
5019 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) this_arg;
5020 int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 27, 0, 0, 0, 0, 0, 0);
5021 LDKThirtyTwoBytes ret_ref;
5022 CHECK(ret->arr_len == 32);
5023 memcpy(ret_ref.data, ret->elems, 32); FREE(ret);
5026 static void LDKKeysInterface_JCalls_cloned(LDKKeysInterface* new_obj) {
5027 LDKKeysInterface_JCalls *j_calls = (LDKKeysInterface_JCalls*) new_obj->this_arg;
5028 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
5030 static inline LDKKeysInterface LDKKeysInterface_init (JSValue o) {
5031 LDKKeysInterface_JCalls *calls = MALLOC(sizeof(LDKKeysInterface_JCalls), "LDKKeysInterface_JCalls");
5032 atomic_init(&calls->refcnt, 1);
5033 calls->instance_ptr = o;
5035 LDKKeysInterface ret = {
5036 .this_arg = (void*) calls,
5037 .get_node_secret = get_node_secret_LDKKeysInterface_jcall,
5038 .get_destination_script = get_destination_script_LDKKeysInterface_jcall,
5039 .get_shutdown_scriptpubkey = get_shutdown_scriptpubkey_LDKKeysInterface_jcall,
5040 .get_channel_signer = get_channel_signer_LDKKeysInterface_jcall,
5041 .get_secure_random_bytes = get_secure_random_bytes_LDKKeysInterface_jcall,
5042 .read_chan_signer = read_chan_signer_LDKKeysInterface_jcall,
5043 .sign_invoice = sign_invoice_LDKKeysInterface_jcall,
5044 .get_inbound_payment_key_material = get_inbound_payment_key_material_LDKKeysInterface_jcall,
5045 .free = LDKKeysInterface_JCalls_free,
5049 uint64_t __attribute__((export_name("TS_LDKKeysInterface_new"))) TS_LDKKeysInterface_new(JSValue o) {
5050 LDKKeysInterface *res_ptr = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
5051 *res_ptr = LDKKeysInterface_init(o);
5052 return tag_ptr(res_ptr, true);
5054 uint64_t __attribute__((export_name("TS_KeysInterface_get_node_secret"))) TS_KeysInterface_get_node_secret(uint64_t this_arg, uint32_t recipient) {
5055 void* this_arg_ptr = untag_ptr(this_arg);
5056 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5057 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
5058 LDKRecipient recipient_conv = LDKRecipient_from_js(recipient);
5059 LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ");
5060 *ret_conv = (this_arg_conv->get_node_secret)(this_arg_conv->this_arg, recipient_conv);
5061 return tag_ptr(ret_conv, true);
5064 int8_tArray __attribute__((export_name("TS_KeysInterface_get_destination_script"))) TS_KeysInterface_get_destination_script(uint64_t this_arg) {
5065 void* this_arg_ptr = untag_ptr(this_arg);
5066 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5067 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
5068 LDKCVec_u8Z ret_var = (this_arg_conv->get_destination_script)(this_arg_conv->this_arg);
5069 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
5070 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
5071 CVec_u8Z_free(ret_var);
5075 uint64_t __attribute__((export_name("TS_KeysInterface_get_shutdown_scriptpubkey"))) TS_KeysInterface_get_shutdown_scriptpubkey(uint64_t this_arg) {
5076 void* this_arg_ptr = untag_ptr(this_arg);
5077 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5078 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
5079 LDKShutdownScript ret_var = (this_arg_conv->get_shutdown_scriptpubkey)(this_arg_conv->this_arg);
5080 uint64_t ret_ref = 0;
5081 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5082 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5086 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) {
5087 void* this_arg_ptr = untag_ptr(this_arg);
5088 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5089 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
5090 LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
5091 *ret_ret = (this_arg_conv->get_channel_signer)(this_arg_conv->this_arg, inbound, channel_value_satoshis);
5092 return tag_ptr(ret_ret, true);
5095 int8_tArray __attribute__((export_name("TS_KeysInterface_get_secure_random_bytes"))) TS_KeysInterface_get_secure_random_bytes(uint64_t this_arg) {
5096 void* this_arg_ptr = untag_ptr(this_arg);
5097 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5098 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
5099 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
5100 memcpy(ret_arr->elems, (this_arg_conv->get_secure_random_bytes)(this_arg_conv->this_arg).data, 32);
5104 uint64_t __attribute__((export_name("TS_KeysInterface_read_chan_signer"))) TS_KeysInterface_read_chan_signer(uint64_t this_arg, int8_tArray reader) {
5105 void* this_arg_ptr = untag_ptr(this_arg);
5106 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5107 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
5108 LDKu8slice reader_ref;
5109 reader_ref.datalen = reader->arr_len;
5110 reader_ref.data = reader->elems;
5111 LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
5112 *ret_conv = (this_arg_conv->read_chan_signer)(this_arg_conv->this_arg, reader_ref);
5114 return tag_ptr(ret_conv, true);
5117 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) {
5118 void* this_arg_ptr = untag_ptr(this_arg);
5119 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5120 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
5121 LDKu8slice hrp_bytes_ref;
5122 hrp_bytes_ref.datalen = hrp_bytes->arr_len;
5123 hrp_bytes_ref.data = hrp_bytes->elems;
5124 LDKCVec_u5Z invoice_data_constr;
5125 invoice_data_constr.datalen = invoice_data->arr_len;
5126 if (invoice_data_constr.datalen > 0)
5127 invoice_data_constr.data = MALLOC(invoice_data_constr.datalen * sizeof(LDKu5), "LDKCVec_u5Z Elements");
5129 invoice_data_constr.data = NULL;
5130 int8_t* invoice_data_vals = (void*) invoice_data->elems;
5131 for (size_t h = 0; h < invoice_data_constr.datalen; h++) {
5132 int8_t invoice_data_conv_7 = invoice_data_vals[h];
5134 invoice_data_constr.data[h] = (LDKu5){ ._0 = invoice_data_conv_7 };
5137 LDKRecipient receipient_conv = LDKRecipient_from_js(receipient);
5138 LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
5139 *ret_conv = (this_arg_conv->sign_invoice)(this_arg_conv->this_arg, hrp_bytes_ref, invoice_data_constr, receipient_conv);
5141 return tag_ptr(ret_conv, true);
5144 int8_tArray __attribute__((export_name("TS_KeysInterface_get_inbound_payment_key_material"))) TS_KeysInterface_get_inbound_payment_key_material(uint64_t this_arg) {
5145 void* this_arg_ptr = untag_ptr(this_arg);
5146 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5147 LDKKeysInterface* this_arg_conv = (LDKKeysInterface*)this_arg_ptr;
5148 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
5149 memcpy(ret_arr->elems, (this_arg_conv->get_inbound_payment_key_material)(this_arg_conv->this_arg).data, 32);
5153 typedef struct LDKFeeEstimator_JCalls {
5154 atomic_size_t refcnt;
5155 uint32_t instance_ptr;
5156 } LDKFeeEstimator_JCalls;
5157 static void LDKFeeEstimator_JCalls_free(void* this_arg) {
5158 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
5159 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
5163 uint32_t get_est_sat_per_1000_weight_LDKFeeEstimator_jcall(const void* this_arg, LDKConfirmationTarget confirmation_target) {
5164 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) this_arg;
5165 uint32_t confirmation_target_conv = LDKConfirmationTarget_to_js(confirmation_target);
5166 return js_invoke_function_uuuuuu(j_calls->instance_ptr, 28, confirmation_target_conv, 0, 0, 0, 0, 0);
5168 static void LDKFeeEstimator_JCalls_cloned(LDKFeeEstimator* new_obj) {
5169 LDKFeeEstimator_JCalls *j_calls = (LDKFeeEstimator_JCalls*) new_obj->this_arg;
5170 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
5172 static inline LDKFeeEstimator LDKFeeEstimator_init (JSValue o) {
5173 LDKFeeEstimator_JCalls *calls = MALLOC(sizeof(LDKFeeEstimator_JCalls), "LDKFeeEstimator_JCalls");
5174 atomic_init(&calls->refcnt, 1);
5175 calls->instance_ptr = o;
5177 LDKFeeEstimator ret = {
5178 .this_arg = (void*) calls,
5179 .get_est_sat_per_1000_weight = get_est_sat_per_1000_weight_LDKFeeEstimator_jcall,
5180 .free = LDKFeeEstimator_JCalls_free,
5184 uint64_t __attribute__((export_name("TS_LDKFeeEstimator_new"))) TS_LDKFeeEstimator_new(JSValue o) {
5185 LDKFeeEstimator *res_ptr = MALLOC(sizeof(LDKFeeEstimator), "LDKFeeEstimator");
5186 *res_ptr = LDKFeeEstimator_init(o);
5187 return tag_ptr(res_ptr, true);
5189 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) {
5190 void* this_arg_ptr = untag_ptr(this_arg);
5191 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5192 LDKFeeEstimator* this_arg_conv = (LDKFeeEstimator*)this_arg_ptr;
5193 LDKConfirmationTarget confirmation_target_conv = LDKConfirmationTarget_from_js(confirmation_target);
5194 int32_t ret_conv = (this_arg_conv->get_est_sat_per_1000_weight)(this_arg_conv->this_arg, confirmation_target_conv);
5198 static inline struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelManagerZ_get_a(LDKC2Tuple_BlockHashChannelManagerZ *NONNULL_PTR owner){
5199 return ThirtyTwoBytes_clone(&owner->a);
5201 int8_tArray __attribute__((export_name("TS_C2Tuple_BlockHashChannelManagerZ_get_a"))) TS_C2Tuple_BlockHashChannelManagerZ_get_a(uint64_t owner) {
5202 LDKC2Tuple_BlockHashChannelManagerZ* owner_conv = (LDKC2Tuple_BlockHashChannelManagerZ*)untag_ptr(owner);
5203 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
5204 memcpy(ret_arr->elems, C2Tuple_BlockHashChannelManagerZ_get_a(owner_conv).data, 32);
5208 static inline struct LDKChannelManager *C2Tuple_BlockHashChannelManagerZ_get_b(LDKC2Tuple_BlockHashChannelManagerZ *NONNULL_PTR owner){
5211 uint64_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelManagerZ_get_b"))) TS_C2Tuple_BlockHashChannelManagerZ_get_b(uint64_t owner) {
5212 LDKC2Tuple_BlockHashChannelManagerZ* owner_conv = (LDKC2Tuple_BlockHashChannelManagerZ*)untag_ptr(owner);
5213 LDKChannelManager ret_var = *C2Tuple_BlockHashChannelManagerZ_get_b(owner_conv);
5214 uint64_t ret_ref = 0;
5215 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5216 ret_ref = tag_ptr(ret_var.inner, false);
5220 static inline struct LDKC2Tuple_BlockHashChannelManagerZ *CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *NONNULL_PTR owner){
5221 CHECK(owner->result_ok);
5222 return &*owner->contents.result;
5224 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(uint64_t owner) {
5225 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)untag_ptr(owner);
5226 uint64_t ret_ret = tag_ptr(CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_ok(owner_conv), false);
5230 static inline struct LDKDecodeError CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ *NONNULL_PTR owner){
5231 CHECK(!owner->result_ok);
5232 return DecodeError_clone(&*owner->contents.err);
5234 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(uint64_t owner) {
5235 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)untag_ptr(owner);
5236 LDKDecodeError ret_var = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_get_err(owner_conv);
5237 uint64_t ret_ref = 0;
5238 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5239 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5243 static inline struct LDKChannelConfig CResult_ChannelConfigDecodeErrorZ_get_ok(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR owner){
5244 CHECK(owner->result_ok);
5245 return ChannelConfig_clone(&*owner->contents.result);
5247 uint64_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_get_ok"))) TS_CResult_ChannelConfigDecodeErrorZ_get_ok(uint64_t owner) {
5248 LDKCResult_ChannelConfigDecodeErrorZ* owner_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(owner);
5249 LDKChannelConfig ret_var = CResult_ChannelConfigDecodeErrorZ_get_ok(owner_conv);
5250 uint64_t ret_ref = 0;
5251 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5252 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5256 static inline struct LDKDecodeError CResult_ChannelConfigDecodeErrorZ_get_err(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR owner){
5257 CHECK(!owner->result_ok);
5258 return DecodeError_clone(&*owner->contents.err);
5260 uint64_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_get_err"))) TS_CResult_ChannelConfigDecodeErrorZ_get_err(uint64_t owner) {
5261 LDKCResult_ChannelConfigDecodeErrorZ* owner_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(owner);
5262 LDKDecodeError ret_var = CResult_ChannelConfigDecodeErrorZ_get_err(owner_conv);
5263 uint64_t ret_ref = 0;
5264 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5265 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5269 static inline struct LDKOutPoint CResult_OutPointDecodeErrorZ_get_ok(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR owner){
5270 CHECK(owner->result_ok);
5271 return OutPoint_clone(&*owner->contents.result);
5273 uint64_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_get_ok"))) TS_CResult_OutPointDecodeErrorZ_get_ok(uint64_t owner) {
5274 LDKCResult_OutPointDecodeErrorZ* owner_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(owner);
5275 LDKOutPoint ret_var = CResult_OutPointDecodeErrorZ_get_ok(owner_conv);
5276 uint64_t ret_ref = 0;
5277 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5278 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5282 static inline struct LDKDecodeError CResult_OutPointDecodeErrorZ_get_err(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR owner){
5283 CHECK(!owner->result_ok);
5284 return DecodeError_clone(&*owner->contents.err);
5286 uint64_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_get_err"))) TS_CResult_OutPointDecodeErrorZ_get_err(uint64_t owner) {
5287 LDKCResult_OutPointDecodeErrorZ* owner_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(owner);
5288 LDKDecodeError ret_var = CResult_OutPointDecodeErrorZ_get_err(owner_conv);
5289 uint64_t ret_ref = 0;
5290 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5291 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5295 typedef struct LDKType_JCalls {
5296 atomic_size_t refcnt;
5297 uint32_t instance_ptr;
5299 static void LDKType_JCalls_free(void* this_arg) {
5300 LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg;
5301 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
5305 uint16_t type_id_LDKType_jcall(const void* this_arg) {
5306 LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg;
5307 return js_invoke_function_uuuuuu(j_calls->instance_ptr, 29, 0, 0, 0, 0, 0, 0);
5309 LDKStr debug_str_LDKType_jcall(const void* this_arg) {
5310 LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg;
5311 jstring ret = (jstring)js_invoke_function_uuuuuu(j_calls->instance_ptr, 30, 0, 0, 0, 0, 0, 0);
5312 LDKStr ret_conv = str_ref_to_owned_c(ret);
5315 LDKCVec_u8Z write_LDKType_jcall(const void* this_arg) {
5316 LDKType_JCalls *j_calls = (LDKType_JCalls*) this_arg;
5317 int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 31, 0, 0, 0, 0, 0, 0);
5318 LDKCVec_u8Z ret_ref;
5319 ret_ref.datalen = ret->arr_len;
5320 ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
5321 memcpy(ret_ref.data, ret->elems, ret_ref.datalen); FREE(ret);
5324 static void LDKType_JCalls_cloned(LDKType* new_obj) {
5325 LDKType_JCalls *j_calls = (LDKType_JCalls*) new_obj->this_arg;
5326 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
5328 static inline LDKType LDKType_init (JSValue o) {
5329 LDKType_JCalls *calls = MALLOC(sizeof(LDKType_JCalls), "LDKType_JCalls");
5330 atomic_init(&calls->refcnt, 1);
5331 calls->instance_ptr = o;
5334 .this_arg = (void*) calls,
5335 .type_id = type_id_LDKType_jcall,
5336 .debug_str = debug_str_LDKType_jcall,
5337 .write = write_LDKType_jcall,
5338 .cloned = LDKType_JCalls_cloned,
5339 .free = LDKType_JCalls_free,
5343 uint64_t __attribute__((export_name("TS_LDKType_new"))) TS_LDKType_new(JSValue o) {
5344 LDKType *res_ptr = MALLOC(sizeof(LDKType), "LDKType");
5345 *res_ptr = LDKType_init(o);
5346 return tag_ptr(res_ptr, true);
5348 int16_t __attribute__((export_name("TS_Type_type_id"))) TS_Type_type_id(uint64_t this_arg) {
5349 void* this_arg_ptr = untag_ptr(this_arg);
5350 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5351 LDKType* this_arg_conv = (LDKType*)this_arg_ptr;
5352 int16_t ret_conv = (this_arg_conv->type_id)(this_arg_conv->this_arg);
5356 jstring __attribute__((export_name("TS_Type_debug_str"))) TS_Type_debug_str(uint64_t this_arg) {
5357 void* this_arg_ptr = untag_ptr(this_arg);
5358 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5359 LDKType* this_arg_conv = (LDKType*)this_arg_ptr;
5360 LDKStr ret_str = (this_arg_conv->debug_str)(this_arg_conv->this_arg);
5361 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
5366 int8_tArray __attribute__((export_name("TS_Type_write"))) TS_Type_write(uint64_t this_arg) {
5367 void* this_arg_ptr = untag_ptr(this_arg);
5368 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
5369 LDKType* this_arg_conv = (LDKType*)this_arg_ptr;
5370 LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
5371 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
5372 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
5373 CVec_u8Z_free(ret_var);
5377 uint32_t __attribute__((export_name("TS_LDKCOption_TypeZ_ty_from_ptr"))) TS_LDKCOption_TypeZ_ty_from_ptr(uint64_t ptr) {
5378 LDKCOption_TypeZ *obj = (LDKCOption_TypeZ*)untag_ptr(ptr);
5380 case LDKCOption_TypeZ_Some: return 0;
5381 case LDKCOption_TypeZ_None: return 1;
5385 uint64_t __attribute__((export_name("TS_LDKCOption_TypeZ_Some_get_some"))) TS_LDKCOption_TypeZ_Some_get_some(uint64_t ptr) {
5386 LDKCOption_TypeZ *obj = (LDKCOption_TypeZ*)untag_ptr(ptr);
5387 assert(obj->tag == LDKCOption_TypeZ_Some);
5388 LDKType* some_ret = MALLOC(sizeof(LDKType), "LDKType");
5389 *some_ret = Type_clone(&obj->some);
5390 return tag_ptr(some_ret, true);
5392 static inline struct LDKCOption_TypeZ CResult_COption_TypeZDecodeErrorZ_get_ok(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR owner){
5393 CHECK(owner->result_ok);
5394 return COption_TypeZ_clone(&*owner->contents.result);
5396 uint64_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_get_ok"))) TS_CResult_COption_TypeZDecodeErrorZ_get_ok(uint64_t owner) {
5397 LDKCResult_COption_TypeZDecodeErrorZ* owner_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(owner);
5398 LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
5399 *ret_copy = CResult_COption_TypeZDecodeErrorZ_get_ok(owner_conv);
5400 uint64_t ret_ref = tag_ptr(ret_copy, true);
5404 static inline struct LDKDecodeError CResult_COption_TypeZDecodeErrorZ_get_err(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR owner){
5405 CHECK(!owner->result_ok);
5406 return DecodeError_clone(&*owner->contents.err);
5408 uint64_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_get_err"))) TS_CResult_COption_TypeZDecodeErrorZ_get_err(uint64_t owner) {
5409 LDKCResult_COption_TypeZDecodeErrorZ* owner_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(owner);
5410 LDKDecodeError ret_var = CResult_COption_TypeZDecodeErrorZ_get_err(owner_conv);
5411 uint64_t ret_ref = 0;
5412 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5413 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5417 uint32_t __attribute__((export_name("TS_LDKPaymentError_ty_from_ptr"))) TS_LDKPaymentError_ty_from_ptr(uint64_t ptr) {
5418 LDKPaymentError *obj = (LDKPaymentError*)untag_ptr(ptr);
5420 case LDKPaymentError_Invoice: return 0;
5421 case LDKPaymentError_Routing: return 1;
5422 case LDKPaymentError_Sending: return 2;
5426 jstring __attribute__((export_name("TS_LDKPaymentError_Invoice_get_invoice"))) TS_LDKPaymentError_Invoice_get_invoice(uint64_t ptr) {
5427 LDKPaymentError *obj = (LDKPaymentError*)untag_ptr(ptr);
5428 assert(obj->tag == LDKPaymentError_Invoice);
5429 LDKStr invoice_str = obj->invoice;
5430 jstring invoice_conv = str_ref_to_ts(invoice_str.chars, invoice_str.len);
5431 return invoice_conv;
5433 uint64_t __attribute__((export_name("TS_LDKPaymentError_Routing_get_routing"))) TS_LDKPaymentError_Routing_get_routing(uint64_t ptr) {
5434 LDKPaymentError *obj = (LDKPaymentError*)untag_ptr(ptr);
5435 assert(obj->tag == LDKPaymentError_Routing);
5436 LDKLightningError routing_var = obj->routing;
5437 uint64_t routing_ref = 0;
5438 CHECK_INNER_FIELD_ACCESS_OR_NULL(routing_var);
5439 routing_ref = tag_ptr(routing_var.inner, false);
5442 uint64_t __attribute__((export_name("TS_LDKPaymentError_Sending_get_sending"))) TS_LDKPaymentError_Sending_get_sending(uint64_t ptr) {
5443 LDKPaymentError *obj = (LDKPaymentError*)untag_ptr(ptr);
5444 assert(obj->tag == LDKPaymentError_Sending);
5445 uint64_t sending_ref = tag_ptr(&obj->sending, false);
5448 static inline struct LDKThirtyTwoBytes CResult_PaymentIdPaymentErrorZ_get_ok(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR owner){
5449 CHECK(owner->result_ok);
5450 return ThirtyTwoBytes_clone(&*owner->contents.result);
5452 int8_tArray __attribute__((export_name("TS_CResult_PaymentIdPaymentErrorZ_get_ok"))) TS_CResult_PaymentIdPaymentErrorZ_get_ok(uint64_t owner) {
5453 LDKCResult_PaymentIdPaymentErrorZ* owner_conv = (LDKCResult_PaymentIdPaymentErrorZ*)untag_ptr(owner);
5454 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
5455 memcpy(ret_arr->elems, CResult_PaymentIdPaymentErrorZ_get_ok(owner_conv).data, 32);
5459 static inline struct LDKPaymentError CResult_PaymentIdPaymentErrorZ_get_err(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR owner){
5460 CHECK(!owner->result_ok);
5461 return PaymentError_clone(&*owner->contents.err);
5463 uint64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentErrorZ_get_err"))) TS_CResult_PaymentIdPaymentErrorZ_get_err(uint64_t owner) {
5464 LDKCResult_PaymentIdPaymentErrorZ* owner_conv = (LDKCResult_PaymentIdPaymentErrorZ*)untag_ptr(owner);
5465 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
5466 *ret_copy = CResult_PaymentIdPaymentErrorZ_get_err(owner_conv);
5467 uint64_t ret_ref = tag_ptr(ret_copy, true);
5471 uint32_t __attribute__((export_name("TS_LDKParseError_ty_from_ptr"))) TS_LDKParseError_ty_from_ptr(uint64_t ptr) {
5472 LDKParseError *obj = (LDKParseError*)untag_ptr(ptr);
5474 case LDKParseError_Bech32Error: return 0;
5475 case LDKParseError_ParseAmountError: return 1;
5476 case LDKParseError_MalformedSignature: return 2;
5477 case LDKParseError_BadPrefix: return 3;
5478 case LDKParseError_UnknownCurrency: return 4;
5479 case LDKParseError_UnknownSiPrefix: return 5;
5480 case LDKParseError_MalformedHRP: return 6;
5481 case LDKParseError_TooShortDataPart: return 7;
5482 case LDKParseError_UnexpectedEndOfTaggedFields: return 8;
5483 case LDKParseError_DescriptionDecodeError: return 9;
5484 case LDKParseError_PaddingError: return 10;
5485 case LDKParseError_IntegerOverflowError: return 11;
5486 case LDKParseError_InvalidSegWitProgramLength: return 12;
5487 case LDKParseError_InvalidPubKeyHashLength: return 13;
5488 case LDKParseError_InvalidScriptHashLength: return 14;
5489 case LDKParseError_InvalidRecoveryId: return 15;
5490 case LDKParseError_InvalidSliceLength: return 16;
5491 case LDKParseError_Skip: return 17;
5495 uint64_t __attribute__((export_name("TS_LDKParseError_Bech32Error_get_bech32_error"))) TS_LDKParseError_Bech32Error_get_bech32_error(uint64_t ptr) {
5496 LDKParseError *obj = (LDKParseError*)untag_ptr(ptr);
5497 assert(obj->tag == LDKParseError_Bech32Error);
5498 uint64_t bech32_error_ref = tag_ptr(&obj->bech32_error, false);
5499 return bech32_error_ref;
5501 int32_t __attribute__((export_name("TS_LDKParseError_ParseAmountError_get_parse_amount_error"))) TS_LDKParseError_ParseAmountError_get_parse_amount_error(uint64_t ptr) {
5502 LDKParseError *obj = (LDKParseError*)untag_ptr(ptr);
5503 assert(obj->tag == LDKParseError_ParseAmountError);
5504 /*obj->parse_amount_error*/
5507 uint32_t __attribute__((export_name("TS_LDKParseError_MalformedSignature_get_malformed_signature"))) TS_LDKParseError_MalformedSignature_get_malformed_signature(uint64_t ptr) {
5508 LDKParseError *obj = (LDKParseError*)untag_ptr(ptr);
5509 assert(obj->tag == LDKParseError_MalformedSignature);
5510 uint32_t malformed_signature_conv = LDKSecp256k1Error_to_js(obj->malformed_signature);
5511 return malformed_signature_conv;
5513 int32_t __attribute__((export_name("TS_LDKParseError_DescriptionDecodeError_get_description_decode_error"))) TS_LDKParseError_DescriptionDecodeError_get_description_decode_error(uint64_t ptr) {
5514 LDKParseError *obj = (LDKParseError*)untag_ptr(ptr);
5515 assert(obj->tag == LDKParseError_DescriptionDecodeError);
5516 /*obj->description_decode_error*/
5519 jstring __attribute__((export_name("TS_LDKParseError_InvalidSliceLength_get_invalid_slice_length"))) TS_LDKParseError_InvalidSliceLength_get_invalid_slice_length(uint64_t ptr) {
5520 LDKParseError *obj = (LDKParseError*)untag_ptr(ptr);
5521 assert(obj->tag == LDKParseError_InvalidSliceLength);
5522 LDKStr invalid_slice_length_str = obj->invalid_slice_length;
5523 jstring invalid_slice_length_conv = str_ref_to_ts(invalid_slice_length_str.chars, invalid_slice_length_str.len);
5524 return invalid_slice_length_conv;
5526 static inline enum LDKSiPrefix CResult_SiPrefixParseErrorZ_get_ok(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR owner){
5527 CHECK(owner->result_ok);
5528 return SiPrefix_clone(&*owner->contents.result);
5530 uint32_t __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_get_ok"))) TS_CResult_SiPrefixParseErrorZ_get_ok(uint64_t owner) {
5531 LDKCResult_SiPrefixParseErrorZ* owner_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(owner);
5532 uint32_t ret_conv = LDKSiPrefix_to_js(CResult_SiPrefixParseErrorZ_get_ok(owner_conv));
5536 static inline struct LDKParseError CResult_SiPrefixParseErrorZ_get_err(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR owner){
5537 CHECK(!owner->result_ok);
5538 return ParseError_clone(&*owner->contents.err);
5540 uint64_t __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_get_err"))) TS_CResult_SiPrefixParseErrorZ_get_err(uint64_t owner) {
5541 LDKCResult_SiPrefixParseErrorZ* owner_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(owner);
5542 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
5543 *ret_copy = CResult_SiPrefixParseErrorZ_get_err(owner_conv);
5544 uint64_t ret_ref = tag_ptr(ret_copy, true);
5548 uint32_t __attribute__((export_name("TS_LDKParseOrSemanticError_ty_from_ptr"))) TS_LDKParseOrSemanticError_ty_from_ptr(uint64_t ptr) {
5549 LDKParseOrSemanticError *obj = (LDKParseOrSemanticError*)untag_ptr(ptr);
5551 case LDKParseOrSemanticError_ParseError: return 0;
5552 case LDKParseOrSemanticError_SemanticError: return 1;
5556 uint64_t __attribute__((export_name("TS_LDKParseOrSemanticError_ParseError_get_parse_error"))) TS_LDKParseOrSemanticError_ParseError_get_parse_error(uint64_t ptr) {
5557 LDKParseOrSemanticError *obj = (LDKParseOrSemanticError*)untag_ptr(ptr);
5558 assert(obj->tag == LDKParseOrSemanticError_ParseError);
5559 uint64_t parse_error_ref = tag_ptr(&obj->parse_error, false);
5560 return parse_error_ref;
5562 uint32_t __attribute__((export_name("TS_LDKParseOrSemanticError_SemanticError_get_semantic_error"))) TS_LDKParseOrSemanticError_SemanticError_get_semantic_error(uint64_t ptr) {
5563 LDKParseOrSemanticError *obj = (LDKParseOrSemanticError*)untag_ptr(ptr);
5564 assert(obj->tag == LDKParseOrSemanticError_SemanticError);
5565 uint32_t semantic_error_conv = LDKSemanticError_to_js(obj->semantic_error);
5566 return semantic_error_conv;
5568 static inline struct LDKInvoice CResult_InvoiceParseOrSemanticErrorZ_get_ok(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR owner){
5569 CHECK(owner->result_ok);
5570 return Invoice_clone(&*owner->contents.result);
5572 uint64_t __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_get_ok"))) TS_CResult_InvoiceParseOrSemanticErrorZ_get_ok(uint64_t owner) {
5573 LDKCResult_InvoiceParseOrSemanticErrorZ* owner_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(owner);
5574 LDKInvoice ret_var = CResult_InvoiceParseOrSemanticErrorZ_get_ok(owner_conv);
5575 uint64_t ret_ref = 0;
5576 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5577 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5581 static inline struct LDKParseOrSemanticError CResult_InvoiceParseOrSemanticErrorZ_get_err(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR owner){
5582 CHECK(!owner->result_ok);
5583 return ParseOrSemanticError_clone(&*owner->contents.err);
5585 uint64_t __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_get_err"))) TS_CResult_InvoiceParseOrSemanticErrorZ_get_err(uint64_t owner) {
5586 LDKCResult_InvoiceParseOrSemanticErrorZ* owner_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(owner);
5587 LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError");
5588 *ret_copy = CResult_InvoiceParseOrSemanticErrorZ_get_err(owner_conv);
5589 uint64_t ret_ref = tag_ptr(ret_copy, true);
5593 static inline struct LDKSignedRawInvoice CResult_SignedRawInvoiceParseErrorZ_get_ok(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR owner){
5594 CHECK(owner->result_ok);
5595 return SignedRawInvoice_clone(&*owner->contents.result);
5597 uint64_t __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_get_ok"))) TS_CResult_SignedRawInvoiceParseErrorZ_get_ok(uint64_t owner) {
5598 LDKCResult_SignedRawInvoiceParseErrorZ* owner_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(owner);
5599 LDKSignedRawInvoice ret_var = CResult_SignedRawInvoiceParseErrorZ_get_ok(owner_conv);
5600 uint64_t ret_ref = 0;
5601 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5602 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5606 static inline struct LDKParseError CResult_SignedRawInvoiceParseErrorZ_get_err(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR owner){
5607 CHECK(!owner->result_ok);
5608 return ParseError_clone(&*owner->contents.err);
5610 uint64_t __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_get_err"))) TS_CResult_SignedRawInvoiceParseErrorZ_get_err(uint64_t owner) {
5611 LDKCResult_SignedRawInvoiceParseErrorZ* owner_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(owner);
5612 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
5613 *ret_copy = CResult_SignedRawInvoiceParseErrorZ_get_err(owner_conv);
5614 uint64_t ret_ref = tag_ptr(ret_copy, true);
5618 static inline struct LDKRawInvoice C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner){
5619 return RawInvoice_clone(&owner->a);
5621 uint64_t __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(uint64_t owner) {
5622 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* owner_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(owner);
5623 LDKRawInvoice ret_var = C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_a(owner_conv);
5624 uint64_t ret_ref = 0;
5625 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5626 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5630 static inline struct LDKThirtyTwoBytes C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner){
5631 return ThirtyTwoBytes_clone(&owner->b);
5633 int8_tArray __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(uint64_t owner) {
5634 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* owner_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(owner);
5635 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
5636 memcpy(ret_arr->elems, C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_b(owner_conv).data, 32);
5640 static inline struct LDKInvoiceSignature C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR owner){
5641 return InvoiceSignature_clone(&owner->c);
5643 uint64_t __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(uint64_t owner) {
5644 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* owner_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(owner);
5645 LDKInvoiceSignature ret_var = C3Tuple_RawInvoice_u832InvoiceSignatureZ_get_c(owner_conv);
5646 uint64_t ret_ref = 0;
5647 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5648 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5652 static inline struct LDKPayeePubKey CResult_PayeePubKeyErrorZ_get_ok(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR owner){
5653 CHECK(owner->result_ok);
5654 return PayeePubKey_clone(&*owner->contents.result);
5656 uint64_t __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_get_ok"))) TS_CResult_PayeePubKeyErrorZ_get_ok(uint64_t owner) {
5657 LDKCResult_PayeePubKeyErrorZ* owner_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(owner);
5658 LDKPayeePubKey ret_var = CResult_PayeePubKeyErrorZ_get_ok(owner_conv);
5659 uint64_t ret_ref = 0;
5660 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5661 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5665 static inline enum LDKSecp256k1Error CResult_PayeePubKeyErrorZ_get_err(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR owner){
5666 CHECK(!owner->result_ok);
5667 return *owner->contents.err;
5669 uint32_t __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_get_err"))) TS_CResult_PayeePubKeyErrorZ_get_err(uint64_t owner) {
5670 LDKCResult_PayeePubKeyErrorZ* owner_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(owner);
5671 uint32_t ret_conv = LDKSecp256k1Error_to_js(CResult_PayeePubKeyErrorZ_get_err(owner_conv));
5675 static inline LDKCVec_PrivateRouteZ CVec_PrivateRouteZ_clone(const LDKCVec_PrivateRouteZ *orig) {
5676 LDKCVec_PrivateRouteZ ret = { .data = MALLOC(sizeof(LDKPrivateRoute) * orig->datalen, "LDKCVec_PrivateRouteZ clone bytes"), .datalen = orig->datalen };
5677 for (size_t i = 0; i < ret.datalen; i++) {
5678 ret.data[i] = PrivateRoute_clone(&orig->data[i]);
5682 static inline struct LDKPositiveTimestamp CResult_PositiveTimestampCreationErrorZ_get_ok(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR owner){
5683 CHECK(owner->result_ok);
5684 return PositiveTimestamp_clone(&*owner->contents.result);
5686 uint64_t __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_get_ok"))) TS_CResult_PositiveTimestampCreationErrorZ_get_ok(uint64_t owner) {
5687 LDKCResult_PositiveTimestampCreationErrorZ* owner_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(owner);
5688 LDKPositiveTimestamp ret_var = CResult_PositiveTimestampCreationErrorZ_get_ok(owner_conv);
5689 uint64_t ret_ref = 0;
5690 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5691 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5695 static inline enum LDKCreationError CResult_PositiveTimestampCreationErrorZ_get_err(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR owner){
5696 CHECK(!owner->result_ok);
5697 return CreationError_clone(&*owner->contents.err);
5699 uint32_t __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_get_err"))) TS_CResult_PositiveTimestampCreationErrorZ_get_err(uint64_t owner) {
5700 LDKCResult_PositiveTimestampCreationErrorZ* owner_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(owner);
5701 uint32_t ret_conv = LDKCreationError_to_js(CResult_PositiveTimestampCreationErrorZ_get_err(owner_conv));
5705 static inline void CResult_NoneSemanticErrorZ_get_ok(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR owner){
5706 CHECK(owner->result_ok);
5707 return *owner->contents.result;
5709 void __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_get_ok"))) TS_CResult_NoneSemanticErrorZ_get_ok(uint64_t owner) {
5710 LDKCResult_NoneSemanticErrorZ* owner_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(owner);
5711 CResult_NoneSemanticErrorZ_get_ok(owner_conv);
5714 static inline enum LDKSemanticError CResult_NoneSemanticErrorZ_get_err(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR owner){
5715 CHECK(!owner->result_ok);
5716 return SemanticError_clone(&*owner->contents.err);
5718 uint32_t __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_get_err"))) TS_CResult_NoneSemanticErrorZ_get_err(uint64_t owner) {
5719 LDKCResult_NoneSemanticErrorZ* owner_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(owner);
5720 uint32_t ret_conv = LDKSemanticError_to_js(CResult_NoneSemanticErrorZ_get_err(owner_conv));
5724 static inline struct LDKInvoice CResult_InvoiceSemanticErrorZ_get_ok(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR owner){
5725 CHECK(owner->result_ok);
5726 return Invoice_clone(&*owner->contents.result);
5728 uint64_t __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_get_ok"))) TS_CResult_InvoiceSemanticErrorZ_get_ok(uint64_t owner) {
5729 LDKCResult_InvoiceSemanticErrorZ* owner_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(owner);
5730 LDKInvoice ret_var = CResult_InvoiceSemanticErrorZ_get_ok(owner_conv);
5731 uint64_t ret_ref = 0;
5732 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5733 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5737 static inline enum LDKSemanticError CResult_InvoiceSemanticErrorZ_get_err(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR owner){
5738 CHECK(!owner->result_ok);
5739 return SemanticError_clone(&*owner->contents.err);
5741 uint32_t __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_get_err"))) TS_CResult_InvoiceSemanticErrorZ_get_err(uint64_t owner) {
5742 LDKCResult_InvoiceSemanticErrorZ* owner_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(owner);
5743 uint32_t ret_conv = LDKSemanticError_to_js(CResult_InvoiceSemanticErrorZ_get_err(owner_conv));
5747 static inline struct LDKDescription CResult_DescriptionCreationErrorZ_get_ok(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR owner){
5748 CHECK(owner->result_ok);
5749 return Description_clone(&*owner->contents.result);
5751 uint64_t __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_get_ok"))) TS_CResult_DescriptionCreationErrorZ_get_ok(uint64_t owner) {
5752 LDKCResult_DescriptionCreationErrorZ* owner_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(owner);
5753 LDKDescription ret_var = CResult_DescriptionCreationErrorZ_get_ok(owner_conv);
5754 uint64_t ret_ref = 0;
5755 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5756 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5760 static inline enum LDKCreationError CResult_DescriptionCreationErrorZ_get_err(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR owner){
5761 CHECK(!owner->result_ok);
5762 return CreationError_clone(&*owner->contents.err);
5764 uint32_t __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_get_err"))) TS_CResult_DescriptionCreationErrorZ_get_err(uint64_t owner) {
5765 LDKCResult_DescriptionCreationErrorZ* owner_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(owner);
5766 uint32_t ret_conv = LDKCreationError_to_js(CResult_DescriptionCreationErrorZ_get_err(owner_conv));
5770 static inline struct LDKPrivateRoute CResult_PrivateRouteCreationErrorZ_get_ok(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR owner){
5771 CHECK(owner->result_ok);
5772 return PrivateRoute_clone(&*owner->contents.result);
5774 uint64_t __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_get_ok"))) TS_CResult_PrivateRouteCreationErrorZ_get_ok(uint64_t owner) {
5775 LDKCResult_PrivateRouteCreationErrorZ* owner_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(owner);
5776 LDKPrivateRoute ret_var = CResult_PrivateRouteCreationErrorZ_get_ok(owner_conv);
5777 uint64_t ret_ref = 0;
5778 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5779 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5783 static inline enum LDKCreationError CResult_PrivateRouteCreationErrorZ_get_err(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR owner){
5784 CHECK(!owner->result_ok);
5785 return CreationError_clone(&*owner->contents.err);
5787 uint32_t __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_get_err"))) TS_CResult_PrivateRouteCreationErrorZ_get_err(uint64_t owner) {
5788 LDKCResult_PrivateRouteCreationErrorZ* owner_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(owner);
5789 uint32_t ret_conv = LDKCreationError_to_js(CResult_PrivateRouteCreationErrorZ_get_err(owner_conv));
5793 static inline struct LDKStr CResult_StringErrorZ_get_ok(LDKCResult_StringErrorZ *NONNULL_PTR owner){
5794 CHECK(owner->result_ok);
5795 return *owner->contents.result;
5797 jstring __attribute__((export_name("TS_CResult_StringErrorZ_get_ok"))) TS_CResult_StringErrorZ_get_ok(uint64_t owner) {
5798 LDKCResult_StringErrorZ* owner_conv = (LDKCResult_StringErrorZ*)untag_ptr(owner);
5799 LDKStr ret_str = CResult_StringErrorZ_get_ok(owner_conv);
5800 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
5804 static inline enum LDKSecp256k1Error CResult_StringErrorZ_get_err(LDKCResult_StringErrorZ *NONNULL_PTR owner){
5805 CHECK(!owner->result_ok);
5806 return *owner->contents.err;
5808 uint32_t __attribute__((export_name("TS_CResult_StringErrorZ_get_err"))) TS_CResult_StringErrorZ_get_err(uint64_t owner) {
5809 LDKCResult_StringErrorZ* owner_conv = (LDKCResult_StringErrorZ*)untag_ptr(owner);
5810 uint32_t ret_conv = LDKSecp256k1Error_to_js(CResult_StringErrorZ_get_err(owner_conv));
5814 static inline struct LDKChannelMonitorUpdate CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR owner){
5815 CHECK(owner->result_ok);
5816 return ChannelMonitorUpdate_clone(&*owner->contents.result);
5818 uint64_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(uint64_t owner) {
5819 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(owner);
5820 LDKChannelMonitorUpdate ret_var = CResult_ChannelMonitorUpdateDecodeErrorZ_get_ok(owner_conv);
5821 uint64_t ret_ref = 0;
5822 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5823 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5827 static inline struct LDKDecodeError CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR owner){
5828 CHECK(!owner->result_ok);
5829 return DecodeError_clone(&*owner->contents.err);
5831 uint64_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_get_err"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(uint64_t owner) {
5832 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(owner);
5833 LDKDecodeError ret_var = CResult_ChannelMonitorUpdateDecodeErrorZ_get_err(owner_conv);
5834 uint64_t ret_ref = 0;
5835 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5836 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5840 uint32_t __attribute__((export_name("TS_LDKCOption_MonitorEventZ_ty_from_ptr"))) TS_LDKCOption_MonitorEventZ_ty_from_ptr(uint64_t ptr) {
5841 LDKCOption_MonitorEventZ *obj = (LDKCOption_MonitorEventZ*)untag_ptr(ptr);
5843 case LDKCOption_MonitorEventZ_Some: return 0;
5844 case LDKCOption_MonitorEventZ_None: return 1;
5848 uint64_t __attribute__((export_name("TS_LDKCOption_MonitorEventZ_Some_get_some"))) TS_LDKCOption_MonitorEventZ_Some_get_some(uint64_t ptr) {
5849 LDKCOption_MonitorEventZ *obj = (LDKCOption_MonitorEventZ*)untag_ptr(ptr);
5850 assert(obj->tag == LDKCOption_MonitorEventZ_Some);
5851 uint64_t some_ref = tag_ptr(&obj->some, false);
5854 static inline struct LDKCOption_MonitorEventZ CResult_COption_MonitorEventZDecodeErrorZ_get_ok(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR owner){
5855 CHECK(owner->result_ok);
5856 return COption_MonitorEventZ_clone(&*owner->contents.result);
5858 uint64_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_get_ok"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_get_ok(uint64_t owner) {
5859 LDKCResult_COption_MonitorEventZDecodeErrorZ* owner_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(owner);
5860 LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
5861 *ret_copy = CResult_COption_MonitorEventZDecodeErrorZ_get_ok(owner_conv);
5862 uint64_t ret_ref = tag_ptr(ret_copy, true);
5866 static inline struct LDKDecodeError CResult_COption_MonitorEventZDecodeErrorZ_get_err(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR owner){
5867 CHECK(!owner->result_ok);
5868 return DecodeError_clone(&*owner->contents.err);
5870 uint64_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_get_err"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_get_err(uint64_t owner) {
5871 LDKCResult_COption_MonitorEventZDecodeErrorZ* owner_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(owner);
5872 LDKDecodeError ret_var = CResult_COption_MonitorEventZDecodeErrorZ_get_err(owner_conv);
5873 uint64_t ret_ref = 0;
5874 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5875 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5879 static inline struct LDKHTLCUpdate CResult_HTLCUpdateDecodeErrorZ_get_ok(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR owner){
5880 CHECK(owner->result_ok);
5881 return HTLCUpdate_clone(&*owner->contents.result);
5883 uint64_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_get_ok"))) TS_CResult_HTLCUpdateDecodeErrorZ_get_ok(uint64_t owner) {
5884 LDKCResult_HTLCUpdateDecodeErrorZ* owner_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(owner);
5885 LDKHTLCUpdate ret_var = CResult_HTLCUpdateDecodeErrorZ_get_ok(owner_conv);
5886 uint64_t ret_ref = 0;
5887 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5888 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5892 static inline struct LDKDecodeError CResult_HTLCUpdateDecodeErrorZ_get_err(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR owner){
5893 CHECK(!owner->result_ok);
5894 return DecodeError_clone(&*owner->contents.err);
5896 uint64_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_get_err"))) TS_CResult_HTLCUpdateDecodeErrorZ_get_err(uint64_t owner) {
5897 LDKCResult_HTLCUpdateDecodeErrorZ* owner_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(owner);
5898 LDKDecodeError ret_var = CResult_HTLCUpdateDecodeErrorZ_get_err(owner_conv);
5899 uint64_t ret_ref = 0;
5900 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5901 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5905 static inline struct LDKOutPoint C2Tuple_OutPointScriptZ_get_a(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR owner){
5906 return OutPoint_clone(&owner->a);
5908 uint64_t __attribute__((export_name("TS_C2Tuple_OutPointScriptZ_get_a"))) TS_C2Tuple_OutPointScriptZ_get_a(uint64_t owner) {
5909 LDKC2Tuple_OutPointScriptZ* owner_conv = (LDKC2Tuple_OutPointScriptZ*)untag_ptr(owner);
5910 LDKOutPoint ret_var = C2Tuple_OutPointScriptZ_get_a(owner_conv);
5911 uint64_t ret_ref = 0;
5912 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
5913 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
5917 static inline struct LDKCVec_u8Z C2Tuple_OutPointScriptZ_get_b(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR owner){
5918 return CVec_u8Z_clone(&owner->b);
5920 int8_tArray __attribute__((export_name("TS_C2Tuple_OutPointScriptZ_get_b"))) TS_C2Tuple_OutPointScriptZ_get_b(uint64_t owner) {
5921 LDKC2Tuple_OutPointScriptZ* owner_conv = (LDKC2Tuple_OutPointScriptZ*)untag_ptr(owner);
5922 LDKCVec_u8Z ret_var = C2Tuple_OutPointScriptZ_get_b(owner_conv);
5923 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
5924 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
5925 CVec_u8Z_free(ret_var);
5929 static inline uint32_t C2Tuple_u32ScriptZ_get_a(LDKC2Tuple_u32ScriptZ *NONNULL_PTR owner){
5932 int32_t __attribute__((export_name("TS_C2Tuple_u32ScriptZ_get_a"))) TS_C2Tuple_u32ScriptZ_get_a(uint64_t owner) {
5933 LDKC2Tuple_u32ScriptZ* owner_conv = (LDKC2Tuple_u32ScriptZ*)untag_ptr(owner);
5934 int32_t ret_conv = C2Tuple_u32ScriptZ_get_a(owner_conv);
5938 static inline struct LDKCVec_u8Z C2Tuple_u32ScriptZ_get_b(LDKC2Tuple_u32ScriptZ *NONNULL_PTR owner){
5939 return CVec_u8Z_clone(&owner->b);
5941 int8_tArray __attribute__((export_name("TS_C2Tuple_u32ScriptZ_get_b"))) TS_C2Tuple_u32ScriptZ_get_b(uint64_t owner) {
5942 LDKC2Tuple_u32ScriptZ* owner_conv = (LDKC2Tuple_u32ScriptZ*)untag_ptr(owner);
5943 LDKCVec_u8Z ret_var = C2Tuple_u32ScriptZ_get_b(owner_conv);
5944 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
5945 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
5946 CVec_u8Z_free(ret_var);
5950 static inline LDKCVec_C2Tuple_u32ScriptZZ CVec_C2Tuple_u32ScriptZZ_clone(const LDKCVec_C2Tuple_u32ScriptZZ *orig) {
5951 LDKCVec_C2Tuple_u32ScriptZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ) * orig->datalen, "LDKCVec_C2Tuple_u32ScriptZZ clone bytes"), .datalen = orig->datalen };
5952 for (size_t i = 0; i < ret.datalen; i++) {
5953 ret.data[i] = C2Tuple_u32ScriptZ_clone(&orig->data[i]);
5957 static inline struct LDKThirtyTwoBytes C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR owner){
5958 return ThirtyTwoBytes_clone(&owner->a);
5960 int8_tArray __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a"))) TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(uint64_t owner) {
5961 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)untag_ptr(owner);
5962 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
5963 memcpy(ret_arr->elems, C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_a(owner_conv).data, 32);
5967 static inline struct LDKCVec_C2Tuple_u32ScriptZZ C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR owner){
5968 return CVec_C2Tuple_u32ScriptZZ_clone(&owner->b);
5970 uint64_tArray __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b"))) TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(uint64_t owner) {
5971 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)untag_ptr(owner);
5972 LDKCVec_C2Tuple_u32ScriptZZ ret_var = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_get_b(owner_conv);
5973 uint64_tArray ret_arr = NULL;
5974 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
5975 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
5976 for (size_t v = 0; v < ret_var.datalen; v++) {
5977 LDKC2Tuple_u32ScriptZ* ret_conv_21_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ");
5978 *ret_conv_21_conv = ret_var.data[v];
5979 ret_arr_ptr[v] = tag_ptr(ret_conv_21_conv, true);
5986 static inline LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_clone(const LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ *orig) {
5987 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 };
5988 for (size_t i = 0; i < ret.datalen; i++) {
5989 ret.data[i] = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(&orig->data[i]);
5993 static inline LDKCVec_EventZ CVec_EventZ_clone(const LDKCVec_EventZ *orig) {
5994 LDKCVec_EventZ ret = { .data = MALLOC(sizeof(LDKEvent) * orig->datalen, "LDKCVec_EventZ clone bytes"), .datalen = orig->datalen };
5995 for (size_t i = 0; i < ret.datalen; i++) {
5996 ret.data[i] = Event_clone(&orig->data[i]);
6000 static inline uint32_t C2Tuple_u32TxOutZ_get_a(LDKC2Tuple_u32TxOutZ *NONNULL_PTR owner){
6003 int32_t __attribute__((export_name("TS_C2Tuple_u32TxOutZ_get_a"))) TS_C2Tuple_u32TxOutZ_get_a(uint64_t owner) {
6004 LDKC2Tuple_u32TxOutZ* owner_conv = (LDKC2Tuple_u32TxOutZ*)untag_ptr(owner);
6005 int32_t ret_conv = C2Tuple_u32TxOutZ_get_a(owner_conv);
6009 static inline struct LDKTxOut C2Tuple_u32TxOutZ_get_b(LDKC2Tuple_u32TxOutZ *NONNULL_PTR owner){
6010 return TxOut_clone(&owner->b);
6012 uint64_t __attribute__((export_name("TS_C2Tuple_u32TxOutZ_get_b"))) TS_C2Tuple_u32TxOutZ_get_b(uint64_t owner) {
6013 LDKC2Tuple_u32TxOutZ* owner_conv = (LDKC2Tuple_u32TxOutZ*)untag_ptr(owner);
6014 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
6015 *ret_ref = C2Tuple_u32TxOutZ_get_b(owner_conv);
6016 return tag_ptr(ret_ref, true);
6019 static inline LDKCVec_C2Tuple_u32TxOutZZ CVec_C2Tuple_u32TxOutZZ_clone(const LDKCVec_C2Tuple_u32TxOutZZ *orig) {
6020 LDKCVec_C2Tuple_u32TxOutZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ) * orig->datalen, "LDKCVec_C2Tuple_u32TxOutZZ clone bytes"), .datalen = orig->datalen };
6021 for (size_t i = 0; i < ret.datalen; i++) {
6022 ret.data[i] = C2Tuple_u32TxOutZ_clone(&orig->data[i]);
6026 static inline struct LDKThirtyTwoBytes C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR owner){
6027 return ThirtyTwoBytes_clone(&owner->a);
6029 int8_tArray __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a"))) TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(uint64_t owner) {
6030 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)untag_ptr(owner);
6031 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
6032 memcpy(ret_arr->elems, C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_a(owner_conv).data, 32);
6036 static inline struct LDKCVec_C2Tuple_u32TxOutZZ C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR owner){
6037 return CVec_C2Tuple_u32TxOutZZ_clone(&owner->b);
6039 uint64_tArray __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b"))) TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(uint64_t owner) {
6040 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* owner_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)untag_ptr(owner);
6041 LDKCVec_C2Tuple_u32TxOutZZ ret_var = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_get_b(owner_conv);
6042 uint64_tArray ret_arr = NULL;
6043 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
6044 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
6045 for (size_t u = 0; u < ret_var.datalen; u++) {
6046 LDKC2Tuple_u32TxOutZ* ret_conv_20_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
6047 *ret_conv_20_conv = ret_var.data[u];
6048 ret_arr_ptr[u] = tag_ptr(ret_conv_20_conv, true);
6055 static inline LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_clone(const LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ *orig) {
6056 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 };
6057 for (size_t i = 0; i < ret.datalen; i++) {
6058 ret.data[i] = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(&orig->data[i]);
6062 uint32_t __attribute__((export_name("TS_LDKBalance_ty_from_ptr"))) TS_LDKBalance_ty_from_ptr(uint64_t ptr) {
6063 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
6065 case LDKBalance_ClaimableOnChannelClose: return 0;
6066 case LDKBalance_ClaimableAwaitingConfirmations: return 1;
6067 case LDKBalance_ContentiousClaimable: return 2;
6068 case LDKBalance_MaybeClaimableHTLCAwaitingTimeout: return 3;
6072 int64_t __attribute__((export_name("TS_LDKBalance_ClaimableOnChannelClose_get_claimable_amount_satoshis"))) TS_LDKBalance_ClaimableOnChannelClose_get_claimable_amount_satoshis(uint64_t ptr) {
6073 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
6074 assert(obj->tag == LDKBalance_ClaimableOnChannelClose);
6075 int64_t claimable_amount_satoshis_conv = obj->claimable_on_channel_close.claimable_amount_satoshis;
6076 return claimable_amount_satoshis_conv;
6078 int64_t __attribute__((export_name("TS_LDKBalance_ClaimableAwaitingConfirmations_get_claimable_amount_satoshis"))) TS_LDKBalance_ClaimableAwaitingConfirmations_get_claimable_amount_satoshis(uint64_t ptr) {
6079 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
6080 assert(obj->tag == LDKBalance_ClaimableAwaitingConfirmations);
6081 int64_t claimable_amount_satoshis_conv = obj->claimable_awaiting_confirmations.claimable_amount_satoshis;
6082 return claimable_amount_satoshis_conv;
6084 int32_t __attribute__((export_name("TS_LDKBalance_ClaimableAwaitingConfirmations_get_confirmation_height"))) TS_LDKBalance_ClaimableAwaitingConfirmations_get_confirmation_height(uint64_t ptr) {
6085 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
6086 assert(obj->tag == LDKBalance_ClaimableAwaitingConfirmations);
6087 int32_t confirmation_height_conv = obj->claimable_awaiting_confirmations.confirmation_height;
6088 return confirmation_height_conv;
6090 int64_t __attribute__((export_name("TS_LDKBalance_ContentiousClaimable_get_claimable_amount_satoshis"))) TS_LDKBalance_ContentiousClaimable_get_claimable_amount_satoshis(uint64_t ptr) {
6091 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
6092 assert(obj->tag == LDKBalance_ContentiousClaimable);
6093 int64_t claimable_amount_satoshis_conv = obj->contentious_claimable.claimable_amount_satoshis;
6094 return claimable_amount_satoshis_conv;
6096 int32_t __attribute__((export_name("TS_LDKBalance_ContentiousClaimable_get_timeout_height"))) TS_LDKBalance_ContentiousClaimable_get_timeout_height(uint64_t ptr) {
6097 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
6098 assert(obj->tag == LDKBalance_ContentiousClaimable);
6099 int32_t timeout_height_conv = obj->contentious_claimable.timeout_height;
6100 return timeout_height_conv;
6102 int64_t __attribute__((export_name("TS_LDKBalance_MaybeClaimableHTLCAwaitingTimeout_get_claimable_amount_satoshis"))) TS_LDKBalance_MaybeClaimableHTLCAwaitingTimeout_get_claimable_amount_satoshis(uint64_t ptr) {
6103 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
6104 assert(obj->tag == LDKBalance_MaybeClaimableHTLCAwaitingTimeout);
6105 int64_t claimable_amount_satoshis_conv = obj->maybe_claimable_htlc_awaiting_timeout.claimable_amount_satoshis;
6106 return claimable_amount_satoshis_conv;
6108 int32_t __attribute__((export_name("TS_LDKBalance_MaybeClaimableHTLCAwaitingTimeout_get_claimable_height"))) TS_LDKBalance_MaybeClaimableHTLCAwaitingTimeout_get_claimable_height(uint64_t ptr) {
6109 LDKBalance *obj = (LDKBalance*)untag_ptr(ptr);
6110 assert(obj->tag == LDKBalance_MaybeClaimableHTLCAwaitingTimeout);
6111 int32_t claimable_height_conv = obj->maybe_claimable_htlc_awaiting_timeout.claimable_height;
6112 return claimable_height_conv;
6114 static inline LDKCVec_BalanceZ CVec_BalanceZ_clone(const LDKCVec_BalanceZ *orig) {
6115 LDKCVec_BalanceZ ret = { .data = MALLOC(sizeof(LDKBalance) * orig->datalen, "LDKCVec_BalanceZ clone bytes"), .datalen = orig->datalen };
6116 for (size_t i = 0; i < ret.datalen; i++) {
6117 ret.data[i] = Balance_clone(&orig->data[i]);
6121 static inline struct LDKThirtyTwoBytes C2Tuple_BlockHashChannelMonitorZ_get_a(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR owner){
6122 return ThirtyTwoBytes_clone(&owner->a);
6124 int8_tArray __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_get_a"))) TS_C2Tuple_BlockHashChannelMonitorZ_get_a(uint64_t owner) {
6125 LDKC2Tuple_BlockHashChannelMonitorZ* owner_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(owner);
6126 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
6127 memcpy(ret_arr->elems, C2Tuple_BlockHashChannelMonitorZ_get_a(owner_conv).data, 32);
6131 static inline struct LDKChannelMonitor C2Tuple_BlockHashChannelMonitorZ_get_b(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR owner){
6132 return ChannelMonitor_clone(&owner->b);
6134 uint64_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_get_b"))) TS_C2Tuple_BlockHashChannelMonitorZ_get_b(uint64_t owner) {
6135 LDKC2Tuple_BlockHashChannelMonitorZ* owner_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(owner);
6136 LDKChannelMonitor ret_var = C2Tuple_BlockHashChannelMonitorZ_get_b(owner_conv);
6137 uint64_t ret_ref = 0;
6138 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6139 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6143 static inline struct LDKC2Tuple_BlockHashChannelMonitorZ CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR owner){
6144 CHECK(owner->result_ok);
6145 return C2Tuple_BlockHashChannelMonitorZ_clone(&*owner->contents.result);
6147 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok(uint64_t owner) {
6148 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(owner);
6149 LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
6150 *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_ok(owner_conv);
6151 return tag_ptr(ret_conv, true);
6154 static inline struct LDKDecodeError CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR owner){
6155 CHECK(!owner->result_ok);
6156 return DecodeError_clone(&*owner->contents.err);
6158 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(uint64_t owner) {
6159 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* owner_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(owner);
6160 LDKDecodeError ret_var = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_get_err(owner_conv);
6161 uint64_t ret_ref = 0;
6162 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6163 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6167 static inline struct LDKPublicKey C2Tuple_PublicKeyTypeZ_get_a(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR owner){
6170 int8_tArray __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_get_a"))) TS_C2Tuple_PublicKeyTypeZ_get_a(uint64_t owner) {
6171 LDKC2Tuple_PublicKeyTypeZ* owner_conv = (LDKC2Tuple_PublicKeyTypeZ*)untag_ptr(owner);
6172 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
6173 memcpy(ret_arr->elems, C2Tuple_PublicKeyTypeZ_get_a(owner_conv).compressed_form, 33);
6177 static inline struct LDKType C2Tuple_PublicKeyTypeZ_get_b(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR owner){
6178 return Type_clone(&owner->b);
6180 uint64_t __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_get_b"))) TS_C2Tuple_PublicKeyTypeZ_get_b(uint64_t owner) {
6181 LDKC2Tuple_PublicKeyTypeZ* owner_conv = (LDKC2Tuple_PublicKeyTypeZ*)untag_ptr(owner);
6182 LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType");
6183 *ret_ret = C2Tuple_PublicKeyTypeZ_get_b(owner_conv);
6184 return tag_ptr(ret_ret, true);
6187 static inline LDKCVec_C2Tuple_PublicKeyTypeZZ CVec_C2Tuple_PublicKeyTypeZZ_clone(const LDKCVec_C2Tuple_PublicKeyTypeZZ *orig) {
6188 LDKCVec_C2Tuple_PublicKeyTypeZZ ret = { .data = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ) * orig->datalen, "LDKCVec_C2Tuple_PublicKeyTypeZZ clone bytes"), .datalen = orig->datalen };
6189 for (size_t i = 0; i < ret.datalen; i++) {
6190 ret.data[i] = C2Tuple_PublicKeyTypeZ_clone(&orig->data[i]);
6194 uint32_t __attribute__((export_name("TS_LDKCOption_NetAddressZ_ty_from_ptr"))) TS_LDKCOption_NetAddressZ_ty_from_ptr(uint64_t ptr) {
6195 LDKCOption_NetAddressZ *obj = (LDKCOption_NetAddressZ*)untag_ptr(ptr);
6197 case LDKCOption_NetAddressZ_Some: return 0;
6198 case LDKCOption_NetAddressZ_None: return 1;
6202 uint64_t __attribute__((export_name("TS_LDKCOption_NetAddressZ_Some_get_some"))) TS_LDKCOption_NetAddressZ_Some_get_some(uint64_t ptr) {
6203 LDKCOption_NetAddressZ *obj = (LDKCOption_NetAddressZ*)untag_ptr(ptr);
6204 assert(obj->tag == LDKCOption_NetAddressZ_Some);
6205 uint64_t some_ref = tag_ptr(&obj->some, false);
6208 static inline struct LDKCVec_u8Z CResult_CVec_u8ZPeerHandleErrorZ_get_ok(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR owner){
6209 CHECK(owner->result_ok);
6210 return CVec_u8Z_clone(&*owner->contents.result);
6212 int8_tArray __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_get_ok"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_get_ok(uint64_t owner) {
6213 LDKCResult_CVec_u8ZPeerHandleErrorZ* owner_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(owner);
6214 LDKCVec_u8Z ret_var = CResult_CVec_u8ZPeerHandleErrorZ_get_ok(owner_conv);
6215 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
6216 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
6217 CVec_u8Z_free(ret_var);
6221 static inline struct LDKPeerHandleError CResult_CVec_u8ZPeerHandleErrorZ_get_err(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR owner){
6222 CHECK(!owner->result_ok);
6223 return PeerHandleError_clone(&*owner->contents.err);
6225 uint64_t __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_get_err"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_get_err(uint64_t owner) {
6226 LDKCResult_CVec_u8ZPeerHandleErrorZ* owner_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(owner);
6227 LDKPeerHandleError ret_var = CResult_CVec_u8ZPeerHandleErrorZ_get_err(owner_conv);
6228 uint64_t ret_ref = 0;
6229 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6230 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6234 static inline void CResult_NonePeerHandleErrorZ_get_ok(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR owner){
6235 CHECK(owner->result_ok);
6236 return *owner->contents.result;
6238 void __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_get_ok"))) TS_CResult_NonePeerHandleErrorZ_get_ok(uint64_t owner) {
6239 LDKCResult_NonePeerHandleErrorZ* owner_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(owner);
6240 CResult_NonePeerHandleErrorZ_get_ok(owner_conv);
6243 static inline struct LDKPeerHandleError CResult_NonePeerHandleErrorZ_get_err(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR owner){
6244 CHECK(!owner->result_ok);
6245 return PeerHandleError_clone(&*owner->contents.err);
6247 uint64_t __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_get_err"))) TS_CResult_NonePeerHandleErrorZ_get_err(uint64_t owner) {
6248 LDKCResult_NonePeerHandleErrorZ* owner_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(owner);
6249 LDKPeerHandleError ret_var = CResult_NonePeerHandleErrorZ_get_err(owner_conv);
6250 uint64_t ret_ref = 0;
6251 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6252 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6256 static inline bool CResult_boolPeerHandleErrorZ_get_ok(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR owner){
6257 CHECK(owner->result_ok);
6258 return *owner->contents.result;
6260 jboolean __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_get_ok"))) TS_CResult_boolPeerHandleErrorZ_get_ok(uint64_t owner) {
6261 LDKCResult_boolPeerHandleErrorZ* owner_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(owner);
6262 jboolean ret_conv = CResult_boolPeerHandleErrorZ_get_ok(owner_conv);
6266 static inline struct LDKPeerHandleError CResult_boolPeerHandleErrorZ_get_err(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR owner){
6267 CHECK(!owner->result_ok);
6268 return PeerHandleError_clone(&*owner->contents.err);
6270 uint64_t __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_get_err"))) TS_CResult_boolPeerHandleErrorZ_get_err(uint64_t owner) {
6271 LDKCResult_boolPeerHandleErrorZ* owner_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(owner);
6272 LDKPeerHandleError ret_var = CResult_boolPeerHandleErrorZ_get_err(owner_conv);
6273 uint64_t ret_ref = 0;
6274 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6275 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6279 static inline void CResult_NoneErrorZ_get_ok(LDKCResult_NoneErrorZ *NONNULL_PTR owner){
6280 CHECK(owner->result_ok);
6281 return *owner->contents.result;
6283 void __attribute__((export_name("TS_CResult_NoneErrorZ_get_ok"))) TS_CResult_NoneErrorZ_get_ok(uint64_t owner) {
6284 LDKCResult_NoneErrorZ* owner_conv = (LDKCResult_NoneErrorZ*)untag_ptr(owner);
6285 CResult_NoneErrorZ_get_ok(owner_conv);
6288 static inline enum LDKIOError CResult_NoneErrorZ_get_err(LDKCResult_NoneErrorZ *NONNULL_PTR owner){
6289 CHECK(!owner->result_ok);
6290 return *owner->contents.err;
6292 uint32_t __attribute__((export_name("TS_CResult_NoneErrorZ_get_err"))) TS_CResult_NoneErrorZ_get_err(uint64_t owner) {
6293 LDKCResult_NoneErrorZ* owner_conv = (LDKCResult_NoneErrorZ*)untag_ptr(owner);
6294 uint32_t ret_conv = LDKIOError_to_js(CResult_NoneErrorZ_get_err(owner_conv));
6298 static inline struct LDKNetAddress CResult_NetAddressDecodeErrorZ_get_ok(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR owner){
6299 CHECK(owner->result_ok);
6300 return NetAddress_clone(&*owner->contents.result);
6302 uint64_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_get_ok"))) TS_CResult_NetAddressDecodeErrorZ_get_ok(uint64_t owner) {
6303 LDKCResult_NetAddressDecodeErrorZ* owner_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(owner);
6304 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
6305 *ret_copy = CResult_NetAddressDecodeErrorZ_get_ok(owner_conv);
6306 uint64_t ret_ref = tag_ptr(ret_copy, true);
6310 static inline struct LDKDecodeError CResult_NetAddressDecodeErrorZ_get_err(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR owner){
6311 CHECK(!owner->result_ok);
6312 return DecodeError_clone(&*owner->contents.err);
6314 uint64_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_get_err"))) TS_CResult_NetAddressDecodeErrorZ_get_err(uint64_t owner) {
6315 LDKCResult_NetAddressDecodeErrorZ* owner_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(owner);
6316 LDKDecodeError ret_var = CResult_NetAddressDecodeErrorZ_get_err(owner_conv);
6317 uint64_t ret_ref = 0;
6318 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6319 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6323 static inline LDKCVec_UpdateAddHTLCZ CVec_UpdateAddHTLCZ_clone(const LDKCVec_UpdateAddHTLCZ *orig) {
6324 LDKCVec_UpdateAddHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateAddHTLC) * orig->datalen, "LDKCVec_UpdateAddHTLCZ clone bytes"), .datalen = orig->datalen };
6325 for (size_t i = 0; i < ret.datalen; i++) {
6326 ret.data[i] = UpdateAddHTLC_clone(&orig->data[i]);
6330 static inline LDKCVec_UpdateFulfillHTLCZ CVec_UpdateFulfillHTLCZ_clone(const LDKCVec_UpdateFulfillHTLCZ *orig) {
6331 LDKCVec_UpdateFulfillHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFulfillHTLC) * orig->datalen, "LDKCVec_UpdateFulfillHTLCZ clone bytes"), .datalen = orig->datalen };
6332 for (size_t i = 0; i < ret.datalen; i++) {
6333 ret.data[i] = UpdateFulfillHTLC_clone(&orig->data[i]);
6337 static inline LDKCVec_UpdateFailHTLCZ CVec_UpdateFailHTLCZ_clone(const LDKCVec_UpdateFailHTLCZ *orig) {
6338 LDKCVec_UpdateFailHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFailHTLC) * orig->datalen, "LDKCVec_UpdateFailHTLCZ clone bytes"), .datalen = orig->datalen };
6339 for (size_t i = 0; i < ret.datalen; i++) {
6340 ret.data[i] = UpdateFailHTLC_clone(&orig->data[i]);
6344 static inline LDKCVec_UpdateFailMalformedHTLCZ CVec_UpdateFailMalformedHTLCZ_clone(const LDKCVec_UpdateFailMalformedHTLCZ *orig) {
6345 LDKCVec_UpdateFailMalformedHTLCZ ret = { .data = MALLOC(sizeof(LDKUpdateFailMalformedHTLC) * orig->datalen, "LDKCVec_UpdateFailMalformedHTLCZ clone bytes"), .datalen = orig->datalen };
6346 for (size_t i = 0; i < ret.datalen; i++) {
6347 ret.data[i] = UpdateFailMalformedHTLC_clone(&orig->data[i]);
6351 static inline struct LDKAcceptChannel CResult_AcceptChannelDecodeErrorZ_get_ok(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR owner){
6352 CHECK(owner->result_ok);
6353 return AcceptChannel_clone(&*owner->contents.result);
6355 uint64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_get_ok"))) TS_CResult_AcceptChannelDecodeErrorZ_get_ok(uint64_t owner) {
6356 LDKCResult_AcceptChannelDecodeErrorZ* owner_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(owner);
6357 LDKAcceptChannel ret_var = CResult_AcceptChannelDecodeErrorZ_get_ok(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 struct LDKDecodeError CResult_AcceptChannelDecodeErrorZ_get_err(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR owner){
6365 CHECK(!owner->result_ok);
6366 return DecodeError_clone(&*owner->contents.err);
6368 uint64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_get_err"))) TS_CResult_AcceptChannelDecodeErrorZ_get_err(uint64_t owner) {
6369 LDKCResult_AcceptChannelDecodeErrorZ* owner_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(owner);
6370 LDKDecodeError ret_var = CResult_AcceptChannelDecodeErrorZ_get_err(owner_conv);
6371 uint64_t ret_ref = 0;
6372 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6373 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6377 static inline struct LDKAnnouncementSignatures CResult_AnnouncementSignaturesDecodeErrorZ_get_ok(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR owner){
6378 CHECK(owner->result_ok);
6379 return AnnouncementSignatures_clone(&*owner->contents.result);
6381 uint64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_get_ok"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_get_ok(uint64_t owner) {
6382 LDKCResult_AnnouncementSignaturesDecodeErrorZ* owner_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(owner);
6383 LDKAnnouncementSignatures ret_var = CResult_AnnouncementSignaturesDecodeErrorZ_get_ok(owner_conv);
6384 uint64_t ret_ref = 0;
6385 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6386 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6390 static inline struct LDKDecodeError CResult_AnnouncementSignaturesDecodeErrorZ_get_err(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR owner){
6391 CHECK(!owner->result_ok);
6392 return DecodeError_clone(&*owner->contents.err);
6394 uint64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_get_err"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_get_err(uint64_t owner) {
6395 LDKCResult_AnnouncementSignaturesDecodeErrorZ* owner_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(owner);
6396 LDKDecodeError ret_var = CResult_AnnouncementSignaturesDecodeErrorZ_get_err(owner_conv);
6397 uint64_t ret_ref = 0;
6398 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6399 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6403 static inline struct LDKChannelReestablish CResult_ChannelReestablishDecodeErrorZ_get_ok(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR owner){
6404 CHECK(owner->result_ok);
6405 return ChannelReestablish_clone(&*owner->contents.result);
6407 uint64_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_get_ok"))) TS_CResult_ChannelReestablishDecodeErrorZ_get_ok(uint64_t owner) {
6408 LDKCResult_ChannelReestablishDecodeErrorZ* owner_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(owner);
6409 LDKChannelReestablish ret_var = CResult_ChannelReestablishDecodeErrorZ_get_ok(owner_conv);
6410 uint64_t ret_ref = 0;
6411 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6412 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6416 static inline struct LDKDecodeError CResult_ChannelReestablishDecodeErrorZ_get_err(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR owner){
6417 CHECK(!owner->result_ok);
6418 return DecodeError_clone(&*owner->contents.err);
6420 uint64_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_get_err"))) TS_CResult_ChannelReestablishDecodeErrorZ_get_err(uint64_t owner) {
6421 LDKCResult_ChannelReestablishDecodeErrorZ* owner_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(owner);
6422 LDKDecodeError ret_var = CResult_ChannelReestablishDecodeErrorZ_get_err(owner_conv);
6423 uint64_t ret_ref = 0;
6424 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6425 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6429 static inline struct LDKClosingSigned CResult_ClosingSignedDecodeErrorZ_get_ok(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR owner){
6430 CHECK(owner->result_ok);
6431 return ClosingSigned_clone(&*owner->contents.result);
6433 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_get_ok"))) TS_CResult_ClosingSignedDecodeErrorZ_get_ok(uint64_t owner) {
6434 LDKCResult_ClosingSignedDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(owner);
6435 LDKClosingSigned ret_var = CResult_ClosingSignedDecodeErrorZ_get_ok(owner_conv);
6436 uint64_t ret_ref = 0;
6437 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6438 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6442 static inline struct LDKDecodeError CResult_ClosingSignedDecodeErrorZ_get_err(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR owner){
6443 CHECK(!owner->result_ok);
6444 return DecodeError_clone(&*owner->contents.err);
6446 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_get_err"))) TS_CResult_ClosingSignedDecodeErrorZ_get_err(uint64_t owner) {
6447 LDKCResult_ClosingSignedDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(owner);
6448 LDKDecodeError ret_var = CResult_ClosingSignedDecodeErrorZ_get_err(owner_conv);
6449 uint64_t ret_ref = 0;
6450 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6451 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6455 static inline struct LDKClosingSignedFeeRange CResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR owner){
6456 CHECK(owner->result_ok);
6457 return ClosingSignedFeeRange_clone(&*owner->contents.result);
6459 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok(uint64_t owner) {
6460 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(owner);
6461 LDKClosingSignedFeeRange ret_var = CResult_ClosingSignedFeeRangeDecodeErrorZ_get_ok(owner_conv);
6462 uint64_t ret_ref = 0;
6463 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6464 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6468 static inline struct LDKDecodeError CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR owner){
6469 CHECK(!owner->result_ok);
6470 return DecodeError_clone(&*owner->contents.err);
6472 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(uint64_t owner) {
6473 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* owner_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(owner);
6474 LDKDecodeError ret_var = CResult_ClosingSignedFeeRangeDecodeErrorZ_get_err(owner_conv);
6475 uint64_t ret_ref = 0;
6476 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6477 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6481 static inline struct LDKCommitmentSigned CResult_CommitmentSignedDecodeErrorZ_get_ok(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR owner){
6482 CHECK(owner->result_ok);
6483 return CommitmentSigned_clone(&*owner->contents.result);
6485 uint64_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_get_ok"))) TS_CResult_CommitmentSignedDecodeErrorZ_get_ok(uint64_t owner) {
6486 LDKCResult_CommitmentSignedDecodeErrorZ* owner_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(owner);
6487 LDKCommitmentSigned ret_var = CResult_CommitmentSignedDecodeErrorZ_get_ok(owner_conv);
6488 uint64_t ret_ref = 0;
6489 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6490 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6494 static inline struct LDKDecodeError CResult_CommitmentSignedDecodeErrorZ_get_err(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR owner){
6495 CHECK(!owner->result_ok);
6496 return DecodeError_clone(&*owner->contents.err);
6498 uint64_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_get_err"))) TS_CResult_CommitmentSignedDecodeErrorZ_get_err(uint64_t owner) {
6499 LDKCResult_CommitmentSignedDecodeErrorZ* owner_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(owner);
6500 LDKDecodeError ret_var = CResult_CommitmentSignedDecodeErrorZ_get_err(owner_conv);
6501 uint64_t ret_ref = 0;
6502 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6503 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6507 static inline struct LDKFundingCreated CResult_FundingCreatedDecodeErrorZ_get_ok(LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR owner){
6508 CHECK(owner->result_ok);
6509 return FundingCreated_clone(&*owner->contents.result);
6511 uint64_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_get_ok"))) TS_CResult_FundingCreatedDecodeErrorZ_get_ok(uint64_t owner) {
6512 LDKCResult_FundingCreatedDecodeErrorZ* owner_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(owner);
6513 LDKFundingCreated ret_var = CResult_FundingCreatedDecodeErrorZ_get_ok(owner_conv);
6514 uint64_t ret_ref = 0;
6515 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6516 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6520 static inline struct LDKDecodeError CResult_FundingCreatedDecodeErrorZ_get_err(LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR owner){
6521 CHECK(!owner->result_ok);
6522 return DecodeError_clone(&*owner->contents.err);
6524 uint64_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_get_err"))) TS_CResult_FundingCreatedDecodeErrorZ_get_err(uint64_t owner) {
6525 LDKCResult_FundingCreatedDecodeErrorZ* owner_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(owner);
6526 LDKDecodeError ret_var = CResult_FundingCreatedDecodeErrorZ_get_err(owner_conv);
6527 uint64_t ret_ref = 0;
6528 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6529 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6533 static inline struct LDKFundingSigned CResult_FundingSignedDecodeErrorZ_get_ok(LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR owner){
6534 CHECK(owner->result_ok);
6535 return FundingSigned_clone(&*owner->contents.result);
6537 uint64_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_get_ok"))) TS_CResult_FundingSignedDecodeErrorZ_get_ok(uint64_t owner) {
6538 LDKCResult_FundingSignedDecodeErrorZ* owner_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(owner);
6539 LDKFundingSigned ret_var = CResult_FundingSignedDecodeErrorZ_get_ok(owner_conv);
6540 uint64_t ret_ref = 0;
6541 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6542 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6546 static inline struct LDKDecodeError CResult_FundingSignedDecodeErrorZ_get_err(LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR owner){
6547 CHECK(!owner->result_ok);
6548 return DecodeError_clone(&*owner->contents.err);
6550 uint64_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_get_err"))) TS_CResult_FundingSignedDecodeErrorZ_get_err(uint64_t owner) {
6551 LDKCResult_FundingSignedDecodeErrorZ* owner_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(owner);
6552 LDKDecodeError ret_var = CResult_FundingSignedDecodeErrorZ_get_err(owner_conv);
6553 uint64_t ret_ref = 0;
6554 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6555 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6559 static inline struct LDKChannelReady CResult_ChannelReadyDecodeErrorZ_get_ok(LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR owner){
6560 CHECK(owner->result_ok);
6561 return ChannelReady_clone(&*owner->contents.result);
6563 uint64_t __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_get_ok"))) TS_CResult_ChannelReadyDecodeErrorZ_get_ok(uint64_t owner) {
6564 LDKCResult_ChannelReadyDecodeErrorZ* owner_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(owner);
6565 LDKChannelReady ret_var = CResult_ChannelReadyDecodeErrorZ_get_ok(owner_conv);
6566 uint64_t ret_ref = 0;
6567 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6568 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6572 static inline struct LDKDecodeError CResult_ChannelReadyDecodeErrorZ_get_err(LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR owner){
6573 CHECK(!owner->result_ok);
6574 return DecodeError_clone(&*owner->contents.err);
6576 uint64_t __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_get_err"))) TS_CResult_ChannelReadyDecodeErrorZ_get_err(uint64_t owner) {
6577 LDKCResult_ChannelReadyDecodeErrorZ* owner_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(owner);
6578 LDKDecodeError ret_var = CResult_ChannelReadyDecodeErrorZ_get_err(owner_conv);
6579 uint64_t ret_ref = 0;
6580 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6581 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6585 static inline struct LDKInit CResult_InitDecodeErrorZ_get_ok(LDKCResult_InitDecodeErrorZ *NONNULL_PTR owner){
6586 CHECK(owner->result_ok);
6587 return Init_clone(&*owner->contents.result);
6589 uint64_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_get_ok"))) TS_CResult_InitDecodeErrorZ_get_ok(uint64_t owner) {
6590 LDKCResult_InitDecodeErrorZ* owner_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(owner);
6591 LDKInit ret_var = CResult_InitDecodeErrorZ_get_ok(owner_conv);
6592 uint64_t ret_ref = 0;
6593 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6594 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6598 static inline struct LDKDecodeError CResult_InitDecodeErrorZ_get_err(LDKCResult_InitDecodeErrorZ *NONNULL_PTR owner){
6599 CHECK(!owner->result_ok);
6600 return DecodeError_clone(&*owner->contents.err);
6602 uint64_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_get_err"))) TS_CResult_InitDecodeErrorZ_get_err(uint64_t owner) {
6603 LDKCResult_InitDecodeErrorZ* owner_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(owner);
6604 LDKDecodeError ret_var = CResult_InitDecodeErrorZ_get_err(owner_conv);
6605 uint64_t ret_ref = 0;
6606 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6607 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6611 static inline struct LDKOpenChannel CResult_OpenChannelDecodeErrorZ_get_ok(LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR owner){
6612 CHECK(owner->result_ok);
6613 return OpenChannel_clone(&*owner->contents.result);
6615 uint64_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_get_ok"))) TS_CResult_OpenChannelDecodeErrorZ_get_ok(uint64_t owner) {
6616 LDKCResult_OpenChannelDecodeErrorZ* owner_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(owner);
6617 LDKOpenChannel ret_var = CResult_OpenChannelDecodeErrorZ_get_ok(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 LDKDecodeError CResult_OpenChannelDecodeErrorZ_get_err(LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR owner){
6625 CHECK(!owner->result_ok);
6626 return DecodeError_clone(&*owner->contents.err);
6628 uint64_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_get_err"))) TS_CResult_OpenChannelDecodeErrorZ_get_err(uint64_t owner) {
6629 LDKCResult_OpenChannelDecodeErrorZ* owner_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(owner);
6630 LDKDecodeError ret_var = CResult_OpenChannelDecodeErrorZ_get_err(owner_conv);
6631 uint64_t ret_ref = 0;
6632 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6633 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6637 static inline struct LDKRevokeAndACK CResult_RevokeAndACKDecodeErrorZ_get_ok(LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR owner){
6638 CHECK(owner->result_ok);
6639 return RevokeAndACK_clone(&*owner->contents.result);
6641 uint64_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_get_ok"))) TS_CResult_RevokeAndACKDecodeErrorZ_get_ok(uint64_t owner) {
6642 LDKCResult_RevokeAndACKDecodeErrorZ* owner_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(owner);
6643 LDKRevokeAndACK ret_var = CResult_RevokeAndACKDecodeErrorZ_get_ok(owner_conv);
6644 uint64_t ret_ref = 0;
6645 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6646 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6650 static inline struct LDKDecodeError CResult_RevokeAndACKDecodeErrorZ_get_err(LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR owner){
6651 CHECK(!owner->result_ok);
6652 return DecodeError_clone(&*owner->contents.err);
6654 uint64_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_get_err"))) TS_CResult_RevokeAndACKDecodeErrorZ_get_err(uint64_t owner) {
6655 LDKCResult_RevokeAndACKDecodeErrorZ* owner_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(owner);
6656 LDKDecodeError ret_var = CResult_RevokeAndACKDecodeErrorZ_get_err(owner_conv);
6657 uint64_t ret_ref = 0;
6658 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6659 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6663 static inline struct LDKShutdown CResult_ShutdownDecodeErrorZ_get_ok(LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR owner){
6664 CHECK(owner->result_ok);
6665 return Shutdown_clone(&*owner->contents.result);
6667 uint64_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_get_ok"))) TS_CResult_ShutdownDecodeErrorZ_get_ok(uint64_t owner) {
6668 LDKCResult_ShutdownDecodeErrorZ* owner_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(owner);
6669 LDKShutdown ret_var = CResult_ShutdownDecodeErrorZ_get_ok(owner_conv);
6670 uint64_t ret_ref = 0;
6671 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6672 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6676 static inline struct LDKDecodeError CResult_ShutdownDecodeErrorZ_get_err(LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR owner){
6677 CHECK(!owner->result_ok);
6678 return DecodeError_clone(&*owner->contents.err);
6680 uint64_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_get_err"))) TS_CResult_ShutdownDecodeErrorZ_get_err(uint64_t owner) {
6681 LDKCResult_ShutdownDecodeErrorZ* owner_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(owner);
6682 LDKDecodeError ret_var = CResult_ShutdownDecodeErrorZ_get_err(owner_conv);
6683 uint64_t ret_ref = 0;
6684 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6685 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6689 static inline struct LDKUpdateFailHTLC CResult_UpdateFailHTLCDecodeErrorZ_get_ok(LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR owner){
6690 CHECK(owner->result_ok);
6691 return UpdateFailHTLC_clone(&*owner->contents.result);
6693 uint64_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_get_ok"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_get_ok(uint64_t owner) {
6694 LDKCResult_UpdateFailHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(owner);
6695 LDKUpdateFailHTLC ret_var = CResult_UpdateFailHTLCDecodeErrorZ_get_ok(owner_conv);
6696 uint64_t ret_ref = 0;
6697 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6698 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6702 static inline struct LDKDecodeError CResult_UpdateFailHTLCDecodeErrorZ_get_err(LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR owner){
6703 CHECK(!owner->result_ok);
6704 return DecodeError_clone(&*owner->contents.err);
6706 uint64_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_get_err"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_get_err(uint64_t owner) {
6707 LDKCResult_UpdateFailHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(owner);
6708 LDKDecodeError ret_var = CResult_UpdateFailHTLCDecodeErrorZ_get_err(owner_conv);
6709 uint64_t ret_ref = 0;
6710 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6711 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6715 static inline struct LDKUpdateFailMalformedHTLC CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_ok(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR owner){
6716 CHECK(owner->result_ok);
6717 return UpdateFailMalformedHTLC_clone(&*owner->contents.result);
6719 uint64_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_ok"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_ok(uint64_t owner) {
6720 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(owner);
6721 LDKUpdateFailMalformedHTLC ret_var = CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_ok(owner_conv);
6722 uint64_t ret_ref = 0;
6723 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6724 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6728 static inline struct LDKDecodeError CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR owner){
6729 CHECK(!owner->result_ok);
6730 return DecodeError_clone(&*owner->contents.err);
6732 uint64_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(uint64_t owner) {
6733 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(owner);
6734 LDKDecodeError ret_var = CResult_UpdateFailMalformedHTLCDecodeErrorZ_get_err(owner_conv);
6735 uint64_t ret_ref = 0;
6736 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6737 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6741 static inline struct LDKUpdateFee CResult_UpdateFeeDecodeErrorZ_get_ok(LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR owner){
6742 CHECK(owner->result_ok);
6743 return UpdateFee_clone(&*owner->contents.result);
6745 uint64_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_get_ok"))) TS_CResult_UpdateFeeDecodeErrorZ_get_ok(uint64_t owner) {
6746 LDKCResult_UpdateFeeDecodeErrorZ* owner_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(owner);
6747 LDKUpdateFee ret_var = CResult_UpdateFeeDecodeErrorZ_get_ok(owner_conv);
6748 uint64_t ret_ref = 0;
6749 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6750 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6754 static inline struct LDKDecodeError CResult_UpdateFeeDecodeErrorZ_get_err(LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR owner){
6755 CHECK(!owner->result_ok);
6756 return DecodeError_clone(&*owner->contents.err);
6758 uint64_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_get_err"))) TS_CResult_UpdateFeeDecodeErrorZ_get_err(uint64_t owner) {
6759 LDKCResult_UpdateFeeDecodeErrorZ* owner_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(owner);
6760 LDKDecodeError ret_var = CResult_UpdateFeeDecodeErrorZ_get_err(owner_conv);
6761 uint64_t ret_ref = 0;
6762 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6763 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6767 static inline struct LDKUpdateFulfillHTLC CResult_UpdateFulfillHTLCDecodeErrorZ_get_ok(LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR owner){
6768 CHECK(owner->result_ok);
6769 return UpdateFulfillHTLC_clone(&*owner->contents.result);
6771 uint64_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_get_ok"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_get_ok(uint64_t owner) {
6772 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(owner);
6773 LDKUpdateFulfillHTLC ret_var = CResult_UpdateFulfillHTLCDecodeErrorZ_get_ok(owner_conv);
6774 uint64_t ret_ref = 0;
6775 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6776 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6780 static inline struct LDKDecodeError CResult_UpdateFulfillHTLCDecodeErrorZ_get_err(LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR owner){
6781 CHECK(!owner->result_ok);
6782 return DecodeError_clone(&*owner->contents.err);
6784 uint64_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_get_err"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_get_err(uint64_t owner) {
6785 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(owner);
6786 LDKDecodeError ret_var = CResult_UpdateFulfillHTLCDecodeErrorZ_get_err(owner_conv);
6787 uint64_t ret_ref = 0;
6788 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6789 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6793 static inline struct LDKUpdateAddHTLC CResult_UpdateAddHTLCDecodeErrorZ_get_ok(LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR owner){
6794 CHECK(owner->result_ok);
6795 return UpdateAddHTLC_clone(&*owner->contents.result);
6797 uint64_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_get_ok"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_get_ok(uint64_t owner) {
6798 LDKCResult_UpdateAddHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(owner);
6799 LDKUpdateAddHTLC ret_var = CResult_UpdateAddHTLCDecodeErrorZ_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_UpdateAddHTLCDecodeErrorZ_get_err(LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR owner){
6807 CHECK(!owner->result_ok);
6808 return DecodeError_clone(&*owner->contents.err);
6810 uint64_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_get_err"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_get_err(uint64_t owner) {
6811 LDKCResult_UpdateAddHTLCDecodeErrorZ* owner_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(owner);
6812 LDKDecodeError ret_var = CResult_UpdateAddHTLCDecodeErrorZ_get_err(owner_conv);
6813 uint64_t ret_ref = 0;
6814 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6815 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6819 static inline struct LDKPing CResult_PingDecodeErrorZ_get_ok(LDKCResult_PingDecodeErrorZ *NONNULL_PTR owner){
6820 CHECK(owner->result_ok);
6821 return Ping_clone(&*owner->contents.result);
6823 uint64_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_get_ok"))) TS_CResult_PingDecodeErrorZ_get_ok(uint64_t owner) {
6824 LDKCResult_PingDecodeErrorZ* owner_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(owner);
6825 LDKPing ret_var = CResult_PingDecodeErrorZ_get_ok(owner_conv);
6826 uint64_t ret_ref = 0;
6827 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6828 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6832 static inline struct LDKDecodeError CResult_PingDecodeErrorZ_get_err(LDKCResult_PingDecodeErrorZ *NONNULL_PTR owner){
6833 CHECK(!owner->result_ok);
6834 return DecodeError_clone(&*owner->contents.err);
6836 uint64_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_get_err"))) TS_CResult_PingDecodeErrorZ_get_err(uint64_t owner) {
6837 LDKCResult_PingDecodeErrorZ* owner_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(owner);
6838 LDKDecodeError ret_var = CResult_PingDecodeErrorZ_get_err(owner_conv);
6839 uint64_t ret_ref = 0;
6840 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6841 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6845 static inline struct LDKPong CResult_PongDecodeErrorZ_get_ok(LDKCResult_PongDecodeErrorZ *NONNULL_PTR owner){
6846 CHECK(owner->result_ok);
6847 return Pong_clone(&*owner->contents.result);
6849 uint64_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_get_ok"))) TS_CResult_PongDecodeErrorZ_get_ok(uint64_t owner) {
6850 LDKCResult_PongDecodeErrorZ* owner_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(owner);
6851 LDKPong ret_var = CResult_PongDecodeErrorZ_get_ok(owner_conv);
6852 uint64_t ret_ref = 0;
6853 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6854 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6858 static inline struct LDKDecodeError CResult_PongDecodeErrorZ_get_err(LDKCResult_PongDecodeErrorZ *NONNULL_PTR owner){
6859 CHECK(!owner->result_ok);
6860 return DecodeError_clone(&*owner->contents.err);
6862 uint64_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_get_err"))) TS_CResult_PongDecodeErrorZ_get_err(uint64_t owner) {
6863 LDKCResult_PongDecodeErrorZ* owner_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(owner);
6864 LDKDecodeError ret_var = CResult_PongDecodeErrorZ_get_err(owner_conv);
6865 uint64_t ret_ref = 0;
6866 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6867 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6871 static inline struct LDKUnsignedChannelAnnouncement CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR owner){
6872 CHECK(owner->result_ok);
6873 return UnsignedChannelAnnouncement_clone(&*owner->contents.result);
6875 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok(uint64_t owner) {
6876 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(owner);
6877 LDKUnsignedChannelAnnouncement ret_var = CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_ok(owner_conv);
6878 uint64_t ret_ref = 0;
6879 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6880 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6884 static inline struct LDKDecodeError CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR owner){
6885 CHECK(!owner->result_ok);
6886 return DecodeError_clone(&*owner->contents.err);
6888 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(uint64_t owner) {
6889 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(owner);
6890 LDKDecodeError ret_var = CResult_UnsignedChannelAnnouncementDecodeErrorZ_get_err(owner_conv);
6891 uint64_t ret_ref = 0;
6892 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6893 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6897 static inline struct LDKChannelAnnouncement CResult_ChannelAnnouncementDecodeErrorZ_get_ok(LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR owner){
6898 CHECK(owner->result_ok);
6899 return ChannelAnnouncement_clone(&*owner->contents.result);
6901 uint64_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_get_ok"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_get_ok(uint64_t owner) {
6902 LDKCResult_ChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(owner);
6903 LDKChannelAnnouncement ret_var = CResult_ChannelAnnouncementDecodeErrorZ_get_ok(owner_conv);
6904 uint64_t ret_ref = 0;
6905 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6906 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6910 static inline struct LDKDecodeError CResult_ChannelAnnouncementDecodeErrorZ_get_err(LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR owner){
6911 CHECK(!owner->result_ok);
6912 return DecodeError_clone(&*owner->contents.err);
6914 uint64_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_get_err"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_get_err(uint64_t owner) {
6915 LDKCResult_ChannelAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(owner);
6916 LDKDecodeError ret_var = CResult_ChannelAnnouncementDecodeErrorZ_get_err(owner_conv);
6917 uint64_t ret_ref = 0;
6918 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6919 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6923 static inline struct LDKUnsignedChannelUpdate CResult_UnsignedChannelUpdateDecodeErrorZ_get_ok(LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR owner){
6924 CHECK(owner->result_ok);
6925 return UnsignedChannelUpdate_clone(&*owner->contents.result);
6927 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_get_ok"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_get_ok(uint64_t owner) {
6928 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(owner);
6929 LDKUnsignedChannelUpdate ret_var = CResult_UnsignedChannelUpdateDecodeErrorZ_get_ok(owner_conv);
6930 uint64_t ret_ref = 0;
6931 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6932 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6936 static inline struct LDKDecodeError CResult_UnsignedChannelUpdateDecodeErrorZ_get_err(LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR owner){
6937 CHECK(!owner->result_ok);
6938 return DecodeError_clone(&*owner->contents.err);
6940 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_get_err"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_get_err(uint64_t owner) {
6941 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(owner);
6942 LDKDecodeError ret_var = CResult_UnsignedChannelUpdateDecodeErrorZ_get_err(owner_conv);
6943 uint64_t ret_ref = 0;
6944 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6945 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6949 static inline struct LDKChannelUpdate CResult_ChannelUpdateDecodeErrorZ_get_ok(LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR owner){
6950 CHECK(owner->result_ok);
6951 return ChannelUpdate_clone(&*owner->contents.result);
6953 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_get_ok"))) TS_CResult_ChannelUpdateDecodeErrorZ_get_ok(uint64_t owner) {
6954 LDKCResult_ChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(owner);
6955 LDKChannelUpdate ret_var = CResult_ChannelUpdateDecodeErrorZ_get_ok(owner_conv);
6956 uint64_t ret_ref = 0;
6957 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6958 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6962 static inline struct LDKDecodeError CResult_ChannelUpdateDecodeErrorZ_get_err(LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR owner){
6963 CHECK(!owner->result_ok);
6964 return DecodeError_clone(&*owner->contents.err);
6966 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_get_err"))) TS_CResult_ChannelUpdateDecodeErrorZ_get_err(uint64_t owner) {
6967 LDKCResult_ChannelUpdateDecodeErrorZ* owner_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(owner);
6968 LDKDecodeError ret_var = CResult_ChannelUpdateDecodeErrorZ_get_err(owner_conv);
6969 uint64_t ret_ref = 0;
6970 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6971 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
6975 static inline struct LDKErrorMessage CResult_ErrorMessageDecodeErrorZ_get_ok(LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR owner){
6976 CHECK(owner->result_ok);
6977 return ErrorMessage_clone(&*owner->contents.result);
6979 uint64_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_get_ok"))) TS_CResult_ErrorMessageDecodeErrorZ_get_ok(uint64_t owner) {
6980 LDKCResult_ErrorMessageDecodeErrorZ* owner_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(owner);
6981 LDKErrorMessage ret_var = CResult_ErrorMessageDecodeErrorZ_get_ok(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 LDKDecodeError CResult_ErrorMessageDecodeErrorZ_get_err(LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR owner){
6989 CHECK(!owner->result_ok);
6990 return DecodeError_clone(&*owner->contents.err);
6992 uint64_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_get_err"))) TS_CResult_ErrorMessageDecodeErrorZ_get_err(uint64_t owner) {
6993 LDKCResult_ErrorMessageDecodeErrorZ* owner_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(owner);
6994 LDKDecodeError ret_var = CResult_ErrorMessageDecodeErrorZ_get_err(owner_conv);
6995 uint64_t ret_ref = 0;
6996 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
6997 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7001 static inline struct LDKWarningMessage CResult_WarningMessageDecodeErrorZ_get_ok(LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR owner){
7002 CHECK(owner->result_ok);
7003 return WarningMessage_clone(&*owner->contents.result);
7005 uint64_t __attribute__((export_name("TS_CResult_WarningMessageDecodeErrorZ_get_ok"))) TS_CResult_WarningMessageDecodeErrorZ_get_ok(uint64_t owner) {
7006 LDKCResult_WarningMessageDecodeErrorZ* owner_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(owner);
7007 LDKWarningMessage ret_var = CResult_WarningMessageDecodeErrorZ_get_ok(owner_conv);
7008 uint64_t ret_ref = 0;
7009 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7010 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7014 static inline struct LDKDecodeError CResult_WarningMessageDecodeErrorZ_get_err(LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR owner){
7015 CHECK(!owner->result_ok);
7016 return DecodeError_clone(&*owner->contents.err);
7018 uint64_t __attribute__((export_name("TS_CResult_WarningMessageDecodeErrorZ_get_err"))) TS_CResult_WarningMessageDecodeErrorZ_get_err(uint64_t owner) {
7019 LDKCResult_WarningMessageDecodeErrorZ* owner_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(owner);
7020 LDKDecodeError ret_var = CResult_WarningMessageDecodeErrorZ_get_err(owner_conv);
7021 uint64_t ret_ref = 0;
7022 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7023 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7027 static inline struct LDKUnsignedNodeAnnouncement CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR owner){
7028 CHECK(owner->result_ok);
7029 return UnsignedNodeAnnouncement_clone(&*owner->contents.result);
7031 uint64_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok(uint64_t owner) {
7032 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(owner);
7033 LDKUnsignedNodeAnnouncement ret_var = CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_ok(owner_conv);
7034 uint64_t ret_ref = 0;
7035 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7036 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7040 static inline struct LDKDecodeError CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR owner){
7041 CHECK(!owner->result_ok);
7042 return DecodeError_clone(&*owner->contents.err);
7044 uint64_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(uint64_t owner) {
7045 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(owner);
7046 LDKDecodeError ret_var = CResult_UnsignedNodeAnnouncementDecodeErrorZ_get_err(owner_conv);
7047 uint64_t ret_ref = 0;
7048 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7049 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7053 static inline struct LDKNodeAnnouncement CResult_NodeAnnouncementDecodeErrorZ_get_ok(LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR owner){
7054 CHECK(owner->result_ok);
7055 return NodeAnnouncement_clone(&*owner->contents.result);
7057 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_get_ok"))) TS_CResult_NodeAnnouncementDecodeErrorZ_get_ok(uint64_t owner) {
7058 LDKCResult_NodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(owner);
7059 LDKNodeAnnouncement ret_var = CResult_NodeAnnouncementDecodeErrorZ_get_ok(owner_conv);
7060 uint64_t ret_ref = 0;
7061 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7062 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7066 static inline struct LDKDecodeError CResult_NodeAnnouncementDecodeErrorZ_get_err(LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR owner){
7067 CHECK(!owner->result_ok);
7068 return DecodeError_clone(&*owner->contents.err);
7070 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_get_err"))) TS_CResult_NodeAnnouncementDecodeErrorZ_get_err(uint64_t owner) {
7071 LDKCResult_NodeAnnouncementDecodeErrorZ* owner_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(owner);
7072 LDKDecodeError ret_var = CResult_NodeAnnouncementDecodeErrorZ_get_err(owner_conv);
7073 uint64_t ret_ref = 0;
7074 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7075 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7079 static inline struct LDKQueryShortChannelIds CResult_QueryShortChannelIdsDecodeErrorZ_get_ok(LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR owner){
7080 CHECK(owner->result_ok);
7081 return QueryShortChannelIds_clone(&*owner->contents.result);
7083 uint64_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_get_ok"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_get_ok(uint64_t owner) {
7084 LDKCResult_QueryShortChannelIdsDecodeErrorZ* owner_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(owner);
7085 LDKQueryShortChannelIds ret_var = CResult_QueryShortChannelIdsDecodeErrorZ_get_ok(owner_conv);
7086 uint64_t ret_ref = 0;
7087 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7088 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7092 static inline struct LDKDecodeError CResult_QueryShortChannelIdsDecodeErrorZ_get_err(LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR owner){
7093 CHECK(!owner->result_ok);
7094 return DecodeError_clone(&*owner->contents.err);
7096 uint64_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_get_err"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_get_err(uint64_t owner) {
7097 LDKCResult_QueryShortChannelIdsDecodeErrorZ* owner_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(owner);
7098 LDKDecodeError ret_var = CResult_QueryShortChannelIdsDecodeErrorZ_get_err(owner_conv);
7099 uint64_t ret_ref = 0;
7100 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7101 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7105 static inline struct LDKReplyShortChannelIdsEnd CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR owner){
7106 CHECK(owner->result_ok);
7107 return ReplyShortChannelIdsEnd_clone(&*owner->contents.result);
7109 uint64_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok(uint64_t owner) {
7110 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* owner_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(owner);
7111 LDKReplyShortChannelIdsEnd ret_var = CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_ok(owner_conv);
7112 uint64_t ret_ref = 0;
7113 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7114 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7118 static inline struct LDKDecodeError CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR owner){
7119 CHECK(!owner->result_ok);
7120 return DecodeError_clone(&*owner->contents.err);
7122 uint64_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(uint64_t owner) {
7123 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* owner_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(owner);
7124 LDKDecodeError ret_var = CResult_ReplyShortChannelIdsEndDecodeErrorZ_get_err(owner_conv);
7125 uint64_t ret_ref = 0;
7126 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7127 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7131 static inline struct LDKQueryChannelRange CResult_QueryChannelRangeDecodeErrorZ_get_ok(LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR owner){
7132 CHECK(owner->result_ok);
7133 return QueryChannelRange_clone(&*owner->contents.result);
7135 uint64_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_get_ok"))) TS_CResult_QueryChannelRangeDecodeErrorZ_get_ok(uint64_t owner) {
7136 LDKCResult_QueryChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(owner);
7137 LDKQueryChannelRange ret_var = CResult_QueryChannelRangeDecodeErrorZ_get_ok(owner_conv);
7138 uint64_t ret_ref = 0;
7139 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7140 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7144 static inline struct LDKDecodeError CResult_QueryChannelRangeDecodeErrorZ_get_err(LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR owner){
7145 CHECK(!owner->result_ok);
7146 return DecodeError_clone(&*owner->contents.err);
7148 uint64_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_get_err"))) TS_CResult_QueryChannelRangeDecodeErrorZ_get_err(uint64_t owner) {
7149 LDKCResult_QueryChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(owner);
7150 LDKDecodeError ret_var = CResult_QueryChannelRangeDecodeErrorZ_get_err(owner_conv);
7151 uint64_t ret_ref = 0;
7152 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7153 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7157 static inline struct LDKReplyChannelRange CResult_ReplyChannelRangeDecodeErrorZ_get_ok(LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR owner){
7158 CHECK(owner->result_ok);
7159 return ReplyChannelRange_clone(&*owner->contents.result);
7161 uint64_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_get_ok"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_get_ok(uint64_t owner) {
7162 LDKCResult_ReplyChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(owner);
7163 LDKReplyChannelRange ret_var = CResult_ReplyChannelRangeDecodeErrorZ_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_ReplyChannelRangeDecodeErrorZ_get_err(LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR owner){
7171 CHECK(!owner->result_ok);
7172 return DecodeError_clone(&*owner->contents.err);
7174 uint64_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_get_err"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_get_err(uint64_t owner) {
7175 LDKCResult_ReplyChannelRangeDecodeErrorZ* owner_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(owner);
7176 LDKDecodeError ret_var = CResult_ReplyChannelRangeDecodeErrorZ_get_err(owner_conv);
7177 uint64_t ret_ref = 0;
7178 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7179 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7183 static inline struct LDKGossipTimestampFilter CResult_GossipTimestampFilterDecodeErrorZ_get_ok(LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR owner){
7184 CHECK(owner->result_ok);
7185 return GossipTimestampFilter_clone(&*owner->contents.result);
7187 uint64_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_get_ok"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_get_ok(uint64_t owner) {
7188 LDKCResult_GossipTimestampFilterDecodeErrorZ* owner_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(owner);
7189 LDKGossipTimestampFilter ret_var = CResult_GossipTimestampFilterDecodeErrorZ_get_ok(owner_conv);
7190 uint64_t ret_ref = 0;
7191 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7192 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7196 static inline struct LDKDecodeError CResult_GossipTimestampFilterDecodeErrorZ_get_err(LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR owner){
7197 CHECK(!owner->result_ok);
7198 return DecodeError_clone(&*owner->contents.err);
7200 uint64_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_get_err"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_get_err(uint64_t owner) {
7201 LDKCResult_GossipTimestampFilterDecodeErrorZ* owner_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(owner);
7202 LDKDecodeError ret_var = CResult_GossipTimestampFilterDecodeErrorZ_get_err(owner_conv);
7203 uint64_t ret_ref = 0;
7204 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7205 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7209 uint32_t __attribute__((export_name("TS_LDKSignOrCreationError_ty_from_ptr"))) TS_LDKSignOrCreationError_ty_from_ptr(uint64_t ptr) {
7210 LDKSignOrCreationError *obj = (LDKSignOrCreationError*)untag_ptr(ptr);
7212 case LDKSignOrCreationError_SignError: return 0;
7213 case LDKSignOrCreationError_CreationError: return 1;
7217 uint32_t __attribute__((export_name("TS_LDKSignOrCreationError_CreationError_get_creation_error"))) TS_LDKSignOrCreationError_CreationError_get_creation_error(uint64_t ptr) {
7218 LDKSignOrCreationError *obj = (LDKSignOrCreationError*)untag_ptr(ptr);
7219 assert(obj->tag == LDKSignOrCreationError_CreationError);
7220 uint32_t creation_error_conv = LDKCreationError_to_js(obj->creation_error);
7221 return creation_error_conv;
7223 static inline struct LDKInvoice CResult_InvoiceSignOrCreationErrorZ_get_ok(LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR owner){
7224 CHECK(owner->result_ok);
7225 return Invoice_clone(&*owner->contents.result);
7227 uint64_t __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_get_ok"))) TS_CResult_InvoiceSignOrCreationErrorZ_get_ok(uint64_t owner) {
7228 LDKCResult_InvoiceSignOrCreationErrorZ* owner_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(owner);
7229 LDKInvoice ret_var = CResult_InvoiceSignOrCreationErrorZ_get_ok(owner_conv);
7230 uint64_t ret_ref = 0;
7231 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7232 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
7236 static inline struct LDKSignOrCreationError CResult_InvoiceSignOrCreationErrorZ_get_err(LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR owner){
7237 CHECK(!owner->result_ok);
7238 return SignOrCreationError_clone(&*owner->contents.err);
7240 uint64_t __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_get_err"))) TS_CResult_InvoiceSignOrCreationErrorZ_get_err(uint64_t owner) {
7241 LDKCResult_InvoiceSignOrCreationErrorZ* owner_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(owner);
7242 LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
7243 *ret_copy = CResult_InvoiceSignOrCreationErrorZ_get_err(owner_conv);
7244 uint64_t ret_ref = tag_ptr(ret_copy, true);
7248 typedef struct LDKFilter_JCalls {
7249 atomic_size_t refcnt;
7250 uint32_t instance_ptr;
7252 static void LDKFilter_JCalls_free(void* this_arg) {
7253 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
7254 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
7258 void register_tx_LDKFilter_jcall(const void* this_arg, const uint8_t (* txid)[32], LDKu8slice script_pubkey) {
7259 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
7260 int8_tArray txid_arr = init_int8_tArray(32, __LINE__);
7261 memcpy(txid_arr->elems, *txid, 32);
7262 LDKu8slice script_pubkey_var = script_pubkey;
7263 int8_tArray script_pubkey_arr = init_int8_tArray(script_pubkey_var.datalen, __LINE__);
7264 memcpy(script_pubkey_arr->elems, script_pubkey_var.data, script_pubkey_var.datalen);
7265 js_invoke_function_uuuuuu(j_calls->instance_ptr, 32, (uint32_t)txid_arr, (uint32_t)script_pubkey_arr, 0, 0, 0, 0);
7267 LDKCOption_C2Tuple_usizeTransactionZZ register_output_LDKFilter_jcall(const void* this_arg, LDKWatchedOutput output) {
7268 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) this_arg;
7269 LDKWatchedOutput output_var = output;
7270 uint64_t output_ref = 0;
7271 CHECK_INNER_FIELD_ACCESS_OR_NULL(output_var);
7272 output_ref = tag_ptr(output_var.inner, output_var.is_owned);
7273 uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 33, output_ref, 0, 0, 0, 0, 0);
7274 void* ret_ptr = untag_ptr(ret);
7275 CHECK_ACCESS(ret_ptr);
7276 LDKCOption_C2Tuple_usizeTransactionZZ ret_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(ret_ptr);
7277 FREE(untag_ptr(ret));
7280 static void LDKFilter_JCalls_cloned(LDKFilter* new_obj) {
7281 LDKFilter_JCalls *j_calls = (LDKFilter_JCalls*) new_obj->this_arg;
7282 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
7284 static inline LDKFilter LDKFilter_init (JSValue o) {
7285 LDKFilter_JCalls *calls = MALLOC(sizeof(LDKFilter_JCalls), "LDKFilter_JCalls");
7286 atomic_init(&calls->refcnt, 1);
7287 calls->instance_ptr = o;
7290 .this_arg = (void*) calls,
7291 .register_tx = register_tx_LDKFilter_jcall,
7292 .register_output = register_output_LDKFilter_jcall,
7293 .free = LDKFilter_JCalls_free,
7297 uint64_t __attribute__((export_name("TS_LDKFilter_new"))) TS_LDKFilter_new(JSValue o) {
7298 LDKFilter *res_ptr = MALLOC(sizeof(LDKFilter), "LDKFilter");
7299 *res_ptr = LDKFilter_init(o);
7300 return tag_ptr(res_ptr, true);
7302 void __attribute__((export_name("TS_Filter_register_tx"))) TS_Filter_register_tx(uint64_t this_arg, int8_tArray txid, int8_tArray script_pubkey) {
7303 void* this_arg_ptr = untag_ptr(this_arg);
7304 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7305 LDKFilter* this_arg_conv = (LDKFilter*)this_arg_ptr;
7306 unsigned char txid_arr[32];
7307 CHECK(txid->arr_len == 32);
7308 memcpy(txid_arr, txid->elems, 32); FREE(txid);
7309 unsigned char (*txid_ref)[32] = &txid_arr;
7310 LDKu8slice script_pubkey_ref;
7311 script_pubkey_ref.datalen = script_pubkey->arr_len;
7312 script_pubkey_ref.data = script_pubkey->elems;
7313 (this_arg_conv->register_tx)(this_arg_conv->this_arg, txid_ref, script_pubkey_ref);
7314 FREE(script_pubkey);
7317 uint64_t __attribute__((export_name("TS_Filter_register_output"))) TS_Filter_register_output(uint64_t this_arg, uint64_t output) {
7318 void* this_arg_ptr = untag_ptr(this_arg);
7319 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7320 LDKFilter* this_arg_conv = (LDKFilter*)this_arg_ptr;
7321 LDKWatchedOutput output_conv;
7322 output_conv.inner = untag_ptr(output);
7323 output_conv.is_owned = ptr_is_owned(output);
7324 CHECK_INNER_FIELD_ACCESS_OR_NULL(output_conv);
7325 output_conv = WatchedOutput_clone(&output_conv);
7326 LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ");
7327 *ret_copy = (this_arg_conv->register_output)(this_arg_conv->this_arg, output_conv);
7328 uint64_t ret_ref = tag_ptr(ret_copy, true);
7332 uint32_t __attribute__((export_name("TS_LDKCOption_FilterZ_ty_from_ptr"))) TS_LDKCOption_FilterZ_ty_from_ptr(uint64_t ptr) {
7333 LDKCOption_FilterZ *obj = (LDKCOption_FilterZ*)untag_ptr(ptr);
7335 case LDKCOption_FilterZ_Some: return 0;
7336 case LDKCOption_FilterZ_None: return 1;
7340 uint64_t __attribute__((export_name("TS_LDKCOption_FilterZ_Some_get_some"))) TS_LDKCOption_FilterZ_Some_get_some(uint64_t ptr) {
7341 LDKCOption_FilterZ *obj = (LDKCOption_FilterZ*)untag_ptr(ptr);
7342 assert(obj->tag == LDKCOption_FilterZ_Some);
7343 LDKFilter* some_ret = MALLOC(sizeof(LDKFilter), "LDKFilter");
7344 *some_ret = obj->some;
7345 // WARNING: We likely need to clone here, but no clone is available, so we just do it for Java instances
7346 if ((*some_ret).free == LDKFilter_JCalls_free) {
7347 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
7348 LDKFilter_JCalls_cloned(&(*some_ret));
7350 return tag_ptr(some_ret, true);
7352 static inline struct LDKLockedChannelMonitor *CResult_LockedChannelMonitorNoneZ_get_ok(LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR owner){
7353 CHECK(owner->result_ok);
7354 return &*owner->contents.result;
7356 uint64_t __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_get_ok"))) TS_CResult_LockedChannelMonitorNoneZ_get_ok(uint64_t owner) {
7357 LDKCResult_LockedChannelMonitorNoneZ* owner_conv = (LDKCResult_LockedChannelMonitorNoneZ*)untag_ptr(owner);
7358 LDKLockedChannelMonitor ret_var = *CResult_LockedChannelMonitorNoneZ_get_ok(owner_conv);
7359 uint64_t ret_ref = 0;
7360 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
7361 ret_ref = tag_ptr(ret_var.inner, false);
7365 static inline void CResult_LockedChannelMonitorNoneZ_get_err(LDKCResult_LockedChannelMonitorNoneZ *NONNULL_PTR owner){
7366 CHECK(!owner->result_ok);
7367 return *owner->contents.err;
7369 void __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_get_err"))) TS_CResult_LockedChannelMonitorNoneZ_get_err(uint64_t owner) {
7370 LDKCResult_LockedChannelMonitorNoneZ* owner_conv = (LDKCResult_LockedChannelMonitorNoneZ*)untag_ptr(owner);
7371 CResult_LockedChannelMonitorNoneZ_get_err(owner_conv);
7374 static inline LDKCVec_OutPointZ CVec_OutPointZ_clone(const LDKCVec_OutPointZ *orig) {
7375 LDKCVec_OutPointZ ret = { .data = MALLOC(sizeof(LDKOutPoint) * orig->datalen, "LDKCVec_OutPointZ clone bytes"), .datalen = orig->datalen };
7376 for (size_t i = 0; i < ret.datalen; i++) {
7377 ret.data[i] = OutPoint_clone(&orig->data[i]);
7381 typedef struct LDKMessageSendEventsProvider_JCalls {
7382 atomic_size_t refcnt;
7383 uint32_t instance_ptr;
7384 } LDKMessageSendEventsProvider_JCalls;
7385 static void LDKMessageSendEventsProvider_JCalls_free(void* this_arg) {
7386 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
7387 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
7391 LDKCVec_MessageSendEventZ get_and_clear_pending_msg_events_LDKMessageSendEventsProvider_jcall(const void* this_arg) {
7392 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) this_arg;
7393 uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 34, 0, 0, 0, 0, 0, 0);
7394 LDKCVec_MessageSendEventZ ret_constr;
7395 ret_constr.datalen = ret->arr_len;
7396 if (ret_constr.datalen > 0)
7397 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKMessageSendEvent), "LDKCVec_MessageSendEventZ Elements");
7399 ret_constr.data = NULL;
7400 uint64_t* ret_vals = ret->elems;
7401 for (size_t s = 0; s < ret_constr.datalen; s++) {
7402 uint64_t ret_conv_18 = ret_vals[s];
7403 void* ret_conv_18_ptr = untag_ptr(ret_conv_18);
7404 CHECK_ACCESS(ret_conv_18_ptr);
7405 LDKMessageSendEvent ret_conv_18_conv = *(LDKMessageSendEvent*)(ret_conv_18_ptr);
7406 FREE(untag_ptr(ret_conv_18));
7407 ret_constr.data[s] = ret_conv_18_conv;
7412 static void LDKMessageSendEventsProvider_JCalls_cloned(LDKMessageSendEventsProvider* new_obj) {
7413 LDKMessageSendEventsProvider_JCalls *j_calls = (LDKMessageSendEventsProvider_JCalls*) new_obj->this_arg;
7414 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
7416 static inline LDKMessageSendEventsProvider LDKMessageSendEventsProvider_init (JSValue o) {
7417 LDKMessageSendEventsProvider_JCalls *calls = MALLOC(sizeof(LDKMessageSendEventsProvider_JCalls), "LDKMessageSendEventsProvider_JCalls");
7418 atomic_init(&calls->refcnt, 1);
7419 calls->instance_ptr = o;
7421 LDKMessageSendEventsProvider ret = {
7422 .this_arg = (void*) calls,
7423 .get_and_clear_pending_msg_events = get_and_clear_pending_msg_events_LDKMessageSendEventsProvider_jcall,
7424 .free = LDKMessageSendEventsProvider_JCalls_free,
7428 uint64_t __attribute__((export_name("TS_LDKMessageSendEventsProvider_new"))) TS_LDKMessageSendEventsProvider_new(JSValue o) {
7429 LDKMessageSendEventsProvider *res_ptr = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
7430 *res_ptr = LDKMessageSendEventsProvider_init(o);
7431 return tag_ptr(res_ptr, true);
7433 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) {
7434 void* this_arg_ptr = untag_ptr(this_arg);
7435 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7436 LDKMessageSendEventsProvider* this_arg_conv = (LDKMessageSendEventsProvider*)this_arg_ptr;
7437 LDKCVec_MessageSendEventZ ret_var = (this_arg_conv->get_and_clear_pending_msg_events)(this_arg_conv->this_arg);
7438 uint64_tArray ret_arr = NULL;
7439 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
7440 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
7441 for (size_t s = 0; s < ret_var.datalen; s++) {
7442 LDKMessageSendEvent *ret_conv_18_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
7443 *ret_conv_18_copy = ret_var.data[s];
7444 uint64_t ret_conv_18_ref = tag_ptr(ret_conv_18_copy, true);
7445 ret_arr_ptr[s] = ret_conv_18_ref;
7452 typedef struct LDKEventHandler_JCalls {
7453 atomic_size_t refcnt;
7454 uint32_t instance_ptr;
7455 } LDKEventHandler_JCalls;
7456 static void LDKEventHandler_JCalls_free(void* this_arg) {
7457 LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) this_arg;
7458 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
7462 void handle_event_LDKEventHandler_jcall(const void* this_arg, const LDKEvent * event) {
7463 LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) this_arg;
7464 LDKEvent *ret_event = MALLOC(sizeof(LDKEvent), "LDKEvent ret conversion");
7465 *ret_event = Event_clone(event);
7466 uint64_t ref_event = tag_ptr(ret_event, true);
7467 js_invoke_function_buuuuu(j_calls->instance_ptr, 35, ref_event, 0, 0, 0, 0, 0);
7469 static void LDKEventHandler_JCalls_cloned(LDKEventHandler* new_obj) {
7470 LDKEventHandler_JCalls *j_calls = (LDKEventHandler_JCalls*) new_obj->this_arg;
7471 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
7473 static inline LDKEventHandler LDKEventHandler_init (JSValue o) {
7474 LDKEventHandler_JCalls *calls = MALLOC(sizeof(LDKEventHandler_JCalls), "LDKEventHandler_JCalls");
7475 atomic_init(&calls->refcnt, 1);
7476 calls->instance_ptr = o;
7478 LDKEventHandler ret = {
7479 .this_arg = (void*) calls,
7480 .handle_event = handle_event_LDKEventHandler_jcall,
7481 .free = LDKEventHandler_JCalls_free,
7485 uint64_t __attribute__((export_name("TS_LDKEventHandler_new"))) TS_LDKEventHandler_new(JSValue o) {
7486 LDKEventHandler *res_ptr = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
7487 *res_ptr = LDKEventHandler_init(o);
7488 return tag_ptr(res_ptr, true);
7490 void __attribute__((export_name("TS_EventHandler_handle_event"))) TS_EventHandler_handle_event(uint64_t this_arg, uint64_t event) {
7491 void* this_arg_ptr = untag_ptr(this_arg);
7492 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7493 LDKEventHandler* this_arg_conv = (LDKEventHandler*)this_arg_ptr;
7494 LDKEvent* event_conv = (LDKEvent*)untag_ptr(event);
7495 (this_arg_conv->handle_event)(this_arg_conv->this_arg, event_conv);
7498 typedef struct LDKEventsProvider_JCalls {
7499 atomic_size_t refcnt;
7500 uint32_t instance_ptr;
7501 } LDKEventsProvider_JCalls;
7502 static void LDKEventsProvider_JCalls_free(void* this_arg) {
7503 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
7504 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
7508 void process_pending_events_LDKEventsProvider_jcall(const void* this_arg, LDKEventHandler handler) {
7509 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) this_arg;
7510 LDKEventHandler* handler_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
7511 *handler_ret = handler;
7512 js_invoke_function_buuuuu(j_calls->instance_ptr, 36, tag_ptr(handler_ret, true), 0, 0, 0, 0, 0);
7514 static void LDKEventsProvider_JCalls_cloned(LDKEventsProvider* new_obj) {
7515 LDKEventsProvider_JCalls *j_calls = (LDKEventsProvider_JCalls*) new_obj->this_arg;
7516 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
7518 static inline LDKEventsProvider LDKEventsProvider_init (JSValue o) {
7519 LDKEventsProvider_JCalls *calls = MALLOC(sizeof(LDKEventsProvider_JCalls), "LDKEventsProvider_JCalls");
7520 atomic_init(&calls->refcnt, 1);
7521 calls->instance_ptr = o;
7523 LDKEventsProvider ret = {
7524 .this_arg = (void*) calls,
7525 .process_pending_events = process_pending_events_LDKEventsProvider_jcall,
7526 .free = LDKEventsProvider_JCalls_free,
7530 uint64_t __attribute__((export_name("TS_LDKEventsProvider_new"))) TS_LDKEventsProvider_new(JSValue o) {
7531 LDKEventsProvider *res_ptr = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
7532 *res_ptr = LDKEventsProvider_init(o);
7533 return tag_ptr(res_ptr, true);
7535 void __attribute__((export_name("TS_EventsProvider_process_pending_events"))) TS_EventsProvider_process_pending_events(uint64_t this_arg, uint64_t handler) {
7536 void* this_arg_ptr = untag_ptr(this_arg);
7537 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7538 LDKEventsProvider* this_arg_conv = (LDKEventsProvider*)this_arg_ptr;
7539 void* handler_ptr = untag_ptr(handler);
7540 CHECK_ACCESS(handler_ptr);
7541 LDKEventHandler handler_conv = *(LDKEventHandler*)(handler_ptr);
7542 if (handler_conv.free == LDKEventHandler_JCalls_free) {
7543 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
7544 LDKEventHandler_JCalls_cloned(&handler_conv);
7546 (this_arg_conv->process_pending_events)(this_arg_conv->this_arg, handler_conv);
7549 typedef struct LDKScore_JCalls {
7550 atomic_size_t refcnt;
7551 uint32_t instance_ptr;
7553 static void LDKScore_JCalls_free(void* this_arg) {
7554 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
7555 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
7559 uint64_t channel_penalty_msat_LDKScore_jcall(const void* this_arg, uint64_t short_channel_id, const LDKNodeId * source, const LDKNodeId * target, LDKChannelUsage usage) {
7560 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
7561 int64_t short_channel_id_conv = short_channel_id;
7562 LDKNodeId source_var = *source;
7563 uint64_t source_ref = 0;
7564 source_var = NodeId_clone(&source_var);
7565 CHECK_INNER_FIELD_ACCESS_OR_NULL(source_var);
7566 source_ref = tag_ptr(source_var.inner, source_var.is_owned);
7567 LDKNodeId target_var = *target;
7568 uint64_t target_ref = 0;
7569 target_var = NodeId_clone(&target_var);
7570 CHECK_INNER_FIELD_ACCESS_OR_NULL(target_var);
7571 target_ref = tag_ptr(target_var.inner, target_var.is_owned);
7572 LDKChannelUsage usage_var = usage;
7573 uint64_t usage_ref = 0;
7574 CHECK_INNER_FIELD_ACCESS_OR_NULL(usage_var);
7575 usage_ref = tag_ptr(usage_var.inner, usage_var.is_owned);
7576 return js_invoke_function_bbbbuu(j_calls->instance_ptr, 37, short_channel_id_conv, source_ref, target_ref, usage_ref, 0, 0);
7578 void payment_path_failed_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path, uint64_t short_channel_id) {
7579 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
7580 LDKCVec_RouteHopZ path_var = path;
7581 uint64_tArray path_arr = NULL;
7582 path_arr = init_uint64_tArray(path_var.datalen, __LINE__);
7583 uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8);
7584 for (size_t k = 0; k < path_var.datalen; k++) {
7585 LDKRouteHop path_conv_10_var = path_var.data[k];
7586 uint64_t path_conv_10_ref = 0;
7587 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
7588 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, path_conv_10_var.is_owned);
7589 path_arr_ptr[k] = path_conv_10_ref;
7592 FREE(path_var.data);
7593 int64_t short_channel_id_conv = short_channel_id;
7594 js_invoke_function_ubuuuu(j_calls->instance_ptr, 38, (uint32_t)path_arr, short_channel_id_conv, 0, 0, 0, 0);
7596 void payment_path_successful_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path) {
7597 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
7598 LDKCVec_RouteHopZ path_var = path;
7599 uint64_tArray path_arr = NULL;
7600 path_arr = init_uint64_tArray(path_var.datalen, __LINE__);
7601 uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8);
7602 for (size_t k = 0; k < path_var.datalen; k++) {
7603 LDKRouteHop path_conv_10_var = path_var.data[k];
7604 uint64_t path_conv_10_ref = 0;
7605 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
7606 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, path_conv_10_var.is_owned);
7607 path_arr_ptr[k] = path_conv_10_ref;
7610 FREE(path_var.data);
7611 js_invoke_function_uuuuuu(j_calls->instance_ptr, 39, (uint32_t)path_arr, 0, 0, 0, 0, 0);
7613 void probe_failed_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path, uint64_t short_channel_id) {
7614 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
7615 LDKCVec_RouteHopZ path_var = path;
7616 uint64_tArray path_arr = NULL;
7617 path_arr = init_uint64_tArray(path_var.datalen, __LINE__);
7618 uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8);
7619 for (size_t k = 0; k < path_var.datalen; k++) {
7620 LDKRouteHop path_conv_10_var = path_var.data[k];
7621 uint64_t path_conv_10_ref = 0;
7622 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
7623 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, path_conv_10_var.is_owned);
7624 path_arr_ptr[k] = path_conv_10_ref;
7627 FREE(path_var.data);
7628 int64_t short_channel_id_conv = short_channel_id;
7629 js_invoke_function_ubuuuu(j_calls->instance_ptr, 40, (uint32_t)path_arr, short_channel_id_conv, 0, 0, 0, 0);
7631 void probe_successful_LDKScore_jcall(void* this_arg, LDKCVec_RouteHopZ path) {
7632 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
7633 LDKCVec_RouteHopZ path_var = path;
7634 uint64_tArray path_arr = NULL;
7635 path_arr = init_uint64_tArray(path_var.datalen, __LINE__);
7636 uint64_t *path_arr_ptr = (uint64_t*)(((uint8_t*)path_arr) + 8);
7637 for (size_t k = 0; k < path_var.datalen; k++) {
7638 LDKRouteHop path_conv_10_var = path_var.data[k];
7639 uint64_t path_conv_10_ref = 0;
7640 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_var);
7641 path_conv_10_ref = tag_ptr(path_conv_10_var.inner, path_conv_10_var.is_owned);
7642 path_arr_ptr[k] = path_conv_10_ref;
7645 FREE(path_var.data);
7646 js_invoke_function_uuuuuu(j_calls->instance_ptr, 41, (uint32_t)path_arr, 0, 0, 0, 0, 0);
7648 LDKCVec_u8Z write_LDKScore_jcall(const void* this_arg) {
7649 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) this_arg;
7650 int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 42, 0, 0, 0, 0, 0, 0);
7651 LDKCVec_u8Z ret_ref;
7652 ret_ref.datalen = ret->arr_len;
7653 ret_ref.data = MALLOC(ret_ref.datalen, "LDKCVec_u8Z Bytes");
7654 memcpy(ret_ref.data, ret->elems, ret_ref.datalen); FREE(ret);
7657 static void LDKScore_JCalls_cloned(LDKScore* new_obj) {
7658 LDKScore_JCalls *j_calls = (LDKScore_JCalls*) new_obj->this_arg;
7659 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
7661 static inline LDKScore LDKScore_init (JSValue o) {
7662 LDKScore_JCalls *calls = MALLOC(sizeof(LDKScore_JCalls), "LDKScore_JCalls");
7663 atomic_init(&calls->refcnt, 1);
7664 calls->instance_ptr = o;
7667 .this_arg = (void*) calls,
7668 .channel_penalty_msat = channel_penalty_msat_LDKScore_jcall,
7669 .payment_path_failed = payment_path_failed_LDKScore_jcall,
7670 .payment_path_successful = payment_path_successful_LDKScore_jcall,
7671 .probe_failed = probe_failed_LDKScore_jcall,
7672 .probe_successful = probe_successful_LDKScore_jcall,
7673 .write = write_LDKScore_jcall,
7674 .free = LDKScore_JCalls_free,
7678 uint64_t __attribute__((export_name("TS_LDKScore_new"))) TS_LDKScore_new(JSValue o) {
7679 LDKScore *res_ptr = MALLOC(sizeof(LDKScore), "LDKScore");
7680 *res_ptr = LDKScore_init(o);
7681 return tag_ptr(res_ptr, true);
7683 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) {
7684 void* this_arg_ptr = untag_ptr(this_arg);
7685 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7686 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
7687 LDKNodeId source_conv;
7688 source_conv.inner = untag_ptr(source);
7689 source_conv.is_owned = ptr_is_owned(source);
7690 CHECK_INNER_FIELD_ACCESS_OR_NULL(source_conv);
7691 source_conv.is_owned = false;
7692 LDKNodeId target_conv;
7693 target_conv.inner = untag_ptr(target);
7694 target_conv.is_owned = ptr_is_owned(target);
7695 CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv);
7696 target_conv.is_owned = false;
7697 LDKChannelUsage usage_conv;
7698 usage_conv.inner = untag_ptr(usage);
7699 usage_conv.is_owned = ptr_is_owned(usage);
7700 CHECK_INNER_FIELD_ACCESS_OR_NULL(usage_conv);
7701 usage_conv = ChannelUsage_clone(&usage_conv);
7702 int64_t ret_conv = (this_arg_conv->channel_penalty_msat)(this_arg_conv->this_arg, short_channel_id, &source_conv, &target_conv, usage_conv);
7706 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) {
7707 void* this_arg_ptr = untag_ptr(this_arg);
7708 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7709 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
7710 LDKCVec_RouteHopZ path_constr;
7711 path_constr.datalen = path->arr_len;
7712 if (path_constr.datalen > 0)
7713 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
7715 path_constr.data = NULL;
7716 uint64_t* path_vals = path->elems;
7717 for (size_t k = 0; k < path_constr.datalen; k++) {
7718 uint64_t path_conv_10 = path_vals[k];
7719 LDKRouteHop path_conv_10_conv;
7720 path_conv_10_conv.inner = untag_ptr(path_conv_10);
7721 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
7722 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
7723 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
7724 path_constr.data[k] = path_conv_10_conv;
7727 (this_arg_conv->payment_path_failed)(this_arg_conv->this_arg, path_constr, short_channel_id);
7730 void __attribute__((export_name("TS_Score_payment_path_successful"))) TS_Score_payment_path_successful(uint64_t this_arg, uint64_tArray path) {
7731 void* this_arg_ptr = untag_ptr(this_arg);
7732 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7733 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
7734 LDKCVec_RouteHopZ path_constr;
7735 path_constr.datalen = path->arr_len;
7736 if (path_constr.datalen > 0)
7737 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
7739 path_constr.data = NULL;
7740 uint64_t* path_vals = path->elems;
7741 for (size_t k = 0; k < path_constr.datalen; k++) {
7742 uint64_t path_conv_10 = path_vals[k];
7743 LDKRouteHop path_conv_10_conv;
7744 path_conv_10_conv.inner = untag_ptr(path_conv_10);
7745 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
7746 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
7747 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
7748 path_constr.data[k] = path_conv_10_conv;
7751 (this_arg_conv->payment_path_successful)(this_arg_conv->this_arg, path_constr);
7754 void __attribute__((export_name("TS_Score_probe_failed"))) TS_Score_probe_failed(uint64_t this_arg, uint64_tArray path, int64_t short_channel_id) {
7755 void* this_arg_ptr = untag_ptr(this_arg);
7756 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7757 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
7758 LDKCVec_RouteHopZ path_constr;
7759 path_constr.datalen = path->arr_len;
7760 if (path_constr.datalen > 0)
7761 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
7763 path_constr.data = NULL;
7764 uint64_t* path_vals = path->elems;
7765 for (size_t k = 0; k < path_constr.datalen; k++) {
7766 uint64_t path_conv_10 = path_vals[k];
7767 LDKRouteHop path_conv_10_conv;
7768 path_conv_10_conv.inner = untag_ptr(path_conv_10);
7769 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
7770 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
7771 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
7772 path_constr.data[k] = path_conv_10_conv;
7775 (this_arg_conv->probe_failed)(this_arg_conv->this_arg, path_constr, short_channel_id);
7778 void __attribute__((export_name("TS_Score_probe_successful"))) TS_Score_probe_successful(uint64_t this_arg, uint64_tArray path) {
7779 void* this_arg_ptr = untag_ptr(this_arg);
7780 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7781 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
7782 LDKCVec_RouteHopZ path_constr;
7783 path_constr.datalen = path->arr_len;
7784 if (path_constr.datalen > 0)
7785 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
7787 path_constr.data = NULL;
7788 uint64_t* path_vals = path->elems;
7789 for (size_t k = 0; k < path_constr.datalen; k++) {
7790 uint64_t path_conv_10 = path_vals[k];
7791 LDKRouteHop path_conv_10_conv;
7792 path_conv_10_conv.inner = untag_ptr(path_conv_10);
7793 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
7794 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
7795 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
7796 path_constr.data[k] = path_conv_10_conv;
7799 (this_arg_conv->probe_successful)(this_arg_conv->this_arg, path_constr);
7802 int8_tArray __attribute__((export_name("TS_Score_write"))) TS_Score_write(uint64_t this_arg) {
7803 void* this_arg_ptr = untag_ptr(this_arg);
7804 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7805 LDKScore* this_arg_conv = (LDKScore*)this_arg_ptr;
7806 LDKCVec_u8Z ret_var = (this_arg_conv->write)(this_arg_conv->this_arg);
7807 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
7808 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
7809 CVec_u8Z_free(ret_var);
7813 typedef struct LDKPersister_JCalls {
7814 atomic_size_t refcnt;
7815 uint32_t instance_ptr;
7816 } LDKPersister_JCalls;
7817 static void LDKPersister_JCalls_free(void* this_arg) {
7818 LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg;
7819 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
7823 LDKCResult_NoneErrorZ persist_manager_LDKPersister_jcall(const void* this_arg, const LDKChannelManager * channel_manager) {
7824 LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg;
7825 LDKChannelManager channel_manager_var = *channel_manager;
7826 uint64_t channel_manager_ref = 0;
7827 // WARNING: we may need a move here but no clone is available for LDKChannelManager
7828 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_var);
7829 channel_manager_ref = tag_ptr(channel_manager_var.inner, channel_manager_var.is_owned);
7830 uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 43, channel_manager_ref, 0, 0, 0, 0, 0);
7831 void* ret_ptr = untag_ptr(ret);
7832 CHECK_ACCESS(ret_ptr);
7833 LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr);
7834 FREE(untag_ptr(ret));
7837 LDKCResult_NoneErrorZ persist_graph_LDKPersister_jcall(const void* this_arg, const LDKNetworkGraph * network_graph) {
7838 LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg;
7839 LDKNetworkGraph network_graph_var = *network_graph;
7840 uint64_t network_graph_ref = 0;
7841 // WARNING: we may need a move here but no clone is available for LDKNetworkGraph
7842 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_var);
7843 network_graph_ref = tag_ptr(network_graph_var.inner, network_graph_var.is_owned);
7844 uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 44, network_graph_ref, 0, 0, 0, 0, 0);
7845 void* ret_ptr = untag_ptr(ret);
7846 CHECK_ACCESS(ret_ptr);
7847 LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr);
7848 FREE(untag_ptr(ret));
7851 LDKCResult_NoneErrorZ persist_scorer_LDKPersister_jcall(const void* this_arg, const LDKMultiThreadedLockableScore * scorer) {
7852 LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) this_arg;
7853 LDKMultiThreadedLockableScore scorer_var = *scorer;
7854 uint64_t scorer_ref = 0;
7855 // WARNING: we may need a move here but no clone is available for LDKMultiThreadedLockableScore
7856 CHECK_INNER_FIELD_ACCESS_OR_NULL(scorer_var);
7857 scorer_ref = tag_ptr(scorer_var.inner, scorer_var.is_owned);
7858 uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 45, scorer_ref, 0, 0, 0, 0, 0);
7859 void* ret_ptr = untag_ptr(ret);
7860 CHECK_ACCESS(ret_ptr);
7861 LDKCResult_NoneErrorZ ret_conv = *(LDKCResult_NoneErrorZ*)(ret_ptr);
7862 FREE(untag_ptr(ret));
7865 static void LDKPersister_JCalls_cloned(LDKPersister* new_obj) {
7866 LDKPersister_JCalls *j_calls = (LDKPersister_JCalls*) new_obj->this_arg;
7867 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
7869 static inline LDKPersister LDKPersister_init (JSValue o) {
7870 LDKPersister_JCalls *calls = MALLOC(sizeof(LDKPersister_JCalls), "LDKPersister_JCalls");
7871 atomic_init(&calls->refcnt, 1);
7872 calls->instance_ptr = o;
7874 LDKPersister ret = {
7875 .this_arg = (void*) calls,
7876 .persist_manager = persist_manager_LDKPersister_jcall,
7877 .persist_graph = persist_graph_LDKPersister_jcall,
7878 .persist_scorer = persist_scorer_LDKPersister_jcall,
7879 .free = LDKPersister_JCalls_free,
7883 uint64_t __attribute__((export_name("TS_LDKPersister_new"))) TS_LDKPersister_new(JSValue o) {
7884 LDKPersister *res_ptr = MALLOC(sizeof(LDKPersister), "LDKPersister");
7885 *res_ptr = LDKPersister_init(o);
7886 return tag_ptr(res_ptr, true);
7888 uint64_t __attribute__((export_name("TS_Persister_persist_manager"))) TS_Persister_persist_manager(uint64_t this_arg, uint64_t channel_manager) {
7889 void* this_arg_ptr = untag_ptr(this_arg);
7890 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7891 LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr;
7892 LDKChannelManager channel_manager_conv;
7893 channel_manager_conv.inner = untag_ptr(channel_manager);
7894 channel_manager_conv.is_owned = ptr_is_owned(channel_manager);
7895 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_manager_conv);
7896 channel_manager_conv.is_owned = false;
7897 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
7898 *ret_conv = (this_arg_conv->persist_manager)(this_arg_conv->this_arg, &channel_manager_conv);
7899 return tag_ptr(ret_conv, true);
7902 uint64_t __attribute__((export_name("TS_Persister_persist_graph"))) TS_Persister_persist_graph(uint64_t this_arg, uint64_t network_graph) {
7903 void* this_arg_ptr = untag_ptr(this_arg);
7904 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7905 LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr;
7906 LDKNetworkGraph network_graph_conv;
7907 network_graph_conv.inner = untag_ptr(network_graph);
7908 network_graph_conv.is_owned = ptr_is_owned(network_graph);
7909 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
7910 network_graph_conv.is_owned = false;
7911 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
7912 *ret_conv = (this_arg_conv->persist_graph)(this_arg_conv->this_arg, &network_graph_conv);
7913 return tag_ptr(ret_conv, true);
7916 uint64_t __attribute__((export_name("TS_Persister_persist_scorer"))) TS_Persister_persist_scorer(uint64_t this_arg, uint64_t scorer) {
7917 void* this_arg_ptr = untag_ptr(this_arg);
7918 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7919 LDKPersister* this_arg_conv = (LDKPersister*)this_arg_ptr;
7920 LDKMultiThreadedLockableScore scorer_conv;
7921 scorer_conv.inner = untag_ptr(scorer);
7922 scorer_conv.is_owned = ptr_is_owned(scorer);
7923 CHECK_INNER_FIELD_ACCESS_OR_NULL(scorer_conv);
7924 scorer_conv.is_owned = false;
7925 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
7926 *ret_conv = (this_arg_conv->persist_scorer)(this_arg_conv->this_arg, &scorer_conv);
7927 return tag_ptr(ret_conv, true);
7930 typedef struct LDKListen_JCalls {
7931 atomic_size_t refcnt;
7932 uint32_t instance_ptr;
7934 static void LDKListen_JCalls_free(void* this_arg) {
7935 LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
7936 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
7940 void filtered_block_connected_LDKListen_jcall(const void* this_arg, const uint8_t (* header)[80], LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height) {
7941 LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
7942 int8_tArray header_arr = init_int8_tArray(80, __LINE__);
7943 memcpy(header_arr->elems, *header, 80);
7944 LDKCVec_C2Tuple_usizeTransactionZZ txdata_var = txdata;
7945 uint64_tArray txdata_arr = NULL;
7946 txdata_arr = init_uint64_tArray(txdata_var.datalen, __LINE__);
7947 uint64_t *txdata_arr_ptr = (uint64_t*)(((uint8_t*)txdata_arr) + 8);
7948 for (size_t c = 0; c < txdata_var.datalen; c++) {
7949 LDKC2Tuple_usizeTransactionZ* txdata_conv_28_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
7950 *txdata_conv_28_conv = txdata_var.data[c];
7951 txdata_arr_ptr[c] = tag_ptr(txdata_conv_28_conv, true);
7954 FREE(txdata_var.data);
7955 int32_t height_conv = height;
7956 js_invoke_function_uuuuuu(j_calls->instance_ptr, 46, (uint32_t)header_arr, (uint32_t)txdata_arr, height_conv, 0, 0, 0);
7958 void block_connected_LDKListen_jcall(const void* this_arg, LDKu8slice block, uint32_t height) {
7959 LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
7960 LDKu8slice block_var = block;
7961 int8_tArray block_arr = init_int8_tArray(block_var.datalen, __LINE__);
7962 memcpy(block_arr->elems, block_var.data, block_var.datalen);
7963 int32_t height_conv = height;
7964 js_invoke_function_uuuuuu(j_calls->instance_ptr, 47, (uint32_t)block_arr, height_conv, 0, 0, 0, 0);
7966 void block_disconnected_LDKListen_jcall(const void* this_arg, const uint8_t (* header)[80], uint32_t height) {
7967 LDKListen_JCalls *j_calls = (LDKListen_JCalls*) this_arg;
7968 int8_tArray header_arr = init_int8_tArray(80, __LINE__);
7969 memcpy(header_arr->elems, *header, 80);
7970 int32_t height_conv = height;
7971 js_invoke_function_uuuuuu(j_calls->instance_ptr, 48, (uint32_t)header_arr, height_conv, 0, 0, 0, 0);
7973 static void LDKListen_JCalls_cloned(LDKListen* new_obj) {
7974 LDKListen_JCalls *j_calls = (LDKListen_JCalls*) new_obj->this_arg;
7975 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
7977 static inline LDKListen LDKListen_init (JSValue o) {
7978 LDKListen_JCalls *calls = MALLOC(sizeof(LDKListen_JCalls), "LDKListen_JCalls");
7979 atomic_init(&calls->refcnt, 1);
7980 calls->instance_ptr = o;
7983 .this_arg = (void*) calls,
7984 .filtered_block_connected = filtered_block_connected_LDKListen_jcall,
7985 .block_connected = block_connected_LDKListen_jcall,
7986 .block_disconnected = block_disconnected_LDKListen_jcall,
7987 .free = LDKListen_JCalls_free,
7991 uint64_t __attribute__((export_name("TS_LDKListen_new"))) TS_LDKListen_new(JSValue o) {
7992 LDKListen *res_ptr = MALLOC(sizeof(LDKListen), "LDKListen");
7993 *res_ptr = LDKListen_init(o);
7994 return tag_ptr(res_ptr, true);
7996 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) {
7997 void* this_arg_ptr = untag_ptr(this_arg);
7998 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
7999 LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr;
8000 unsigned char header_arr[80];
8001 CHECK(header->arr_len == 80);
8002 memcpy(header_arr, header->elems, 80); FREE(header);
8003 unsigned char (*header_ref)[80] = &header_arr;
8004 LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr;
8005 txdata_constr.datalen = txdata->arr_len;
8006 if (txdata_constr.datalen > 0)
8007 txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
8009 txdata_constr.data = NULL;
8010 uint64_t* txdata_vals = txdata->elems;
8011 for (size_t c = 0; c < txdata_constr.datalen; c++) {
8012 uint64_t txdata_conv_28 = txdata_vals[c];
8013 void* txdata_conv_28_ptr = untag_ptr(txdata_conv_28);
8014 CHECK_ACCESS(txdata_conv_28_ptr);
8015 LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr);
8016 txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(txdata_conv_28));
8017 txdata_constr.data[c] = txdata_conv_28_conv;
8020 (this_arg_conv->filtered_block_connected)(this_arg_conv->this_arg, header_ref, txdata_constr, height);
8023 void __attribute__((export_name("TS_Listen_block_connected"))) TS_Listen_block_connected(uint64_t this_arg, int8_tArray block, int32_t height) {
8024 void* this_arg_ptr = untag_ptr(this_arg);
8025 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8026 LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr;
8027 LDKu8slice block_ref;
8028 block_ref.datalen = block->arr_len;
8029 block_ref.data = block->elems;
8030 (this_arg_conv->block_connected)(this_arg_conv->this_arg, block_ref, height);
8034 void __attribute__((export_name("TS_Listen_block_disconnected"))) TS_Listen_block_disconnected(uint64_t this_arg, int8_tArray header, int32_t height) {
8035 void* this_arg_ptr = untag_ptr(this_arg);
8036 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8037 LDKListen* this_arg_conv = (LDKListen*)this_arg_ptr;
8038 unsigned char header_arr[80];
8039 CHECK(header->arr_len == 80);
8040 memcpy(header_arr, header->elems, 80); FREE(header);
8041 unsigned char (*header_ref)[80] = &header_arr;
8042 (this_arg_conv->block_disconnected)(this_arg_conv->this_arg, header_ref, height);
8045 typedef struct LDKConfirm_JCalls {
8046 atomic_size_t refcnt;
8047 uint32_t instance_ptr;
8048 } LDKConfirm_JCalls;
8049 static void LDKConfirm_JCalls_free(void* this_arg) {
8050 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
8051 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
8055 void transactions_confirmed_LDKConfirm_jcall(const void* this_arg, const uint8_t (* header)[80], LDKCVec_C2Tuple_usizeTransactionZZ txdata, uint32_t height) {
8056 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
8057 int8_tArray header_arr = init_int8_tArray(80, __LINE__);
8058 memcpy(header_arr->elems, *header, 80);
8059 LDKCVec_C2Tuple_usizeTransactionZZ txdata_var = txdata;
8060 uint64_tArray txdata_arr = NULL;
8061 txdata_arr = init_uint64_tArray(txdata_var.datalen, __LINE__);
8062 uint64_t *txdata_arr_ptr = (uint64_t*)(((uint8_t*)txdata_arr) + 8);
8063 for (size_t c = 0; c < txdata_var.datalen; c++) {
8064 LDKC2Tuple_usizeTransactionZ* txdata_conv_28_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
8065 *txdata_conv_28_conv = txdata_var.data[c];
8066 txdata_arr_ptr[c] = tag_ptr(txdata_conv_28_conv, true);
8069 FREE(txdata_var.data);
8070 int32_t height_conv = height;
8071 js_invoke_function_uuuuuu(j_calls->instance_ptr, 49, (uint32_t)header_arr, (uint32_t)txdata_arr, height_conv, 0, 0, 0);
8073 void transaction_unconfirmed_LDKConfirm_jcall(const void* this_arg, const uint8_t (* txid)[32]) {
8074 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
8075 int8_tArray txid_arr = init_int8_tArray(32, __LINE__);
8076 memcpy(txid_arr->elems, *txid, 32);
8077 js_invoke_function_uuuuuu(j_calls->instance_ptr, 50, (uint32_t)txid_arr, 0, 0, 0, 0, 0);
8079 void best_block_updated_LDKConfirm_jcall(const void* this_arg, const uint8_t (* header)[80], uint32_t height) {
8080 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
8081 int8_tArray header_arr = init_int8_tArray(80, __LINE__);
8082 memcpy(header_arr->elems, *header, 80);
8083 int32_t height_conv = height;
8084 js_invoke_function_uuuuuu(j_calls->instance_ptr, 51, (uint32_t)header_arr, height_conv, 0, 0, 0, 0);
8086 LDKCVec_TxidZ get_relevant_txids_LDKConfirm_jcall(const void* this_arg) {
8087 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) this_arg;
8088 ptrArray ret = (ptrArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 52, 0, 0, 0, 0, 0, 0);
8089 LDKCVec_TxidZ ret_constr;
8090 ret_constr.datalen = ret->arr_len;
8091 if (ret_constr.datalen > 0)
8092 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_TxidZ Elements");
8094 ret_constr.data = NULL;
8095 int8_tArray* ret_vals = (void*) ret->elems;
8096 for (size_t m = 0; m < ret_constr.datalen; m++) {
8097 int8_tArray ret_conv_12 = ret_vals[m];
8098 LDKThirtyTwoBytes ret_conv_12_ref;
8099 CHECK(ret_conv_12->arr_len == 32);
8100 memcpy(ret_conv_12_ref.data, ret_conv_12->elems, 32); FREE(ret_conv_12);
8101 ret_constr.data[m] = ret_conv_12_ref;
8106 static void LDKConfirm_JCalls_cloned(LDKConfirm* new_obj) {
8107 LDKConfirm_JCalls *j_calls = (LDKConfirm_JCalls*) new_obj->this_arg;
8108 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
8110 static inline LDKConfirm LDKConfirm_init (JSValue o) {
8111 LDKConfirm_JCalls *calls = MALLOC(sizeof(LDKConfirm_JCalls), "LDKConfirm_JCalls");
8112 atomic_init(&calls->refcnt, 1);
8113 calls->instance_ptr = o;
8116 .this_arg = (void*) calls,
8117 .transactions_confirmed = transactions_confirmed_LDKConfirm_jcall,
8118 .transaction_unconfirmed = transaction_unconfirmed_LDKConfirm_jcall,
8119 .best_block_updated = best_block_updated_LDKConfirm_jcall,
8120 .get_relevant_txids = get_relevant_txids_LDKConfirm_jcall,
8121 .free = LDKConfirm_JCalls_free,
8125 uint64_t __attribute__((export_name("TS_LDKConfirm_new"))) TS_LDKConfirm_new(JSValue o) {
8126 LDKConfirm *res_ptr = MALLOC(sizeof(LDKConfirm), "LDKConfirm");
8127 *res_ptr = LDKConfirm_init(o);
8128 return tag_ptr(res_ptr, true);
8130 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) {
8131 void* this_arg_ptr = untag_ptr(this_arg);
8132 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8133 LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
8134 unsigned char header_arr[80];
8135 CHECK(header->arr_len == 80);
8136 memcpy(header_arr, header->elems, 80); FREE(header);
8137 unsigned char (*header_ref)[80] = &header_arr;
8138 LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr;
8139 txdata_constr.datalen = txdata->arr_len;
8140 if (txdata_constr.datalen > 0)
8141 txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
8143 txdata_constr.data = NULL;
8144 uint64_t* txdata_vals = txdata->elems;
8145 for (size_t c = 0; c < txdata_constr.datalen; c++) {
8146 uint64_t txdata_conv_28 = txdata_vals[c];
8147 void* txdata_conv_28_ptr = untag_ptr(txdata_conv_28);
8148 CHECK_ACCESS(txdata_conv_28_ptr);
8149 LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr);
8150 txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(txdata_conv_28));
8151 txdata_constr.data[c] = txdata_conv_28_conv;
8154 (this_arg_conv->transactions_confirmed)(this_arg_conv->this_arg, header_ref, txdata_constr, height);
8157 void __attribute__((export_name("TS_Confirm_transaction_unconfirmed"))) TS_Confirm_transaction_unconfirmed(uint64_t this_arg, int8_tArray txid) {
8158 void* this_arg_ptr = untag_ptr(this_arg);
8159 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8160 LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
8161 unsigned char txid_arr[32];
8162 CHECK(txid->arr_len == 32);
8163 memcpy(txid_arr, txid->elems, 32); FREE(txid);
8164 unsigned char (*txid_ref)[32] = &txid_arr;
8165 (this_arg_conv->transaction_unconfirmed)(this_arg_conv->this_arg, txid_ref);
8168 void __attribute__((export_name("TS_Confirm_best_block_updated"))) TS_Confirm_best_block_updated(uint64_t this_arg, int8_tArray header, int32_t height) {
8169 void* this_arg_ptr = untag_ptr(this_arg);
8170 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8171 LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
8172 unsigned char header_arr[80];
8173 CHECK(header->arr_len == 80);
8174 memcpy(header_arr, header->elems, 80); FREE(header);
8175 unsigned char (*header_ref)[80] = &header_arr;
8176 (this_arg_conv->best_block_updated)(this_arg_conv->this_arg, header_ref, height);
8179 ptrArray __attribute__((export_name("TS_Confirm_get_relevant_txids"))) TS_Confirm_get_relevant_txids(uint64_t this_arg) {
8180 void* this_arg_ptr = untag_ptr(this_arg);
8181 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8182 LDKConfirm* this_arg_conv = (LDKConfirm*)this_arg_ptr;
8183 LDKCVec_TxidZ ret_var = (this_arg_conv->get_relevant_txids)(this_arg_conv->this_arg);
8184 ptrArray ret_arr = NULL;
8185 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
8186 int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8);
8187 for (size_t m = 0; m < ret_var.datalen; m++) {
8188 int8_tArray ret_conv_12_arr = init_int8_tArray(32, __LINE__);
8189 memcpy(ret_conv_12_arr->elems, ret_var.data[m].data, 32);
8190 ret_arr_ptr[m] = ret_conv_12_arr;
8197 typedef struct LDKPersist_JCalls {
8198 atomic_size_t refcnt;
8199 uint32_t instance_ptr;
8200 } LDKPersist_JCalls;
8201 static void LDKPersist_JCalls_free(void* this_arg) {
8202 LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg;
8203 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
8207 LDKCResult_NoneChannelMonitorUpdateErrZ persist_new_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) {
8208 LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg;
8209 LDKOutPoint channel_id_var = channel_id;
8210 uint64_t channel_id_ref = 0;
8211 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var);
8212 channel_id_ref = tag_ptr(channel_id_var.inner, channel_id_var.is_owned);
8213 LDKChannelMonitor data_var = *data;
8214 uint64_t data_ref = 0;
8215 data_var = ChannelMonitor_clone(&data_var);
8216 CHECK_INNER_FIELD_ACCESS_OR_NULL(data_var);
8217 data_ref = tag_ptr(data_var.inner, data_var.is_owned);
8218 LDKMonitorUpdateId update_id_var = update_id;
8219 uint64_t update_id_ref = 0;
8220 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_var);
8221 update_id_ref = tag_ptr(update_id_var.inner, update_id_var.is_owned);
8222 uint32_t ret = js_invoke_function_bbbuuu(j_calls->instance_ptr, 53, channel_id_ref, data_ref, update_id_ref, 0, 0, 0);
8223 void* ret_ptr = untag_ptr(ret);
8224 CHECK_ACCESS(ret_ptr);
8225 LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
8226 FREE(untag_ptr(ret));
8229 LDKCResult_NoneChannelMonitorUpdateErrZ update_persisted_channel_LDKPersist_jcall(const void* this_arg, LDKOutPoint channel_id, const LDKChannelMonitorUpdate * update, const LDKChannelMonitor * data, LDKMonitorUpdateId update_id) {
8230 LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) this_arg;
8231 LDKOutPoint channel_id_var = channel_id;
8232 uint64_t channel_id_ref = 0;
8233 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_var);
8234 channel_id_ref = tag_ptr(channel_id_var.inner, channel_id_var.is_owned);
8235 LDKChannelMonitorUpdate update_var = *update;
8236 uint64_t update_ref = 0;
8237 update_var = ChannelMonitorUpdate_clone(&update_var);
8238 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_var);
8239 update_ref = tag_ptr(update_var.inner, update_var.is_owned);
8240 LDKChannelMonitor data_var = *data;
8241 uint64_t data_ref = 0;
8242 data_var = ChannelMonitor_clone(&data_var);
8243 CHECK_INNER_FIELD_ACCESS_OR_NULL(data_var);
8244 data_ref = tag_ptr(data_var.inner, data_var.is_owned);
8245 LDKMonitorUpdateId update_id_var = update_id;
8246 uint64_t update_id_ref = 0;
8247 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_var);
8248 update_id_ref = tag_ptr(update_id_var.inner, update_id_var.is_owned);
8249 uint32_t ret = js_invoke_function_bbbbuu(j_calls->instance_ptr, 54, channel_id_ref, update_ref, data_ref, update_id_ref, 0, 0);
8250 void* ret_ptr = untag_ptr(ret);
8251 CHECK_ACCESS(ret_ptr);
8252 LDKCResult_NoneChannelMonitorUpdateErrZ ret_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(ret_ptr);
8253 FREE(untag_ptr(ret));
8256 static void LDKPersist_JCalls_cloned(LDKPersist* new_obj) {
8257 LDKPersist_JCalls *j_calls = (LDKPersist_JCalls*) new_obj->this_arg;
8258 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
8260 static inline LDKPersist LDKPersist_init (JSValue o) {
8261 LDKPersist_JCalls *calls = MALLOC(sizeof(LDKPersist_JCalls), "LDKPersist_JCalls");
8262 atomic_init(&calls->refcnt, 1);
8263 calls->instance_ptr = o;
8266 .this_arg = (void*) calls,
8267 .persist_new_channel = persist_new_channel_LDKPersist_jcall,
8268 .update_persisted_channel = update_persisted_channel_LDKPersist_jcall,
8269 .free = LDKPersist_JCalls_free,
8273 uint64_t __attribute__((export_name("TS_LDKPersist_new"))) TS_LDKPersist_new(JSValue o) {
8274 LDKPersist *res_ptr = MALLOC(sizeof(LDKPersist), "LDKPersist");
8275 *res_ptr = LDKPersist_init(o);
8276 return tag_ptr(res_ptr, true);
8278 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) {
8279 void* this_arg_ptr = untag_ptr(this_arg);
8280 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8281 LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr;
8282 LDKOutPoint channel_id_conv;
8283 channel_id_conv.inner = untag_ptr(channel_id);
8284 channel_id_conv.is_owned = ptr_is_owned(channel_id);
8285 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv);
8286 channel_id_conv = OutPoint_clone(&channel_id_conv);
8287 LDKChannelMonitor data_conv;
8288 data_conv.inner = untag_ptr(data);
8289 data_conv.is_owned = ptr_is_owned(data);
8290 CHECK_INNER_FIELD_ACCESS_OR_NULL(data_conv);
8291 data_conv.is_owned = false;
8292 LDKMonitorUpdateId update_id_conv;
8293 update_id_conv.inner = untag_ptr(update_id);
8294 update_id_conv.is_owned = ptr_is_owned(update_id);
8295 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_conv);
8296 update_id_conv = MonitorUpdateId_clone(&update_id_conv);
8297 LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
8298 *ret_conv = (this_arg_conv->persist_new_channel)(this_arg_conv->this_arg, channel_id_conv, &data_conv, update_id_conv);
8299 return tag_ptr(ret_conv, true);
8302 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) {
8303 void* this_arg_ptr = untag_ptr(this_arg);
8304 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8305 LDKPersist* this_arg_conv = (LDKPersist*)this_arg_ptr;
8306 LDKOutPoint channel_id_conv;
8307 channel_id_conv.inner = untag_ptr(channel_id);
8308 channel_id_conv.is_owned = ptr_is_owned(channel_id);
8309 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_id_conv);
8310 channel_id_conv = OutPoint_clone(&channel_id_conv);
8311 LDKChannelMonitorUpdate update_conv;
8312 update_conv.inner = untag_ptr(update);
8313 update_conv.is_owned = ptr_is_owned(update);
8314 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_conv);
8315 update_conv.is_owned = false;
8316 LDKChannelMonitor data_conv;
8317 data_conv.inner = untag_ptr(data);
8318 data_conv.is_owned = ptr_is_owned(data);
8319 CHECK_INNER_FIELD_ACCESS_OR_NULL(data_conv);
8320 data_conv.is_owned = false;
8321 LDKMonitorUpdateId update_id_conv;
8322 update_id_conv.inner = untag_ptr(update_id);
8323 update_id_conv.is_owned = ptr_is_owned(update_id);
8324 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_id_conv);
8325 update_id_conv = MonitorUpdateId_clone(&update_id_conv);
8326 LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
8327 *ret_conv = (this_arg_conv->update_persisted_channel)(this_arg_conv->this_arg, channel_id_conv, &update_conv, &data_conv, update_id_conv);
8328 return tag_ptr(ret_conv, true);
8331 typedef struct LDKChannelMessageHandler_JCalls {
8332 atomic_size_t refcnt;
8333 uint32_t instance_ptr;
8334 LDKMessageSendEventsProvider_JCalls* MessageSendEventsProvider;
8335 } LDKChannelMessageHandler_JCalls;
8336 static void LDKChannelMessageHandler_JCalls_free(void* this_arg) {
8337 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8338 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
8342 void handle_open_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKOpenChannel * msg) {
8343 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8344 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8345 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8346 LDKInitFeatures their_features_var = their_features;
8347 uint64_t their_features_ref = 0;
8348 CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_var);
8349 their_features_ref = tag_ptr(their_features_var.inner, their_features_var.is_owned);
8350 LDKOpenChannel msg_var = *msg;
8351 uint64_t msg_ref = 0;
8352 msg_var = OpenChannel_clone(&msg_var);
8353 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8354 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8355 js_invoke_function_ubbuuu(j_calls->instance_ptr, 55, (uint32_t)their_node_id_arr, their_features_ref, msg_ref, 0, 0, 0);
8357 void handle_accept_channel_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKInitFeatures their_features, const LDKAcceptChannel * msg) {
8358 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8359 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8360 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8361 LDKInitFeatures their_features_var = their_features;
8362 uint64_t their_features_ref = 0;
8363 CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_var);
8364 their_features_ref = tag_ptr(their_features_var.inner, their_features_var.is_owned);
8365 LDKAcceptChannel msg_var = *msg;
8366 uint64_t msg_ref = 0;
8367 msg_var = AcceptChannel_clone(&msg_var);
8368 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8369 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8370 js_invoke_function_ubbuuu(j_calls->instance_ptr, 56, (uint32_t)their_node_id_arr, their_features_ref, msg_ref, 0, 0, 0);
8372 void handle_funding_created_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingCreated * msg) {
8373 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8374 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8375 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8376 LDKFundingCreated msg_var = *msg;
8377 uint64_t msg_ref = 0;
8378 msg_var = FundingCreated_clone(&msg_var);
8379 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8380 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8381 js_invoke_function_ubuuuu(j_calls->instance_ptr, 57, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
8383 void handle_funding_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKFundingSigned * msg) {
8384 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8385 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8386 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8387 LDKFundingSigned msg_var = *msg;
8388 uint64_t msg_ref = 0;
8389 msg_var = FundingSigned_clone(&msg_var);
8390 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8391 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8392 js_invoke_function_ubuuuu(j_calls->instance_ptr, 58, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
8394 void handle_channel_ready_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReady * msg) {
8395 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8396 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8397 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8398 LDKChannelReady msg_var = *msg;
8399 uint64_t msg_ref = 0;
8400 msg_var = ChannelReady_clone(&msg_var);
8401 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8402 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8403 js_invoke_function_ubuuuu(j_calls->instance_ptr, 59, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
8405 void handle_shutdown_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInitFeatures * their_features, const LDKShutdown * msg) {
8406 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8407 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8408 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8409 LDKInitFeatures their_features_var = *their_features;
8410 uint64_t their_features_ref = 0;
8411 their_features_var = InitFeatures_clone(&their_features_var);
8412 CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_var);
8413 their_features_ref = tag_ptr(their_features_var.inner, their_features_var.is_owned);
8414 LDKShutdown msg_var = *msg;
8415 uint64_t msg_ref = 0;
8416 msg_var = Shutdown_clone(&msg_var);
8417 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8418 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8419 js_invoke_function_ubbuuu(j_calls->instance_ptr, 60, (uint32_t)their_node_id_arr, their_features_ref, msg_ref, 0, 0, 0);
8421 void handle_closing_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKClosingSigned * msg) {
8422 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8423 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8424 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8425 LDKClosingSigned msg_var = *msg;
8426 uint64_t msg_ref = 0;
8427 msg_var = ClosingSigned_clone(&msg_var);
8428 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8429 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8430 js_invoke_function_ubuuuu(j_calls->instance_ptr, 61, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
8432 void handle_update_add_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateAddHTLC * msg) {
8433 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8434 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8435 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8436 LDKUpdateAddHTLC msg_var = *msg;
8437 uint64_t msg_ref = 0;
8438 msg_var = UpdateAddHTLC_clone(&msg_var);
8439 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8440 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8441 js_invoke_function_ubuuuu(j_calls->instance_ptr, 62, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
8443 void handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFulfillHTLC * msg) {
8444 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8445 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8446 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8447 LDKUpdateFulfillHTLC msg_var = *msg;
8448 uint64_t msg_ref = 0;
8449 msg_var = UpdateFulfillHTLC_clone(&msg_var);
8450 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8451 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8452 js_invoke_function_ubuuuu(j_calls->instance_ptr, 63, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
8454 void handle_update_fail_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailHTLC * msg) {
8455 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8456 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8457 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8458 LDKUpdateFailHTLC msg_var = *msg;
8459 uint64_t msg_ref = 0;
8460 msg_var = UpdateFailHTLC_clone(&msg_var);
8461 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8462 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8463 js_invoke_function_ubuuuu(j_calls->instance_ptr, 64, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
8465 void handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFailMalformedHTLC * msg) {
8466 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8467 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8468 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8469 LDKUpdateFailMalformedHTLC msg_var = *msg;
8470 uint64_t msg_ref = 0;
8471 msg_var = UpdateFailMalformedHTLC_clone(&msg_var);
8472 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8473 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8474 js_invoke_function_ubuuuu(j_calls->instance_ptr, 65, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
8476 void handle_commitment_signed_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKCommitmentSigned * msg) {
8477 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8478 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8479 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8480 LDKCommitmentSigned msg_var = *msg;
8481 uint64_t msg_ref = 0;
8482 msg_var = CommitmentSigned_clone(&msg_var);
8483 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8484 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8485 js_invoke_function_ubuuuu(j_calls->instance_ptr, 66, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
8487 void handle_revoke_and_ack_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKRevokeAndACK * msg) {
8488 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8489 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8490 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8491 LDKRevokeAndACK msg_var = *msg;
8492 uint64_t msg_ref = 0;
8493 msg_var = RevokeAndACK_clone(&msg_var);
8494 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8495 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8496 js_invoke_function_ubuuuu(j_calls->instance_ptr, 67, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
8498 void handle_update_fee_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKUpdateFee * msg) {
8499 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8500 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8501 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8502 LDKUpdateFee msg_var = *msg;
8503 uint64_t msg_ref = 0;
8504 msg_var = UpdateFee_clone(&msg_var);
8505 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8506 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8507 js_invoke_function_ubuuuu(j_calls->instance_ptr, 68, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
8509 void handle_announcement_signatures_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKAnnouncementSignatures * msg) {
8510 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8511 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8512 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8513 LDKAnnouncementSignatures msg_var = *msg;
8514 uint64_t msg_ref = 0;
8515 msg_var = AnnouncementSignatures_clone(&msg_var);
8516 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8517 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8518 js_invoke_function_ubuuuu(j_calls->instance_ptr, 69, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
8520 void peer_disconnected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, bool no_connection_possible) {
8521 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8522 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8523 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8524 jboolean no_connection_possible_conv = no_connection_possible;
8525 js_invoke_function_uuuuuu(j_calls->instance_ptr, 70, (uint32_t)their_node_id_arr, no_connection_possible_conv, 0, 0, 0, 0);
8527 void peer_connected_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * msg) {
8528 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8529 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8530 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8531 LDKInit msg_var = *msg;
8532 uint64_t msg_ref = 0;
8533 msg_var = Init_clone(&msg_var);
8534 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8535 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8536 js_invoke_function_ubuuuu(j_calls->instance_ptr, 71, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
8538 void handle_channel_reestablish_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelReestablish * msg) {
8539 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8540 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8541 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8542 LDKChannelReestablish msg_var = *msg;
8543 uint64_t msg_ref = 0;
8544 msg_var = ChannelReestablish_clone(&msg_var);
8545 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8546 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8547 js_invoke_function_ubuuuu(j_calls->instance_ptr, 72, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
8549 void handle_channel_update_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKChannelUpdate * msg) {
8550 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8551 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8552 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8553 LDKChannelUpdate msg_var = *msg;
8554 uint64_t msg_ref = 0;
8555 msg_var = ChannelUpdate_clone(&msg_var);
8556 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8557 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8558 js_invoke_function_ubuuuu(j_calls->instance_ptr, 73, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
8560 void handle_error_LDKChannelMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKErrorMessage * msg) {
8561 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) this_arg;
8562 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
8563 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
8564 LDKErrorMessage msg_var = *msg;
8565 uint64_t msg_ref = 0;
8566 msg_var = ErrorMessage_clone(&msg_var);
8567 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8568 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8569 js_invoke_function_ubuuuu(j_calls->instance_ptr, 74, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
8571 static void LDKChannelMessageHandler_JCalls_cloned(LDKChannelMessageHandler* new_obj) {
8572 LDKChannelMessageHandler_JCalls *j_calls = (LDKChannelMessageHandler_JCalls*) new_obj->this_arg;
8573 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
8574 atomic_fetch_add_explicit(&j_calls->MessageSendEventsProvider->refcnt, 1, memory_order_release);
8576 static inline LDKChannelMessageHandler LDKChannelMessageHandler_init (JSValue o, JSValue MessageSendEventsProvider) {
8577 LDKChannelMessageHandler_JCalls *calls = MALLOC(sizeof(LDKChannelMessageHandler_JCalls), "LDKChannelMessageHandler_JCalls");
8578 atomic_init(&calls->refcnt, 1);
8579 calls->instance_ptr = o;
8581 LDKChannelMessageHandler ret = {
8582 .this_arg = (void*) calls,
8583 .handle_open_channel = handle_open_channel_LDKChannelMessageHandler_jcall,
8584 .handle_accept_channel = handle_accept_channel_LDKChannelMessageHandler_jcall,
8585 .handle_funding_created = handle_funding_created_LDKChannelMessageHandler_jcall,
8586 .handle_funding_signed = handle_funding_signed_LDKChannelMessageHandler_jcall,
8587 .handle_channel_ready = handle_channel_ready_LDKChannelMessageHandler_jcall,
8588 .handle_shutdown = handle_shutdown_LDKChannelMessageHandler_jcall,
8589 .handle_closing_signed = handle_closing_signed_LDKChannelMessageHandler_jcall,
8590 .handle_update_add_htlc = handle_update_add_htlc_LDKChannelMessageHandler_jcall,
8591 .handle_update_fulfill_htlc = handle_update_fulfill_htlc_LDKChannelMessageHandler_jcall,
8592 .handle_update_fail_htlc = handle_update_fail_htlc_LDKChannelMessageHandler_jcall,
8593 .handle_update_fail_malformed_htlc = handle_update_fail_malformed_htlc_LDKChannelMessageHandler_jcall,
8594 .handle_commitment_signed = handle_commitment_signed_LDKChannelMessageHandler_jcall,
8595 .handle_revoke_and_ack = handle_revoke_and_ack_LDKChannelMessageHandler_jcall,
8596 .handle_update_fee = handle_update_fee_LDKChannelMessageHandler_jcall,
8597 .handle_announcement_signatures = handle_announcement_signatures_LDKChannelMessageHandler_jcall,
8598 .peer_disconnected = peer_disconnected_LDKChannelMessageHandler_jcall,
8599 .peer_connected = peer_connected_LDKChannelMessageHandler_jcall,
8600 .handle_channel_reestablish = handle_channel_reestablish_LDKChannelMessageHandler_jcall,
8601 .handle_channel_update = handle_channel_update_LDKChannelMessageHandler_jcall,
8602 .handle_error = handle_error_LDKChannelMessageHandler_jcall,
8603 .free = LDKChannelMessageHandler_JCalls_free,
8604 .MessageSendEventsProvider = LDKMessageSendEventsProvider_init(MessageSendEventsProvider),
8606 calls->MessageSendEventsProvider = ret.MessageSendEventsProvider.this_arg;
8609 uint64_t __attribute__((export_name("TS_LDKChannelMessageHandler_new"))) TS_LDKChannelMessageHandler_new(JSValue o, JSValue MessageSendEventsProvider) {
8610 LDKChannelMessageHandler *res_ptr = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
8611 *res_ptr = LDKChannelMessageHandler_init(o, MessageSendEventsProvider);
8612 return tag_ptr(res_ptr, true);
8614 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) {
8615 void* this_arg_ptr = untag_ptr(this_arg);
8616 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8617 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
8618 LDKPublicKey their_node_id_ref;
8619 CHECK(their_node_id->arr_len == 33);
8620 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
8621 LDKInitFeatures their_features_conv;
8622 their_features_conv.inner = untag_ptr(their_features);
8623 their_features_conv.is_owned = ptr_is_owned(their_features);
8624 CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_conv);
8625 their_features_conv = InitFeatures_clone(&their_features_conv);
8626 LDKOpenChannel msg_conv;
8627 msg_conv.inner = untag_ptr(msg);
8628 msg_conv.is_owned = ptr_is_owned(msg);
8629 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
8630 msg_conv.is_owned = false;
8631 (this_arg_conv->handle_open_channel)(this_arg_conv->this_arg, their_node_id_ref, their_features_conv, &msg_conv);
8634 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) {
8635 void* this_arg_ptr = untag_ptr(this_arg);
8636 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8637 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
8638 LDKPublicKey their_node_id_ref;
8639 CHECK(their_node_id->arr_len == 33);
8640 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
8641 LDKInitFeatures their_features_conv;
8642 their_features_conv.inner = untag_ptr(their_features);
8643 their_features_conv.is_owned = ptr_is_owned(their_features);
8644 CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_conv);
8645 their_features_conv = InitFeatures_clone(&their_features_conv);
8646 LDKAcceptChannel msg_conv;
8647 msg_conv.inner = untag_ptr(msg);
8648 msg_conv.is_owned = ptr_is_owned(msg);
8649 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
8650 msg_conv.is_owned = false;
8651 (this_arg_conv->handle_accept_channel)(this_arg_conv->this_arg, their_node_id_ref, their_features_conv, &msg_conv);
8654 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) {
8655 void* this_arg_ptr = untag_ptr(this_arg);
8656 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8657 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
8658 LDKPublicKey their_node_id_ref;
8659 CHECK(their_node_id->arr_len == 33);
8660 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
8661 LDKFundingCreated msg_conv;
8662 msg_conv.inner = untag_ptr(msg);
8663 msg_conv.is_owned = ptr_is_owned(msg);
8664 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
8665 msg_conv.is_owned = false;
8666 (this_arg_conv->handle_funding_created)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
8669 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) {
8670 void* this_arg_ptr = untag_ptr(this_arg);
8671 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8672 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
8673 LDKPublicKey their_node_id_ref;
8674 CHECK(their_node_id->arr_len == 33);
8675 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
8676 LDKFundingSigned msg_conv;
8677 msg_conv.inner = untag_ptr(msg);
8678 msg_conv.is_owned = ptr_is_owned(msg);
8679 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
8680 msg_conv.is_owned = false;
8681 (this_arg_conv->handle_funding_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
8684 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) {
8685 void* this_arg_ptr = untag_ptr(this_arg);
8686 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8687 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
8688 LDKPublicKey their_node_id_ref;
8689 CHECK(their_node_id->arr_len == 33);
8690 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
8691 LDKChannelReady msg_conv;
8692 msg_conv.inner = untag_ptr(msg);
8693 msg_conv.is_owned = ptr_is_owned(msg);
8694 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
8695 msg_conv.is_owned = false;
8696 (this_arg_conv->handle_channel_ready)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
8699 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) {
8700 void* this_arg_ptr = untag_ptr(this_arg);
8701 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8702 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
8703 LDKPublicKey their_node_id_ref;
8704 CHECK(their_node_id->arr_len == 33);
8705 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
8706 LDKInitFeatures their_features_conv;
8707 their_features_conv.inner = untag_ptr(their_features);
8708 their_features_conv.is_owned = ptr_is_owned(their_features);
8709 CHECK_INNER_FIELD_ACCESS_OR_NULL(their_features_conv);
8710 their_features_conv.is_owned = false;
8711 LDKShutdown msg_conv;
8712 msg_conv.inner = untag_ptr(msg);
8713 msg_conv.is_owned = ptr_is_owned(msg);
8714 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
8715 msg_conv.is_owned = false;
8716 (this_arg_conv->handle_shutdown)(this_arg_conv->this_arg, their_node_id_ref, &their_features_conv, &msg_conv);
8719 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) {
8720 void* this_arg_ptr = untag_ptr(this_arg);
8721 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8722 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
8723 LDKPublicKey their_node_id_ref;
8724 CHECK(their_node_id->arr_len == 33);
8725 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
8726 LDKClosingSigned msg_conv;
8727 msg_conv.inner = untag_ptr(msg);
8728 msg_conv.is_owned = ptr_is_owned(msg);
8729 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
8730 msg_conv.is_owned = false;
8731 (this_arg_conv->handle_closing_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
8734 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) {
8735 void* this_arg_ptr = untag_ptr(this_arg);
8736 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8737 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
8738 LDKPublicKey their_node_id_ref;
8739 CHECK(their_node_id->arr_len == 33);
8740 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
8741 LDKUpdateAddHTLC msg_conv;
8742 msg_conv.inner = untag_ptr(msg);
8743 msg_conv.is_owned = ptr_is_owned(msg);
8744 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
8745 msg_conv.is_owned = false;
8746 (this_arg_conv->handle_update_add_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
8749 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) {
8750 void* this_arg_ptr = untag_ptr(this_arg);
8751 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8752 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
8753 LDKPublicKey their_node_id_ref;
8754 CHECK(their_node_id->arr_len == 33);
8755 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
8756 LDKUpdateFulfillHTLC msg_conv;
8757 msg_conv.inner = untag_ptr(msg);
8758 msg_conv.is_owned = ptr_is_owned(msg);
8759 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
8760 msg_conv.is_owned = false;
8761 (this_arg_conv->handle_update_fulfill_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
8764 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) {
8765 void* this_arg_ptr = untag_ptr(this_arg);
8766 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8767 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
8768 LDKPublicKey their_node_id_ref;
8769 CHECK(their_node_id->arr_len == 33);
8770 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
8771 LDKUpdateFailHTLC msg_conv;
8772 msg_conv.inner = untag_ptr(msg);
8773 msg_conv.is_owned = ptr_is_owned(msg);
8774 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
8775 msg_conv.is_owned = false;
8776 (this_arg_conv->handle_update_fail_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
8779 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) {
8780 void* this_arg_ptr = untag_ptr(this_arg);
8781 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8782 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
8783 LDKPublicKey their_node_id_ref;
8784 CHECK(their_node_id->arr_len == 33);
8785 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
8786 LDKUpdateFailMalformedHTLC msg_conv;
8787 msg_conv.inner = untag_ptr(msg);
8788 msg_conv.is_owned = ptr_is_owned(msg);
8789 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
8790 msg_conv.is_owned = false;
8791 (this_arg_conv->handle_update_fail_malformed_htlc)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
8794 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) {
8795 void* this_arg_ptr = untag_ptr(this_arg);
8796 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8797 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
8798 LDKPublicKey their_node_id_ref;
8799 CHECK(their_node_id->arr_len == 33);
8800 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
8801 LDKCommitmentSigned msg_conv;
8802 msg_conv.inner = untag_ptr(msg);
8803 msg_conv.is_owned = ptr_is_owned(msg);
8804 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
8805 msg_conv.is_owned = false;
8806 (this_arg_conv->handle_commitment_signed)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
8809 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) {
8810 void* this_arg_ptr = untag_ptr(this_arg);
8811 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8812 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
8813 LDKPublicKey their_node_id_ref;
8814 CHECK(their_node_id->arr_len == 33);
8815 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
8816 LDKRevokeAndACK msg_conv;
8817 msg_conv.inner = untag_ptr(msg);
8818 msg_conv.is_owned = ptr_is_owned(msg);
8819 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
8820 msg_conv.is_owned = false;
8821 (this_arg_conv->handle_revoke_and_ack)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
8824 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) {
8825 void* this_arg_ptr = untag_ptr(this_arg);
8826 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8827 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
8828 LDKPublicKey their_node_id_ref;
8829 CHECK(their_node_id->arr_len == 33);
8830 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
8831 LDKUpdateFee msg_conv;
8832 msg_conv.inner = untag_ptr(msg);
8833 msg_conv.is_owned = ptr_is_owned(msg);
8834 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
8835 msg_conv.is_owned = false;
8836 (this_arg_conv->handle_update_fee)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
8839 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) {
8840 void* this_arg_ptr = untag_ptr(this_arg);
8841 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8842 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
8843 LDKPublicKey their_node_id_ref;
8844 CHECK(their_node_id->arr_len == 33);
8845 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
8846 LDKAnnouncementSignatures msg_conv;
8847 msg_conv.inner = untag_ptr(msg);
8848 msg_conv.is_owned = ptr_is_owned(msg);
8849 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
8850 msg_conv.is_owned = false;
8851 (this_arg_conv->handle_announcement_signatures)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
8854 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) {
8855 void* this_arg_ptr = untag_ptr(this_arg);
8856 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8857 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
8858 LDKPublicKey their_node_id_ref;
8859 CHECK(their_node_id->arr_len == 33);
8860 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
8861 (this_arg_conv->peer_disconnected)(this_arg_conv->this_arg, their_node_id_ref, no_connection_possible);
8864 void __attribute__((export_name("TS_ChannelMessageHandler_peer_connected"))) TS_ChannelMessageHandler_peer_connected(uint64_t this_arg, int8_tArray their_node_id, uint64_t msg) {
8865 void* this_arg_ptr = untag_ptr(this_arg);
8866 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8867 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
8868 LDKPublicKey their_node_id_ref;
8869 CHECK(their_node_id->arr_len == 33);
8870 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
8872 msg_conv.inner = untag_ptr(msg);
8873 msg_conv.is_owned = ptr_is_owned(msg);
8874 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
8875 msg_conv.is_owned = false;
8876 (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
8879 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) {
8880 void* this_arg_ptr = untag_ptr(this_arg);
8881 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8882 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
8883 LDKPublicKey their_node_id_ref;
8884 CHECK(their_node_id->arr_len == 33);
8885 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
8886 LDKChannelReestablish msg_conv;
8887 msg_conv.inner = untag_ptr(msg);
8888 msg_conv.is_owned = ptr_is_owned(msg);
8889 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
8890 msg_conv.is_owned = false;
8891 (this_arg_conv->handle_channel_reestablish)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
8894 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) {
8895 void* this_arg_ptr = untag_ptr(this_arg);
8896 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8897 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
8898 LDKPublicKey their_node_id_ref;
8899 CHECK(their_node_id->arr_len == 33);
8900 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
8901 LDKChannelUpdate msg_conv;
8902 msg_conv.inner = untag_ptr(msg);
8903 msg_conv.is_owned = ptr_is_owned(msg);
8904 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
8905 msg_conv.is_owned = false;
8906 (this_arg_conv->handle_channel_update)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
8909 void __attribute__((export_name("TS_ChannelMessageHandler_handle_error"))) TS_ChannelMessageHandler_handle_error(uint64_t this_arg, int8_tArray their_node_id, uint64_t msg) {
8910 void* this_arg_ptr = untag_ptr(this_arg);
8911 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
8912 LDKChannelMessageHandler* this_arg_conv = (LDKChannelMessageHandler*)this_arg_ptr;
8913 LDKPublicKey their_node_id_ref;
8914 CHECK(their_node_id->arr_len == 33);
8915 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
8916 LDKErrorMessage msg_conv;
8917 msg_conv.inner = untag_ptr(msg);
8918 msg_conv.is_owned = ptr_is_owned(msg);
8919 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
8920 msg_conv.is_owned = false;
8921 (this_arg_conv->handle_error)(this_arg_conv->this_arg, their_node_id_ref, &msg_conv);
8924 typedef struct LDKRoutingMessageHandler_JCalls {
8925 atomic_size_t refcnt;
8926 uint32_t instance_ptr;
8927 LDKMessageSendEventsProvider_JCalls* MessageSendEventsProvider;
8928 } LDKRoutingMessageHandler_JCalls;
8929 static void LDKRoutingMessageHandler_JCalls_free(void* this_arg) {
8930 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
8931 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
8935 LDKCResult_boolLightningErrorZ handle_node_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKNodeAnnouncement * msg) {
8936 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
8937 LDKNodeAnnouncement msg_var = *msg;
8938 uint64_t msg_ref = 0;
8939 msg_var = NodeAnnouncement_clone(&msg_var);
8940 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8941 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8942 uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 75, msg_ref, 0, 0, 0, 0, 0);
8943 void* ret_ptr = untag_ptr(ret);
8944 CHECK_ACCESS(ret_ptr);
8945 LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
8946 FREE(untag_ptr(ret));
8949 LDKCResult_boolLightningErrorZ handle_channel_announcement_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKChannelAnnouncement * msg) {
8950 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
8951 LDKChannelAnnouncement msg_var = *msg;
8952 uint64_t msg_ref = 0;
8953 msg_var = ChannelAnnouncement_clone(&msg_var);
8954 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8955 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8956 uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 76, msg_ref, 0, 0, 0, 0, 0);
8957 void* ret_ptr = untag_ptr(ret);
8958 CHECK_ACCESS(ret_ptr);
8959 LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
8960 FREE(untag_ptr(ret));
8963 LDKCResult_boolLightningErrorZ handle_channel_update_LDKRoutingMessageHandler_jcall(const void* this_arg, const LDKChannelUpdate * msg) {
8964 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
8965 LDKChannelUpdate msg_var = *msg;
8966 uint64_t msg_ref = 0;
8967 msg_var = ChannelUpdate_clone(&msg_var);
8968 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
8969 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
8970 uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 77, msg_ref, 0, 0, 0, 0, 0);
8971 void* ret_ptr = untag_ptr(ret);
8972 CHECK_ACCESS(ret_ptr);
8973 LDKCResult_boolLightningErrorZ ret_conv = *(LDKCResult_boolLightningErrorZ*)(ret_ptr);
8974 FREE(untag_ptr(ret));
8977 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ get_next_channel_announcements_LDKRoutingMessageHandler_jcall(const void* this_arg, uint64_t starting_point, uint8_t batch_amount) {
8978 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
8979 int64_t starting_point_conv = starting_point;
8980 int8_t batch_amount_conv = batch_amount;
8981 uint64_tArray ret = (uint64_tArray)js_invoke_function_buuuuu(j_calls->instance_ptr, 78, starting_point_conv, batch_amount_conv, 0, 0, 0, 0);
8982 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret_constr;
8983 ret_constr.datalen = ret->arr_len;
8984 if (ret_constr.datalen > 0)
8985 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ Elements");
8987 ret_constr.data = NULL;
8988 uint64_t* ret_vals = ret->elems;
8989 for (size_t h = 0; h < ret_constr.datalen; h++) {
8990 uint64_t ret_conv_59 = ret_vals[h];
8991 void* ret_conv_59_ptr = untag_ptr(ret_conv_59);
8992 CHECK_ACCESS(ret_conv_59_ptr);
8993 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ ret_conv_59_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(ret_conv_59_ptr);
8994 FREE(untag_ptr(ret_conv_59));
8995 ret_constr.data[h] = ret_conv_59_conv;
9000 LDKCVec_NodeAnnouncementZ get_next_node_announcements_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey starting_point, uint8_t batch_amount) {
9001 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9002 int8_tArray starting_point_arr = init_int8_tArray(33, __LINE__);
9003 memcpy(starting_point_arr->elems, starting_point.compressed_form, 33);
9004 int8_t batch_amount_conv = batch_amount;
9005 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);
9006 LDKCVec_NodeAnnouncementZ ret_constr;
9007 ret_constr.datalen = ret->arr_len;
9008 if (ret_constr.datalen > 0)
9009 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKNodeAnnouncement), "LDKCVec_NodeAnnouncementZ Elements");
9011 ret_constr.data = NULL;
9012 uint64_t* ret_vals = ret->elems;
9013 for (size_t s = 0; s < ret_constr.datalen; s++) {
9014 uint64_t ret_conv_18 = ret_vals[s];
9015 LDKNodeAnnouncement ret_conv_18_conv;
9016 ret_conv_18_conv.inner = untag_ptr(ret_conv_18);
9017 ret_conv_18_conv.is_owned = ptr_is_owned(ret_conv_18);
9018 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_18_conv);
9019 ret_constr.data[s] = ret_conv_18_conv;
9024 void peer_connected_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, const LDKInit * init) {
9025 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9026 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9027 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9028 LDKInit init_var = *init;
9029 uint64_t init_ref = 0;
9030 init_var = Init_clone(&init_var);
9031 CHECK_INNER_FIELD_ACCESS_OR_NULL(init_var);
9032 init_ref = tag_ptr(init_var.inner, init_var.is_owned);
9033 js_invoke_function_ubuuuu(j_calls->instance_ptr, 80, (uint32_t)their_node_id_arr, init_ref, 0, 0, 0, 0);
9035 LDKCResult_NoneLightningErrorZ handle_reply_channel_range_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKReplyChannelRange msg) {
9036 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9037 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9038 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9039 LDKReplyChannelRange msg_var = msg;
9040 uint64_t msg_ref = 0;
9041 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9042 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9043 uint32_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 81, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9044 void* ret_ptr = untag_ptr(ret);
9045 CHECK_ACCESS(ret_ptr);
9046 LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
9047 FREE(untag_ptr(ret));
9050 LDKCResult_NoneLightningErrorZ handle_reply_short_channel_ids_end_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKReplyShortChannelIdsEnd msg) {
9051 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9052 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9053 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9054 LDKReplyShortChannelIdsEnd msg_var = msg;
9055 uint64_t msg_ref = 0;
9056 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9057 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9058 uint32_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 82, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9059 void* ret_ptr = untag_ptr(ret);
9060 CHECK_ACCESS(ret_ptr);
9061 LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
9062 FREE(untag_ptr(ret));
9065 LDKCResult_NoneLightningErrorZ handle_query_channel_range_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKQueryChannelRange msg) {
9066 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9067 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9068 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9069 LDKQueryChannelRange msg_var = msg;
9070 uint64_t msg_ref = 0;
9071 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9072 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9073 uint32_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 83, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9074 void* ret_ptr = untag_ptr(ret);
9075 CHECK_ACCESS(ret_ptr);
9076 LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
9077 FREE(untag_ptr(ret));
9080 LDKCResult_NoneLightningErrorZ handle_query_short_channel_ids_LDKRoutingMessageHandler_jcall(const void* this_arg, LDKPublicKey their_node_id, LDKQueryShortChannelIds msg) {
9081 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) this_arg;
9082 int8_tArray their_node_id_arr = init_int8_tArray(33, __LINE__);
9083 memcpy(their_node_id_arr->elems, their_node_id.compressed_form, 33);
9084 LDKQueryShortChannelIds msg_var = msg;
9085 uint64_t msg_ref = 0;
9086 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_var);
9087 msg_ref = tag_ptr(msg_var.inner, msg_var.is_owned);
9088 uint32_t ret = js_invoke_function_ubuuuu(j_calls->instance_ptr, 84, (uint32_t)their_node_id_arr, msg_ref, 0, 0, 0, 0);
9089 void* ret_ptr = untag_ptr(ret);
9090 CHECK_ACCESS(ret_ptr);
9091 LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
9092 FREE(untag_ptr(ret));
9095 static void LDKRoutingMessageHandler_JCalls_cloned(LDKRoutingMessageHandler* new_obj) {
9096 LDKRoutingMessageHandler_JCalls *j_calls = (LDKRoutingMessageHandler_JCalls*) new_obj->this_arg;
9097 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
9098 atomic_fetch_add_explicit(&j_calls->MessageSendEventsProvider->refcnt, 1, memory_order_release);
9100 static inline LDKRoutingMessageHandler LDKRoutingMessageHandler_init (JSValue o, JSValue MessageSendEventsProvider) {
9101 LDKRoutingMessageHandler_JCalls *calls = MALLOC(sizeof(LDKRoutingMessageHandler_JCalls), "LDKRoutingMessageHandler_JCalls");
9102 atomic_init(&calls->refcnt, 1);
9103 calls->instance_ptr = o;
9105 LDKRoutingMessageHandler ret = {
9106 .this_arg = (void*) calls,
9107 .handle_node_announcement = handle_node_announcement_LDKRoutingMessageHandler_jcall,
9108 .handle_channel_announcement = handle_channel_announcement_LDKRoutingMessageHandler_jcall,
9109 .handle_channel_update = handle_channel_update_LDKRoutingMessageHandler_jcall,
9110 .get_next_channel_announcements = get_next_channel_announcements_LDKRoutingMessageHandler_jcall,
9111 .get_next_node_announcements = get_next_node_announcements_LDKRoutingMessageHandler_jcall,
9112 .peer_connected = peer_connected_LDKRoutingMessageHandler_jcall,
9113 .handle_reply_channel_range = handle_reply_channel_range_LDKRoutingMessageHandler_jcall,
9114 .handle_reply_short_channel_ids_end = handle_reply_short_channel_ids_end_LDKRoutingMessageHandler_jcall,
9115 .handle_query_channel_range = handle_query_channel_range_LDKRoutingMessageHandler_jcall,
9116 .handle_query_short_channel_ids = handle_query_short_channel_ids_LDKRoutingMessageHandler_jcall,
9117 .free = LDKRoutingMessageHandler_JCalls_free,
9118 .MessageSendEventsProvider = LDKMessageSendEventsProvider_init(MessageSendEventsProvider),
9120 calls->MessageSendEventsProvider = ret.MessageSendEventsProvider.this_arg;
9123 uint64_t __attribute__((export_name("TS_LDKRoutingMessageHandler_new"))) TS_LDKRoutingMessageHandler_new(JSValue o, JSValue MessageSendEventsProvider) {
9124 LDKRoutingMessageHandler *res_ptr = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
9125 *res_ptr = LDKRoutingMessageHandler_init(o, MessageSendEventsProvider);
9126 return tag_ptr(res_ptr, true);
9128 uint64_t __attribute__((export_name("TS_RoutingMessageHandler_handle_node_announcement"))) TS_RoutingMessageHandler_handle_node_announcement(uint64_t this_arg, uint64_t msg) {
9129 void* this_arg_ptr = untag_ptr(this_arg);
9130 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9131 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
9132 LDKNodeAnnouncement msg_conv;
9133 msg_conv.inner = untag_ptr(msg);
9134 msg_conv.is_owned = ptr_is_owned(msg);
9135 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9136 msg_conv.is_owned = false;
9137 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
9138 *ret_conv = (this_arg_conv->handle_node_announcement)(this_arg_conv->this_arg, &msg_conv);
9139 return tag_ptr(ret_conv, true);
9142 uint64_t __attribute__((export_name("TS_RoutingMessageHandler_handle_channel_announcement"))) TS_RoutingMessageHandler_handle_channel_announcement(uint64_t this_arg, uint64_t msg) {
9143 void* this_arg_ptr = untag_ptr(this_arg);
9144 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9145 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
9146 LDKChannelAnnouncement msg_conv;
9147 msg_conv.inner = untag_ptr(msg);
9148 msg_conv.is_owned = ptr_is_owned(msg);
9149 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9150 msg_conv.is_owned = false;
9151 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
9152 *ret_conv = (this_arg_conv->handle_channel_announcement)(this_arg_conv->this_arg, &msg_conv);
9153 return tag_ptr(ret_conv, true);
9156 uint64_t __attribute__((export_name("TS_RoutingMessageHandler_handle_channel_update"))) TS_RoutingMessageHandler_handle_channel_update(uint64_t this_arg, uint64_t msg) {
9157 void* this_arg_ptr = untag_ptr(this_arg);
9158 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9159 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
9160 LDKChannelUpdate msg_conv;
9161 msg_conv.inner = untag_ptr(msg);
9162 msg_conv.is_owned = ptr_is_owned(msg);
9163 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9164 msg_conv.is_owned = false;
9165 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
9166 *ret_conv = (this_arg_conv->handle_channel_update)(this_arg_conv->this_arg, &msg_conv);
9167 return tag_ptr(ret_conv, true);
9170 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) {
9171 void* this_arg_ptr = untag_ptr(this_arg);
9172 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9173 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
9174 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ ret_var = (this_arg_conv->get_next_channel_announcements)(this_arg_conv->this_arg, starting_point, batch_amount);
9175 uint64_tArray ret_arr = NULL;
9176 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
9177 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
9178 for (size_t h = 0; h < ret_var.datalen; h++) {
9179 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv_59_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
9180 *ret_conv_59_conv = ret_var.data[h];
9181 ret_arr_ptr[h] = tag_ptr(ret_conv_59_conv, true);
9188 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) {
9189 void* this_arg_ptr = untag_ptr(this_arg);
9190 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9191 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
9192 LDKPublicKey starting_point_ref;
9193 CHECK(starting_point->arr_len == 33);
9194 memcpy(starting_point_ref.compressed_form, starting_point->elems, 33); FREE(starting_point);
9195 LDKCVec_NodeAnnouncementZ ret_var = (this_arg_conv->get_next_node_announcements)(this_arg_conv->this_arg, starting_point_ref, batch_amount);
9196 uint64_tArray ret_arr = NULL;
9197 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
9198 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
9199 for (size_t s = 0; s < ret_var.datalen; s++) {
9200 LDKNodeAnnouncement ret_conv_18_var = ret_var.data[s];
9201 uint64_t ret_conv_18_ref = 0;
9202 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_18_var);
9203 ret_conv_18_ref = tag_ptr(ret_conv_18_var.inner, ret_conv_18_var.is_owned);
9204 ret_arr_ptr[s] = ret_conv_18_ref;
9211 void __attribute__((export_name("TS_RoutingMessageHandler_peer_connected"))) TS_RoutingMessageHandler_peer_connected(uint64_t this_arg, int8_tArray their_node_id, uint64_t init) {
9212 void* this_arg_ptr = untag_ptr(this_arg);
9213 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9214 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
9215 LDKPublicKey their_node_id_ref;
9216 CHECK(their_node_id->arr_len == 33);
9217 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9219 init_conv.inner = untag_ptr(init);
9220 init_conv.is_owned = ptr_is_owned(init);
9221 CHECK_INNER_FIELD_ACCESS_OR_NULL(init_conv);
9222 init_conv.is_owned = false;
9223 (this_arg_conv->peer_connected)(this_arg_conv->this_arg, their_node_id_ref, &init_conv);
9226 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) {
9227 void* this_arg_ptr = untag_ptr(this_arg);
9228 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9229 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
9230 LDKPublicKey their_node_id_ref;
9231 CHECK(their_node_id->arr_len == 33);
9232 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9233 LDKReplyChannelRange msg_conv;
9234 msg_conv.inner = untag_ptr(msg);
9235 msg_conv.is_owned = ptr_is_owned(msg);
9236 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9237 msg_conv = ReplyChannelRange_clone(&msg_conv);
9238 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
9239 *ret_conv = (this_arg_conv->handle_reply_channel_range)(this_arg_conv->this_arg, their_node_id_ref, msg_conv);
9240 return tag_ptr(ret_conv, true);
9243 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) {
9244 void* this_arg_ptr = untag_ptr(this_arg);
9245 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9246 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
9247 LDKPublicKey their_node_id_ref;
9248 CHECK(their_node_id->arr_len == 33);
9249 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9250 LDKReplyShortChannelIdsEnd msg_conv;
9251 msg_conv.inner = untag_ptr(msg);
9252 msg_conv.is_owned = ptr_is_owned(msg);
9253 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9254 msg_conv = ReplyShortChannelIdsEnd_clone(&msg_conv);
9255 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
9256 *ret_conv = (this_arg_conv->handle_reply_short_channel_ids_end)(this_arg_conv->this_arg, their_node_id_ref, msg_conv);
9257 return tag_ptr(ret_conv, true);
9260 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) {
9261 void* this_arg_ptr = untag_ptr(this_arg);
9262 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9263 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
9264 LDKPublicKey their_node_id_ref;
9265 CHECK(their_node_id->arr_len == 33);
9266 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9267 LDKQueryChannelRange msg_conv;
9268 msg_conv.inner = untag_ptr(msg);
9269 msg_conv.is_owned = ptr_is_owned(msg);
9270 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9271 msg_conv = QueryChannelRange_clone(&msg_conv);
9272 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
9273 *ret_conv = (this_arg_conv->handle_query_channel_range)(this_arg_conv->this_arg, their_node_id_ref, msg_conv);
9274 return tag_ptr(ret_conv, true);
9277 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) {
9278 void* this_arg_ptr = untag_ptr(this_arg);
9279 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9280 LDKRoutingMessageHandler* this_arg_conv = (LDKRoutingMessageHandler*)this_arg_ptr;
9281 LDKPublicKey their_node_id_ref;
9282 CHECK(their_node_id->arr_len == 33);
9283 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
9284 LDKQueryShortChannelIds msg_conv;
9285 msg_conv.inner = untag_ptr(msg);
9286 msg_conv.is_owned = ptr_is_owned(msg);
9287 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
9288 msg_conv = QueryShortChannelIds_clone(&msg_conv);
9289 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
9290 *ret_conv = (this_arg_conv->handle_query_short_channel_ids)(this_arg_conv->this_arg, their_node_id_ref, msg_conv);
9291 return tag_ptr(ret_conv, true);
9294 typedef struct LDKCustomMessageReader_JCalls {
9295 atomic_size_t refcnt;
9296 uint32_t instance_ptr;
9297 } LDKCustomMessageReader_JCalls;
9298 static void LDKCustomMessageReader_JCalls_free(void* this_arg) {
9299 LDKCustomMessageReader_JCalls *j_calls = (LDKCustomMessageReader_JCalls*) this_arg;
9300 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
9304 LDKCResult_COption_TypeZDecodeErrorZ read_LDKCustomMessageReader_jcall(const void* this_arg, uint16_t message_type, LDKu8slice buffer) {
9305 LDKCustomMessageReader_JCalls *j_calls = (LDKCustomMessageReader_JCalls*) this_arg;
9306 int16_t message_type_conv = message_type;
9307 LDKu8slice buffer_var = buffer;
9308 int8_tArray buffer_arr = init_int8_tArray(buffer_var.datalen, __LINE__);
9309 memcpy(buffer_arr->elems, buffer_var.data, buffer_var.datalen);
9310 uint32_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 85, message_type_conv, (uint32_t)buffer_arr, 0, 0, 0, 0);
9311 void* ret_ptr = untag_ptr(ret);
9312 CHECK_ACCESS(ret_ptr);
9313 LDKCResult_COption_TypeZDecodeErrorZ ret_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(ret_ptr);
9314 FREE(untag_ptr(ret));
9317 static void LDKCustomMessageReader_JCalls_cloned(LDKCustomMessageReader* new_obj) {
9318 LDKCustomMessageReader_JCalls *j_calls = (LDKCustomMessageReader_JCalls*) new_obj->this_arg;
9319 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
9321 static inline LDKCustomMessageReader LDKCustomMessageReader_init (JSValue o) {
9322 LDKCustomMessageReader_JCalls *calls = MALLOC(sizeof(LDKCustomMessageReader_JCalls), "LDKCustomMessageReader_JCalls");
9323 atomic_init(&calls->refcnt, 1);
9324 calls->instance_ptr = o;
9326 LDKCustomMessageReader ret = {
9327 .this_arg = (void*) calls,
9328 .read = read_LDKCustomMessageReader_jcall,
9329 .free = LDKCustomMessageReader_JCalls_free,
9333 uint64_t __attribute__((export_name("TS_LDKCustomMessageReader_new"))) TS_LDKCustomMessageReader_new(JSValue o) {
9334 LDKCustomMessageReader *res_ptr = MALLOC(sizeof(LDKCustomMessageReader), "LDKCustomMessageReader");
9335 *res_ptr = LDKCustomMessageReader_init(o);
9336 return tag_ptr(res_ptr, true);
9338 uint64_t __attribute__((export_name("TS_CustomMessageReader_read"))) TS_CustomMessageReader_read(uint64_t this_arg, int16_t message_type, int8_tArray buffer) {
9339 void* this_arg_ptr = untag_ptr(this_arg);
9340 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9341 LDKCustomMessageReader* this_arg_conv = (LDKCustomMessageReader*)this_arg_ptr;
9342 LDKu8slice buffer_ref;
9343 buffer_ref.datalen = buffer->arr_len;
9344 buffer_ref.data = buffer->elems;
9345 LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
9346 *ret_conv = (this_arg_conv->read)(this_arg_conv->this_arg, message_type, buffer_ref);
9348 return tag_ptr(ret_conv, true);
9351 typedef struct LDKCustomMessageHandler_JCalls {
9352 atomic_size_t refcnt;
9353 uint32_t instance_ptr;
9354 LDKCustomMessageReader_JCalls* CustomMessageReader;
9355 } LDKCustomMessageHandler_JCalls;
9356 static void LDKCustomMessageHandler_JCalls_free(void* this_arg) {
9357 LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) this_arg;
9358 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
9362 LDKCResult_NoneLightningErrorZ handle_custom_message_LDKCustomMessageHandler_jcall(const void* this_arg, LDKType msg, LDKPublicKey sender_node_id) {
9363 LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) this_arg;
9364 LDKType* msg_ret = MALLOC(sizeof(LDKType), "LDKType");
9366 int8_tArray sender_node_id_arr = init_int8_tArray(33, __LINE__);
9367 memcpy(sender_node_id_arr->elems, sender_node_id.compressed_form, 33);
9368 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);
9369 void* ret_ptr = untag_ptr(ret);
9370 CHECK_ACCESS(ret_ptr);
9371 LDKCResult_NoneLightningErrorZ ret_conv = *(LDKCResult_NoneLightningErrorZ*)(ret_ptr);
9372 FREE(untag_ptr(ret));
9375 LDKCVec_C2Tuple_PublicKeyTypeZZ get_and_clear_pending_msg_LDKCustomMessageHandler_jcall(const void* this_arg) {
9376 LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) this_arg;
9377 uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 87, 0, 0, 0, 0, 0, 0);
9378 LDKCVec_C2Tuple_PublicKeyTypeZZ ret_constr;
9379 ret_constr.datalen = ret->arr_len;
9380 if (ret_constr.datalen > 0)
9381 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKCVec_C2Tuple_PublicKeyTypeZZ Elements");
9383 ret_constr.data = NULL;
9384 uint64_t* ret_vals = ret->elems;
9385 for (size_t z = 0; z < ret_constr.datalen; z++) {
9386 uint64_t ret_conv_25 = ret_vals[z];
9387 void* ret_conv_25_ptr = untag_ptr(ret_conv_25);
9388 CHECK_ACCESS(ret_conv_25_ptr);
9389 LDKC2Tuple_PublicKeyTypeZ ret_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(ret_conv_25_ptr);
9390 FREE(untag_ptr(ret_conv_25));
9391 ret_constr.data[z] = ret_conv_25_conv;
9396 static void LDKCustomMessageHandler_JCalls_cloned(LDKCustomMessageHandler* new_obj) {
9397 LDKCustomMessageHandler_JCalls *j_calls = (LDKCustomMessageHandler_JCalls*) new_obj->this_arg;
9398 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
9399 atomic_fetch_add_explicit(&j_calls->CustomMessageReader->refcnt, 1, memory_order_release);
9401 static inline LDKCustomMessageHandler LDKCustomMessageHandler_init (JSValue o, JSValue CustomMessageReader) {
9402 LDKCustomMessageHandler_JCalls *calls = MALLOC(sizeof(LDKCustomMessageHandler_JCalls), "LDKCustomMessageHandler_JCalls");
9403 atomic_init(&calls->refcnt, 1);
9404 calls->instance_ptr = o;
9406 LDKCustomMessageHandler ret = {
9407 .this_arg = (void*) calls,
9408 .handle_custom_message = handle_custom_message_LDKCustomMessageHandler_jcall,
9409 .get_and_clear_pending_msg = get_and_clear_pending_msg_LDKCustomMessageHandler_jcall,
9410 .free = LDKCustomMessageHandler_JCalls_free,
9411 .CustomMessageReader = LDKCustomMessageReader_init(CustomMessageReader),
9413 calls->CustomMessageReader = ret.CustomMessageReader.this_arg;
9416 uint64_t __attribute__((export_name("TS_LDKCustomMessageHandler_new"))) TS_LDKCustomMessageHandler_new(JSValue o, JSValue CustomMessageReader) {
9417 LDKCustomMessageHandler *res_ptr = MALLOC(sizeof(LDKCustomMessageHandler), "LDKCustomMessageHandler");
9418 *res_ptr = LDKCustomMessageHandler_init(o, CustomMessageReader);
9419 return tag_ptr(res_ptr, true);
9421 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) {
9422 void* this_arg_ptr = untag_ptr(this_arg);
9423 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9424 LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)this_arg_ptr;
9425 void* msg_ptr = untag_ptr(msg);
9426 CHECK_ACCESS(msg_ptr);
9427 LDKType msg_conv = *(LDKType*)(msg_ptr);
9428 if (msg_conv.free == LDKType_JCalls_free) {
9429 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
9430 LDKType_JCalls_cloned(&msg_conv);
9432 LDKPublicKey sender_node_id_ref;
9433 CHECK(sender_node_id->arr_len == 33);
9434 memcpy(sender_node_id_ref.compressed_form, sender_node_id->elems, 33); FREE(sender_node_id);
9435 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
9436 *ret_conv = (this_arg_conv->handle_custom_message)(this_arg_conv->this_arg, msg_conv, sender_node_id_ref);
9437 return tag_ptr(ret_conv, true);
9440 uint64_tArray __attribute__((export_name("TS_CustomMessageHandler_get_and_clear_pending_msg"))) TS_CustomMessageHandler_get_and_clear_pending_msg(uint64_t this_arg) {
9441 void* this_arg_ptr = untag_ptr(this_arg);
9442 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9443 LDKCustomMessageHandler* this_arg_conv = (LDKCustomMessageHandler*)this_arg_ptr;
9444 LDKCVec_C2Tuple_PublicKeyTypeZZ ret_var = (this_arg_conv->get_and_clear_pending_msg)(this_arg_conv->this_arg);
9445 uint64_tArray ret_arr = NULL;
9446 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
9447 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
9448 for (size_t z = 0; z < ret_var.datalen; z++) {
9449 LDKC2Tuple_PublicKeyTypeZ* ret_conv_25_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
9450 *ret_conv_25_conv = ret_var.data[z];
9451 ret_arr_ptr[z] = tag_ptr(ret_conv_25_conv, true);
9458 typedef struct LDKSocketDescriptor_JCalls {
9459 atomic_size_t refcnt;
9460 uint32_t instance_ptr;
9461 } LDKSocketDescriptor_JCalls;
9462 static void LDKSocketDescriptor_JCalls_free(void* this_arg) {
9463 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
9464 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
9468 uintptr_t send_data_LDKSocketDescriptor_jcall(void* this_arg, LDKu8slice data, bool resume_read) {
9469 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
9470 LDKu8slice data_var = data;
9471 int8_tArray data_arr = init_int8_tArray(data_var.datalen, __LINE__);
9472 memcpy(data_arr->elems, data_var.data, data_var.datalen);
9473 jboolean resume_read_conv = resume_read;
9474 return js_invoke_function_uuuuuu(j_calls->instance_ptr, 88, (uint32_t)data_arr, resume_read_conv, 0, 0, 0, 0);
9476 void disconnect_socket_LDKSocketDescriptor_jcall(void* this_arg) {
9477 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
9478 js_invoke_function_uuuuuu(j_calls->instance_ptr, 89, 0, 0, 0, 0, 0, 0);
9480 bool eq_LDKSocketDescriptor_jcall(const void* this_arg, const LDKSocketDescriptor * other_arg) {
9481 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
9482 LDKSocketDescriptor *other_arg_clone = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
9483 *other_arg_clone = SocketDescriptor_clone(other_arg);
9484 return js_invoke_function_buuuuu(j_calls->instance_ptr, 90, tag_ptr(other_arg_clone, true), 0, 0, 0, 0, 0);
9486 uint64_t hash_LDKSocketDescriptor_jcall(const void* this_arg) {
9487 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) this_arg;
9488 return js_invoke_function_uuuuuu(j_calls->instance_ptr, 91, 0, 0, 0, 0, 0, 0);
9490 static void LDKSocketDescriptor_JCalls_cloned(LDKSocketDescriptor* new_obj) {
9491 LDKSocketDescriptor_JCalls *j_calls = (LDKSocketDescriptor_JCalls*) new_obj->this_arg;
9492 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
9494 static inline LDKSocketDescriptor LDKSocketDescriptor_init (JSValue o) {
9495 LDKSocketDescriptor_JCalls *calls = MALLOC(sizeof(LDKSocketDescriptor_JCalls), "LDKSocketDescriptor_JCalls");
9496 atomic_init(&calls->refcnt, 1);
9497 calls->instance_ptr = o;
9499 LDKSocketDescriptor ret = {
9500 .this_arg = (void*) calls,
9501 .send_data = send_data_LDKSocketDescriptor_jcall,
9502 .disconnect_socket = disconnect_socket_LDKSocketDescriptor_jcall,
9503 .eq = eq_LDKSocketDescriptor_jcall,
9504 .hash = hash_LDKSocketDescriptor_jcall,
9505 .cloned = LDKSocketDescriptor_JCalls_cloned,
9506 .free = LDKSocketDescriptor_JCalls_free,
9510 uint64_t __attribute__((export_name("TS_LDKSocketDescriptor_new"))) TS_LDKSocketDescriptor_new(JSValue o) {
9511 LDKSocketDescriptor *res_ptr = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
9512 *res_ptr = LDKSocketDescriptor_init(o);
9513 return tag_ptr(res_ptr, true);
9515 uint32_t __attribute__((export_name("TS_SocketDescriptor_send_data"))) TS_SocketDescriptor_send_data(uint64_t this_arg, int8_tArray data, jboolean resume_read) {
9516 void* this_arg_ptr = untag_ptr(this_arg);
9517 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9518 LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg_ptr;
9519 LDKu8slice data_ref;
9520 data_ref.datalen = data->arr_len;
9521 data_ref.data = data->elems;
9522 uint32_t ret_conv = (this_arg_conv->send_data)(this_arg_conv->this_arg, data_ref, resume_read);
9527 void __attribute__((export_name("TS_SocketDescriptor_disconnect_socket"))) TS_SocketDescriptor_disconnect_socket(uint64_t this_arg) {
9528 void* this_arg_ptr = untag_ptr(this_arg);
9529 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9530 LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg_ptr;
9531 (this_arg_conv->disconnect_socket)(this_arg_conv->this_arg);
9534 int64_t __attribute__((export_name("TS_SocketDescriptor_hash"))) TS_SocketDescriptor_hash(uint64_t this_arg) {
9535 void* this_arg_ptr = untag_ptr(this_arg);
9536 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9537 LDKSocketDescriptor* this_arg_conv = (LDKSocketDescriptor*)this_arg_ptr;
9538 int64_t ret_conv = (this_arg_conv->hash)(this_arg_conv->this_arg);
9542 uint32_t __attribute__((export_name("TS_LDKEffectiveCapacity_ty_from_ptr"))) TS_LDKEffectiveCapacity_ty_from_ptr(uint64_t ptr) {
9543 LDKEffectiveCapacity *obj = (LDKEffectiveCapacity*)untag_ptr(ptr);
9545 case LDKEffectiveCapacity_ExactLiquidity: return 0;
9546 case LDKEffectiveCapacity_MaximumHTLC: return 1;
9547 case LDKEffectiveCapacity_Total: return 2;
9548 case LDKEffectiveCapacity_Infinite: return 3;
9549 case LDKEffectiveCapacity_Unknown: return 4;
9553 int64_t __attribute__((export_name("TS_LDKEffectiveCapacity_ExactLiquidity_get_liquidity_msat"))) TS_LDKEffectiveCapacity_ExactLiquidity_get_liquidity_msat(uint64_t ptr) {
9554 LDKEffectiveCapacity *obj = (LDKEffectiveCapacity*)untag_ptr(ptr);
9555 assert(obj->tag == LDKEffectiveCapacity_ExactLiquidity);
9556 int64_t liquidity_msat_conv = obj->exact_liquidity.liquidity_msat;
9557 return liquidity_msat_conv;
9559 int64_t __attribute__((export_name("TS_LDKEffectiveCapacity_MaximumHTLC_get_amount_msat"))) TS_LDKEffectiveCapacity_MaximumHTLC_get_amount_msat(uint64_t ptr) {
9560 LDKEffectiveCapacity *obj = (LDKEffectiveCapacity*)untag_ptr(ptr);
9561 assert(obj->tag == LDKEffectiveCapacity_MaximumHTLC);
9562 int64_t amount_msat_conv = obj->maximum_htlc.amount_msat;
9563 return amount_msat_conv;
9565 int64_t __attribute__((export_name("TS_LDKEffectiveCapacity_Total_get_capacity_msat"))) TS_LDKEffectiveCapacity_Total_get_capacity_msat(uint64_t ptr) {
9566 LDKEffectiveCapacity *obj = (LDKEffectiveCapacity*)untag_ptr(ptr);
9567 assert(obj->tag == LDKEffectiveCapacity_Total);
9568 int64_t capacity_msat_conv = obj->total.capacity_msat;
9569 return capacity_msat_conv;
9571 uint64_t __attribute__((export_name("TS_LDKEffectiveCapacity_Total_get_htlc_maximum_msat"))) TS_LDKEffectiveCapacity_Total_get_htlc_maximum_msat(uint64_t ptr) {
9572 LDKEffectiveCapacity *obj = (LDKEffectiveCapacity*)untag_ptr(ptr);
9573 assert(obj->tag == LDKEffectiveCapacity_Total);
9574 uint64_t htlc_maximum_msat_ref = tag_ptr(&obj->total.htlc_maximum_msat, false);
9575 return htlc_maximum_msat_ref;
9577 typedef struct LDKLockableScore_JCalls {
9578 atomic_size_t refcnt;
9579 uint32_t instance_ptr;
9580 } LDKLockableScore_JCalls;
9581 static void LDKLockableScore_JCalls_free(void* this_arg) {
9582 LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) this_arg;
9583 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
9587 LDKScore lock_LDKLockableScore_jcall(const void* this_arg) {
9588 LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) this_arg;
9589 uint32_t ret = js_invoke_function_uuuuuu(j_calls->instance_ptr, 92, 0, 0, 0, 0, 0, 0);
9590 void* ret_ptr = untag_ptr(ret);
9591 CHECK_ACCESS(ret_ptr);
9592 LDKScore ret_conv = *(LDKScore*)(ret_ptr);
9593 if (ret_conv.free == LDKScore_JCalls_free) {
9594 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
9595 LDKScore_JCalls_cloned(&ret_conv);
9596 }// WARNING: we may need a move here but no clone is available for LDKScore
9600 static void LDKLockableScore_JCalls_cloned(LDKLockableScore* new_obj) {
9601 LDKLockableScore_JCalls *j_calls = (LDKLockableScore_JCalls*) new_obj->this_arg;
9602 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
9604 static inline LDKLockableScore LDKLockableScore_init (JSValue o) {
9605 LDKLockableScore_JCalls *calls = MALLOC(sizeof(LDKLockableScore_JCalls), "LDKLockableScore_JCalls");
9606 atomic_init(&calls->refcnt, 1);
9607 calls->instance_ptr = o;
9609 LDKLockableScore ret = {
9610 .this_arg = (void*) calls,
9611 .lock = lock_LDKLockableScore_jcall,
9612 .free = LDKLockableScore_JCalls_free,
9616 uint64_t __attribute__((export_name("TS_LDKLockableScore_new"))) TS_LDKLockableScore_new(JSValue o) {
9617 LDKLockableScore *res_ptr = MALLOC(sizeof(LDKLockableScore), "LDKLockableScore");
9618 *res_ptr = LDKLockableScore_init(o);
9619 return tag_ptr(res_ptr, true);
9621 uint64_t __attribute__((export_name("TS_LockableScore_lock"))) TS_LockableScore_lock(uint64_t this_arg) {
9622 void* this_arg_ptr = untag_ptr(this_arg);
9623 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9624 LDKLockableScore* this_arg_conv = (LDKLockableScore*)this_arg_ptr;
9625 LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore");
9626 *ret_ret = (this_arg_conv->lock)(this_arg_conv->this_arg);
9627 return tag_ptr(ret_ret, true);
9630 uint32_t __attribute__((export_name("TS_LDKFallback_ty_from_ptr"))) TS_LDKFallback_ty_from_ptr(uint64_t ptr) {
9631 LDKFallback *obj = (LDKFallback*)untag_ptr(ptr);
9633 case LDKFallback_SegWitProgram: return 0;
9634 case LDKFallback_PubKeyHash: return 1;
9635 case LDKFallback_ScriptHash: return 2;
9639 int8_t __attribute__((export_name("TS_LDKFallback_SegWitProgram_get_version"))) TS_LDKFallback_SegWitProgram_get_version(uint64_t ptr) {
9640 LDKFallback *obj = (LDKFallback*)untag_ptr(ptr);
9641 assert(obj->tag == LDKFallback_SegWitProgram);
9642 uint8_t version_val = obj->seg_wit_program.version._0;
9645 int8_tArray __attribute__((export_name("TS_LDKFallback_SegWitProgram_get_program"))) TS_LDKFallback_SegWitProgram_get_program(uint64_t ptr) {
9646 LDKFallback *obj = (LDKFallback*)untag_ptr(ptr);
9647 assert(obj->tag == LDKFallback_SegWitProgram);
9648 LDKCVec_u8Z program_var = obj->seg_wit_program.program;
9649 int8_tArray program_arr = init_int8_tArray(program_var.datalen, __LINE__);
9650 memcpy(program_arr->elems, program_var.data, program_var.datalen);
9653 int8_tArray __attribute__((export_name("TS_LDKFallback_PubKeyHash_get_pub_key_hash"))) TS_LDKFallback_PubKeyHash_get_pub_key_hash(uint64_t ptr) {
9654 LDKFallback *obj = (LDKFallback*)untag_ptr(ptr);
9655 assert(obj->tag == LDKFallback_PubKeyHash);
9656 int8_tArray pub_key_hash_arr = init_int8_tArray(20, __LINE__);
9657 memcpy(pub_key_hash_arr->elems, obj->pub_key_hash.data, 20);
9658 return pub_key_hash_arr;
9660 int8_tArray __attribute__((export_name("TS_LDKFallback_ScriptHash_get_script_hash"))) TS_LDKFallback_ScriptHash_get_script_hash(uint64_t ptr) {
9661 LDKFallback *obj = (LDKFallback*)untag_ptr(ptr);
9662 assert(obj->tag == LDKFallback_ScriptHash);
9663 int8_tArray script_hash_arr = init_int8_tArray(20, __LINE__);
9664 memcpy(script_hash_arr->elems, obj->script_hash.data, 20);
9665 return script_hash_arr;
9667 typedef struct LDKPayer_JCalls {
9668 atomic_size_t refcnt;
9669 uint32_t instance_ptr;
9671 static void LDKPayer_JCalls_free(void* this_arg) {
9672 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
9673 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
9677 LDKPublicKey node_id_LDKPayer_jcall(const void* this_arg) {
9678 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
9679 int8_tArray ret = (int8_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 93, 0, 0, 0, 0, 0, 0);
9680 LDKPublicKey ret_ref;
9681 CHECK(ret->arr_len == 33);
9682 memcpy(ret_ref.compressed_form, ret->elems, 33); FREE(ret);
9685 LDKCVec_ChannelDetailsZ first_hops_LDKPayer_jcall(const void* this_arg) {
9686 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
9687 uint64_tArray ret = (uint64_tArray)js_invoke_function_uuuuuu(j_calls->instance_ptr, 94, 0, 0, 0, 0, 0, 0);
9688 LDKCVec_ChannelDetailsZ ret_constr;
9689 ret_constr.datalen = ret->arr_len;
9690 if (ret_constr.datalen > 0)
9691 ret_constr.data = MALLOC(ret_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
9693 ret_constr.data = NULL;
9694 uint64_t* ret_vals = ret->elems;
9695 for (size_t q = 0; q < ret_constr.datalen; q++) {
9696 uint64_t ret_conv_16 = ret_vals[q];
9697 LDKChannelDetails ret_conv_16_conv;
9698 ret_conv_16_conv.inner = untag_ptr(ret_conv_16);
9699 ret_conv_16_conv.is_owned = ptr_is_owned(ret_conv_16);
9700 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_conv);
9701 ret_constr.data[q] = ret_conv_16_conv;
9706 LDKCResult_PaymentIdPaymentSendFailureZ send_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_hash, LDKThirtyTwoBytes payment_secret) {
9707 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
9708 LDKRoute route_var = *route;
9709 uint64_t route_ref = 0;
9710 route_var = Route_clone(&route_var);
9711 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var);
9712 route_ref = tag_ptr(route_var.inner, route_var.is_owned);
9713 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
9714 memcpy(payment_hash_arr->elems, payment_hash.data, 32);
9715 int8_tArray payment_secret_arr = init_int8_tArray(32, __LINE__);
9716 memcpy(payment_secret_arr->elems, payment_secret.data, 32);
9717 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);
9718 void* ret_ptr = untag_ptr(ret);
9719 CHECK_ACCESS(ret_ptr);
9720 LDKCResult_PaymentIdPaymentSendFailureZ ret_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(ret_ptr);
9721 FREE(untag_ptr(ret));
9724 LDKCResult_PaymentIdPaymentSendFailureZ send_spontaneous_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_preimage) {
9725 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
9726 LDKRoute route_var = *route;
9727 uint64_t route_ref = 0;
9728 route_var = Route_clone(&route_var);
9729 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var);
9730 route_ref = tag_ptr(route_var.inner, route_var.is_owned);
9731 int8_tArray payment_preimage_arr = init_int8_tArray(32, __LINE__);
9732 memcpy(payment_preimage_arr->elems, payment_preimage.data, 32);
9733 uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 96, route_ref, (uint32_t)payment_preimage_arr, 0, 0, 0, 0);
9734 void* ret_ptr = untag_ptr(ret);
9735 CHECK_ACCESS(ret_ptr);
9736 LDKCResult_PaymentIdPaymentSendFailureZ ret_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(ret_ptr);
9737 FREE(untag_ptr(ret));
9740 LDKCResult_NonePaymentSendFailureZ retry_payment_LDKPayer_jcall(const void* this_arg, const LDKRoute * route, LDKThirtyTwoBytes payment_id) {
9741 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
9742 LDKRoute route_var = *route;
9743 uint64_t route_ref = 0;
9744 route_var = Route_clone(&route_var);
9745 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_var);
9746 route_ref = tag_ptr(route_var.inner, route_var.is_owned);
9747 int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
9748 memcpy(payment_id_arr->elems, payment_id.data, 32);
9749 uint32_t ret = js_invoke_function_buuuuu(j_calls->instance_ptr, 97, route_ref, (uint32_t)payment_id_arr, 0, 0, 0, 0);
9750 void* ret_ptr = untag_ptr(ret);
9751 CHECK_ACCESS(ret_ptr);
9752 LDKCResult_NonePaymentSendFailureZ ret_conv = *(LDKCResult_NonePaymentSendFailureZ*)(ret_ptr);
9753 FREE(untag_ptr(ret));
9756 void abandon_payment_LDKPayer_jcall(const void* this_arg, LDKThirtyTwoBytes payment_id) {
9757 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) this_arg;
9758 int8_tArray payment_id_arr = init_int8_tArray(32, __LINE__);
9759 memcpy(payment_id_arr->elems, payment_id.data, 32);
9760 js_invoke_function_uuuuuu(j_calls->instance_ptr, 98, (uint32_t)payment_id_arr, 0, 0, 0, 0, 0);
9762 static void LDKPayer_JCalls_cloned(LDKPayer* new_obj) {
9763 LDKPayer_JCalls *j_calls = (LDKPayer_JCalls*) new_obj->this_arg;
9764 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
9766 static inline LDKPayer LDKPayer_init (JSValue o) {
9767 LDKPayer_JCalls *calls = MALLOC(sizeof(LDKPayer_JCalls), "LDKPayer_JCalls");
9768 atomic_init(&calls->refcnt, 1);
9769 calls->instance_ptr = o;
9772 .this_arg = (void*) calls,
9773 .node_id = node_id_LDKPayer_jcall,
9774 .first_hops = first_hops_LDKPayer_jcall,
9775 .send_payment = send_payment_LDKPayer_jcall,
9776 .send_spontaneous_payment = send_spontaneous_payment_LDKPayer_jcall,
9777 .retry_payment = retry_payment_LDKPayer_jcall,
9778 .abandon_payment = abandon_payment_LDKPayer_jcall,
9779 .free = LDKPayer_JCalls_free,
9783 uint64_t __attribute__((export_name("TS_LDKPayer_new"))) TS_LDKPayer_new(JSValue o) {
9784 LDKPayer *res_ptr = MALLOC(sizeof(LDKPayer), "LDKPayer");
9785 *res_ptr = LDKPayer_init(o);
9786 return tag_ptr(res_ptr, true);
9788 int8_tArray __attribute__((export_name("TS_Payer_node_id"))) TS_Payer_node_id(uint64_t this_arg) {
9789 void* this_arg_ptr = untag_ptr(this_arg);
9790 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9791 LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
9792 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
9793 memcpy(ret_arr->elems, (this_arg_conv->node_id)(this_arg_conv->this_arg).compressed_form, 33);
9797 uint64_tArray __attribute__((export_name("TS_Payer_first_hops"))) TS_Payer_first_hops(uint64_t this_arg) {
9798 void* this_arg_ptr = untag_ptr(this_arg);
9799 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9800 LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
9801 LDKCVec_ChannelDetailsZ ret_var = (this_arg_conv->first_hops)(this_arg_conv->this_arg);
9802 uint64_tArray ret_arr = NULL;
9803 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
9804 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
9805 for (size_t q = 0; q < ret_var.datalen; q++) {
9806 LDKChannelDetails ret_conv_16_var = ret_var.data[q];
9807 uint64_t ret_conv_16_ref = 0;
9808 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
9809 ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned);
9810 ret_arr_ptr[q] = ret_conv_16_ref;
9817 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) {
9818 void* this_arg_ptr = untag_ptr(this_arg);
9819 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9820 LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
9821 LDKRoute route_conv;
9822 route_conv.inner = untag_ptr(route);
9823 route_conv.is_owned = ptr_is_owned(route);
9824 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
9825 route_conv.is_owned = false;
9826 LDKThirtyTwoBytes payment_hash_ref;
9827 CHECK(payment_hash->arr_len == 32);
9828 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
9829 LDKThirtyTwoBytes payment_secret_ref;
9830 CHECK(payment_secret->arr_len == 32);
9831 memcpy(payment_secret_ref.data, payment_secret->elems, 32); FREE(payment_secret);
9832 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
9833 *ret_conv = (this_arg_conv->send_payment)(this_arg_conv->this_arg, &route_conv, payment_hash_ref, payment_secret_ref);
9834 return tag_ptr(ret_conv, true);
9837 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) {
9838 void* this_arg_ptr = untag_ptr(this_arg);
9839 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9840 LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
9841 LDKRoute route_conv;
9842 route_conv.inner = untag_ptr(route);
9843 route_conv.is_owned = ptr_is_owned(route);
9844 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
9845 route_conv.is_owned = false;
9846 LDKThirtyTwoBytes payment_preimage_ref;
9847 CHECK(payment_preimage->arr_len == 32);
9848 memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage);
9849 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
9850 *ret_conv = (this_arg_conv->send_spontaneous_payment)(this_arg_conv->this_arg, &route_conv, payment_preimage_ref);
9851 return tag_ptr(ret_conv, true);
9854 uint64_t __attribute__((export_name("TS_Payer_retry_payment"))) TS_Payer_retry_payment(uint64_t this_arg, uint64_t route, int8_tArray payment_id) {
9855 void* this_arg_ptr = untag_ptr(this_arg);
9856 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9857 LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
9858 LDKRoute route_conv;
9859 route_conv.inner = untag_ptr(route);
9860 route_conv.is_owned = ptr_is_owned(route);
9861 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
9862 route_conv.is_owned = false;
9863 LDKThirtyTwoBytes payment_id_ref;
9864 CHECK(payment_id->arr_len == 32);
9865 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
9866 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
9867 *ret_conv = (this_arg_conv->retry_payment)(this_arg_conv->this_arg, &route_conv, payment_id_ref);
9868 return tag_ptr(ret_conv, true);
9871 void __attribute__((export_name("TS_Payer_abandon_payment"))) TS_Payer_abandon_payment(uint64_t this_arg, int8_tArray payment_id) {
9872 void* this_arg_ptr = untag_ptr(this_arg);
9873 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9874 LDKPayer* this_arg_conv = (LDKPayer*)this_arg_ptr;
9875 LDKThirtyTwoBytes payment_id_ref;
9876 CHECK(payment_id->arr_len == 32);
9877 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
9878 (this_arg_conv->abandon_payment)(this_arg_conv->this_arg, payment_id_ref);
9881 typedef struct LDKRouter_JCalls {
9882 atomic_size_t refcnt;
9883 uint32_t instance_ptr;
9885 static void LDKRouter_JCalls_free(void* this_arg) {
9886 LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg;
9887 if (atomic_fetch_sub_explicit(&j_calls->refcnt, 1, memory_order_acquire) == 1) {
9891 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) {
9892 LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) this_arg;
9893 int8_tArray payer_arr = init_int8_tArray(33, __LINE__);
9894 memcpy(payer_arr->elems, payer.compressed_form, 33);
9895 LDKRouteParameters route_params_var = *route_params;
9896 uint64_t route_params_ref = 0;
9897 route_params_var = RouteParameters_clone(&route_params_var);
9898 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_var);
9899 route_params_ref = tag_ptr(route_params_var.inner, route_params_var.is_owned);
9900 int8_tArray payment_hash_arr = init_int8_tArray(32, __LINE__);
9901 memcpy(payment_hash_arr->elems, *payment_hash, 32);
9902 LDKCVec_ChannelDetailsZ *first_hops_var_ptr = first_hops;
9903 uint64_tArray first_hops_arr = NULL;
9904 if (first_hops != NULL) {
9905 LDKCVec_ChannelDetailsZ first_hops_var = *first_hops_var_ptr;
9906 first_hops_arr = init_uint64_tArray(first_hops_var.datalen, __LINE__);
9907 uint64_t *first_hops_arr_ptr = (uint64_t*)(((uint8_t*)first_hops_arr) + 8);
9908 for (size_t q = 0; q < first_hops_var.datalen; q++) {
9909 LDKChannelDetails first_hops_conv_16_var = first_hops_var.data[q];
9910 uint64_t first_hops_conv_16_ref = 0;
9911 CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_var);
9912 first_hops_conv_16_ref = tag_ptr(first_hops_conv_16_var.inner, first_hops_conv_16_var.is_owned);
9913 first_hops_arr_ptr[q] = first_hops_conv_16_ref;
9917 // WARNING: This object doesn't live past this scope, needs clone!
9918 uint64_t ret_scorer = tag_ptr(scorer, false);
9919 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);
9920 void* ret_ptr = untag_ptr(ret);
9921 CHECK_ACCESS(ret_ptr);
9922 LDKCResult_RouteLightningErrorZ ret_conv = *(LDKCResult_RouteLightningErrorZ*)(ret_ptr);
9923 FREE(untag_ptr(ret));
9926 static void LDKRouter_JCalls_cloned(LDKRouter* new_obj) {
9927 LDKRouter_JCalls *j_calls = (LDKRouter_JCalls*) new_obj->this_arg;
9928 atomic_fetch_add_explicit(&j_calls->refcnt, 1, memory_order_release);
9930 static inline LDKRouter LDKRouter_init (JSValue o) {
9931 LDKRouter_JCalls *calls = MALLOC(sizeof(LDKRouter_JCalls), "LDKRouter_JCalls");
9932 atomic_init(&calls->refcnt, 1);
9933 calls->instance_ptr = o;
9936 .this_arg = (void*) calls,
9937 .find_route = find_route_LDKRouter_jcall,
9938 .free = LDKRouter_JCalls_free,
9942 uint64_t __attribute__((export_name("TS_LDKRouter_new"))) TS_LDKRouter_new(JSValue o) {
9943 LDKRouter *res_ptr = MALLOC(sizeof(LDKRouter), "LDKRouter");
9944 *res_ptr = LDKRouter_init(o);
9945 return tag_ptr(res_ptr, true);
9947 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) {
9948 void* this_arg_ptr = untag_ptr(this_arg);
9949 if (ptr_is_owned(this_arg)) { CHECK_ACCESS(this_arg_ptr); }
9950 LDKRouter* this_arg_conv = (LDKRouter*)this_arg_ptr;
9951 LDKPublicKey payer_ref;
9952 CHECK(payer->arr_len == 33);
9953 memcpy(payer_ref.compressed_form, payer->elems, 33); FREE(payer);
9954 LDKRouteParameters route_params_conv;
9955 route_params_conv.inner = untag_ptr(route_params);
9956 route_params_conv.is_owned = ptr_is_owned(route_params);
9957 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv);
9958 route_params_conv.is_owned = false;
9959 unsigned char payment_hash_arr[32];
9960 CHECK(payment_hash->arr_len == 32);
9961 memcpy(payment_hash_arr, payment_hash->elems, 32); FREE(payment_hash);
9962 unsigned char (*payment_hash_ref)[32] = &payment_hash_arr;
9963 LDKCVec_ChannelDetailsZ first_hops_constr;
9964 LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL;
9965 if (first_hops != 0) {
9966 first_hops_constr.datalen = first_hops->arr_len;
9967 if (first_hops_constr.datalen > 0)
9968 first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
9970 first_hops_constr.data = NULL;
9971 uint64_t* first_hops_vals = first_hops->elems;
9972 for (size_t q = 0; q < first_hops_constr.datalen; q++) {
9973 uint64_t first_hops_conv_16 = first_hops_vals[q];
9974 LDKChannelDetails first_hops_conv_16_conv;
9975 first_hops_conv_16_conv.inner = untag_ptr(first_hops_conv_16);
9976 first_hops_conv_16_conv.is_owned = ptr_is_owned(first_hops_conv_16);
9977 CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv);
9978 first_hops_conv_16_conv.is_owned = false;
9979 first_hops_constr.data[q] = first_hops_conv_16_conv;
9982 first_hops_ptr = &first_hops_constr;
9984 void* scorer_ptr = untag_ptr(scorer);
9985 if (ptr_is_owned(scorer)) { CHECK_ACCESS(scorer_ptr); }
9986 LDKScore* scorer_conv = (LDKScore*)scorer_ptr;
9987 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
9988 *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);
9989 if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
9990 return tag_ptr(ret_conv, true);
9993 uint32_t __attribute__((export_name("TS_LDKRetry_ty_from_ptr"))) TS_LDKRetry_ty_from_ptr(uint64_t ptr) {
9994 LDKRetry *obj = (LDKRetry*)untag_ptr(ptr);
9996 case LDKRetry_Attempts: return 0;
10000 uint32_t __attribute__((export_name("TS_LDKRetry_Attempts_get_attempts"))) TS_LDKRetry_Attempts_get_attempts(uint64_t ptr) {
10001 LDKRetry *obj = (LDKRetry*)untag_ptr(ptr);
10002 assert(obj->tag == LDKRetry_Attempts);
10003 uint32_t attempts_conv = obj->attempts;
10004 return attempts_conv;
10006 jstring __attribute__((export_name("TS__ldk_get_compiled_version"))) TS__ldk_get_compiled_version() {
10007 LDKStr ret_str = _ldk_get_compiled_version();
10008 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
10013 jstring __attribute__((export_name("TS__ldk_c_bindings_get_compiled_version"))) TS__ldk_c_bindings_get_compiled_version() {
10014 LDKStr ret_str = _ldk_c_bindings_get_compiled_version();
10015 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
10020 static inline uint64_t Bech32Error_clone_ptr(LDKBech32Error *NONNULL_PTR arg) {
10021 LDKBech32Error *ret_copy = MALLOC(sizeof(LDKBech32Error), "LDKBech32Error");
10022 *ret_copy = Bech32Error_clone(arg);
10023 uint64_t ret_ref = tag_ptr(ret_copy, true);
10026 int64_t __attribute__((export_name("TS_Bech32Error_clone_ptr"))) TS_Bech32Error_clone_ptr(uint64_t arg) {
10027 LDKBech32Error* arg_conv = (LDKBech32Error*)untag_ptr(arg);
10028 int64_t ret_conv = Bech32Error_clone_ptr(arg_conv);
10032 uint64_t __attribute__((export_name("TS_Bech32Error_clone"))) TS_Bech32Error_clone(uint64_t orig) {
10033 LDKBech32Error* orig_conv = (LDKBech32Error*)untag_ptr(orig);
10034 LDKBech32Error *ret_copy = MALLOC(sizeof(LDKBech32Error), "LDKBech32Error");
10035 *ret_copy = Bech32Error_clone(orig_conv);
10036 uint64_t ret_ref = tag_ptr(ret_copy, true);
10040 void __attribute__((export_name("TS_Bech32Error_free"))) TS_Bech32Error_free(uint64_t o) {
10041 if (!ptr_is_owned(o)) return;
10042 void* o_ptr = untag_ptr(o);
10043 CHECK_ACCESS(o_ptr);
10044 LDKBech32Error o_conv = *(LDKBech32Error*)(o_ptr);
10045 FREE(untag_ptr(o));
10046 Bech32Error_free(o_conv);
10049 void __attribute__((export_name("TS_Transaction_free"))) TS_Transaction_free(int8_tArray _res) {
10050 LDKTransaction _res_ref;
10051 _res_ref.datalen = _res->arr_len;
10052 _res_ref.data = MALLOC(_res_ref.datalen, "LDKTransaction Bytes");
10053 memcpy(_res_ref.data, _res->elems, _res_ref.datalen); FREE(_res);
10054 _res_ref.data_is_owned = true;
10055 Transaction_free(_res_ref);
10058 uint64_t __attribute__((export_name("TS_TxOut_new"))) TS_TxOut_new(int8_tArray script_pubkey, int64_t value) {
10059 LDKCVec_u8Z script_pubkey_ref;
10060 script_pubkey_ref.datalen = script_pubkey->arr_len;
10061 script_pubkey_ref.data = MALLOC(script_pubkey_ref.datalen, "LDKCVec_u8Z Bytes");
10062 memcpy(script_pubkey_ref.data, script_pubkey->elems, script_pubkey_ref.datalen); FREE(script_pubkey);
10063 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
10064 *ret_ref = TxOut_new(script_pubkey_ref, value);
10065 return tag_ptr(ret_ref, true);
10068 void __attribute__((export_name("TS_TxOut_free"))) TS_TxOut_free(uint64_t _res) {
10069 if (!ptr_is_owned(_res)) return;
10070 void* _res_ptr = untag_ptr(_res);
10071 CHECK_ACCESS(_res_ptr);
10072 LDKTxOut _res_conv = *(LDKTxOut*)(_res_ptr);
10073 FREE(untag_ptr(_res));
10074 TxOut_free(_res_conv);
10077 static inline uint64_t TxOut_clone_ptr(LDKTxOut *NONNULL_PTR arg) {
10078 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
10079 *ret_ref = TxOut_clone(arg);
10080 return tag_ptr(ret_ref, true);
10082 int64_t __attribute__((export_name("TS_TxOut_clone_ptr"))) TS_TxOut_clone_ptr(uint64_t arg) {
10083 LDKTxOut* arg_conv = (LDKTxOut*)untag_ptr(arg);
10084 int64_t ret_conv = TxOut_clone_ptr(arg_conv);
10088 uint64_t __attribute__((export_name("TS_TxOut_clone"))) TS_TxOut_clone(uint64_t orig) {
10089 LDKTxOut* orig_conv = (LDKTxOut*)untag_ptr(orig);
10090 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
10091 *ret_ref = TxOut_clone(orig_conv);
10092 return tag_ptr(ret_ref, true);
10095 void __attribute__((export_name("TS_Str_free"))) TS_Str_free(jstring _res) {
10096 LDKStr dummy = { .chars = NULL, .len = 0, .chars_is_owned = false };
10100 uint64_t __attribute__((export_name("TS_CResult_NoneNoneZ_ok"))) TS_CResult_NoneNoneZ_ok() {
10101 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
10102 *ret_conv = CResult_NoneNoneZ_ok();
10103 return tag_ptr(ret_conv, true);
10106 uint64_t __attribute__((export_name("TS_CResult_NoneNoneZ_err"))) TS_CResult_NoneNoneZ_err() {
10107 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
10108 *ret_conv = CResult_NoneNoneZ_err();
10109 return tag_ptr(ret_conv, true);
10112 jboolean __attribute__((export_name("TS_CResult_NoneNoneZ_is_ok"))) TS_CResult_NoneNoneZ_is_ok(uint64_t o) {
10113 LDKCResult_NoneNoneZ* o_conv = (LDKCResult_NoneNoneZ*)untag_ptr(o);
10114 jboolean ret_conv = CResult_NoneNoneZ_is_ok(o_conv);
10118 void __attribute__((export_name("TS_CResult_NoneNoneZ_free"))) TS_CResult_NoneNoneZ_free(uint64_t _res) {
10119 if (!ptr_is_owned(_res)) return;
10120 void* _res_ptr = untag_ptr(_res);
10121 CHECK_ACCESS(_res_ptr);
10122 LDKCResult_NoneNoneZ _res_conv = *(LDKCResult_NoneNoneZ*)(_res_ptr);
10123 FREE(untag_ptr(_res));
10124 CResult_NoneNoneZ_free(_res_conv);
10127 static inline uint64_t CResult_NoneNoneZ_clone_ptr(LDKCResult_NoneNoneZ *NONNULL_PTR arg) {
10128 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
10129 *ret_conv = CResult_NoneNoneZ_clone(arg);
10130 return tag_ptr(ret_conv, true);
10132 int64_t __attribute__((export_name("TS_CResult_NoneNoneZ_clone_ptr"))) TS_CResult_NoneNoneZ_clone_ptr(uint64_t arg) {
10133 LDKCResult_NoneNoneZ* arg_conv = (LDKCResult_NoneNoneZ*)untag_ptr(arg);
10134 int64_t ret_conv = CResult_NoneNoneZ_clone_ptr(arg_conv);
10138 uint64_t __attribute__((export_name("TS_CResult_NoneNoneZ_clone"))) TS_CResult_NoneNoneZ_clone(uint64_t orig) {
10139 LDKCResult_NoneNoneZ* orig_conv = (LDKCResult_NoneNoneZ*)untag_ptr(orig);
10140 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
10141 *ret_conv = CResult_NoneNoneZ_clone(orig_conv);
10142 return tag_ptr(ret_conv, true);
10145 uint64_t __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(uint64_t o) {
10146 LDKCounterpartyCommitmentSecrets o_conv;
10147 o_conv.inner = untag_ptr(o);
10148 o_conv.is_owned = ptr_is_owned(o);
10149 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
10150 o_conv = CounterpartyCommitmentSecrets_clone(&o_conv);
10151 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
10152 *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_ok(o_conv);
10153 return tag_ptr(ret_conv, true);
10156 uint64_t __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(uint64_t e) {
10157 LDKDecodeError e_conv;
10158 e_conv.inner = untag_ptr(e);
10159 e_conv.is_owned = ptr_is_owned(e);
10160 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
10161 e_conv = DecodeError_clone(&e_conv);
10162 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
10163 *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_err(e_conv);
10164 return tag_ptr(ret_conv, true);
10167 jboolean __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(uint64_t o) {
10168 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* o_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(o);
10169 jboolean ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_is_ok(o_conv);
10173 void __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(uint64_t _res) {
10174 if (!ptr_is_owned(_res)) return;
10175 void* _res_ptr = untag_ptr(_res);
10176 CHECK_ACCESS(_res_ptr);
10177 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)(_res_ptr);
10178 FREE(untag_ptr(_res));
10179 CResult_CounterpartyCommitmentSecretsDecodeErrorZ_free(_res_conv);
10182 static inline uint64_t CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ *NONNULL_PTR arg) {
10183 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
10184 *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(arg);
10185 return tag_ptr(ret_conv, true);
10187 int64_t __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr(uint64_t arg) {
10188 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(arg);
10189 int64_t ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone_ptr(arg_conv);
10193 uint64_t __attribute__((export_name("TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone"))) TS_CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(uint64_t orig) {
10194 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ*)untag_ptr(orig);
10195 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
10196 *ret_conv = CResult_CounterpartyCommitmentSecretsDecodeErrorZ_clone(orig_conv);
10197 return tag_ptr(ret_conv, true);
10200 uint64_t __attribute__((export_name("TS_CResult_SecretKeyErrorZ_ok"))) TS_CResult_SecretKeyErrorZ_ok(int8_tArray o) {
10201 LDKSecretKey o_ref;
10202 CHECK(o->arr_len == 32);
10203 memcpy(o_ref.bytes, o->elems, 32); FREE(o);
10204 LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
10205 *ret_conv = CResult_SecretKeyErrorZ_ok(o_ref);
10206 return tag_ptr(ret_conv, true);
10209 uint64_t __attribute__((export_name("TS_CResult_SecretKeyErrorZ_err"))) TS_CResult_SecretKeyErrorZ_err(uint32_t e) {
10210 LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_js(e);
10211 LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
10212 *ret_conv = CResult_SecretKeyErrorZ_err(e_conv);
10213 return tag_ptr(ret_conv, true);
10216 jboolean __attribute__((export_name("TS_CResult_SecretKeyErrorZ_is_ok"))) TS_CResult_SecretKeyErrorZ_is_ok(uint64_t o) {
10217 LDKCResult_SecretKeyErrorZ* o_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(o);
10218 jboolean ret_conv = CResult_SecretKeyErrorZ_is_ok(o_conv);
10222 void __attribute__((export_name("TS_CResult_SecretKeyErrorZ_free"))) TS_CResult_SecretKeyErrorZ_free(uint64_t _res) {
10223 if (!ptr_is_owned(_res)) return;
10224 void* _res_ptr = untag_ptr(_res);
10225 CHECK_ACCESS(_res_ptr);
10226 LDKCResult_SecretKeyErrorZ _res_conv = *(LDKCResult_SecretKeyErrorZ*)(_res_ptr);
10227 FREE(untag_ptr(_res));
10228 CResult_SecretKeyErrorZ_free(_res_conv);
10231 static inline uint64_t CResult_SecretKeyErrorZ_clone_ptr(LDKCResult_SecretKeyErrorZ *NONNULL_PTR arg) {
10232 LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
10233 *ret_conv = CResult_SecretKeyErrorZ_clone(arg);
10234 return tag_ptr(ret_conv, true);
10236 int64_t __attribute__((export_name("TS_CResult_SecretKeyErrorZ_clone_ptr"))) TS_CResult_SecretKeyErrorZ_clone_ptr(uint64_t arg) {
10237 LDKCResult_SecretKeyErrorZ* arg_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(arg);
10238 int64_t ret_conv = CResult_SecretKeyErrorZ_clone_ptr(arg_conv);
10242 uint64_t __attribute__((export_name("TS_CResult_SecretKeyErrorZ_clone"))) TS_CResult_SecretKeyErrorZ_clone(uint64_t orig) {
10243 LDKCResult_SecretKeyErrorZ* orig_conv = (LDKCResult_SecretKeyErrorZ*)untag_ptr(orig);
10244 LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
10245 *ret_conv = CResult_SecretKeyErrorZ_clone(orig_conv);
10246 return tag_ptr(ret_conv, true);
10249 uint64_t __attribute__((export_name("TS_CResult_PublicKeyErrorZ_ok"))) TS_CResult_PublicKeyErrorZ_ok(int8_tArray o) {
10250 LDKPublicKey o_ref;
10251 CHECK(o->arr_len == 33);
10252 memcpy(o_ref.compressed_form, o->elems, 33); FREE(o);
10253 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
10254 *ret_conv = CResult_PublicKeyErrorZ_ok(o_ref);
10255 return tag_ptr(ret_conv, true);
10258 uint64_t __attribute__((export_name("TS_CResult_PublicKeyErrorZ_err"))) TS_CResult_PublicKeyErrorZ_err(uint32_t e) {
10259 LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_js(e);
10260 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
10261 *ret_conv = CResult_PublicKeyErrorZ_err(e_conv);
10262 return tag_ptr(ret_conv, true);
10265 jboolean __attribute__((export_name("TS_CResult_PublicKeyErrorZ_is_ok"))) TS_CResult_PublicKeyErrorZ_is_ok(uint64_t o) {
10266 LDKCResult_PublicKeyErrorZ* o_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(o);
10267 jboolean ret_conv = CResult_PublicKeyErrorZ_is_ok(o_conv);
10271 void __attribute__((export_name("TS_CResult_PublicKeyErrorZ_free"))) TS_CResult_PublicKeyErrorZ_free(uint64_t _res) {
10272 if (!ptr_is_owned(_res)) return;
10273 void* _res_ptr = untag_ptr(_res);
10274 CHECK_ACCESS(_res_ptr);
10275 LDKCResult_PublicKeyErrorZ _res_conv = *(LDKCResult_PublicKeyErrorZ*)(_res_ptr);
10276 FREE(untag_ptr(_res));
10277 CResult_PublicKeyErrorZ_free(_res_conv);
10280 static inline uint64_t CResult_PublicKeyErrorZ_clone_ptr(LDKCResult_PublicKeyErrorZ *NONNULL_PTR arg) {
10281 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
10282 *ret_conv = CResult_PublicKeyErrorZ_clone(arg);
10283 return tag_ptr(ret_conv, true);
10285 int64_t __attribute__((export_name("TS_CResult_PublicKeyErrorZ_clone_ptr"))) TS_CResult_PublicKeyErrorZ_clone_ptr(uint64_t arg) {
10286 LDKCResult_PublicKeyErrorZ* arg_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(arg);
10287 int64_t ret_conv = CResult_PublicKeyErrorZ_clone_ptr(arg_conv);
10291 uint64_t __attribute__((export_name("TS_CResult_PublicKeyErrorZ_clone"))) TS_CResult_PublicKeyErrorZ_clone(uint64_t orig) {
10292 LDKCResult_PublicKeyErrorZ* orig_conv = (LDKCResult_PublicKeyErrorZ*)untag_ptr(orig);
10293 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
10294 *ret_conv = CResult_PublicKeyErrorZ_clone(orig_conv);
10295 return tag_ptr(ret_conv, true);
10298 uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_ok"))) TS_CResult_TxCreationKeysDecodeErrorZ_ok(uint64_t o) {
10299 LDKTxCreationKeys o_conv;
10300 o_conv.inner = untag_ptr(o);
10301 o_conv.is_owned = ptr_is_owned(o);
10302 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
10303 o_conv = TxCreationKeys_clone(&o_conv);
10304 LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
10305 *ret_conv = CResult_TxCreationKeysDecodeErrorZ_ok(o_conv);
10306 return tag_ptr(ret_conv, true);
10309 uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_err"))) TS_CResult_TxCreationKeysDecodeErrorZ_err(uint64_t e) {
10310 LDKDecodeError e_conv;
10311 e_conv.inner = untag_ptr(e);
10312 e_conv.is_owned = ptr_is_owned(e);
10313 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
10314 e_conv = DecodeError_clone(&e_conv);
10315 LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
10316 *ret_conv = CResult_TxCreationKeysDecodeErrorZ_err(e_conv);
10317 return tag_ptr(ret_conv, true);
10320 jboolean __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_is_ok"))) TS_CResult_TxCreationKeysDecodeErrorZ_is_ok(uint64_t o) {
10321 LDKCResult_TxCreationKeysDecodeErrorZ* o_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(o);
10322 jboolean ret_conv = CResult_TxCreationKeysDecodeErrorZ_is_ok(o_conv);
10326 void __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_free"))) TS_CResult_TxCreationKeysDecodeErrorZ_free(uint64_t _res) {
10327 if (!ptr_is_owned(_res)) return;
10328 void* _res_ptr = untag_ptr(_res);
10329 CHECK_ACCESS(_res_ptr);
10330 LDKCResult_TxCreationKeysDecodeErrorZ _res_conv = *(LDKCResult_TxCreationKeysDecodeErrorZ*)(_res_ptr);
10331 FREE(untag_ptr(_res));
10332 CResult_TxCreationKeysDecodeErrorZ_free(_res_conv);
10335 static inline uint64_t CResult_TxCreationKeysDecodeErrorZ_clone_ptr(LDKCResult_TxCreationKeysDecodeErrorZ *NONNULL_PTR arg) {
10336 LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
10337 *ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone(arg);
10338 return tag_ptr(ret_conv, true);
10340 int64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_clone_ptr"))) TS_CResult_TxCreationKeysDecodeErrorZ_clone_ptr(uint64_t arg) {
10341 LDKCResult_TxCreationKeysDecodeErrorZ* arg_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(arg);
10342 int64_t ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone_ptr(arg_conv);
10346 uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysDecodeErrorZ_clone"))) TS_CResult_TxCreationKeysDecodeErrorZ_clone(uint64_t orig) {
10347 LDKCResult_TxCreationKeysDecodeErrorZ* orig_conv = (LDKCResult_TxCreationKeysDecodeErrorZ*)untag_ptr(orig);
10348 LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
10349 *ret_conv = CResult_TxCreationKeysDecodeErrorZ_clone(orig_conv);
10350 return tag_ptr(ret_conv, true);
10353 uint64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_ok"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_ok(uint64_t o) {
10354 LDKChannelPublicKeys o_conv;
10355 o_conv.inner = untag_ptr(o);
10356 o_conv.is_owned = ptr_is_owned(o);
10357 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
10358 o_conv = ChannelPublicKeys_clone(&o_conv);
10359 LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
10360 *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_ok(o_conv);
10361 return tag_ptr(ret_conv, true);
10364 uint64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_err"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_err(uint64_t e) {
10365 LDKDecodeError e_conv;
10366 e_conv.inner = untag_ptr(e);
10367 e_conv.is_owned = ptr_is_owned(e);
10368 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
10369 e_conv = DecodeError_clone(&e_conv);
10370 LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
10371 *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_err(e_conv);
10372 return tag_ptr(ret_conv, true);
10375 jboolean __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_is_ok"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_is_ok(uint64_t o) {
10376 LDKCResult_ChannelPublicKeysDecodeErrorZ* o_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(o);
10377 jboolean ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_is_ok(o_conv);
10381 void __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_free"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_free(uint64_t _res) {
10382 if (!ptr_is_owned(_res)) return;
10383 void* _res_ptr = untag_ptr(_res);
10384 CHECK_ACCESS(_res_ptr);
10385 LDKCResult_ChannelPublicKeysDecodeErrorZ _res_conv = *(LDKCResult_ChannelPublicKeysDecodeErrorZ*)(_res_ptr);
10386 FREE(untag_ptr(_res));
10387 CResult_ChannelPublicKeysDecodeErrorZ_free(_res_conv);
10390 static inline uint64_t CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(LDKCResult_ChannelPublicKeysDecodeErrorZ *NONNULL_PTR arg) {
10391 LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
10392 *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone(arg);
10393 return tag_ptr(ret_conv, true);
10395 int64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(uint64_t arg) {
10396 LDKCResult_ChannelPublicKeysDecodeErrorZ* arg_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(arg);
10397 int64_t ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone_ptr(arg_conv);
10401 uint64_t __attribute__((export_name("TS_CResult_ChannelPublicKeysDecodeErrorZ_clone"))) TS_CResult_ChannelPublicKeysDecodeErrorZ_clone(uint64_t orig) {
10402 LDKCResult_ChannelPublicKeysDecodeErrorZ* orig_conv = (LDKCResult_ChannelPublicKeysDecodeErrorZ*)untag_ptr(orig);
10403 LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
10404 *ret_conv = CResult_ChannelPublicKeysDecodeErrorZ_clone(orig_conv);
10405 return tag_ptr(ret_conv, true);
10408 uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_ok"))) TS_CResult_TxCreationKeysErrorZ_ok(uint64_t o) {
10409 LDKTxCreationKeys o_conv;
10410 o_conv.inner = untag_ptr(o);
10411 o_conv.is_owned = ptr_is_owned(o);
10412 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
10413 o_conv = TxCreationKeys_clone(&o_conv);
10414 LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
10415 *ret_conv = CResult_TxCreationKeysErrorZ_ok(o_conv);
10416 return tag_ptr(ret_conv, true);
10419 uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_err"))) TS_CResult_TxCreationKeysErrorZ_err(uint32_t e) {
10420 LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_js(e);
10421 LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
10422 *ret_conv = CResult_TxCreationKeysErrorZ_err(e_conv);
10423 return tag_ptr(ret_conv, true);
10426 jboolean __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_is_ok"))) TS_CResult_TxCreationKeysErrorZ_is_ok(uint64_t o) {
10427 LDKCResult_TxCreationKeysErrorZ* o_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(o);
10428 jboolean ret_conv = CResult_TxCreationKeysErrorZ_is_ok(o_conv);
10432 void __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_free"))) TS_CResult_TxCreationKeysErrorZ_free(uint64_t _res) {
10433 if (!ptr_is_owned(_res)) return;
10434 void* _res_ptr = untag_ptr(_res);
10435 CHECK_ACCESS(_res_ptr);
10436 LDKCResult_TxCreationKeysErrorZ _res_conv = *(LDKCResult_TxCreationKeysErrorZ*)(_res_ptr);
10437 FREE(untag_ptr(_res));
10438 CResult_TxCreationKeysErrorZ_free(_res_conv);
10441 static inline uint64_t CResult_TxCreationKeysErrorZ_clone_ptr(LDKCResult_TxCreationKeysErrorZ *NONNULL_PTR arg) {
10442 LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
10443 *ret_conv = CResult_TxCreationKeysErrorZ_clone(arg);
10444 return tag_ptr(ret_conv, true);
10446 int64_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_clone_ptr"))) TS_CResult_TxCreationKeysErrorZ_clone_ptr(uint64_t arg) {
10447 LDKCResult_TxCreationKeysErrorZ* arg_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(arg);
10448 int64_t ret_conv = CResult_TxCreationKeysErrorZ_clone_ptr(arg_conv);
10452 uint64_t __attribute__((export_name("TS_CResult_TxCreationKeysErrorZ_clone"))) TS_CResult_TxCreationKeysErrorZ_clone(uint64_t orig) {
10453 LDKCResult_TxCreationKeysErrorZ* orig_conv = (LDKCResult_TxCreationKeysErrorZ*)untag_ptr(orig);
10454 LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
10455 *ret_conv = CResult_TxCreationKeysErrorZ_clone(orig_conv);
10456 return tag_ptr(ret_conv, true);
10459 uint64_t __attribute__((export_name("TS_COption_u32Z_some"))) TS_COption_u32Z_some(int32_t o) {
10460 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
10461 *ret_copy = COption_u32Z_some(o);
10462 uint64_t ret_ref = tag_ptr(ret_copy, true);
10466 uint64_t __attribute__((export_name("TS_COption_u32Z_none"))) TS_COption_u32Z_none() {
10467 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
10468 *ret_copy = COption_u32Z_none();
10469 uint64_t ret_ref = tag_ptr(ret_copy, true);
10473 void __attribute__((export_name("TS_COption_u32Z_free"))) TS_COption_u32Z_free(uint64_t _res) {
10474 if (!ptr_is_owned(_res)) return;
10475 void* _res_ptr = untag_ptr(_res);
10476 CHECK_ACCESS(_res_ptr);
10477 LDKCOption_u32Z _res_conv = *(LDKCOption_u32Z*)(_res_ptr);
10478 FREE(untag_ptr(_res));
10479 COption_u32Z_free(_res_conv);
10482 static inline uint64_t COption_u32Z_clone_ptr(LDKCOption_u32Z *NONNULL_PTR arg) {
10483 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
10484 *ret_copy = COption_u32Z_clone(arg);
10485 uint64_t ret_ref = tag_ptr(ret_copy, true);
10488 int64_t __attribute__((export_name("TS_COption_u32Z_clone_ptr"))) TS_COption_u32Z_clone_ptr(uint64_t arg) {
10489 LDKCOption_u32Z* arg_conv = (LDKCOption_u32Z*)untag_ptr(arg);
10490 int64_t ret_conv = COption_u32Z_clone_ptr(arg_conv);
10494 uint64_t __attribute__((export_name("TS_COption_u32Z_clone"))) TS_COption_u32Z_clone(uint64_t orig) {
10495 LDKCOption_u32Z* orig_conv = (LDKCOption_u32Z*)untag_ptr(orig);
10496 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
10497 *ret_copy = COption_u32Z_clone(orig_conv);
10498 uint64_t ret_ref = tag_ptr(ret_copy, true);
10502 uint64_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_ok"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(uint64_t o) {
10503 LDKHTLCOutputInCommitment o_conv;
10504 o_conv.inner = untag_ptr(o);
10505 o_conv.is_owned = ptr_is_owned(o);
10506 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
10507 o_conv = HTLCOutputInCommitment_clone(&o_conv);
10508 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
10509 *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_ok(o_conv);
10510 return tag_ptr(ret_conv, true);
10513 uint64_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_err"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_err(uint64_t e) {
10514 LDKDecodeError e_conv;
10515 e_conv.inner = untag_ptr(e);
10516 e_conv.is_owned = ptr_is_owned(e);
10517 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
10518 e_conv = DecodeError_clone(&e_conv);
10519 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
10520 *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_err(e_conv);
10521 return tag_ptr(ret_conv, true);
10524 jboolean __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(uint64_t o) {
10525 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* o_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(o);
10526 jboolean ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_is_ok(o_conv);
10530 void __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_free"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_free(uint64_t _res) {
10531 if (!ptr_is_owned(_res)) return;
10532 void* _res_ptr = untag_ptr(_res);
10533 CHECK_ACCESS(_res_ptr);
10534 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ _res_conv = *(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)(_res_ptr);
10535 FREE(untag_ptr(_res));
10536 CResult_HTLCOutputInCommitmentDecodeErrorZ_free(_res_conv);
10539 static inline uint64_t CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ *NONNULL_PTR arg) {
10540 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
10541 *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(arg);
10542 return tag_ptr(ret_conv, true);
10544 int64_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(uint64_t arg) {
10545 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* arg_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(arg);
10546 int64_t ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone_ptr(arg_conv);
10550 uint64_t __attribute__((export_name("TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone"))) TS_CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(uint64_t orig) {
10551 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* orig_conv = (LDKCResult_HTLCOutputInCommitmentDecodeErrorZ*)untag_ptr(orig);
10552 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
10553 *ret_conv = CResult_HTLCOutputInCommitmentDecodeErrorZ_clone(orig_conv);
10554 return tag_ptr(ret_conv, true);
10557 uint32_t __attribute__((export_name("TS_COption_NoneZ_some"))) TS_COption_NoneZ_some() {
10558 uint32_t ret_conv = LDKCOption_NoneZ_to_js(COption_NoneZ_some());
10562 uint32_t __attribute__((export_name("TS_COption_NoneZ_none"))) TS_COption_NoneZ_none() {
10563 uint32_t ret_conv = LDKCOption_NoneZ_to_js(COption_NoneZ_none());
10567 void __attribute__((export_name("TS_COption_NoneZ_free"))) TS_COption_NoneZ_free(uint32_t _res) {
10568 LDKCOption_NoneZ _res_conv = LDKCOption_NoneZ_from_js(_res);
10569 COption_NoneZ_free(_res_conv);
10572 uint64_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(uint64_t o) {
10573 LDKCounterpartyChannelTransactionParameters o_conv;
10574 o_conv.inner = untag_ptr(o);
10575 o_conv.is_owned = ptr_is_owned(o);
10576 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
10577 o_conv = CounterpartyChannelTransactionParameters_clone(&o_conv);
10578 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
10579 *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_ok(o_conv);
10580 return tag_ptr(ret_conv, true);
10583 uint64_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(uint64_t e) {
10584 LDKDecodeError e_conv;
10585 e_conv.inner = untag_ptr(e);
10586 e_conv.is_owned = ptr_is_owned(e);
10587 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
10588 e_conv = DecodeError_clone(&e_conv);
10589 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
10590 *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_err(e_conv);
10591 return tag_ptr(ret_conv, true);
10594 jboolean __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(uint64_t o) {
10595 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* o_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(o);
10596 jboolean ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_is_ok(o_conv);
10600 void __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(uint64_t _res) {
10601 if (!ptr_is_owned(_res)) return;
10602 void* _res_ptr = untag_ptr(_res);
10603 CHECK_ACCESS(_res_ptr);
10604 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)(_res_ptr);
10605 FREE(untag_ptr(_res));
10606 CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_free(_res_conv);
10609 static inline uint64_t CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg) {
10610 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
10611 *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(arg);
10612 return tag_ptr(ret_conv, true);
10614 int64_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(uint64_t arg) {
10615 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(arg);
10616 int64_t ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv);
10620 uint64_t __attribute__((export_name("TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone"))) TS_CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(uint64_t orig) {
10621 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ*)untag_ptr(orig);
10622 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
10623 *ret_conv = CResult_CounterpartyChannelTransactionParametersDecodeErrorZ_clone(orig_conv);
10624 return tag_ptr(ret_conv, true);
10627 uint64_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_ok"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_ok(uint64_t o) {
10628 LDKChannelTransactionParameters o_conv;
10629 o_conv.inner = untag_ptr(o);
10630 o_conv.is_owned = ptr_is_owned(o);
10631 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
10632 o_conv = ChannelTransactionParameters_clone(&o_conv);
10633 LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
10634 *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_ok(o_conv);
10635 return tag_ptr(ret_conv, true);
10638 uint64_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_err"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_err(uint64_t e) {
10639 LDKDecodeError e_conv;
10640 e_conv.inner = untag_ptr(e);
10641 e_conv.is_owned = ptr_is_owned(e);
10642 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
10643 e_conv = DecodeError_clone(&e_conv);
10644 LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
10645 *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_err(e_conv);
10646 return tag_ptr(ret_conv, true);
10649 jboolean __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_is_ok"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(uint64_t o) {
10650 LDKCResult_ChannelTransactionParametersDecodeErrorZ* o_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(o);
10651 jboolean ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_is_ok(o_conv);
10655 void __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_free"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_free(uint64_t _res) {
10656 if (!ptr_is_owned(_res)) return;
10657 void* _res_ptr = untag_ptr(_res);
10658 CHECK_ACCESS(_res_ptr);
10659 LDKCResult_ChannelTransactionParametersDecodeErrorZ _res_conv = *(LDKCResult_ChannelTransactionParametersDecodeErrorZ*)(_res_ptr);
10660 FREE(untag_ptr(_res));
10661 CResult_ChannelTransactionParametersDecodeErrorZ_free(_res_conv);
10664 static inline uint64_t CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(LDKCResult_ChannelTransactionParametersDecodeErrorZ *NONNULL_PTR arg) {
10665 LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
10666 *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone(arg);
10667 return tag_ptr(ret_conv, true);
10669 int64_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(uint64_t arg) {
10670 LDKCResult_ChannelTransactionParametersDecodeErrorZ* arg_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(arg);
10671 int64_t ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone_ptr(arg_conv);
10675 uint64_t __attribute__((export_name("TS_CResult_ChannelTransactionParametersDecodeErrorZ_clone"))) TS_CResult_ChannelTransactionParametersDecodeErrorZ_clone(uint64_t orig) {
10676 LDKCResult_ChannelTransactionParametersDecodeErrorZ* orig_conv = (LDKCResult_ChannelTransactionParametersDecodeErrorZ*)untag_ptr(orig);
10677 LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
10678 *ret_conv = CResult_ChannelTransactionParametersDecodeErrorZ_clone(orig_conv);
10679 return tag_ptr(ret_conv, true);
10682 void __attribute__((export_name("TS_CVec_SignatureZ_free"))) TS_CVec_SignatureZ_free(ptrArray _res) {
10683 LDKCVec_SignatureZ _res_constr;
10684 _res_constr.datalen = _res->arr_len;
10685 if (_res_constr.datalen > 0)
10686 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
10688 _res_constr.data = NULL;
10689 int8_tArray* _res_vals = (void*) _res->elems;
10690 for (size_t m = 0; m < _res_constr.datalen; m++) {
10691 int8_tArray _res_conv_12 = _res_vals[m];
10692 LDKSignature _res_conv_12_ref;
10693 CHECK(_res_conv_12->arr_len == 64);
10694 memcpy(_res_conv_12_ref.compact_form, _res_conv_12->elems, 64); FREE(_res_conv_12);
10695 _res_constr.data[m] = _res_conv_12_ref;
10698 CVec_SignatureZ_free(_res_constr);
10701 uint64_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_ok"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_ok(uint64_t o) {
10702 LDKHolderCommitmentTransaction o_conv;
10703 o_conv.inner = untag_ptr(o);
10704 o_conv.is_owned = ptr_is_owned(o);
10705 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
10706 o_conv = HolderCommitmentTransaction_clone(&o_conv);
10707 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
10708 *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_ok(o_conv);
10709 return tag_ptr(ret_conv, true);
10712 uint64_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_err"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_err(uint64_t e) {
10713 LDKDecodeError e_conv;
10714 e_conv.inner = untag_ptr(e);
10715 e_conv.is_owned = ptr_is_owned(e);
10716 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
10717 e_conv = DecodeError_clone(&e_conv);
10718 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
10719 *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_err(e_conv);
10720 return tag_ptr(ret_conv, true);
10723 jboolean __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(uint64_t o) {
10724 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(o);
10725 jboolean ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_is_ok(o_conv);
10729 void __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_free"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_free(uint64_t _res) {
10730 if (!ptr_is_owned(_res)) return;
10731 void* _res_ptr = untag_ptr(_res);
10732 CHECK_ACCESS(_res_ptr);
10733 LDKCResult_HolderCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)(_res_ptr);
10734 FREE(untag_ptr(_res));
10735 CResult_HolderCommitmentTransactionDecodeErrorZ_free(_res_conv);
10738 static inline uint64_t CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_HolderCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) {
10739 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
10740 *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone(arg);
10741 return tag_ptr(ret_conv, true);
10743 int64_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(uint64_t arg) {
10744 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(arg);
10745 int64_t ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv);
10749 uint64_t __attribute__((export_name("TS_CResult_HolderCommitmentTransactionDecodeErrorZ_clone"))) TS_CResult_HolderCommitmentTransactionDecodeErrorZ_clone(uint64_t orig) {
10750 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_HolderCommitmentTransactionDecodeErrorZ*)untag_ptr(orig);
10751 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
10752 *ret_conv = CResult_HolderCommitmentTransactionDecodeErrorZ_clone(orig_conv);
10753 return tag_ptr(ret_conv, true);
10756 uint64_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_ok"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(uint64_t o) {
10757 LDKBuiltCommitmentTransaction o_conv;
10758 o_conv.inner = untag_ptr(o);
10759 o_conv.is_owned = ptr_is_owned(o);
10760 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
10761 o_conv = BuiltCommitmentTransaction_clone(&o_conv);
10762 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
10763 *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_ok(o_conv);
10764 return tag_ptr(ret_conv, true);
10767 uint64_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_err"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_err(uint64_t e) {
10768 LDKDecodeError e_conv;
10769 e_conv.inner = untag_ptr(e);
10770 e_conv.is_owned = ptr_is_owned(e);
10771 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
10772 e_conv = DecodeError_clone(&e_conv);
10773 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
10774 *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_err(e_conv);
10775 return tag_ptr(ret_conv, true);
10778 jboolean __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(uint64_t o) {
10779 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(o);
10780 jboolean ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_is_ok(o_conv);
10784 void __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_free"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_free(uint64_t _res) {
10785 if (!ptr_is_owned(_res)) return;
10786 void* _res_ptr = untag_ptr(_res);
10787 CHECK_ACCESS(_res_ptr);
10788 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)(_res_ptr);
10789 FREE(untag_ptr(_res));
10790 CResult_BuiltCommitmentTransactionDecodeErrorZ_free(_res_conv);
10793 static inline uint64_t CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) {
10794 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
10795 *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(arg);
10796 return tag_ptr(ret_conv, true);
10798 int64_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(uint64_t arg) {
10799 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(arg);
10800 int64_t ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv);
10804 uint64_t __attribute__((export_name("TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone"))) TS_CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(uint64_t orig) {
10805 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_BuiltCommitmentTransactionDecodeErrorZ*)untag_ptr(orig);
10806 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
10807 *ret_conv = CResult_BuiltCommitmentTransactionDecodeErrorZ_clone(orig_conv);
10808 return tag_ptr(ret_conv, true);
10811 uint64_t __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_ok"))) TS_CResult_TrustedClosingTransactionNoneZ_ok(uint64_t o) {
10812 LDKTrustedClosingTransaction o_conv;
10813 o_conv.inner = untag_ptr(o);
10814 o_conv.is_owned = ptr_is_owned(o);
10815 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
10816 // WARNING: we need a move here but no clone is available for LDKTrustedClosingTransaction
10818 LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ");
10819 *ret_conv = CResult_TrustedClosingTransactionNoneZ_ok(o_conv);
10820 return tag_ptr(ret_conv, true);
10823 uint64_t __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_err"))) TS_CResult_TrustedClosingTransactionNoneZ_err() {
10824 LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ");
10825 *ret_conv = CResult_TrustedClosingTransactionNoneZ_err();
10826 return tag_ptr(ret_conv, true);
10829 jboolean __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_is_ok"))) TS_CResult_TrustedClosingTransactionNoneZ_is_ok(uint64_t o) {
10830 LDKCResult_TrustedClosingTransactionNoneZ* o_conv = (LDKCResult_TrustedClosingTransactionNoneZ*)untag_ptr(o);
10831 jboolean ret_conv = CResult_TrustedClosingTransactionNoneZ_is_ok(o_conv);
10835 void __attribute__((export_name("TS_CResult_TrustedClosingTransactionNoneZ_free"))) TS_CResult_TrustedClosingTransactionNoneZ_free(uint64_t _res) {
10836 if (!ptr_is_owned(_res)) return;
10837 void* _res_ptr = untag_ptr(_res);
10838 CHECK_ACCESS(_res_ptr);
10839 LDKCResult_TrustedClosingTransactionNoneZ _res_conv = *(LDKCResult_TrustedClosingTransactionNoneZ*)(_res_ptr);
10840 FREE(untag_ptr(_res));
10841 CResult_TrustedClosingTransactionNoneZ_free(_res_conv);
10844 uint64_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_ok"))) TS_CResult_CommitmentTransactionDecodeErrorZ_ok(uint64_t o) {
10845 LDKCommitmentTransaction o_conv;
10846 o_conv.inner = untag_ptr(o);
10847 o_conv.is_owned = ptr_is_owned(o);
10848 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
10849 o_conv = CommitmentTransaction_clone(&o_conv);
10850 LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
10851 *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_ok(o_conv);
10852 return tag_ptr(ret_conv, true);
10855 uint64_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_err"))) TS_CResult_CommitmentTransactionDecodeErrorZ_err(uint64_t e) {
10856 LDKDecodeError e_conv;
10857 e_conv.inner = untag_ptr(e);
10858 e_conv.is_owned = ptr_is_owned(e);
10859 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
10860 e_conv = DecodeError_clone(&e_conv);
10861 LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
10862 *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_err(e_conv);
10863 return tag_ptr(ret_conv, true);
10866 jboolean __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_is_ok"))) TS_CResult_CommitmentTransactionDecodeErrorZ_is_ok(uint64_t o) {
10867 LDKCResult_CommitmentTransactionDecodeErrorZ* o_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(o);
10868 jboolean ret_conv = CResult_CommitmentTransactionDecodeErrorZ_is_ok(o_conv);
10872 void __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_free"))) TS_CResult_CommitmentTransactionDecodeErrorZ_free(uint64_t _res) {
10873 if (!ptr_is_owned(_res)) return;
10874 void* _res_ptr = untag_ptr(_res);
10875 CHECK_ACCESS(_res_ptr);
10876 LDKCResult_CommitmentTransactionDecodeErrorZ _res_conv = *(LDKCResult_CommitmentTransactionDecodeErrorZ*)(_res_ptr);
10877 FREE(untag_ptr(_res));
10878 CResult_CommitmentTransactionDecodeErrorZ_free(_res_conv);
10881 static inline uint64_t CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(LDKCResult_CommitmentTransactionDecodeErrorZ *NONNULL_PTR arg) {
10882 LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
10883 *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone(arg);
10884 return tag_ptr(ret_conv, true);
10886 int64_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_clone_ptr"))) TS_CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(uint64_t arg) {
10887 LDKCResult_CommitmentTransactionDecodeErrorZ* arg_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(arg);
10888 int64_t ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone_ptr(arg_conv);
10892 uint64_t __attribute__((export_name("TS_CResult_CommitmentTransactionDecodeErrorZ_clone"))) TS_CResult_CommitmentTransactionDecodeErrorZ_clone(uint64_t orig) {
10893 LDKCResult_CommitmentTransactionDecodeErrorZ* orig_conv = (LDKCResult_CommitmentTransactionDecodeErrorZ*)untag_ptr(orig);
10894 LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
10895 *ret_conv = CResult_CommitmentTransactionDecodeErrorZ_clone(orig_conv);
10896 return tag_ptr(ret_conv, true);
10899 uint64_t __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNoneZ_ok"))) TS_CResult_TrustedCommitmentTransactionNoneZ_ok(uint64_t o) {
10900 LDKTrustedCommitmentTransaction o_conv;
10901 o_conv.inner = untag_ptr(o);
10902 o_conv.is_owned = ptr_is_owned(o);
10903 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
10904 // WARNING: we need a move here but no clone is available for LDKTrustedCommitmentTransaction
10906 LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ");
10907 *ret_conv = CResult_TrustedCommitmentTransactionNoneZ_ok(o_conv);
10908 return tag_ptr(ret_conv, true);
10911 uint64_t __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNoneZ_err"))) TS_CResult_TrustedCommitmentTransactionNoneZ_err() {
10912 LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ");
10913 *ret_conv = CResult_TrustedCommitmentTransactionNoneZ_err();
10914 return tag_ptr(ret_conv, true);
10917 jboolean __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNoneZ_is_ok"))) TS_CResult_TrustedCommitmentTransactionNoneZ_is_ok(uint64_t o) {
10918 LDKCResult_TrustedCommitmentTransactionNoneZ* o_conv = (LDKCResult_TrustedCommitmentTransactionNoneZ*)untag_ptr(o);
10919 jboolean ret_conv = CResult_TrustedCommitmentTransactionNoneZ_is_ok(o_conv);
10923 void __attribute__((export_name("TS_CResult_TrustedCommitmentTransactionNoneZ_free"))) TS_CResult_TrustedCommitmentTransactionNoneZ_free(uint64_t _res) {
10924 if (!ptr_is_owned(_res)) return;
10925 void* _res_ptr = untag_ptr(_res);
10926 CHECK_ACCESS(_res_ptr);
10927 LDKCResult_TrustedCommitmentTransactionNoneZ _res_conv = *(LDKCResult_TrustedCommitmentTransactionNoneZ*)(_res_ptr);
10928 FREE(untag_ptr(_res));
10929 CResult_TrustedCommitmentTransactionNoneZ_free(_res_conv);
10932 uint64_t __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_ok"))) TS_CResult_CVec_SignatureZNoneZ_ok(ptrArray o) {
10933 LDKCVec_SignatureZ o_constr;
10934 o_constr.datalen = o->arr_len;
10935 if (o_constr.datalen > 0)
10936 o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
10938 o_constr.data = NULL;
10939 int8_tArray* o_vals = (void*) o->elems;
10940 for (size_t m = 0; m < o_constr.datalen; m++) {
10941 int8_tArray o_conv_12 = o_vals[m];
10942 LDKSignature o_conv_12_ref;
10943 CHECK(o_conv_12->arr_len == 64);
10944 memcpy(o_conv_12_ref.compact_form, o_conv_12->elems, 64); FREE(o_conv_12);
10945 o_constr.data[m] = o_conv_12_ref;
10948 LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
10949 *ret_conv = CResult_CVec_SignatureZNoneZ_ok(o_constr);
10950 return tag_ptr(ret_conv, true);
10953 uint64_t __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_err"))) TS_CResult_CVec_SignatureZNoneZ_err() {
10954 LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
10955 *ret_conv = CResult_CVec_SignatureZNoneZ_err();
10956 return tag_ptr(ret_conv, true);
10959 jboolean __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_is_ok"))) TS_CResult_CVec_SignatureZNoneZ_is_ok(uint64_t o) {
10960 LDKCResult_CVec_SignatureZNoneZ* o_conv = (LDKCResult_CVec_SignatureZNoneZ*)untag_ptr(o);
10961 jboolean ret_conv = CResult_CVec_SignatureZNoneZ_is_ok(o_conv);
10965 void __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_free"))) TS_CResult_CVec_SignatureZNoneZ_free(uint64_t _res) {
10966 if (!ptr_is_owned(_res)) return;
10967 void* _res_ptr = untag_ptr(_res);
10968 CHECK_ACCESS(_res_ptr);
10969 LDKCResult_CVec_SignatureZNoneZ _res_conv = *(LDKCResult_CVec_SignatureZNoneZ*)(_res_ptr);
10970 FREE(untag_ptr(_res));
10971 CResult_CVec_SignatureZNoneZ_free(_res_conv);
10974 static inline uint64_t CResult_CVec_SignatureZNoneZ_clone_ptr(LDKCResult_CVec_SignatureZNoneZ *NONNULL_PTR arg) {
10975 LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
10976 *ret_conv = CResult_CVec_SignatureZNoneZ_clone(arg);
10977 return tag_ptr(ret_conv, true);
10979 int64_t __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_clone_ptr"))) TS_CResult_CVec_SignatureZNoneZ_clone_ptr(uint64_t arg) {
10980 LDKCResult_CVec_SignatureZNoneZ* arg_conv = (LDKCResult_CVec_SignatureZNoneZ*)untag_ptr(arg);
10981 int64_t ret_conv = CResult_CVec_SignatureZNoneZ_clone_ptr(arg_conv);
10985 uint64_t __attribute__((export_name("TS_CResult_CVec_SignatureZNoneZ_clone"))) TS_CResult_CVec_SignatureZNoneZ_clone(uint64_t orig) {
10986 LDKCResult_CVec_SignatureZNoneZ* orig_conv = (LDKCResult_CVec_SignatureZNoneZ*)untag_ptr(orig);
10987 LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
10988 *ret_conv = CResult_CVec_SignatureZNoneZ_clone(orig_conv);
10989 return tag_ptr(ret_conv, true);
10992 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_ok"))) TS_CResult_ShutdownScriptDecodeErrorZ_ok(uint64_t o) {
10993 LDKShutdownScript o_conv;
10994 o_conv.inner = untag_ptr(o);
10995 o_conv.is_owned = ptr_is_owned(o);
10996 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
10997 o_conv = ShutdownScript_clone(&o_conv);
10998 LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
10999 *ret_conv = CResult_ShutdownScriptDecodeErrorZ_ok(o_conv);
11000 return tag_ptr(ret_conv, true);
11003 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_err"))) TS_CResult_ShutdownScriptDecodeErrorZ_err(uint64_t e) {
11004 LDKDecodeError e_conv;
11005 e_conv.inner = untag_ptr(e);
11006 e_conv.is_owned = ptr_is_owned(e);
11007 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
11008 e_conv = DecodeError_clone(&e_conv);
11009 LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
11010 *ret_conv = CResult_ShutdownScriptDecodeErrorZ_err(e_conv);
11011 return tag_ptr(ret_conv, true);
11014 jboolean __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_is_ok"))) TS_CResult_ShutdownScriptDecodeErrorZ_is_ok(uint64_t o) {
11015 LDKCResult_ShutdownScriptDecodeErrorZ* o_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(o);
11016 jboolean ret_conv = CResult_ShutdownScriptDecodeErrorZ_is_ok(o_conv);
11020 void __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_free"))) TS_CResult_ShutdownScriptDecodeErrorZ_free(uint64_t _res) {
11021 if (!ptr_is_owned(_res)) return;
11022 void* _res_ptr = untag_ptr(_res);
11023 CHECK_ACCESS(_res_ptr);
11024 LDKCResult_ShutdownScriptDecodeErrorZ _res_conv = *(LDKCResult_ShutdownScriptDecodeErrorZ*)(_res_ptr);
11025 FREE(untag_ptr(_res));
11026 CResult_ShutdownScriptDecodeErrorZ_free(_res_conv);
11029 static inline uint64_t CResult_ShutdownScriptDecodeErrorZ_clone_ptr(LDKCResult_ShutdownScriptDecodeErrorZ *NONNULL_PTR arg) {
11030 LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
11031 *ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone(arg);
11032 return tag_ptr(ret_conv, true);
11034 int64_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_clone_ptr"))) TS_CResult_ShutdownScriptDecodeErrorZ_clone_ptr(uint64_t arg) {
11035 LDKCResult_ShutdownScriptDecodeErrorZ* arg_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(arg);
11036 int64_t ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone_ptr(arg_conv);
11040 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptDecodeErrorZ_clone"))) TS_CResult_ShutdownScriptDecodeErrorZ_clone(uint64_t orig) {
11041 LDKCResult_ShutdownScriptDecodeErrorZ* orig_conv = (LDKCResult_ShutdownScriptDecodeErrorZ*)untag_ptr(orig);
11042 LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
11043 *ret_conv = CResult_ShutdownScriptDecodeErrorZ_clone(orig_conv);
11044 return tag_ptr(ret_conv, true);
11047 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_ok"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_ok(uint64_t o) {
11048 LDKShutdownScript o_conv;
11049 o_conv.inner = untag_ptr(o);
11050 o_conv.is_owned = ptr_is_owned(o);
11051 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11052 o_conv = ShutdownScript_clone(&o_conv);
11053 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
11054 *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_ok(o_conv);
11055 return tag_ptr(ret_conv, true);
11058 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_err"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_err(uint64_t e) {
11059 LDKInvalidShutdownScript e_conv;
11060 e_conv.inner = untag_ptr(e);
11061 e_conv.is_owned = ptr_is_owned(e);
11062 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
11063 e_conv = InvalidShutdownScript_clone(&e_conv);
11064 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
11065 *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_err(e_conv);
11066 return tag_ptr(ret_conv, true);
11069 jboolean __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(uint64_t o) {
11070 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* o_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(o);
11071 jboolean ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_is_ok(o_conv);
11075 void __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_free"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_free(uint64_t _res) {
11076 if (!ptr_is_owned(_res)) return;
11077 void* _res_ptr = untag_ptr(_res);
11078 CHECK_ACCESS(_res_ptr);
11079 LDKCResult_ShutdownScriptInvalidShutdownScriptZ _res_conv = *(LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)(_res_ptr);
11080 FREE(untag_ptr(_res));
11081 CResult_ShutdownScriptInvalidShutdownScriptZ_free(_res_conv);
11084 static inline uint64_t CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(LDKCResult_ShutdownScriptInvalidShutdownScriptZ *NONNULL_PTR arg) {
11085 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
11086 *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone(arg);
11087 return tag_ptr(ret_conv, true);
11089 int64_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(uint64_t arg) {
11090 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* arg_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(arg);
11091 int64_t ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone_ptr(arg_conv);
11095 uint64_t __attribute__((export_name("TS_CResult_ShutdownScriptInvalidShutdownScriptZ_clone"))) TS_CResult_ShutdownScriptInvalidShutdownScriptZ_clone(uint64_t orig) {
11096 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* orig_conv = (LDKCResult_ShutdownScriptInvalidShutdownScriptZ*)untag_ptr(orig);
11097 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
11098 *ret_conv = CResult_ShutdownScriptInvalidShutdownScriptZ_clone(orig_conv);
11099 return tag_ptr(ret_conv, true);
11102 uint64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_ok"))) TS_CResult_RouteHopDecodeErrorZ_ok(uint64_t o) {
11103 LDKRouteHop o_conv;
11104 o_conv.inner = untag_ptr(o);
11105 o_conv.is_owned = ptr_is_owned(o);
11106 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11107 o_conv = RouteHop_clone(&o_conv);
11108 LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
11109 *ret_conv = CResult_RouteHopDecodeErrorZ_ok(o_conv);
11110 return tag_ptr(ret_conv, true);
11113 uint64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_err"))) TS_CResult_RouteHopDecodeErrorZ_err(uint64_t e) {
11114 LDKDecodeError e_conv;
11115 e_conv.inner = untag_ptr(e);
11116 e_conv.is_owned = ptr_is_owned(e);
11117 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
11118 e_conv = DecodeError_clone(&e_conv);
11119 LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
11120 *ret_conv = CResult_RouteHopDecodeErrorZ_err(e_conv);
11121 return tag_ptr(ret_conv, true);
11124 jboolean __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_is_ok"))) TS_CResult_RouteHopDecodeErrorZ_is_ok(uint64_t o) {
11125 LDKCResult_RouteHopDecodeErrorZ* o_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(o);
11126 jboolean ret_conv = CResult_RouteHopDecodeErrorZ_is_ok(o_conv);
11130 void __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_free"))) TS_CResult_RouteHopDecodeErrorZ_free(uint64_t _res) {
11131 if (!ptr_is_owned(_res)) return;
11132 void* _res_ptr = untag_ptr(_res);
11133 CHECK_ACCESS(_res_ptr);
11134 LDKCResult_RouteHopDecodeErrorZ _res_conv = *(LDKCResult_RouteHopDecodeErrorZ*)(_res_ptr);
11135 FREE(untag_ptr(_res));
11136 CResult_RouteHopDecodeErrorZ_free(_res_conv);
11139 static inline uint64_t CResult_RouteHopDecodeErrorZ_clone_ptr(LDKCResult_RouteHopDecodeErrorZ *NONNULL_PTR arg) {
11140 LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
11141 *ret_conv = CResult_RouteHopDecodeErrorZ_clone(arg);
11142 return tag_ptr(ret_conv, true);
11144 int64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_clone_ptr"))) TS_CResult_RouteHopDecodeErrorZ_clone_ptr(uint64_t arg) {
11145 LDKCResult_RouteHopDecodeErrorZ* arg_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(arg);
11146 int64_t ret_conv = CResult_RouteHopDecodeErrorZ_clone_ptr(arg_conv);
11150 uint64_t __attribute__((export_name("TS_CResult_RouteHopDecodeErrorZ_clone"))) TS_CResult_RouteHopDecodeErrorZ_clone(uint64_t orig) {
11151 LDKCResult_RouteHopDecodeErrorZ* orig_conv = (LDKCResult_RouteHopDecodeErrorZ*)untag_ptr(orig);
11152 LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
11153 *ret_conv = CResult_RouteHopDecodeErrorZ_clone(orig_conv);
11154 return tag_ptr(ret_conv, true);
11157 void __attribute__((export_name("TS_CVec_RouteHopZ_free"))) TS_CVec_RouteHopZ_free(uint64_tArray _res) {
11158 LDKCVec_RouteHopZ _res_constr;
11159 _res_constr.datalen = _res->arr_len;
11160 if (_res_constr.datalen > 0)
11161 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
11163 _res_constr.data = NULL;
11164 uint64_t* _res_vals = _res->elems;
11165 for (size_t k = 0; k < _res_constr.datalen; k++) {
11166 uint64_t _res_conv_10 = _res_vals[k];
11167 LDKRouteHop _res_conv_10_conv;
11168 _res_conv_10_conv.inner = untag_ptr(_res_conv_10);
11169 _res_conv_10_conv.is_owned = ptr_is_owned(_res_conv_10);
11170 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_10_conv);
11171 _res_constr.data[k] = _res_conv_10_conv;
11174 CVec_RouteHopZ_free(_res_constr);
11177 void __attribute__((export_name("TS_CVec_CVec_RouteHopZZ_free"))) TS_CVec_CVec_RouteHopZZ_free(ptrArray _res) {
11178 LDKCVec_CVec_RouteHopZZ _res_constr;
11179 _res_constr.datalen = _res->arr_len;
11180 if (_res_constr.datalen > 0)
11181 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCVec_RouteHopZ), "LDKCVec_CVec_RouteHopZZ Elements");
11183 _res_constr.data = NULL;
11184 uint64_tArray* _res_vals = (void*) _res->elems;
11185 for (size_t m = 0; m < _res_constr.datalen; m++) {
11186 uint64_tArray _res_conv_12 = _res_vals[m];
11187 LDKCVec_RouteHopZ _res_conv_12_constr;
11188 _res_conv_12_constr.datalen = _res_conv_12->arr_len;
11189 if (_res_conv_12_constr.datalen > 0)
11190 _res_conv_12_constr.data = MALLOC(_res_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
11192 _res_conv_12_constr.data = NULL;
11193 uint64_t* _res_conv_12_vals = _res_conv_12->elems;
11194 for (size_t k = 0; k < _res_conv_12_constr.datalen; k++) {
11195 uint64_t _res_conv_12_conv_10 = _res_conv_12_vals[k];
11196 LDKRouteHop _res_conv_12_conv_10_conv;
11197 _res_conv_12_conv_10_conv.inner = untag_ptr(_res_conv_12_conv_10);
11198 _res_conv_12_conv_10_conv.is_owned = ptr_is_owned(_res_conv_12_conv_10);
11199 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_12_conv_10_conv);
11200 _res_conv_12_constr.data[k] = _res_conv_12_conv_10_conv;
11202 FREE(_res_conv_12);
11203 _res_constr.data[m] = _res_conv_12_constr;
11206 CVec_CVec_RouteHopZZ_free(_res_constr);
11209 uint64_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_ok"))) TS_CResult_RouteDecodeErrorZ_ok(uint64_t o) {
11211 o_conv.inner = untag_ptr(o);
11212 o_conv.is_owned = ptr_is_owned(o);
11213 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11214 o_conv = Route_clone(&o_conv);
11215 LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
11216 *ret_conv = CResult_RouteDecodeErrorZ_ok(o_conv);
11217 return tag_ptr(ret_conv, true);
11220 uint64_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_err"))) TS_CResult_RouteDecodeErrorZ_err(uint64_t e) {
11221 LDKDecodeError e_conv;
11222 e_conv.inner = untag_ptr(e);
11223 e_conv.is_owned = ptr_is_owned(e);
11224 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
11225 e_conv = DecodeError_clone(&e_conv);
11226 LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
11227 *ret_conv = CResult_RouteDecodeErrorZ_err(e_conv);
11228 return tag_ptr(ret_conv, true);
11231 jboolean __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_is_ok"))) TS_CResult_RouteDecodeErrorZ_is_ok(uint64_t o) {
11232 LDKCResult_RouteDecodeErrorZ* o_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(o);
11233 jboolean ret_conv = CResult_RouteDecodeErrorZ_is_ok(o_conv);
11237 void __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_free"))) TS_CResult_RouteDecodeErrorZ_free(uint64_t _res) {
11238 if (!ptr_is_owned(_res)) return;
11239 void* _res_ptr = untag_ptr(_res);
11240 CHECK_ACCESS(_res_ptr);
11241 LDKCResult_RouteDecodeErrorZ _res_conv = *(LDKCResult_RouteDecodeErrorZ*)(_res_ptr);
11242 FREE(untag_ptr(_res));
11243 CResult_RouteDecodeErrorZ_free(_res_conv);
11246 static inline uint64_t CResult_RouteDecodeErrorZ_clone_ptr(LDKCResult_RouteDecodeErrorZ *NONNULL_PTR arg) {
11247 LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
11248 *ret_conv = CResult_RouteDecodeErrorZ_clone(arg);
11249 return tag_ptr(ret_conv, true);
11251 int64_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_clone_ptr"))) TS_CResult_RouteDecodeErrorZ_clone_ptr(uint64_t arg) {
11252 LDKCResult_RouteDecodeErrorZ* arg_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(arg);
11253 int64_t ret_conv = CResult_RouteDecodeErrorZ_clone_ptr(arg_conv);
11257 uint64_t __attribute__((export_name("TS_CResult_RouteDecodeErrorZ_clone"))) TS_CResult_RouteDecodeErrorZ_clone(uint64_t orig) {
11258 LDKCResult_RouteDecodeErrorZ* orig_conv = (LDKCResult_RouteDecodeErrorZ*)untag_ptr(orig);
11259 LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
11260 *ret_conv = CResult_RouteDecodeErrorZ_clone(orig_conv);
11261 return tag_ptr(ret_conv, true);
11264 uint64_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_ok"))) TS_CResult_RouteParametersDecodeErrorZ_ok(uint64_t o) {
11265 LDKRouteParameters o_conv;
11266 o_conv.inner = untag_ptr(o);
11267 o_conv.is_owned = ptr_is_owned(o);
11268 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11269 o_conv = RouteParameters_clone(&o_conv);
11270 LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
11271 *ret_conv = CResult_RouteParametersDecodeErrorZ_ok(o_conv);
11272 return tag_ptr(ret_conv, true);
11275 uint64_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_err"))) TS_CResult_RouteParametersDecodeErrorZ_err(uint64_t e) {
11276 LDKDecodeError e_conv;
11277 e_conv.inner = untag_ptr(e);
11278 e_conv.is_owned = ptr_is_owned(e);
11279 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
11280 e_conv = DecodeError_clone(&e_conv);
11281 LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
11282 *ret_conv = CResult_RouteParametersDecodeErrorZ_err(e_conv);
11283 return tag_ptr(ret_conv, true);
11286 jboolean __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_is_ok"))) TS_CResult_RouteParametersDecodeErrorZ_is_ok(uint64_t o) {
11287 LDKCResult_RouteParametersDecodeErrorZ* o_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(o);
11288 jboolean ret_conv = CResult_RouteParametersDecodeErrorZ_is_ok(o_conv);
11292 void __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_free"))) TS_CResult_RouteParametersDecodeErrorZ_free(uint64_t _res) {
11293 if (!ptr_is_owned(_res)) return;
11294 void* _res_ptr = untag_ptr(_res);
11295 CHECK_ACCESS(_res_ptr);
11296 LDKCResult_RouteParametersDecodeErrorZ _res_conv = *(LDKCResult_RouteParametersDecodeErrorZ*)(_res_ptr);
11297 FREE(untag_ptr(_res));
11298 CResult_RouteParametersDecodeErrorZ_free(_res_conv);
11301 static inline uint64_t CResult_RouteParametersDecodeErrorZ_clone_ptr(LDKCResult_RouteParametersDecodeErrorZ *NONNULL_PTR arg) {
11302 LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
11303 *ret_conv = CResult_RouteParametersDecodeErrorZ_clone(arg);
11304 return tag_ptr(ret_conv, true);
11306 int64_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_clone_ptr"))) TS_CResult_RouteParametersDecodeErrorZ_clone_ptr(uint64_t arg) {
11307 LDKCResult_RouteParametersDecodeErrorZ* arg_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(arg);
11308 int64_t ret_conv = CResult_RouteParametersDecodeErrorZ_clone_ptr(arg_conv);
11312 uint64_t __attribute__((export_name("TS_CResult_RouteParametersDecodeErrorZ_clone"))) TS_CResult_RouteParametersDecodeErrorZ_clone(uint64_t orig) {
11313 LDKCResult_RouteParametersDecodeErrorZ* orig_conv = (LDKCResult_RouteParametersDecodeErrorZ*)untag_ptr(orig);
11314 LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
11315 *ret_conv = CResult_RouteParametersDecodeErrorZ_clone(orig_conv);
11316 return tag_ptr(ret_conv, true);
11319 void __attribute__((export_name("TS_CVec_RouteHintZ_free"))) TS_CVec_RouteHintZ_free(uint64_tArray _res) {
11320 LDKCVec_RouteHintZ _res_constr;
11321 _res_constr.datalen = _res->arr_len;
11322 if (_res_constr.datalen > 0)
11323 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
11325 _res_constr.data = NULL;
11326 uint64_t* _res_vals = _res->elems;
11327 for (size_t l = 0; l < _res_constr.datalen; l++) {
11328 uint64_t _res_conv_11 = _res_vals[l];
11329 LDKRouteHint _res_conv_11_conv;
11330 _res_conv_11_conv.inner = untag_ptr(_res_conv_11);
11331 _res_conv_11_conv.is_owned = ptr_is_owned(_res_conv_11);
11332 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_11_conv);
11333 _res_constr.data[l] = _res_conv_11_conv;
11336 CVec_RouteHintZ_free(_res_constr);
11339 uint64_t __attribute__((export_name("TS_COption_u64Z_some"))) TS_COption_u64Z_some(int64_t o) {
11340 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
11341 *ret_copy = COption_u64Z_some(o);
11342 uint64_t ret_ref = tag_ptr(ret_copy, true);
11346 uint64_t __attribute__((export_name("TS_COption_u64Z_none"))) TS_COption_u64Z_none() {
11347 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
11348 *ret_copy = COption_u64Z_none();
11349 uint64_t ret_ref = tag_ptr(ret_copy, true);
11353 void __attribute__((export_name("TS_COption_u64Z_free"))) TS_COption_u64Z_free(uint64_t _res) {
11354 if (!ptr_is_owned(_res)) return;
11355 void* _res_ptr = untag_ptr(_res);
11356 CHECK_ACCESS(_res_ptr);
11357 LDKCOption_u64Z _res_conv = *(LDKCOption_u64Z*)(_res_ptr);
11358 FREE(untag_ptr(_res));
11359 COption_u64Z_free(_res_conv);
11362 static inline uint64_t COption_u64Z_clone_ptr(LDKCOption_u64Z *NONNULL_PTR arg) {
11363 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
11364 *ret_copy = COption_u64Z_clone(arg);
11365 uint64_t ret_ref = tag_ptr(ret_copy, true);
11368 int64_t __attribute__((export_name("TS_COption_u64Z_clone_ptr"))) TS_COption_u64Z_clone_ptr(uint64_t arg) {
11369 LDKCOption_u64Z* arg_conv = (LDKCOption_u64Z*)untag_ptr(arg);
11370 int64_t ret_conv = COption_u64Z_clone_ptr(arg_conv);
11374 uint64_t __attribute__((export_name("TS_COption_u64Z_clone"))) TS_COption_u64Z_clone(uint64_t orig) {
11375 LDKCOption_u64Z* orig_conv = (LDKCOption_u64Z*)untag_ptr(orig);
11376 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
11377 *ret_copy = COption_u64Z_clone(orig_conv);
11378 uint64_t ret_ref = tag_ptr(ret_copy, true);
11382 void __attribute__((export_name("TS_CVec_u64Z_free"))) TS_CVec_u64Z_free(int64_tArray _res) {
11383 LDKCVec_u64Z _res_constr;
11384 _res_constr.datalen = _res->arr_len;
11385 if (_res_constr.datalen > 0)
11386 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
11388 _res_constr.data = NULL;
11389 int64_t* _res_vals = _res->elems;
11390 for (size_t i = 0; i < _res_constr.datalen; i++) {
11391 int64_t _res_conv_8 = _res_vals[i];
11392 _res_constr.data[i] = _res_conv_8;
11395 CVec_u64Z_free(_res_constr);
11398 uint64_t __attribute__((export_name("TS_CResult_PaymentParametersDecodeErrorZ_ok"))) TS_CResult_PaymentParametersDecodeErrorZ_ok(uint64_t o) {
11399 LDKPaymentParameters o_conv;
11400 o_conv.inner = untag_ptr(o);
11401 o_conv.is_owned = ptr_is_owned(o);
11402 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11403 o_conv = PaymentParameters_clone(&o_conv);
11404 LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
11405 *ret_conv = CResult_PaymentParametersDecodeErrorZ_ok(o_conv);
11406 return tag_ptr(ret_conv, true);
11409 uint64_t __attribute__((export_name("TS_CResult_PaymentParametersDecodeErrorZ_err"))) TS_CResult_PaymentParametersDecodeErrorZ_err(uint64_t e) {
11410 LDKDecodeError e_conv;
11411 e_conv.inner = untag_ptr(e);
11412 e_conv.is_owned = ptr_is_owned(e);
11413 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
11414 e_conv = DecodeError_clone(&e_conv);
11415 LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
11416 *ret_conv = CResult_PaymentParametersDecodeErrorZ_err(e_conv);
11417 return tag_ptr(ret_conv, true);
11420 jboolean __attribute__((export_name("TS_CResult_PaymentParametersDecodeErrorZ_is_ok"))) TS_CResult_PaymentParametersDecodeErrorZ_is_ok(uint64_t o) {
11421 LDKCResult_PaymentParametersDecodeErrorZ* o_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(o);
11422 jboolean ret_conv = CResult_PaymentParametersDecodeErrorZ_is_ok(o_conv);
11426 void __attribute__((export_name("TS_CResult_PaymentParametersDecodeErrorZ_free"))) TS_CResult_PaymentParametersDecodeErrorZ_free(uint64_t _res) {
11427 if (!ptr_is_owned(_res)) return;
11428 void* _res_ptr = untag_ptr(_res);
11429 CHECK_ACCESS(_res_ptr);
11430 LDKCResult_PaymentParametersDecodeErrorZ _res_conv = *(LDKCResult_PaymentParametersDecodeErrorZ*)(_res_ptr);
11431 FREE(untag_ptr(_res));
11432 CResult_PaymentParametersDecodeErrorZ_free(_res_conv);
11435 static inline uint64_t CResult_PaymentParametersDecodeErrorZ_clone_ptr(LDKCResult_PaymentParametersDecodeErrorZ *NONNULL_PTR arg) {
11436 LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
11437 *ret_conv = CResult_PaymentParametersDecodeErrorZ_clone(arg);
11438 return tag_ptr(ret_conv, true);
11440 int64_t __attribute__((export_name("TS_CResult_PaymentParametersDecodeErrorZ_clone_ptr"))) TS_CResult_PaymentParametersDecodeErrorZ_clone_ptr(uint64_t arg) {
11441 LDKCResult_PaymentParametersDecodeErrorZ* arg_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(arg);
11442 int64_t ret_conv = CResult_PaymentParametersDecodeErrorZ_clone_ptr(arg_conv);
11446 uint64_t __attribute__((export_name("TS_CResult_PaymentParametersDecodeErrorZ_clone"))) TS_CResult_PaymentParametersDecodeErrorZ_clone(uint64_t orig) {
11447 LDKCResult_PaymentParametersDecodeErrorZ* orig_conv = (LDKCResult_PaymentParametersDecodeErrorZ*)untag_ptr(orig);
11448 LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
11449 *ret_conv = CResult_PaymentParametersDecodeErrorZ_clone(orig_conv);
11450 return tag_ptr(ret_conv, true);
11453 void __attribute__((export_name("TS_CVec_RouteHintHopZ_free"))) TS_CVec_RouteHintHopZ_free(uint64_tArray _res) {
11454 LDKCVec_RouteHintHopZ _res_constr;
11455 _res_constr.datalen = _res->arr_len;
11456 if (_res_constr.datalen > 0)
11457 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements");
11459 _res_constr.data = NULL;
11460 uint64_t* _res_vals = _res->elems;
11461 for (size_t o = 0; o < _res_constr.datalen; o++) {
11462 uint64_t _res_conv_14 = _res_vals[o];
11463 LDKRouteHintHop _res_conv_14_conv;
11464 _res_conv_14_conv.inner = untag_ptr(_res_conv_14);
11465 _res_conv_14_conv.is_owned = ptr_is_owned(_res_conv_14);
11466 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv);
11467 _res_constr.data[o] = _res_conv_14_conv;
11470 CVec_RouteHintHopZ_free(_res_constr);
11473 uint64_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_ok"))) TS_CResult_RouteHintDecodeErrorZ_ok(uint64_t o) {
11474 LDKRouteHint o_conv;
11475 o_conv.inner = untag_ptr(o);
11476 o_conv.is_owned = ptr_is_owned(o);
11477 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11478 o_conv = RouteHint_clone(&o_conv);
11479 LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
11480 *ret_conv = CResult_RouteHintDecodeErrorZ_ok(o_conv);
11481 return tag_ptr(ret_conv, true);
11484 uint64_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_err"))) TS_CResult_RouteHintDecodeErrorZ_err(uint64_t e) {
11485 LDKDecodeError e_conv;
11486 e_conv.inner = untag_ptr(e);
11487 e_conv.is_owned = ptr_is_owned(e);
11488 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
11489 e_conv = DecodeError_clone(&e_conv);
11490 LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
11491 *ret_conv = CResult_RouteHintDecodeErrorZ_err(e_conv);
11492 return tag_ptr(ret_conv, true);
11495 jboolean __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_is_ok"))) TS_CResult_RouteHintDecodeErrorZ_is_ok(uint64_t o) {
11496 LDKCResult_RouteHintDecodeErrorZ* o_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(o);
11497 jboolean ret_conv = CResult_RouteHintDecodeErrorZ_is_ok(o_conv);
11501 void __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_free"))) TS_CResult_RouteHintDecodeErrorZ_free(uint64_t _res) {
11502 if (!ptr_is_owned(_res)) return;
11503 void* _res_ptr = untag_ptr(_res);
11504 CHECK_ACCESS(_res_ptr);
11505 LDKCResult_RouteHintDecodeErrorZ _res_conv = *(LDKCResult_RouteHintDecodeErrorZ*)(_res_ptr);
11506 FREE(untag_ptr(_res));
11507 CResult_RouteHintDecodeErrorZ_free(_res_conv);
11510 static inline uint64_t CResult_RouteHintDecodeErrorZ_clone_ptr(LDKCResult_RouteHintDecodeErrorZ *NONNULL_PTR arg) {
11511 LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
11512 *ret_conv = CResult_RouteHintDecodeErrorZ_clone(arg);
11513 return tag_ptr(ret_conv, true);
11515 int64_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_clone_ptr"))) TS_CResult_RouteHintDecodeErrorZ_clone_ptr(uint64_t arg) {
11516 LDKCResult_RouteHintDecodeErrorZ* arg_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(arg);
11517 int64_t ret_conv = CResult_RouteHintDecodeErrorZ_clone_ptr(arg_conv);
11521 uint64_t __attribute__((export_name("TS_CResult_RouteHintDecodeErrorZ_clone"))) TS_CResult_RouteHintDecodeErrorZ_clone(uint64_t orig) {
11522 LDKCResult_RouteHintDecodeErrorZ* orig_conv = (LDKCResult_RouteHintDecodeErrorZ*)untag_ptr(orig);
11523 LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
11524 *ret_conv = CResult_RouteHintDecodeErrorZ_clone(orig_conv);
11525 return tag_ptr(ret_conv, true);
11528 uint64_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_ok"))) TS_CResult_RouteHintHopDecodeErrorZ_ok(uint64_t o) {
11529 LDKRouteHintHop o_conv;
11530 o_conv.inner = untag_ptr(o);
11531 o_conv.is_owned = ptr_is_owned(o);
11532 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11533 o_conv = RouteHintHop_clone(&o_conv);
11534 LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
11535 *ret_conv = CResult_RouteHintHopDecodeErrorZ_ok(o_conv);
11536 return tag_ptr(ret_conv, true);
11539 uint64_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_err"))) TS_CResult_RouteHintHopDecodeErrorZ_err(uint64_t e) {
11540 LDKDecodeError e_conv;
11541 e_conv.inner = untag_ptr(e);
11542 e_conv.is_owned = ptr_is_owned(e);
11543 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
11544 e_conv = DecodeError_clone(&e_conv);
11545 LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
11546 *ret_conv = CResult_RouteHintHopDecodeErrorZ_err(e_conv);
11547 return tag_ptr(ret_conv, true);
11550 jboolean __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_is_ok"))) TS_CResult_RouteHintHopDecodeErrorZ_is_ok(uint64_t o) {
11551 LDKCResult_RouteHintHopDecodeErrorZ* o_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(o);
11552 jboolean ret_conv = CResult_RouteHintHopDecodeErrorZ_is_ok(o_conv);
11556 void __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_free"))) TS_CResult_RouteHintHopDecodeErrorZ_free(uint64_t _res) {
11557 if (!ptr_is_owned(_res)) return;
11558 void* _res_ptr = untag_ptr(_res);
11559 CHECK_ACCESS(_res_ptr);
11560 LDKCResult_RouteHintHopDecodeErrorZ _res_conv = *(LDKCResult_RouteHintHopDecodeErrorZ*)(_res_ptr);
11561 FREE(untag_ptr(_res));
11562 CResult_RouteHintHopDecodeErrorZ_free(_res_conv);
11565 static inline uint64_t CResult_RouteHintHopDecodeErrorZ_clone_ptr(LDKCResult_RouteHintHopDecodeErrorZ *NONNULL_PTR arg) {
11566 LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
11567 *ret_conv = CResult_RouteHintHopDecodeErrorZ_clone(arg);
11568 return tag_ptr(ret_conv, true);
11570 int64_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_clone_ptr"))) TS_CResult_RouteHintHopDecodeErrorZ_clone_ptr(uint64_t arg) {
11571 LDKCResult_RouteHintHopDecodeErrorZ* arg_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(arg);
11572 int64_t ret_conv = CResult_RouteHintHopDecodeErrorZ_clone_ptr(arg_conv);
11576 uint64_t __attribute__((export_name("TS_CResult_RouteHintHopDecodeErrorZ_clone"))) TS_CResult_RouteHintHopDecodeErrorZ_clone(uint64_t orig) {
11577 LDKCResult_RouteHintHopDecodeErrorZ* orig_conv = (LDKCResult_RouteHintHopDecodeErrorZ*)untag_ptr(orig);
11578 LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
11579 *ret_conv = CResult_RouteHintHopDecodeErrorZ_clone(orig_conv);
11580 return tag_ptr(ret_conv, true);
11583 void __attribute__((export_name("TS_CVec_ChannelDetailsZ_free"))) TS_CVec_ChannelDetailsZ_free(uint64_tArray _res) {
11584 LDKCVec_ChannelDetailsZ _res_constr;
11585 _res_constr.datalen = _res->arr_len;
11586 if (_res_constr.datalen > 0)
11587 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
11589 _res_constr.data = NULL;
11590 uint64_t* _res_vals = _res->elems;
11591 for (size_t q = 0; q < _res_constr.datalen; q++) {
11592 uint64_t _res_conv_16 = _res_vals[q];
11593 LDKChannelDetails _res_conv_16_conv;
11594 _res_conv_16_conv.inner = untag_ptr(_res_conv_16);
11595 _res_conv_16_conv.is_owned = ptr_is_owned(_res_conv_16);
11596 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv);
11597 _res_constr.data[q] = _res_conv_16_conv;
11600 CVec_ChannelDetailsZ_free(_res_constr);
11603 uint64_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_ok"))) TS_CResult_RouteLightningErrorZ_ok(uint64_t o) {
11605 o_conv.inner = untag_ptr(o);
11606 o_conv.is_owned = ptr_is_owned(o);
11607 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
11608 o_conv = Route_clone(&o_conv);
11609 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
11610 *ret_conv = CResult_RouteLightningErrorZ_ok(o_conv);
11611 return tag_ptr(ret_conv, true);
11614 uint64_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_err"))) TS_CResult_RouteLightningErrorZ_err(uint64_t e) {
11615 LDKLightningError e_conv;
11616 e_conv.inner = untag_ptr(e);
11617 e_conv.is_owned = ptr_is_owned(e);
11618 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
11619 e_conv = LightningError_clone(&e_conv);
11620 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
11621 *ret_conv = CResult_RouteLightningErrorZ_err(e_conv);
11622 return tag_ptr(ret_conv, true);
11625 jboolean __attribute__((export_name("TS_CResult_RouteLightningErrorZ_is_ok"))) TS_CResult_RouteLightningErrorZ_is_ok(uint64_t o) {
11626 LDKCResult_RouteLightningErrorZ* o_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(o);
11627 jboolean ret_conv = CResult_RouteLightningErrorZ_is_ok(o_conv);
11631 void __attribute__((export_name("TS_CResult_RouteLightningErrorZ_free"))) TS_CResult_RouteLightningErrorZ_free(uint64_t _res) {
11632 if (!ptr_is_owned(_res)) return;
11633 void* _res_ptr = untag_ptr(_res);
11634 CHECK_ACCESS(_res_ptr);
11635 LDKCResult_RouteLightningErrorZ _res_conv = *(LDKCResult_RouteLightningErrorZ*)(_res_ptr);
11636 FREE(untag_ptr(_res));
11637 CResult_RouteLightningErrorZ_free(_res_conv);
11640 static inline uint64_t CResult_RouteLightningErrorZ_clone_ptr(LDKCResult_RouteLightningErrorZ *NONNULL_PTR arg) {
11641 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
11642 *ret_conv = CResult_RouteLightningErrorZ_clone(arg);
11643 return tag_ptr(ret_conv, true);
11645 int64_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_clone_ptr"))) TS_CResult_RouteLightningErrorZ_clone_ptr(uint64_t arg) {
11646 LDKCResult_RouteLightningErrorZ* arg_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(arg);
11647 int64_t ret_conv = CResult_RouteLightningErrorZ_clone_ptr(arg_conv);
11651 uint64_t __attribute__((export_name("TS_CResult_RouteLightningErrorZ_clone"))) TS_CResult_RouteLightningErrorZ_clone(uint64_t orig) {
11652 LDKCResult_RouteLightningErrorZ* orig_conv = (LDKCResult_RouteLightningErrorZ*)untag_ptr(orig);
11653 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
11654 *ret_conv = CResult_RouteLightningErrorZ_clone(orig_conv);
11655 return tag_ptr(ret_conv, true);
11658 void __attribute__((export_name("TS_CVec_PublicKeyZ_free"))) TS_CVec_PublicKeyZ_free(ptrArray _res) {
11659 LDKCVec_PublicKeyZ _res_constr;
11660 _res_constr.datalen = _res->arr_len;
11661 if (_res_constr.datalen > 0)
11662 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements");
11664 _res_constr.data = NULL;
11665 int8_tArray* _res_vals = (void*) _res->elems;
11666 for (size_t m = 0; m < _res_constr.datalen; m++) {
11667 int8_tArray _res_conv_12 = _res_vals[m];
11668 LDKPublicKey _res_conv_12_ref;
11669 CHECK(_res_conv_12->arr_len == 33);
11670 memcpy(_res_conv_12_ref.compressed_form, _res_conv_12->elems, 33); FREE(_res_conv_12);
11671 _res_constr.data[m] = _res_conv_12_ref;
11674 CVec_PublicKeyZ_free(_res_constr);
11677 uint64_t __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_ok"))) TS_CResult_PaymentPurposeDecodeErrorZ_ok(uint64_t o) {
11678 void* o_ptr = untag_ptr(o);
11679 CHECK_ACCESS(o_ptr);
11680 LDKPaymentPurpose o_conv = *(LDKPaymentPurpose*)(o_ptr);
11681 o_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(o));
11682 LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
11683 *ret_conv = CResult_PaymentPurposeDecodeErrorZ_ok(o_conv);
11684 return tag_ptr(ret_conv, true);
11687 uint64_t __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_err"))) TS_CResult_PaymentPurposeDecodeErrorZ_err(uint64_t e) {
11688 LDKDecodeError e_conv;
11689 e_conv.inner = untag_ptr(e);
11690 e_conv.is_owned = ptr_is_owned(e);
11691 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
11692 e_conv = DecodeError_clone(&e_conv);
11693 LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
11694 *ret_conv = CResult_PaymentPurposeDecodeErrorZ_err(e_conv);
11695 return tag_ptr(ret_conv, true);
11698 jboolean __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_is_ok"))) TS_CResult_PaymentPurposeDecodeErrorZ_is_ok(uint64_t o) {
11699 LDKCResult_PaymentPurposeDecodeErrorZ* o_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(o);
11700 jboolean ret_conv = CResult_PaymentPurposeDecodeErrorZ_is_ok(o_conv);
11704 void __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_free"))) TS_CResult_PaymentPurposeDecodeErrorZ_free(uint64_t _res) {
11705 if (!ptr_is_owned(_res)) return;
11706 void* _res_ptr = untag_ptr(_res);
11707 CHECK_ACCESS(_res_ptr);
11708 LDKCResult_PaymentPurposeDecodeErrorZ _res_conv = *(LDKCResult_PaymentPurposeDecodeErrorZ*)(_res_ptr);
11709 FREE(untag_ptr(_res));
11710 CResult_PaymentPurposeDecodeErrorZ_free(_res_conv);
11713 static inline uint64_t CResult_PaymentPurposeDecodeErrorZ_clone_ptr(LDKCResult_PaymentPurposeDecodeErrorZ *NONNULL_PTR arg) {
11714 LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
11715 *ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone(arg);
11716 return tag_ptr(ret_conv, true);
11718 int64_t __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_clone_ptr"))) TS_CResult_PaymentPurposeDecodeErrorZ_clone_ptr(uint64_t arg) {
11719 LDKCResult_PaymentPurposeDecodeErrorZ* arg_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(arg);
11720 int64_t ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone_ptr(arg_conv);
11724 uint64_t __attribute__((export_name("TS_CResult_PaymentPurposeDecodeErrorZ_clone"))) TS_CResult_PaymentPurposeDecodeErrorZ_clone(uint64_t orig) {
11725 LDKCResult_PaymentPurposeDecodeErrorZ* orig_conv = (LDKCResult_PaymentPurposeDecodeErrorZ*)untag_ptr(orig);
11726 LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
11727 *ret_conv = CResult_PaymentPurposeDecodeErrorZ_clone(orig_conv);
11728 return tag_ptr(ret_conv, true);
11731 uint64_t __attribute__((export_name("TS_COption_ClosureReasonZ_some"))) TS_COption_ClosureReasonZ_some(uint64_t o) {
11732 void* o_ptr = untag_ptr(o);
11733 CHECK_ACCESS(o_ptr);
11734 LDKClosureReason o_conv = *(LDKClosureReason*)(o_ptr);
11735 o_conv = ClosureReason_clone((LDKClosureReason*)untag_ptr(o));
11736 LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
11737 *ret_copy = COption_ClosureReasonZ_some(o_conv);
11738 uint64_t ret_ref = tag_ptr(ret_copy, true);
11742 uint64_t __attribute__((export_name("TS_COption_ClosureReasonZ_none"))) TS_COption_ClosureReasonZ_none() {
11743 LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
11744 *ret_copy = COption_ClosureReasonZ_none();
11745 uint64_t ret_ref = tag_ptr(ret_copy, true);
11749 void __attribute__((export_name("TS_COption_ClosureReasonZ_free"))) TS_COption_ClosureReasonZ_free(uint64_t _res) {
11750 if (!ptr_is_owned(_res)) return;
11751 void* _res_ptr = untag_ptr(_res);
11752 CHECK_ACCESS(_res_ptr);
11753 LDKCOption_ClosureReasonZ _res_conv = *(LDKCOption_ClosureReasonZ*)(_res_ptr);
11754 FREE(untag_ptr(_res));
11755 COption_ClosureReasonZ_free(_res_conv);
11758 static inline uint64_t COption_ClosureReasonZ_clone_ptr(LDKCOption_ClosureReasonZ *NONNULL_PTR arg) {
11759 LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
11760 *ret_copy = COption_ClosureReasonZ_clone(arg);
11761 uint64_t ret_ref = tag_ptr(ret_copy, true);
11764 int64_t __attribute__((export_name("TS_COption_ClosureReasonZ_clone_ptr"))) TS_COption_ClosureReasonZ_clone_ptr(uint64_t arg) {
11765 LDKCOption_ClosureReasonZ* arg_conv = (LDKCOption_ClosureReasonZ*)untag_ptr(arg);
11766 int64_t ret_conv = COption_ClosureReasonZ_clone_ptr(arg_conv);
11770 uint64_t __attribute__((export_name("TS_COption_ClosureReasonZ_clone"))) TS_COption_ClosureReasonZ_clone(uint64_t orig) {
11771 LDKCOption_ClosureReasonZ* orig_conv = (LDKCOption_ClosureReasonZ*)untag_ptr(orig);
11772 LDKCOption_ClosureReasonZ *ret_copy = MALLOC(sizeof(LDKCOption_ClosureReasonZ), "LDKCOption_ClosureReasonZ");
11773 *ret_copy = COption_ClosureReasonZ_clone(orig_conv);
11774 uint64_t ret_ref = tag_ptr(ret_copy, true);
11778 uint64_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_ok"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_ok(uint64_t o) {
11779 void* o_ptr = untag_ptr(o);
11780 CHECK_ACCESS(o_ptr);
11781 LDKCOption_ClosureReasonZ o_conv = *(LDKCOption_ClosureReasonZ*)(o_ptr);
11782 o_conv = COption_ClosureReasonZ_clone((LDKCOption_ClosureReasonZ*)untag_ptr(o));
11783 LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
11784 *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_ok(o_conv);
11785 return tag_ptr(ret_conv, true);
11788 uint64_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_err"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_err(uint64_t e) {
11789 LDKDecodeError e_conv;
11790 e_conv.inner = untag_ptr(e);
11791 e_conv.is_owned = ptr_is_owned(e);
11792 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
11793 e_conv = DecodeError_clone(&e_conv);
11794 LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
11795 *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_err(e_conv);
11796 return tag_ptr(ret_conv, true);
11799 jboolean __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_is_ok"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(uint64_t o) {
11800 LDKCResult_COption_ClosureReasonZDecodeErrorZ* o_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(o);
11801 jboolean ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_is_ok(o_conv);
11805 void __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_free"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_free(uint64_t _res) {
11806 if (!ptr_is_owned(_res)) return;
11807 void* _res_ptr = untag_ptr(_res);
11808 CHECK_ACCESS(_res_ptr);
11809 LDKCResult_COption_ClosureReasonZDecodeErrorZ _res_conv = *(LDKCResult_COption_ClosureReasonZDecodeErrorZ*)(_res_ptr);
11810 FREE(untag_ptr(_res));
11811 CResult_COption_ClosureReasonZDecodeErrorZ_free(_res_conv);
11814 static inline uint64_t CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(LDKCResult_COption_ClosureReasonZDecodeErrorZ *NONNULL_PTR arg) {
11815 LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
11816 *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone(arg);
11817 return tag_ptr(ret_conv, true);
11819 int64_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(uint64_t arg) {
11820 LDKCResult_COption_ClosureReasonZDecodeErrorZ* arg_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(arg);
11821 int64_t ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone_ptr(arg_conv);
11825 uint64_t __attribute__((export_name("TS_CResult_COption_ClosureReasonZDecodeErrorZ_clone"))) TS_CResult_COption_ClosureReasonZDecodeErrorZ_clone(uint64_t orig) {
11826 LDKCResult_COption_ClosureReasonZDecodeErrorZ* orig_conv = (LDKCResult_COption_ClosureReasonZDecodeErrorZ*)untag_ptr(orig);
11827 LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
11828 *ret_conv = CResult_COption_ClosureReasonZDecodeErrorZ_clone(orig_conv);
11829 return tag_ptr(ret_conv, true);
11832 uint64_t __attribute__((export_name("TS_COption_HTLCDestinationZ_some"))) TS_COption_HTLCDestinationZ_some(uint64_t o) {
11833 void* o_ptr = untag_ptr(o);
11834 CHECK_ACCESS(o_ptr);
11835 LDKHTLCDestination o_conv = *(LDKHTLCDestination*)(o_ptr);
11836 o_conv = HTLCDestination_clone((LDKHTLCDestination*)untag_ptr(o));
11837 LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ");
11838 *ret_copy = COption_HTLCDestinationZ_some(o_conv);
11839 uint64_t ret_ref = tag_ptr(ret_copy, true);
11843 uint64_t __attribute__((export_name("TS_COption_HTLCDestinationZ_none"))) TS_COption_HTLCDestinationZ_none() {
11844 LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ");
11845 *ret_copy = COption_HTLCDestinationZ_none();
11846 uint64_t ret_ref = tag_ptr(ret_copy, true);
11850 void __attribute__((export_name("TS_COption_HTLCDestinationZ_free"))) TS_COption_HTLCDestinationZ_free(uint64_t _res) {
11851 if (!ptr_is_owned(_res)) return;
11852 void* _res_ptr = untag_ptr(_res);
11853 CHECK_ACCESS(_res_ptr);
11854 LDKCOption_HTLCDestinationZ _res_conv = *(LDKCOption_HTLCDestinationZ*)(_res_ptr);
11855 FREE(untag_ptr(_res));
11856 COption_HTLCDestinationZ_free(_res_conv);
11859 static inline uint64_t COption_HTLCDestinationZ_clone_ptr(LDKCOption_HTLCDestinationZ *NONNULL_PTR arg) {
11860 LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ");
11861 *ret_copy = COption_HTLCDestinationZ_clone(arg);
11862 uint64_t ret_ref = tag_ptr(ret_copy, true);
11865 int64_t __attribute__((export_name("TS_COption_HTLCDestinationZ_clone_ptr"))) TS_COption_HTLCDestinationZ_clone_ptr(uint64_t arg) {
11866 LDKCOption_HTLCDestinationZ* arg_conv = (LDKCOption_HTLCDestinationZ*)untag_ptr(arg);
11867 int64_t ret_conv = COption_HTLCDestinationZ_clone_ptr(arg_conv);
11871 uint64_t __attribute__((export_name("TS_COption_HTLCDestinationZ_clone"))) TS_COption_HTLCDestinationZ_clone(uint64_t orig) {
11872 LDKCOption_HTLCDestinationZ* orig_conv = (LDKCOption_HTLCDestinationZ*)untag_ptr(orig);
11873 LDKCOption_HTLCDestinationZ *ret_copy = MALLOC(sizeof(LDKCOption_HTLCDestinationZ), "LDKCOption_HTLCDestinationZ");
11874 *ret_copy = COption_HTLCDestinationZ_clone(orig_conv);
11875 uint64_t ret_ref = tag_ptr(ret_copy, true);
11879 uint64_t __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_ok"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_ok(uint64_t o) {
11880 void* o_ptr = untag_ptr(o);
11881 CHECK_ACCESS(o_ptr);
11882 LDKCOption_HTLCDestinationZ o_conv = *(LDKCOption_HTLCDestinationZ*)(o_ptr);
11883 o_conv = COption_HTLCDestinationZ_clone((LDKCOption_HTLCDestinationZ*)untag_ptr(o));
11884 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ");
11885 *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_ok(o_conv);
11886 return tag_ptr(ret_conv, true);
11889 uint64_t __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_err"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_err(uint64_t e) {
11890 LDKDecodeError e_conv;
11891 e_conv.inner = untag_ptr(e);
11892 e_conv.is_owned = ptr_is_owned(e);
11893 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
11894 e_conv = DecodeError_clone(&e_conv);
11895 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ");
11896 *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_err(e_conv);
11897 return tag_ptr(ret_conv, true);
11900 jboolean __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(uint64_t o) {
11901 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* o_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(o);
11902 jboolean ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_is_ok(o_conv);
11906 void __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_free"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_free(uint64_t _res) {
11907 if (!ptr_is_owned(_res)) return;
11908 void* _res_ptr = untag_ptr(_res);
11909 CHECK_ACCESS(_res_ptr);
11910 LDKCResult_COption_HTLCDestinationZDecodeErrorZ _res_conv = *(LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)(_res_ptr);
11911 FREE(untag_ptr(_res));
11912 CResult_COption_HTLCDestinationZDecodeErrorZ_free(_res_conv);
11915 static inline uint64_t CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr(LDKCResult_COption_HTLCDestinationZDecodeErrorZ *NONNULL_PTR arg) {
11916 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ");
11917 *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_clone(arg);
11918 return tag_ptr(ret_conv, true);
11920 int64_t __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr(uint64_t arg) {
11921 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* arg_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(arg);
11922 int64_t ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_clone_ptr(arg_conv);
11926 uint64_t __attribute__((export_name("TS_CResult_COption_HTLCDestinationZDecodeErrorZ_clone"))) TS_CResult_COption_HTLCDestinationZDecodeErrorZ_clone(uint64_t orig) {
11927 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* orig_conv = (LDKCResult_COption_HTLCDestinationZDecodeErrorZ*)untag_ptr(orig);
11928 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ");
11929 *ret_conv = CResult_COption_HTLCDestinationZDecodeErrorZ_clone(orig_conv);
11930 return tag_ptr(ret_conv, true);
11933 uint64_t __attribute__((export_name("TS_COption_NetworkUpdateZ_some"))) TS_COption_NetworkUpdateZ_some(uint64_t o) {
11934 void* o_ptr = untag_ptr(o);
11935 CHECK_ACCESS(o_ptr);
11936 LDKNetworkUpdate o_conv = *(LDKNetworkUpdate*)(o_ptr);
11937 o_conv = NetworkUpdate_clone((LDKNetworkUpdate*)untag_ptr(o));
11938 LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
11939 *ret_copy = COption_NetworkUpdateZ_some(o_conv);
11940 uint64_t ret_ref = tag_ptr(ret_copy, true);
11944 uint64_t __attribute__((export_name("TS_COption_NetworkUpdateZ_none"))) TS_COption_NetworkUpdateZ_none() {
11945 LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
11946 *ret_copy = COption_NetworkUpdateZ_none();
11947 uint64_t ret_ref = tag_ptr(ret_copy, true);
11951 void __attribute__((export_name("TS_COption_NetworkUpdateZ_free"))) TS_COption_NetworkUpdateZ_free(uint64_t _res) {
11952 if (!ptr_is_owned(_res)) return;
11953 void* _res_ptr = untag_ptr(_res);
11954 CHECK_ACCESS(_res_ptr);
11955 LDKCOption_NetworkUpdateZ _res_conv = *(LDKCOption_NetworkUpdateZ*)(_res_ptr);
11956 FREE(untag_ptr(_res));
11957 COption_NetworkUpdateZ_free(_res_conv);
11960 static inline uint64_t COption_NetworkUpdateZ_clone_ptr(LDKCOption_NetworkUpdateZ *NONNULL_PTR arg) {
11961 LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
11962 *ret_copy = COption_NetworkUpdateZ_clone(arg);
11963 uint64_t ret_ref = tag_ptr(ret_copy, true);
11966 int64_t __attribute__((export_name("TS_COption_NetworkUpdateZ_clone_ptr"))) TS_COption_NetworkUpdateZ_clone_ptr(uint64_t arg) {
11967 LDKCOption_NetworkUpdateZ* arg_conv = (LDKCOption_NetworkUpdateZ*)untag_ptr(arg);
11968 int64_t ret_conv = COption_NetworkUpdateZ_clone_ptr(arg_conv);
11972 uint64_t __attribute__((export_name("TS_COption_NetworkUpdateZ_clone"))) TS_COption_NetworkUpdateZ_clone(uint64_t orig) {
11973 LDKCOption_NetworkUpdateZ* orig_conv = (LDKCOption_NetworkUpdateZ*)untag_ptr(orig);
11974 LDKCOption_NetworkUpdateZ *ret_copy = MALLOC(sizeof(LDKCOption_NetworkUpdateZ), "LDKCOption_NetworkUpdateZ");
11975 *ret_copy = COption_NetworkUpdateZ_clone(orig_conv);
11976 uint64_t ret_ref = tag_ptr(ret_copy, true);
11980 void __attribute__((export_name("TS_CVec_SpendableOutputDescriptorZ_free"))) TS_CVec_SpendableOutputDescriptorZ_free(uint64_tArray _res) {
11981 LDKCVec_SpendableOutputDescriptorZ _res_constr;
11982 _res_constr.datalen = _res->arr_len;
11983 if (_res_constr.datalen > 0)
11984 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
11986 _res_constr.data = NULL;
11987 uint64_t* _res_vals = _res->elems;
11988 for (size_t b = 0; b < _res_constr.datalen; b++) {
11989 uint64_t _res_conv_27 = _res_vals[b];
11990 void* _res_conv_27_ptr = untag_ptr(_res_conv_27);
11991 CHECK_ACCESS(_res_conv_27_ptr);
11992 LDKSpendableOutputDescriptor _res_conv_27_conv = *(LDKSpendableOutputDescriptor*)(_res_conv_27_ptr);
11993 FREE(untag_ptr(_res_conv_27));
11994 _res_constr.data[b] = _res_conv_27_conv;
11997 CVec_SpendableOutputDescriptorZ_free(_res_constr);
12000 uint64_t __attribute__((export_name("TS_COption_EventZ_some"))) TS_COption_EventZ_some(uint64_t o) {
12001 void* o_ptr = untag_ptr(o);
12002 CHECK_ACCESS(o_ptr);
12003 LDKEvent o_conv = *(LDKEvent*)(o_ptr);
12004 o_conv = Event_clone((LDKEvent*)untag_ptr(o));
12005 LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
12006 *ret_copy = COption_EventZ_some(o_conv);
12007 uint64_t ret_ref = tag_ptr(ret_copy, true);
12011 uint64_t __attribute__((export_name("TS_COption_EventZ_none"))) TS_COption_EventZ_none() {
12012 LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
12013 *ret_copy = COption_EventZ_none();
12014 uint64_t ret_ref = tag_ptr(ret_copy, true);
12018 void __attribute__((export_name("TS_COption_EventZ_free"))) TS_COption_EventZ_free(uint64_t _res) {
12019 if (!ptr_is_owned(_res)) return;
12020 void* _res_ptr = untag_ptr(_res);
12021 CHECK_ACCESS(_res_ptr);
12022 LDKCOption_EventZ _res_conv = *(LDKCOption_EventZ*)(_res_ptr);
12023 FREE(untag_ptr(_res));
12024 COption_EventZ_free(_res_conv);
12027 static inline uint64_t COption_EventZ_clone_ptr(LDKCOption_EventZ *NONNULL_PTR arg) {
12028 LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
12029 *ret_copy = COption_EventZ_clone(arg);
12030 uint64_t ret_ref = tag_ptr(ret_copy, true);
12033 int64_t __attribute__((export_name("TS_COption_EventZ_clone_ptr"))) TS_COption_EventZ_clone_ptr(uint64_t arg) {
12034 LDKCOption_EventZ* arg_conv = (LDKCOption_EventZ*)untag_ptr(arg);
12035 int64_t ret_conv = COption_EventZ_clone_ptr(arg_conv);
12039 uint64_t __attribute__((export_name("TS_COption_EventZ_clone"))) TS_COption_EventZ_clone(uint64_t orig) {
12040 LDKCOption_EventZ* orig_conv = (LDKCOption_EventZ*)untag_ptr(orig);
12041 LDKCOption_EventZ *ret_copy = MALLOC(sizeof(LDKCOption_EventZ), "LDKCOption_EventZ");
12042 *ret_copy = COption_EventZ_clone(orig_conv);
12043 uint64_t ret_ref = tag_ptr(ret_copy, true);
12047 uint64_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_ok"))) TS_CResult_COption_EventZDecodeErrorZ_ok(uint64_t o) {
12048 void* o_ptr = untag_ptr(o);
12049 CHECK_ACCESS(o_ptr);
12050 LDKCOption_EventZ o_conv = *(LDKCOption_EventZ*)(o_ptr);
12051 o_conv = COption_EventZ_clone((LDKCOption_EventZ*)untag_ptr(o));
12052 LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
12053 *ret_conv = CResult_COption_EventZDecodeErrorZ_ok(o_conv);
12054 return tag_ptr(ret_conv, true);
12057 uint64_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_err"))) TS_CResult_COption_EventZDecodeErrorZ_err(uint64_t e) {
12058 LDKDecodeError e_conv;
12059 e_conv.inner = untag_ptr(e);
12060 e_conv.is_owned = ptr_is_owned(e);
12061 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
12062 e_conv = DecodeError_clone(&e_conv);
12063 LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
12064 *ret_conv = CResult_COption_EventZDecodeErrorZ_err(e_conv);
12065 return tag_ptr(ret_conv, true);
12068 jboolean __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_is_ok"))) TS_CResult_COption_EventZDecodeErrorZ_is_ok(uint64_t o) {
12069 LDKCResult_COption_EventZDecodeErrorZ* o_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(o);
12070 jboolean ret_conv = CResult_COption_EventZDecodeErrorZ_is_ok(o_conv);
12074 void __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_free"))) TS_CResult_COption_EventZDecodeErrorZ_free(uint64_t _res) {
12075 if (!ptr_is_owned(_res)) return;
12076 void* _res_ptr = untag_ptr(_res);
12077 CHECK_ACCESS(_res_ptr);
12078 LDKCResult_COption_EventZDecodeErrorZ _res_conv = *(LDKCResult_COption_EventZDecodeErrorZ*)(_res_ptr);
12079 FREE(untag_ptr(_res));
12080 CResult_COption_EventZDecodeErrorZ_free(_res_conv);
12083 static inline uint64_t CResult_COption_EventZDecodeErrorZ_clone_ptr(LDKCResult_COption_EventZDecodeErrorZ *NONNULL_PTR arg) {
12084 LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
12085 *ret_conv = CResult_COption_EventZDecodeErrorZ_clone(arg);
12086 return tag_ptr(ret_conv, true);
12088 int64_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_EventZDecodeErrorZ_clone_ptr(uint64_t arg) {
12089 LDKCResult_COption_EventZDecodeErrorZ* arg_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(arg);
12090 int64_t ret_conv = CResult_COption_EventZDecodeErrorZ_clone_ptr(arg_conv);
12094 uint64_t __attribute__((export_name("TS_CResult_COption_EventZDecodeErrorZ_clone"))) TS_CResult_COption_EventZDecodeErrorZ_clone(uint64_t orig) {
12095 LDKCResult_COption_EventZDecodeErrorZ* orig_conv = (LDKCResult_COption_EventZDecodeErrorZ*)untag_ptr(orig);
12096 LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
12097 *ret_conv = CResult_COption_EventZDecodeErrorZ_clone(orig_conv);
12098 return tag_ptr(ret_conv, true);
12101 void __attribute__((export_name("TS_CVec_MessageSendEventZ_free"))) TS_CVec_MessageSendEventZ_free(uint64_tArray _res) {
12102 LDKCVec_MessageSendEventZ _res_constr;
12103 _res_constr.datalen = _res->arr_len;
12104 if (_res_constr.datalen > 0)
12105 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMessageSendEvent), "LDKCVec_MessageSendEventZ Elements");
12107 _res_constr.data = NULL;
12108 uint64_t* _res_vals = _res->elems;
12109 for (size_t s = 0; s < _res_constr.datalen; s++) {
12110 uint64_t _res_conv_18 = _res_vals[s];
12111 void* _res_conv_18_ptr = untag_ptr(_res_conv_18);
12112 CHECK_ACCESS(_res_conv_18_ptr);
12113 LDKMessageSendEvent _res_conv_18_conv = *(LDKMessageSendEvent*)(_res_conv_18_ptr);
12114 FREE(untag_ptr(_res_conv_18));
12115 _res_constr.data[s] = _res_conv_18_conv;
12118 CVec_MessageSendEventZ_free(_res_constr);
12121 uint64_t __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_ok"))) TS_CResult_TxOutAccessErrorZ_ok(uint64_t o) {
12122 void* o_ptr = untag_ptr(o);
12123 CHECK_ACCESS(o_ptr);
12124 LDKTxOut o_conv = *(LDKTxOut*)(o_ptr);
12125 o_conv = TxOut_clone((LDKTxOut*)untag_ptr(o));
12126 LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
12127 *ret_conv = CResult_TxOutAccessErrorZ_ok(o_conv);
12128 return tag_ptr(ret_conv, true);
12131 uint64_t __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_err"))) TS_CResult_TxOutAccessErrorZ_err(uint32_t e) {
12132 LDKAccessError e_conv = LDKAccessError_from_js(e);
12133 LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
12134 *ret_conv = CResult_TxOutAccessErrorZ_err(e_conv);
12135 return tag_ptr(ret_conv, true);
12138 jboolean __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_is_ok"))) TS_CResult_TxOutAccessErrorZ_is_ok(uint64_t o) {
12139 LDKCResult_TxOutAccessErrorZ* o_conv = (LDKCResult_TxOutAccessErrorZ*)untag_ptr(o);
12140 jboolean ret_conv = CResult_TxOutAccessErrorZ_is_ok(o_conv);
12144 void __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_free"))) TS_CResult_TxOutAccessErrorZ_free(uint64_t _res) {
12145 if (!ptr_is_owned(_res)) return;
12146 void* _res_ptr = untag_ptr(_res);
12147 CHECK_ACCESS(_res_ptr);
12148 LDKCResult_TxOutAccessErrorZ _res_conv = *(LDKCResult_TxOutAccessErrorZ*)(_res_ptr);
12149 FREE(untag_ptr(_res));
12150 CResult_TxOutAccessErrorZ_free(_res_conv);
12153 static inline uint64_t CResult_TxOutAccessErrorZ_clone_ptr(LDKCResult_TxOutAccessErrorZ *NONNULL_PTR arg) {
12154 LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
12155 *ret_conv = CResult_TxOutAccessErrorZ_clone(arg);
12156 return tag_ptr(ret_conv, true);
12158 int64_t __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_clone_ptr"))) TS_CResult_TxOutAccessErrorZ_clone_ptr(uint64_t arg) {
12159 LDKCResult_TxOutAccessErrorZ* arg_conv = (LDKCResult_TxOutAccessErrorZ*)untag_ptr(arg);
12160 int64_t ret_conv = CResult_TxOutAccessErrorZ_clone_ptr(arg_conv);
12164 uint64_t __attribute__((export_name("TS_CResult_TxOutAccessErrorZ_clone"))) TS_CResult_TxOutAccessErrorZ_clone(uint64_t orig) {
12165 LDKCResult_TxOutAccessErrorZ* orig_conv = (LDKCResult_TxOutAccessErrorZ*)untag_ptr(orig);
12166 LDKCResult_TxOutAccessErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxOutAccessErrorZ), "LDKCResult_TxOutAccessErrorZ");
12167 *ret_conv = CResult_TxOutAccessErrorZ_clone(orig_conv);
12168 return tag_ptr(ret_conv, true);
12171 static inline uint64_t C2Tuple_usizeTransactionZ_clone_ptr(LDKC2Tuple_usizeTransactionZ *NONNULL_PTR arg) {
12172 LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
12173 *ret_conv = C2Tuple_usizeTransactionZ_clone(arg);
12174 return tag_ptr(ret_conv, true);
12176 int64_t __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_clone_ptr"))) TS_C2Tuple_usizeTransactionZ_clone_ptr(uint64_t arg) {
12177 LDKC2Tuple_usizeTransactionZ* arg_conv = (LDKC2Tuple_usizeTransactionZ*)untag_ptr(arg);
12178 int64_t ret_conv = C2Tuple_usizeTransactionZ_clone_ptr(arg_conv);
12182 uint64_t __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_clone"))) TS_C2Tuple_usizeTransactionZ_clone(uint64_t orig) {
12183 LDKC2Tuple_usizeTransactionZ* orig_conv = (LDKC2Tuple_usizeTransactionZ*)untag_ptr(orig);
12184 LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
12185 *ret_conv = C2Tuple_usizeTransactionZ_clone(orig_conv);
12186 return tag_ptr(ret_conv, true);
12189 uint64_t __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_new"))) TS_C2Tuple_usizeTransactionZ_new(uint32_t a, int8_tArray b) {
12190 LDKTransaction b_ref;
12191 b_ref.datalen = b->arr_len;
12192 b_ref.data = MALLOC(b_ref.datalen, "LDKTransaction Bytes");
12193 memcpy(b_ref.data, b->elems, b_ref.datalen); FREE(b);
12194 b_ref.data_is_owned = true;
12195 LDKC2Tuple_usizeTransactionZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_usizeTransactionZ), "LDKC2Tuple_usizeTransactionZ");
12196 *ret_conv = C2Tuple_usizeTransactionZ_new(a, b_ref);
12197 return tag_ptr(ret_conv, true);
12200 void __attribute__((export_name("TS_C2Tuple_usizeTransactionZ_free"))) TS_C2Tuple_usizeTransactionZ_free(uint64_t _res) {
12201 if (!ptr_is_owned(_res)) return;
12202 void* _res_ptr = untag_ptr(_res);
12203 CHECK_ACCESS(_res_ptr);
12204 LDKC2Tuple_usizeTransactionZ _res_conv = *(LDKC2Tuple_usizeTransactionZ*)(_res_ptr);
12205 FREE(untag_ptr(_res));
12206 C2Tuple_usizeTransactionZ_free(_res_conv);
12209 void __attribute__((export_name("TS_CVec_C2Tuple_usizeTransactionZZ_free"))) TS_CVec_C2Tuple_usizeTransactionZZ_free(uint64_tArray _res) {
12210 LDKCVec_C2Tuple_usizeTransactionZZ _res_constr;
12211 _res_constr.datalen = _res->arr_len;
12212 if (_res_constr.datalen > 0)
12213 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
12215 _res_constr.data = NULL;
12216 uint64_t* _res_vals = _res->elems;
12217 for (size_t c = 0; c < _res_constr.datalen; c++) {
12218 uint64_t _res_conv_28 = _res_vals[c];
12219 void* _res_conv_28_ptr = untag_ptr(_res_conv_28);
12220 CHECK_ACCESS(_res_conv_28_ptr);
12221 LDKC2Tuple_usizeTransactionZ _res_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(_res_conv_28_ptr);
12222 FREE(untag_ptr(_res_conv_28));
12223 _res_constr.data[c] = _res_conv_28_conv;
12226 CVec_C2Tuple_usizeTransactionZZ_free(_res_constr);
12229 void __attribute__((export_name("TS_CVec_TxidZ_free"))) TS_CVec_TxidZ_free(ptrArray _res) {
12230 LDKCVec_TxidZ _res_constr;
12231 _res_constr.datalen = _res->arr_len;
12232 if (_res_constr.datalen > 0)
12233 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_TxidZ Elements");
12235 _res_constr.data = NULL;
12236 int8_tArray* _res_vals = (void*) _res->elems;
12237 for (size_t m = 0; m < _res_constr.datalen; m++) {
12238 int8_tArray _res_conv_12 = _res_vals[m];
12239 LDKThirtyTwoBytes _res_conv_12_ref;
12240 CHECK(_res_conv_12->arr_len == 32);
12241 memcpy(_res_conv_12_ref.data, _res_conv_12->elems, 32); FREE(_res_conv_12);
12242 _res_constr.data[m] = _res_conv_12_ref;
12245 CVec_TxidZ_free(_res_constr);
12248 uint64_t __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_ok"))) TS_CResult_NoneChannelMonitorUpdateErrZ_ok() {
12249 LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
12250 *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_ok();
12251 return tag_ptr(ret_conv, true);
12254 uint64_t __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_err"))) TS_CResult_NoneChannelMonitorUpdateErrZ_err(uint32_t e) {
12255 LDKChannelMonitorUpdateErr e_conv = LDKChannelMonitorUpdateErr_from_js(e);
12256 LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
12257 *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_err(e_conv);
12258 return tag_ptr(ret_conv, true);
12261 jboolean __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_is_ok"))) TS_CResult_NoneChannelMonitorUpdateErrZ_is_ok(uint64_t o) {
12262 LDKCResult_NoneChannelMonitorUpdateErrZ* o_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)untag_ptr(o);
12263 jboolean ret_conv = CResult_NoneChannelMonitorUpdateErrZ_is_ok(o_conv);
12267 void __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_free"))) TS_CResult_NoneChannelMonitorUpdateErrZ_free(uint64_t _res) {
12268 if (!ptr_is_owned(_res)) return;
12269 void* _res_ptr = untag_ptr(_res);
12270 CHECK_ACCESS(_res_ptr);
12271 LDKCResult_NoneChannelMonitorUpdateErrZ _res_conv = *(LDKCResult_NoneChannelMonitorUpdateErrZ*)(_res_ptr);
12272 FREE(untag_ptr(_res));
12273 CResult_NoneChannelMonitorUpdateErrZ_free(_res_conv);
12276 static inline uint64_t CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(LDKCResult_NoneChannelMonitorUpdateErrZ *NONNULL_PTR arg) {
12277 LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
12278 *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone(arg);
12279 return tag_ptr(ret_conv, true);
12281 int64_t __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_clone_ptr"))) TS_CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(uint64_t arg) {
12282 LDKCResult_NoneChannelMonitorUpdateErrZ* arg_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)untag_ptr(arg);
12283 int64_t ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone_ptr(arg_conv);
12287 uint64_t __attribute__((export_name("TS_CResult_NoneChannelMonitorUpdateErrZ_clone"))) TS_CResult_NoneChannelMonitorUpdateErrZ_clone(uint64_t orig) {
12288 LDKCResult_NoneChannelMonitorUpdateErrZ* orig_conv = (LDKCResult_NoneChannelMonitorUpdateErrZ*)untag_ptr(orig);
12289 LDKCResult_NoneChannelMonitorUpdateErrZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneChannelMonitorUpdateErrZ), "LDKCResult_NoneChannelMonitorUpdateErrZ");
12290 *ret_conv = CResult_NoneChannelMonitorUpdateErrZ_clone(orig_conv);
12291 return tag_ptr(ret_conv, true);
12294 void __attribute__((export_name("TS_CVec_MonitorEventZ_free"))) TS_CVec_MonitorEventZ_free(uint64_tArray _res) {
12295 LDKCVec_MonitorEventZ _res_constr;
12296 _res_constr.datalen = _res->arr_len;
12297 if (_res_constr.datalen > 0)
12298 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ Elements");
12300 _res_constr.data = NULL;
12301 uint64_t* _res_vals = _res->elems;
12302 for (size_t o = 0; o < _res_constr.datalen; o++) {
12303 uint64_t _res_conv_14 = _res_vals[o];
12304 void* _res_conv_14_ptr = untag_ptr(_res_conv_14);
12305 CHECK_ACCESS(_res_conv_14_ptr);
12306 LDKMonitorEvent _res_conv_14_conv = *(LDKMonitorEvent*)(_res_conv_14_ptr);
12307 FREE(untag_ptr(_res_conv_14));
12308 _res_constr.data[o] = _res_conv_14_conv;
12311 CVec_MonitorEventZ_free(_res_constr);
12314 static inline uint64_t C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ *NONNULL_PTR arg) {
12315 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ");
12316 *ret_conv = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(arg);
12317 return tag_ptr(ret_conv, true);
12319 int64_t __attribute__((export_name("TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr(uint64_t arg) {
12320 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* arg_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(arg);
12321 int64_t ret_conv = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone_ptr(arg_conv);
12325 uint64_t __attribute__((export_name("TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(uint64_t orig) {
12326 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* orig_conv = (LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)untag_ptr(orig);
12327 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ");
12328 *ret_conv = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_clone(orig_conv);
12329 return tag_ptr(ret_conv, true);
12332 uint64_t __attribute__((export_name("TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new(uint64_t a, uint64_tArray b, int8_tArray c) {
12333 LDKOutPoint a_conv;
12334 a_conv.inner = untag_ptr(a);
12335 a_conv.is_owned = ptr_is_owned(a);
12336 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
12337 a_conv = OutPoint_clone(&a_conv);
12338 LDKCVec_MonitorEventZ b_constr;
12339 b_constr.datalen = b->arr_len;
12340 if (b_constr.datalen > 0)
12341 b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKMonitorEvent), "LDKCVec_MonitorEventZ Elements");
12343 b_constr.data = NULL;
12344 uint64_t* b_vals = b->elems;
12345 for (size_t o = 0; o < b_constr.datalen; o++) {
12346 uint64_t b_conv_14 = b_vals[o];
12347 void* b_conv_14_ptr = untag_ptr(b_conv_14);
12348 CHECK_ACCESS(b_conv_14_ptr);
12349 LDKMonitorEvent b_conv_14_conv = *(LDKMonitorEvent*)(b_conv_14_ptr);
12350 b_conv_14_conv = MonitorEvent_clone((LDKMonitorEvent*)untag_ptr(b_conv_14));
12351 b_constr.data[o] = b_conv_14_conv;
12354 LDKPublicKey c_ref;
12355 CHECK(c->arr_len == 33);
12356 memcpy(c_ref.compressed_form, c->elems, 33); FREE(c);
12357 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ");
12358 *ret_conv = C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_new(a_conv, b_constr, c_ref);
12359 return tag_ptr(ret_conv, true);
12362 void __attribute__((export_name("TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free"))) TS_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free(uint64_t _res) {
12363 if (!ptr_is_owned(_res)) return;
12364 void* _res_ptr = untag_ptr(_res);
12365 CHECK_ACCESS(_res_ptr);
12366 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ _res_conv = *(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)(_res_ptr);
12367 FREE(untag_ptr(_res));
12368 C3Tuple_OutPointCVec_MonitorEventZPublicKeyZ_free(_res_conv);
12371 void __attribute__((export_name("TS_CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free"))) TS_CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free(uint64_tArray _res) {
12372 LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ _res_constr;
12373 _res_constr.datalen = _res->arr_len;
12374 if (_res_constr.datalen > 0)
12375 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ), "LDKCVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ Elements");
12377 _res_constr.data = NULL;
12378 uint64_t* _res_vals = _res->elems;
12379 for (size_t x = 0; x < _res_constr.datalen; x++) {
12380 uint64_t _res_conv_49 = _res_vals[x];
12381 void* _res_conv_49_ptr = untag_ptr(_res_conv_49);
12382 CHECK_ACCESS(_res_conv_49_ptr);
12383 LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ _res_conv_49_conv = *(LDKC3Tuple_OutPointCVec_MonitorEventZPublicKeyZ*)(_res_conv_49_ptr);
12384 FREE(untag_ptr(_res_conv_49));
12385 _res_constr.data[x] = _res_conv_49_conv;
12388 CVec_C3Tuple_OutPointCVec_MonitorEventZPublicKeyZZ_free(_res_constr);
12391 uint64_t __attribute__((export_name("TS_COption_C2Tuple_usizeTransactionZZ_some"))) TS_COption_C2Tuple_usizeTransactionZZ_some(uint64_t o) {
12392 void* o_ptr = untag_ptr(o);
12393 CHECK_ACCESS(o_ptr);
12394 LDKC2Tuple_usizeTransactionZ o_conv = *(LDKC2Tuple_usizeTransactionZ*)(o_ptr);
12395 o_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(o));
12396 LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ");
12397 *ret_copy = COption_C2Tuple_usizeTransactionZZ_some(o_conv);
12398 uint64_t ret_ref = tag_ptr(ret_copy, true);
12402 uint64_t __attribute__((export_name("TS_COption_C2Tuple_usizeTransactionZZ_none"))) TS_COption_C2Tuple_usizeTransactionZZ_none() {
12403 LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ");
12404 *ret_copy = COption_C2Tuple_usizeTransactionZZ_none();
12405 uint64_t ret_ref = tag_ptr(ret_copy, true);
12409 void __attribute__((export_name("TS_COption_C2Tuple_usizeTransactionZZ_free"))) TS_COption_C2Tuple_usizeTransactionZZ_free(uint64_t _res) {
12410 if (!ptr_is_owned(_res)) return;
12411 void* _res_ptr = untag_ptr(_res);
12412 CHECK_ACCESS(_res_ptr);
12413 LDKCOption_C2Tuple_usizeTransactionZZ _res_conv = *(LDKCOption_C2Tuple_usizeTransactionZZ*)(_res_ptr);
12414 FREE(untag_ptr(_res));
12415 COption_C2Tuple_usizeTransactionZZ_free(_res_conv);
12418 static inline uint64_t COption_C2Tuple_usizeTransactionZZ_clone_ptr(LDKCOption_C2Tuple_usizeTransactionZZ *NONNULL_PTR arg) {
12419 LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ");
12420 *ret_copy = COption_C2Tuple_usizeTransactionZZ_clone(arg);
12421 uint64_t ret_ref = tag_ptr(ret_copy, true);
12424 int64_t __attribute__((export_name("TS_COption_C2Tuple_usizeTransactionZZ_clone_ptr"))) TS_COption_C2Tuple_usizeTransactionZZ_clone_ptr(uint64_t arg) {
12425 LDKCOption_C2Tuple_usizeTransactionZZ* arg_conv = (LDKCOption_C2Tuple_usizeTransactionZZ*)untag_ptr(arg);
12426 int64_t ret_conv = COption_C2Tuple_usizeTransactionZZ_clone_ptr(arg_conv);
12430 uint64_t __attribute__((export_name("TS_COption_C2Tuple_usizeTransactionZZ_clone"))) TS_COption_C2Tuple_usizeTransactionZZ_clone(uint64_t orig) {
12431 LDKCOption_C2Tuple_usizeTransactionZZ* orig_conv = (LDKCOption_C2Tuple_usizeTransactionZZ*)untag_ptr(orig);
12432 LDKCOption_C2Tuple_usizeTransactionZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_usizeTransactionZZ), "LDKCOption_C2Tuple_usizeTransactionZZ");
12433 *ret_copy = COption_C2Tuple_usizeTransactionZZ_clone(orig_conv);
12434 uint64_t ret_ref = tag_ptr(ret_copy, true);
12438 uint64_t __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_ok"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_ok(uint64_t o) {
12439 LDKFixedPenaltyScorer o_conv;
12440 o_conv.inner = untag_ptr(o);
12441 o_conv.is_owned = ptr_is_owned(o);
12442 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
12443 o_conv = FixedPenaltyScorer_clone(&o_conv);
12444 LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
12445 *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_ok(o_conv);
12446 return tag_ptr(ret_conv, true);
12449 uint64_t __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_err"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_err(uint64_t e) {
12450 LDKDecodeError e_conv;
12451 e_conv.inner = untag_ptr(e);
12452 e_conv.is_owned = ptr_is_owned(e);
12453 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
12454 e_conv = DecodeError_clone(&e_conv);
12455 LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
12456 *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_err(e_conv);
12457 return tag_ptr(ret_conv, true);
12460 jboolean __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_is_ok"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(uint64_t o) {
12461 LDKCResult_FixedPenaltyScorerDecodeErrorZ* o_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(o);
12462 jboolean ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_is_ok(o_conv);
12466 void __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_free"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_free(uint64_t _res) {
12467 if (!ptr_is_owned(_res)) return;
12468 void* _res_ptr = untag_ptr(_res);
12469 CHECK_ACCESS(_res_ptr);
12470 LDKCResult_FixedPenaltyScorerDecodeErrorZ _res_conv = *(LDKCResult_FixedPenaltyScorerDecodeErrorZ*)(_res_ptr);
12471 FREE(untag_ptr(_res));
12472 CResult_FixedPenaltyScorerDecodeErrorZ_free(_res_conv);
12475 static inline uint64_t CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr(LDKCResult_FixedPenaltyScorerDecodeErrorZ *NONNULL_PTR arg) {
12476 LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
12477 *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_clone(arg);
12478 return tag_ptr(ret_conv, true);
12480 int64_t __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr(uint64_t arg) {
12481 LDKCResult_FixedPenaltyScorerDecodeErrorZ* arg_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(arg);
12482 int64_t ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_clone_ptr(arg_conv);
12486 uint64_t __attribute__((export_name("TS_CResult_FixedPenaltyScorerDecodeErrorZ_clone"))) TS_CResult_FixedPenaltyScorerDecodeErrorZ_clone(uint64_t orig) {
12487 LDKCResult_FixedPenaltyScorerDecodeErrorZ* orig_conv = (LDKCResult_FixedPenaltyScorerDecodeErrorZ*)untag_ptr(orig);
12488 LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
12489 *ret_conv = CResult_FixedPenaltyScorerDecodeErrorZ_clone(orig_conv);
12490 return tag_ptr(ret_conv, true);
12493 static inline uint64_t C2Tuple_u64u64Z_clone_ptr(LDKC2Tuple_u64u64Z *NONNULL_PTR arg) {
12494 LDKC2Tuple_u64u64Z* ret_conv = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
12495 *ret_conv = C2Tuple_u64u64Z_clone(arg);
12496 return tag_ptr(ret_conv, true);
12498 int64_t __attribute__((export_name("TS_C2Tuple_u64u64Z_clone_ptr"))) TS_C2Tuple_u64u64Z_clone_ptr(uint64_t arg) {
12499 LDKC2Tuple_u64u64Z* arg_conv = (LDKC2Tuple_u64u64Z*)untag_ptr(arg);
12500 int64_t ret_conv = C2Tuple_u64u64Z_clone_ptr(arg_conv);
12504 uint64_t __attribute__((export_name("TS_C2Tuple_u64u64Z_clone"))) TS_C2Tuple_u64u64Z_clone(uint64_t orig) {
12505 LDKC2Tuple_u64u64Z* orig_conv = (LDKC2Tuple_u64u64Z*)untag_ptr(orig);
12506 LDKC2Tuple_u64u64Z* ret_conv = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
12507 *ret_conv = C2Tuple_u64u64Z_clone(orig_conv);
12508 return tag_ptr(ret_conv, true);
12511 uint64_t __attribute__((export_name("TS_C2Tuple_u64u64Z_new"))) TS_C2Tuple_u64u64Z_new(int64_t a, int64_t b) {
12512 LDKC2Tuple_u64u64Z* ret_conv = MALLOC(sizeof(LDKC2Tuple_u64u64Z), "LDKC2Tuple_u64u64Z");
12513 *ret_conv = C2Tuple_u64u64Z_new(a, b);
12514 return tag_ptr(ret_conv, true);
12517 void __attribute__((export_name("TS_C2Tuple_u64u64Z_free"))) TS_C2Tuple_u64u64Z_free(uint64_t _res) {
12518 if (!ptr_is_owned(_res)) return;
12519 void* _res_ptr = untag_ptr(_res);
12520 CHECK_ACCESS(_res_ptr);
12521 LDKC2Tuple_u64u64Z _res_conv = *(LDKC2Tuple_u64u64Z*)(_res_ptr);
12522 FREE(untag_ptr(_res));
12523 C2Tuple_u64u64Z_free(_res_conv);
12526 uint64_t __attribute__((export_name("TS_COption_C2Tuple_u64u64ZZ_some"))) TS_COption_C2Tuple_u64u64ZZ_some(uint64_t o) {
12527 void* o_ptr = untag_ptr(o);
12528 CHECK_ACCESS(o_ptr);
12529 LDKC2Tuple_u64u64Z o_conv = *(LDKC2Tuple_u64u64Z*)(o_ptr);
12530 o_conv = C2Tuple_u64u64Z_clone((LDKC2Tuple_u64u64Z*)untag_ptr(o));
12531 LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ");
12532 *ret_copy = COption_C2Tuple_u64u64ZZ_some(o_conv);
12533 uint64_t ret_ref = tag_ptr(ret_copy, true);
12537 uint64_t __attribute__((export_name("TS_COption_C2Tuple_u64u64ZZ_none"))) TS_COption_C2Tuple_u64u64ZZ_none() {
12538 LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ");
12539 *ret_copy = COption_C2Tuple_u64u64ZZ_none();
12540 uint64_t ret_ref = tag_ptr(ret_copy, true);
12544 void __attribute__((export_name("TS_COption_C2Tuple_u64u64ZZ_free"))) TS_COption_C2Tuple_u64u64ZZ_free(uint64_t _res) {
12545 if (!ptr_is_owned(_res)) return;
12546 void* _res_ptr = untag_ptr(_res);
12547 CHECK_ACCESS(_res_ptr);
12548 LDKCOption_C2Tuple_u64u64ZZ _res_conv = *(LDKCOption_C2Tuple_u64u64ZZ*)(_res_ptr);
12549 FREE(untag_ptr(_res));
12550 COption_C2Tuple_u64u64ZZ_free(_res_conv);
12553 static inline uint64_t COption_C2Tuple_u64u64ZZ_clone_ptr(LDKCOption_C2Tuple_u64u64ZZ *NONNULL_PTR arg) {
12554 LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ");
12555 *ret_copy = COption_C2Tuple_u64u64ZZ_clone(arg);
12556 uint64_t ret_ref = tag_ptr(ret_copy, true);
12559 int64_t __attribute__((export_name("TS_COption_C2Tuple_u64u64ZZ_clone_ptr"))) TS_COption_C2Tuple_u64u64ZZ_clone_ptr(uint64_t arg) {
12560 LDKCOption_C2Tuple_u64u64ZZ* arg_conv = (LDKCOption_C2Tuple_u64u64ZZ*)untag_ptr(arg);
12561 int64_t ret_conv = COption_C2Tuple_u64u64ZZ_clone_ptr(arg_conv);
12565 uint64_t __attribute__((export_name("TS_COption_C2Tuple_u64u64ZZ_clone"))) TS_COption_C2Tuple_u64u64ZZ_clone(uint64_t orig) {
12566 LDKCOption_C2Tuple_u64u64ZZ* orig_conv = (LDKCOption_C2Tuple_u64u64ZZ*)untag_ptr(orig);
12567 LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ");
12568 *ret_copy = COption_C2Tuple_u64u64ZZ_clone(orig_conv);
12569 uint64_t ret_ref = tag_ptr(ret_copy, true);
12573 void __attribute__((export_name("TS_CVec_NodeIdZ_free"))) TS_CVec_NodeIdZ_free(uint64_tArray _res) {
12574 LDKCVec_NodeIdZ _res_constr;
12575 _res_constr.datalen = _res->arr_len;
12576 if (_res_constr.datalen > 0)
12577 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKNodeId), "LDKCVec_NodeIdZ Elements");
12579 _res_constr.data = NULL;
12580 uint64_t* _res_vals = _res->elems;
12581 for (size_t i = 0; i < _res_constr.datalen; i++) {
12582 uint64_t _res_conv_8 = _res_vals[i];
12583 LDKNodeId _res_conv_8_conv;
12584 _res_conv_8_conv.inner = untag_ptr(_res_conv_8);
12585 _res_conv_8_conv.is_owned = ptr_is_owned(_res_conv_8);
12586 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_8_conv);
12587 _res_constr.data[i] = _res_conv_8_conv;
12590 CVec_NodeIdZ_free(_res_constr);
12593 uint64_t __attribute__((export_name("TS_CResult_ProbabilisticScorerDecodeErrorZ_ok"))) TS_CResult_ProbabilisticScorerDecodeErrorZ_ok(uint64_t o) {
12594 LDKProbabilisticScorer o_conv;
12595 o_conv.inner = untag_ptr(o);
12596 o_conv.is_owned = ptr_is_owned(o);
12597 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
12598 // WARNING: we need a move here but no clone is available for LDKProbabilisticScorer
12600 LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ");
12601 *ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_ok(o_conv);
12602 return tag_ptr(ret_conv, true);
12605 uint64_t __attribute__((export_name("TS_CResult_ProbabilisticScorerDecodeErrorZ_err"))) TS_CResult_ProbabilisticScorerDecodeErrorZ_err(uint64_t e) {
12606 LDKDecodeError e_conv;
12607 e_conv.inner = untag_ptr(e);
12608 e_conv.is_owned = ptr_is_owned(e);
12609 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
12610 e_conv = DecodeError_clone(&e_conv);
12611 LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ");
12612 *ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_err(e_conv);
12613 return tag_ptr(ret_conv, true);
12616 jboolean __attribute__((export_name("TS_CResult_ProbabilisticScorerDecodeErrorZ_is_ok"))) TS_CResult_ProbabilisticScorerDecodeErrorZ_is_ok(uint64_t o) {
12617 LDKCResult_ProbabilisticScorerDecodeErrorZ* o_conv = (LDKCResult_ProbabilisticScorerDecodeErrorZ*)untag_ptr(o);
12618 jboolean ret_conv = CResult_ProbabilisticScorerDecodeErrorZ_is_ok(o_conv);
12622 void __attribute__((export_name("TS_CResult_ProbabilisticScorerDecodeErrorZ_free"))) TS_CResult_ProbabilisticScorerDecodeErrorZ_free(uint64_t _res) {
12623 if (!ptr_is_owned(_res)) return;
12624 void* _res_ptr = untag_ptr(_res);
12625 CHECK_ACCESS(_res_ptr);
12626 LDKCResult_ProbabilisticScorerDecodeErrorZ _res_conv = *(LDKCResult_ProbabilisticScorerDecodeErrorZ*)(_res_ptr);
12627 FREE(untag_ptr(_res));
12628 CResult_ProbabilisticScorerDecodeErrorZ_free(_res_conv);
12631 uint64_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_ok"))) TS_CResult_InitFeaturesDecodeErrorZ_ok(uint64_t o) {
12632 LDKInitFeatures o_conv;
12633 o_conv.inner = untag_ptr(o);
12634 o_conv.is_owned = ptr_is_owned(o);
12635 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
12636 o_conv = InitFeatures_clone(&o_conv);
12637 LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
12638 *ret_conv = CResult_InitFeaturesDecodeErrorZ_ok(o_conv);
12639 return tag_ptr(ret_conv, true);
12642 uint64_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_err"))) TS_CResult_InitFeaturesDecodeErrorZ_err(uint64_t e) {
12643 LDKDecodeError e_conv;
12644 e_conv.inner = untag_ptr(e);
12645 e_conv.is_owned = ptr_is_owned(e);
12646 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
12647 e_conv = DecodeError_clone(&e_conv);
12648 LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
12649 *ret_conv = CResult_InitFeaturesDecodeErrorZ_err(e_conv);
12650 return tag_ptr(ret_conv, true);
12653 jboolean __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_is_ok"))) TS_CResult_InitFeaturesDecodeErrorZ_is_ok(uint64_t o) {
12654 LDKCResult_InitFeaturesDecodeErrorZ* o_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(o);
12655 jboolean ret_conv = CResult_InitFeaturesDecodeErrorZ_is_ok(o_conv);
12659 void __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_free"))) TS_CResult_InitFeaturesDecodeErrorZ_free(uint64_t _res) {
12660 if (!ptr_is_owned(_res)) return;
12661 void* _res_ptr = untag_ptr(_res);
12662 CHECK_ACCESS(_res_ptr);
12663 LDKCResult_InitFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InitFeaturesDecodeErrorZ*)(_res_ptr);
12664 FREE(untag_ptr(_res));
12665 CResult_InitFeaturesDecodeErrorZ_free(_res_conv);
12668 static inline uint64_t CResult_InitFeaturesDecodeErrorZ_clone_ptr(LDKCResult_InitFeaturesDecodeErrorZ *NONNULL_PTR arg) {
12669 LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
12670 *ret_conv = CResult_InitFeaturesDecodeErrorZ_clone(arg);
12671 return tag_ptr(ret_conv, true);
12673 int64_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_clone_ptr"))) TS_CResult_InitFeaturesDecodeErrorZ_clone_ptr(uint64_t arg) {
12674 LDKCResult_InitFeaturesDecodeErrorZ* arg_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(arg);
12675 int64_t ret_conv = CResult_InitFeaturesDecodeErrorZ_clone_ptr(arg_conv);
12679 uint64_t __attribute__((export_name("TS_CResult_InitFeaturesDecodeErrorZ_clone"))) TS_CResult_InitFeaturesDecodeErrorZ_clone(uint64_t orig) {
12680 LDKCResult_InitFeaturesDecodeErrorZ* orig_conv = (LDKCResult_InitFeaturesDecodeErrorZ*)untag_ptr(orig);
12681 LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
12682 *ret_conv = CResult_InitFeaturesDecodeErrorZ_clone(orig_conv);
12683 return tag_ptr(ret_conv, true);
12686 uint64_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_ok"))) TS_CResult_ChannelFeaturesDecodeErrorZ_ok(uint64_t o) {
12687 LDKChannelFeatures o_conv;
12688 o_conv.inner = untag_ptr(o);
12689 o_conv.is_owned = ptr_is_owned(o);
12690 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
12691 o_conv = ChannelFeatures_clone(&o_conv);
12692 LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
12693 *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_ok(o_conv);
12694 return tag_ptr(ret_conv, true);
12697 uint64_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_err"))) TS_CResult_ChannelFeaturesDecodeErrorZ_err(uint64_t e) {
12698 LDKDecodeError e_conv;
12699 e_conv.inner = untag_ptr(e);
12700 e_conv.is_owned = ptr_is_owned(e);
12701 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
12702 e_conv = DecodeError_clone(&e_conv);
12703 LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
12704 *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_err(e_conv);
12705 return tag_ptr(ret_conv, true);
12708 jboolean __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_is_ok"))) TS_CResult_ChannelFeaturesDecodeErrorZ_is_ok(uint64_t o) {
12709 LDKCResult_ChannelFeaturesDecodeErrorZ* o_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(o);
12710 jboolean ret_conv = CResult_ChannelFeaturesDecodeErrorZ_is_ok(o_conv);
12714 void __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_free"))) TS_CResult_ChannelFeaturesDecodeErrorZ_free(uint64_t _res) {
12715 if (!ptr_is_owned(_res)) return;
12716 void* _res_ptr = untag_ptr(_res);
12717 CHECK_ACCESS(_res_ptr);
12718 LDKCResult_ChannelFeaturesDecodeErrorZ _res_conv = *(LDKCResult_ChannelFeaturesDecodeErrorZ*)(_res_ptr);
12719 FREE(untag_ptr(_res));
12720 CResult_ChannelFeaturesDecodeErrorZ_free(_res_conv);
12723 static inline uint64_t CResult_ChannelFeaturesDecodeErrorZ_clone_ptr(LDKCResult_ChannelFeaturesDecodeErrorZ *NONNULL_PTR arg) {
12724 LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
12725 *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_clone(arg);
12726 return tag_ptr(ret_conv, true);
12728 int64_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelFeaturesDecodeErrorZ_clone_ptr(uint64_t arg) {
12729 LDKCResult_ChannelFeaturesDecodeErrorZ* arg_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(arg);
12730 int64_t ret_conv = CResult_ChannelFeaturesDecodeErrorZ_clone_ptr(arg_conv);
12734 uint64_t __attribute__((export_name("TS_CResult_ChannelFeaturesDecodeErrorZ_clone"))) TS_CResult_ChannelFeaturesDecodeErrorZ_clone(uint64_t orig) {
12735 LDKCResult_ChannelFeaturesDecodeErrorZ* orig_conv = (LDKCResult_ChannelFeaturesDecodeErrorZ*)untag_ptr(orig);
12736 LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
12737 *ret_conv = CResult_ChannelFeaturesDecodeErrorZ_clone(orig_conv);
12738 return tag_ptr(ret_conv, true);
12741 uint64_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_ok"))) TS_CResult_NodeFeaturesDecodeErrorZ_ok(uint64_t o) {
12742 LDKNodeFeatures o_conv;
12743 o_conv.inner = untag_ptr(o);
12744 o_conv.is_owned = ptr_is_owned(o);
12745 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
12746 o_conv = NodeFeatures_clone(&o_conv);
12747 LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
12748 *ret_conv = CResult_NodeFeaturesDecodeErrorZ_ok(o_conv);
12749 return tag_ptr(ret_conv, true);
12752 uint64_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_err"))) TS_CResult_NodeFeaturesDecodeErrorZ_err(uint64_t e) {
12753 LDKDecodeError e_conv;
12754 e_conv.inner = untag_ptr(e);
12755 e_conv.is_owned = ptr_is_owned(e);
12756 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
12757 e_conv = DecodeError_clone(&e_conv);
12758 LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
12759 *ret_conv = CResult_NodeFeaturesDecodeErrorZ_err(e_conv);
12760 return tag_ptr(ret_conv, true);
12763 jboolean __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_is_ok"))) TS_CResult_NodeFeaturesDecodeErrorZ_is_ok(uint64_t o) {
12764 LDKCResult_NodeFeaturesDecodeErrorZ* o_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(o);
12765 jboolean ret_conv = CResult_NodeFeaturesDecodeErrorZ_is_ok(o_conv);
12769 void __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_free"))) TS_CResult_NodeFeaturesDecodeErrorZ_free(uint64_t _res) {
12770 if (!ptr_is_owned(_res)) return;
12771 void* _res_ptr = untag_ptr(_res);
12772 CHECK_ACCESS(_res_ptr);
12773 LDKCResult_NodeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_NodeFeaturesDecodeErrorZ*)(_res_ptr);
12774 FREE(untag_ptr(_res));
12775 CResult_NodeFeaturesDecodeErrorZ_free(_res_conv);
12778 static inline uint64_t CResult_NodeFeaturesDecodeErrorZ_clone_ptr(LDKCResult_NodeFeaturesDecodeErrorZ *NONNULL_PTR arg) {
12779 LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
12780 *ret_conv = CResult_NodeFeaturesDecodeErrorZ_clone(arg);
12781 return tag_ptr(ret_conv, true);
12783 int64_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_clone_ptr"))) TS_CResult_NodeFeaturesDecodeErrorZ_clone_ptr(uint64_t arg) {
12784 LDKCResult_NodeFeaturesDecodeErrorZ* arg_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(arg);
12785 int64_t ret_conv = CResult_NodeFeaturesDecodeErrorZ_clone_ptr(arg_conv);
12789 uint64_t __attribute__((export_name("TS_CResult_NodeFeaturesDecodeErrorZ_clone"))) TS_CResult_NodeFeaturesDecodeErrorZ_clone(uint64_t orig) {
12790 LDKCResult_NodeFeaturesDecodeErrorZ* orig_conv = (LDKCResult_NodeFeaturesDecodeErrorZ*)untag_ptr(orig);
12791 LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
12792 *ret_conv = CResult_NodeFeaturesDecodeErrorZ_clone(orig_conv);
12793 return tag_ptr(ret_conv, true);
12796 uint64_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_ok"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_ok(uint64_t o) {
12797 LDKInvoiceFeatures o_conv;
12798 o_conv.inner = untag_ptr(o);
12799 o_conv.is_owned = ptr_is_owned(o);
12800 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
12801 o_conv = InvoiceFeatures_clone(&o_conv);
12802 LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
12803 *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_ok(o_conv);
12804 return tag_ptr(ret_conv, true);
12807 uint64_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_err"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_err(uint64_t e) {
12808 LDKDecodeError e_conv;
12809 e_conv.inner = untag_ptr(e);
12810 e_conv.is_owned = ptr_is_owned(e);
12811 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
12812 e_conv = DecodeError_clone(&e_conv);
12813 LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
12814 *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_err(e_conv);
12815 return tag_ptr(ret_conv, true);
12818 jboolean __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_is_ok"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_is_ok(uint64_t o) {
12819 LDKCResult_InvoiceFeaturesDecodeErrorZ* o_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(o);
12820 jboolean ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_is_ok(o_conv);
12824 void __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_free"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_free(uint64_t _res) {
12825 if (!ptr_is_owned(_res)) return;
12826 void* _res_ptr = untag_ptr(_res);
12827 CHECK_ACCESS(_res_ptr);
12828 LDKCResult_InvoiceFeaturesDecodeErrorZ _res_conv = *(LDKCResult_InvoiceFeaturesDecodeErrorZ*)(_res_ptr);
12829 FREE(untag_ptr(_res));
12830 CResult_InvoiceFeaturesDecodeErrorZ_free(_res_conv);
12833 static inline uint64_t CResult_InvoiceFeaturesDecodeErrorZ_clone_ptr(LDKCResult_InvoiceFeaturesDecodeErrorZ *NONNULL_PTR arg) {
12834 LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
12835 *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_clone(arg);
12836 return tag_ptr(ret_conv, true);
12838 int64_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_clone_ptr"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_clone_ptr(uint64_t arg) {
12839 LDKCResult_InvoiceFeaturesDecodeErrorZ* arg_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(arg);
12840 int64_t ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_clone_ptr(arg_conv);
12844 uint64_t __attribute__((export_name("TS_CResult_InvoiceFeaturesDecodeErrorZ_clone"))) TS_CResult_InvoiceFeaturesDecodeErrorZ_clone(uint64_t orig) {
12845 LDKCResult_InvoiceFeaturesDecodeErrorZ* orig_conv = (LDKCResult_InvoiceFeaturesDecodeErrorZ*)untag_ptr(orig);
12846 LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
12847 *ret_conv = CResult_InvoiceFeaturesDecodeErrorZ_clone(orig_conv);
12848 return tag_ptr(ret_conv, true);
12851 uint64_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_ok"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_ok(uint64_t o) {
12852 LDKChannelTypeFeatures o_conv;
12853 o_conv.inner = untag_ptr(o);
12854 o_conv.is_owned = ptr_is_owned(o);
12855 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
12856 o_conv = ChannelTypeFeatures_clone(&o_conv);
12857 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
12858 *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_ok(o_conv);
12859 return tag_ptr(ret_conv, true);
12862 uint64_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_err"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_err(uint64_t e) {
12863 LDKDecodeError e_conv;
12864 e_conv.inner = untag_ptr(e);
12865 e_conv.is_owned = ptr_is_owned(e);
12866 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
12867 e_conv = DecodeError_clone(&e_conv);
12868 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
12869 *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_err(e_conv);
12870 return tag_ptr(ret_conv, true);
12873 jboolean __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(uint64_t o) {
12874 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* o_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(o);
12875 jboolean ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_is_ok(o_conv);
12879 void __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_free"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_free(uint64_t _res) {
12880 if (!ptr_is_owned(_res)) return;
12881 void* _res_ptr = untag_ptr(_res);
12882 CHECK_ACCESS(_res_ptr);
12883 LDKCResult_ChannelTypeFeaturesDecodeErrorZ _res_conv = *(LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)(_res_ptr);
12884 FREE(untag_ptr(_res));
12885 CResult_ChannelTypeFeaturesDecodeErrorZ_free(_res_conv);
12888 static inline uint64_t CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(LDKCResult_ChannelTypeFeaturesDecodeErrorZ *NONNULL_PTR arg) {
12889 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
12890 *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone(arg);
12891 return tag_ptr(ret_conv, true);
12893 int64_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(uint64_t arg) {
12894 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* arg_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(arg);
12895 int64_t ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone_ptr(arg_conv);
12899 uint64_t __attribute__((export_name("TS_CResult_ChannelTypeFeaturesDecodeErrorZ_clone"))) TS_CResult_ChannelTypeFeaturesDecodeErrorZ_clone(uint64_t orig) {
12900 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* orig_conv = (LDKCResult_ChannelTypeFeaturesDecodeErrorZ*)untag_ptr(orig);
12901 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
12902 *ret_conv = CResult_ChannelTypeFeaturesDecodeErrorZ_clone(orig_conv);
12903 return tag_ptr(ret_conv, true);
12906 uint64_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_ok"))) TS_CResult_NodeIdDecodeErrorZ_ok(uint64_t o) {
12908 o_conv.inner = untag_ptr(o);
12909 o_conv.is_owned = ptr_is_owned(o);
12910 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
12911 o_conv = NodeId_clone(&o_conv);
12912 LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
12913 *ret_conv = CResult_NodeIdDecodeErrorZ_ok(o_conv);
12914 return tag_ptr(ret_conv, true);
12917 uint64_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_err"))) TS_CResult_NodeIdDecodeErrorZ_err(uint64_t e) {
12918 LDKDecodeError e_conv;
12919 e_conv.inner = untag_ptr(e);
12920 e_conv.is_owned = ptr_is_owned(e);
12921 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
12922 e_conv = DecodeError_clone(&e_conv);
12923 LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
12924 *ret_conv = CResult_NodeIdDecodeErrorZ_err(e_conv);
12925 return tag_ptr(ret_conv, true);
12928 jboolean __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_is_ok"))) TS_CResult_NodeIdDecodeErrorZ_is_ok(uint64_t o) {
12929 LDKCResult_NodeIdDecodeErrorZ* o_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(o);
12930 jboolean ret_conv = CResult_NodeIdDecodeErrorZ_is_ok(o_conv);
12934 void __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_free"))) TS_CResult_NodeIdDecodeErrorZ_free(uint64_t _res) {
12935 if (!ptr_is_owned(_res)) return;
12936 void* _res_ptr = untag_ptr(_res);
12937 CHECK_ACCESS(_res_ptr);
12938 LDKCResult_NodeIdDecodeErrorZ _res_conv = *(LDKCResult_NodeIdDecodeErrorZ*)(_res_ptr);
12939 FREE(untag_ptr(_res));
12940 CResult_NodeIdDecodeErrorZ_free(_res_conv);
12943 static inline uint64_t CResult_NodeIdDecodeErrorZ_clone_ptr(LDKCResult_NodeIdDecodeErrorZ *NONNULL_PTR arg) {
12944 LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
12945 *ret_conv = CResult_NodeIdDecodeErrorZ_clone(arg);
12946 return tag_ptr(ret_conv, true);
12948 int64_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_clone_ptr"))) TS_CResult_NodeIdDecodeErrorZ_clone_ptr(uint64_t arg) {
12949 LDKCResult_NodeIdDecodeErrorZ* arg_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(arg);
12950 int64_t ret_conv = CResult_NodeIdDecodeErrorZ_clone_ptr(arg_conv);
12954 uint64_t __attribute__((export_name("TS_CResult_NodeIdDecodeErrorZ_clone"))) TS_CResult_NodeIdDecodeErrorZ_clone(uint64_t orig) {
12955 LDKCResult_NodeIdDecodeErrorZ* orig_conv = (LDKCResult_NodeIdDecodeErrorZ*)untag_ptr(orig);
12956 LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
12957 *ret_conv = CResult_NodeIdDecodeErrorZ_clone(orig_conv);
12958 return tag_ptr(ret_conv, true);
12961 uint64_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_ok"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_ok(uint64_t o) {
12962 void* o_ptr = untag_ptr(o);
12963 CHECK_ACCESS(o_ptr);
12964 LDKCOption_NetworkUpdateZ o_conv = *(LDKCOption_NetworkUpdateZ*)(o_ptr);
12965 o_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)untag_ptr(o));
12966 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
12967 *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_ok(o_conv);
12968 return tag_ptr(ret_conv, true);
12971 uint64_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_err"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_err(uint64_t e) {
12972 LDKDecodeError e_conv;
12973 e_conv.inner = untag_ptr(e);
12974 e_conv.is_owned = ptr_is_owned(e);
12975 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
12976 e_conv = DecodeError_clone(&e_conv);
12977 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
12978 *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_err(e_conv);
12979 return tag_ptr(ret_conv, true);
12982 jboolean __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(uint64_t o) {
12983 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* o_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(o);
12984 jboolean ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_is_ok(o_conv);
12988 void __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_free"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_free(uint64_t _res) {
12989 if (!ptr_is_owned(_res)) return;
12990 void* _res_ptr = untag_ptr(_res);
12991 CHECK_ACCESS(_res_ptr);
12992 LDKCResult_COption_NetworkUpdateZDecodeErrorZ _res_conv = *(LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)(_res_ptr);
12993 FREE(untag_ptr(_res));
12994 CResult_COption_NetworkUpdateZDecodeErrorZ_free(_res_conv);
12997 static inline uint64_t CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(LDKCResult_COption_NetworkUpdateZDecodeErrorZ *NONNULL_PTR arg) {
12998 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
12999 *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone(arg);
13000 return tag_ptr(ret_conv, true);
13002 int64_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(uint64_t arg) {
13003 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* arg_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(arg);
13004 int64_t ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone_ptr(arg_conv);
13008 uint64_t __attribute__((export_name("TS_CResult_COption_NetworkUpdateZDecodeErrorZ_clone"))) TS_CResult_COption_NetworkUpdateZDecodeErrorZ_clone(uint64_t orig) {
13009 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* orig_conv = (LDKCResult_COption_NetworkUpdateZDecodeErrorZ*)untag_ptr(orig);
13010 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
13011 *ret_conv = CResult_COption_NetworkUpdateZDecodeErrorZ_clone(orig_conv);
13012 return tag_ptr(ret_conv, true);
13015 uint64_t __attribute__((export_name("TS_COption_AccessZ_some"))) TS_COption_AccessZ_some(uint64_t o) {
13016 void* o_ptr = untag_ptr(o);
13017 CHECK_ACCESS(o_ptr);
13018 LDKAccess o_conv = *(LDKAccess*)(o_ptr);
13019 if (o_conv.free == LDKAccess_JCalls_free) {
13020 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
13021 LDKAccess_JCalls_cloned(&o_conv);
13023 LDKCOption_AccessZ *ret_copy = MALLOC(sizeof(LDKCOption_AccessZ), "LDKCOption_AccessZ");
13024 *ret_copy = COption_AccessZ_some(o_conv);
13025 uint64_t ret_ref = tag_ptr(ret_copy, true);
13029 uint64_t __attribute__((export_name("TS_COption_AccessZ_none"))) TS_COption_AccessZ_none() {
13030 LDKCOption_AccessZ *ret_copy = MALLOC(sizeof(LDKCOption_AccessZ), "LDKCOption_AccessZ");
13031 *ret_copy = COption_AccessZ_none();
13032 uint64_t ret_ref = tag_ptr(ret_copy, true);
13036 void __attribute__((export_name("TS_COption_AccessZ_free"))) TS_COption_AccessZ_free(uint64_t _res) {
13037 if (!ptr_is_owned(_res)) return;
13038 void* _res_ptr = untag_ptr(_res);
13039 CHECK_ACCESS(_res_ptr);
13040 LDKCOption_AccessZ _res_conv = *(LDKCOption_AccessZ*)(_res_ptr);
13041 FREE(untag_ptr(_res));
13042 COption_AccessZ_free(_res_conv);
13045 uint64_t __attribute__((export_name("TS_CResult_boolLightningErrorZ_ok"))) TS_CResult_boolLightningErrorZ_ok(jboolean o) {
13046 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
13047 *ret_conv = CResult_boolLightningErrorZ_ok(o);
13048 return tag_ptr(ret_conv, true);
13051 uint64_t __attribute__((export_name("TS_CResult_boolLightningErrorZ_err"))) TS_CResult_boolLightningErrorZ_err(uint64_t e) {
13052 LDKLightningError e_conv;
13053 e_conv.inner = untag_ptr(e);
13054 e_conv.is_owned = ptr_is_owned(e);
13055 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13056 e_conv = LightningError_clone(&e_conv);
13057 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
13058 *ret_conv = CResult_boolLightningErrorZ_err(e_conv);
13059 return tag_ptr(ret_conv, true);
13062 jboolean __attribute__((export_name("TS_CResult_boolLightningErrorZ_is_ok"))) TS_CResult_boolLightningErrorZ_is_ok(uint64_t o) {
13063 LDKCResult_boolLightningErrorZ* o_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(o);
13064 jboolean ret_conv = CResult_boolLightningErrorZ_is_ok(o_conv);
13068 void __attribute__((export_name("TS_CResult_boolLightningErrorZ_free"))) TS_CResult_boolLightningErrorZ_free(uint64_t _res) {
13069 if (!ptr_is_owned(_res)) return;
13070 void* _res_ptr = untag_ptr(_res);
13071 CHECK_ACCESS(_res_ptr);
13072 LDKCResult_boolLightningErrorZ _res_conv = *(LDKCResult_boolLightningErrorZ*)(_res_ptr);
13073 FREE(untag_ptr(_res));
13074 CResult_boolLightningErrorZ_free(_res_conv);
13077 static inline uint64_t CResult_boolLightningErrorZ_clone_ptr(LDKCResult_boolLightningErrorZ *NONNULL_PTR arg) {
13078 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
13079 *ret_conv = CResult_boolLightningErrorZ_clone(arg);
13080 return tag_ptr(ret_conv, true);
13082 int64_t __attribute__((export_name("TS_CResult_boolLightningErrorZ_clone_ptr"))) TS_CResult_boolLightningErrorZ_clone_ptr(uint64_t arg) {
13083 LDKCResult_boolLightningErrorZ* arg_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(arg);
13084 int64_t ret_conv = CResult_boolLightningErrorZ_clone_ptr(arg_conv);
13088 uint64_t __attribute__((export_name("TS_CResult_boolLightningErrorZ_clone"))) TS_CResult_boolLightningErrorZ_clone(uint64_t orig) {
13089 LDKCResult_boolLightningErrorZ* orig_conv = (LDKCResult_boolLightningErrorZ*)untag_ptr(orig);
13090 LDKCResult_boolLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolLightningErrorZ), "LDKCResult_boolLightningErrorZ");
13091 *ret_conv = CResult_boolLightningErrorZ_clone(orig_conv);
13092 return tag_ptr(ret_conv, true);
13095 static inline uint64_t C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ *NONNULL_PTR arg) {
13096 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
13097 *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(arg);
13098 return tag_ptr(ret_conv, true);
13100 int64_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(uint64_t arg) {
13101 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* arg_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(arg);
13102 int64_t ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone_ptr(arg_conv);
13106 uint64_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(uint64_t orig) {
13107 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* orig_conv = (LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)untag_ptr(orig);
13108 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
13109 *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_clone(orig_conv);
13110 return tag_ptr(ret_conv, true);
13113 uint64_t __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(uint64_t a, uint64_t b, uint64_t c) {
13114 LDKChannelAnnouncement a_conv;
13115 a_conv.inner = untag_ptr(a);
13116 a_conv.is_owned = ptr_is_owned(a);
13117 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
13118 a_conv = ChannelAnnouncement_clone(&a_conv);
13119 LDKChannelUpdate b_conv;
13120 b_conv.inner = untag_ptr(b);
13121 b_conv.is_owned = ptr_is_owned(b);
13122 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
13123 b_conv = ChannelUpdate_clone(&b_conv);
13124 LDKChannelUpdate c_conv;
13125 c_conv.inner = untag_ptr(c);
13126 c_conv.is_owned = ptr_is_owned(c);
13127 CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv);
13128 c_conv = ChannelUpdate_clone(&c_conv);
13129 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ");
13130 *ret_conv = C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_new(a_conv, b_conv, c_conv);
13131 return tag_ptr(ret_conv, true);
13134 void __attribute__((export_name("TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free"))) TS_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(uint64_t _res) {
13135 if (!ptr_is_owned(_res)) return;
13136 void* _res_ptr = untag_ptr(_res);
13137 CHECK_ACCESS(_res_ptr);
13138 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(_res_ptr);
13139 FREE(untag_ptr(_res));
13140 C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ_free(_res_conv);
13143 void __attribute__((export_name("TS_CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free"))) TS_CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(uint64_tArray _res) {
13144 LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ _res_constr;
13145 _res_constr.datalen = _res->arr_len;
13146 if (_res_constr.datalen > 0)
13147 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ), "LDKCVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ Elements");
13149 _res_constr.data = NULL;
13150 uint64_t* _res_vals = _res->elems;
13151 for (size_t h = 0; h < _res_constr.datalen; h++) {
13152 uint64_t _res_conv_59 = _res_vals[h];
13153 void* _res_conv_59_ptr = untag_ptr(_res_conv_59);
13154 CHECK_ACCESS(_res_conv_59_ptr);
13155 LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ _res_conv_59_conv = *(LDKC3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZ*)(_res_conv_59_ptr);
13156 FREE(untag_ptr(_res_conv_59));
13157 _res_constr.data[h] = _res_conv_59_conv;
13160 CVec_C3Tuple_ChannelAnnouncementChannelUpdateChannelUpdateZZ_free(_res_constr);
13163 void __attribute__((export_name("TS_CVec_NodeAnnouncementZ_free"))) TS_CVec_NodeAnnouncementZ_free(uint64_tArray _res) {
13164 LDKCVec_NodeAnnouncementZ _res_constr;
13165 _res_constr.datalen = _res->arr_len;
13166 if (_res_constr.datalen > 0)
13167 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKNodeAnnouncement), "LDKCVec_NodeAnnouncementZ Elements");
13169 _res_constr.data = NULL;
13170 uint64_t* _res_vals = _res->elems;
13171 for (size_t s = 0; s < _res_constr.datalen; s++) {
13172 uint64_t _res_conv_18 = _res_vals[s];
13173 LDKNodeAnnouncement _res_conv_18_conv;
13174 _res_conv_18_conv.inner = untag_ptr(_res_conv_18);
13175 _res_conv_18_conv.is_owned = ptr_is_owned(_res_conv_18);
13176 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_18_conv);
13177 _res_constr.data[s] = _res_conv_18_conv;
13180 CVec_NodeAnnouncementZ_free(_res_constr);
13183 uint64_t __attribute__((export_name("TS_CResult_NoneLightningErrorZ_ok"))) TS_CResult_NoneLightningErrorZ_ok() {
13184 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
13185 *ret_conv = CResult_NoneLightningErrorZ_ok();
13186 return tag_ptr(ret_conv, true);
13189 uint64_t __attribute__((export_name("TS_CResult_NoneLightningErrorZ_err"))) TS_CResult_NoneLightningErrorZ_err(uint64_t e) {
13190 LDKLightningError e_conv;
13191 e_conv.inner = untag_ptr(e);
13192 e_conv.is_owned = ptr_is_owned(e);
13193 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13194 e_conv = LightningError_clone(&e_conv);
13195 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
13196 *ret_conv = CResult_NoneLightningErrorZ_err(e_conv);
13197 return tag_ptr(ret_conv, true);
13200 jboolean __attribute__((export_name("TS_CResult_NoneLightningErrorZ_is_ok"))) TS_CResult_NoneLightningErrorZ_is_ok(uint64_t o) {
13201 LDKCResult_NoneLightningErrorZ* o_conv = (LDKCResult_NoneLightningErrorZ*)untag_ptr(o);
13202 jboolean ret_conv = CResult_NoneLightningErrorZ_is_ok(o_conv);
13206 void __attribute__((export_name("TS_CResult_NoneLightningErrorZ_free"))) TS_CResult_NoneLightningErrorZ_free(uint64_t _res) {
13207 if (!ptr_is_owned(_res)) return;
13208 void* _res_ptr = untag_ptr(_res);
13209 CHECK_ACCESS(_res_ptr);
13210 LDKCResult_NoneLightningErrorZ _res_conv = *(LDKCResult_NoneLightningErrorZ*)(_res_ptr);
13211 FREE(untag_ptr(_res));
13212 CResult_NoneLightningErrorZ_free(_res_conv);
13215 static inline uint64_t CResult_NoneLightningErrorZ_clone_ptr(LDKCResult_NoneLightningErrorZ *NONNULL_PTR arg) {
13216 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
13217 *ret_conv = CResult_NoneLightningErrorZ_clone(arg);
13218 return tag_ptr(ret_conv, true);
13220 int64_t __attribute__((export_name("TS_CResult_NoneLightningErrorZ_clone_ptr"))) TS_CResult_NoneLightningErrorZ_clone_ptr(uint64_t arg) {
13221 LDKCResult_NoneLightningErrorZ* arg_conv = (LDKCResult_NoneLightningErrorZ*)untag_ptr(arg);
13222 int64_t ret_conv = CResult_NoneLightningErrorZ_clone_ptr(arg_conv);
13226 uint64_t __attribute__((export_name("TS_CResult_NoneLightningErrorZ_clone"))) TS_CResult_NoneLightningErrorZ_clone(uint64_t orig) {
13227 LDKCResult_NoneLightningErrorZ* orig_conv = (LDKCResult_NoneLightningErrorZ*)untag_ptr(orig);
13228 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
13229 *ret_conv = CResult_NoneLightningErrorZ_clone(orig_conv);
13230 return tag_ptr(ret_conv, true);
13233 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateInfoDecodeErrorZ_ok"))) TS_CResult_ChannelUpdateInfoDecodeErrorZ_ok(uint64_t o) {
13234 LDKChannelUpdateInfo o_conv;
13235 o_conv.inner = untag_ptr(o);
13236 o_conv.is_owned = ptr_is_owned(o);
13237 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
13238 o_conv = ChannelUpdateInfo_clone(&o_conv);
13239 LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
13240 *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_ok(o_conv);
13241 return tag_ptr(ret_conv, true);
13244 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateInfoDecodeErrorZ_err"))) TS_CResult_ChannelUpdateInfoDecodeErrorZ_err(uint64_t e) {
13245 LDKDecodeError e_conv;
13246 e_conv.inner = untag_ptr(e);
13247 e_conv.is_owned = ptr_is_owned(e);
13248 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13249 e_conv = DecodeError_clone(&e_conv);
13250 LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
13251 *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_err(e_conv);
13252 return tag_ptr(ret_conv, true);
13255 jboolean __attribute__((export_name("TS_CResult_ChannelUpdateInfoDecodeErrorZ_is_ok"))) TS_CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(uint64_t o) {
13256 LDKCResult_ChannelUpdateInfoDecodeErrorZ* o_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(o);
13257 jboolean ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_is_ok(o_conv);
13261 void __attribute__((export_name("TS_CResult_ChannelUpdateInfoDecodeErrorZ_free"))) TS_CResult_ChannelUpdateInfoDecodeErrorZ_free(uint64_t _res) {
13262 if (!ptr_is_owned(_res)) return;
13263 void* _res_ptr = untag_ptr(_res);
13264 CHECK_ACCESS(_res_ptr);
13265 LDKCResult_ChannelUpdateInfoDecodeErrorZ _res_conv = *(LDKCResult_ChannelUpdateInfoDecodeErrorZ*)(_res_ptr);
13266 FREE(untag_ptr(_res));
13267 CResult_ChannelUpdateInfoDecodeErrorZ_free(_res_conv);
13270 static inline uint64_t CResult_ChannelUpdateInfoDecodeErrorZ_clone_ptr(LDKCResult_ChannelUpdateInfoDecodeErrorZ *NONNULL_PTR arg) {
13271 LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
13272 *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_clone(arg);
13273 return tag_ptr(ret_conv, true);
13275 int64_t __attribute__((export_name("TS_CResult_ChannelUpdateInfoDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelUpdateInfoDecodeErrorZ_clone_ptr(uint64_t arg) {
13276 LDKCResult_ChannelUpdateInfoDecodeErrorZ* arg_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(arg);
13277 int64_t ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_clone_ptr(arg_conv);
13281 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateInfoDecodeErrorZ_clone"))) TS_CResult_ChannelUpdateInfoDecodeErrorZ_clone(uint64_t orig) {
13282 LDKCResult_ChannelUpdateInfoDecodeErrorZ* orig_conv = (LDKCResult_ChannelUpdateInfoDecodeErrorZ*)untag_ptr(orig);
13283 LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
13284 *ret_conv = CResult_ChannelUpdateInfoDecodeErrorZ_clone(orig_conv);
13285 return tag_ptr(ret_conv, true);
13288 uint64_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_ok"))) TS_CResult_ChannelInfoDecodeErrorZ_ok(uint64_t o) {
13289 LDKChannelInfo o_conv;
13290 o_conv.inner = untag_ptr(o);
13291 o_conv.is_owned = ptr_is_owned(o);
13292 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
13293 o_conv = ChannelInfo_clone(&o_conv);
13294 LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
13295 *ret_conv = CResult_ChannelInfoDecodeErrorZ_ok(o_conv);
13296 return tag_ptr(ret_conv, true);
13299 uint64_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_err"))) TS_CResult_ChannelInfoDecodeErrorZ_err(uint64_t e) {
13300 LDKDecodeError e_conv;
13301 e_conv.inner = untag_ptr(e);
13302 e_conv.is_owned = ptr_is_owned(e);
13303 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13304 e_conv = DecodeError_clone(&e_conv);
13305 LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
13306 *ret_conv = CResult_ChannelInfoDecodeErrorZ_err(e_conv);
13307 return tag_ptr(ret_conv, true);
13310 jboolean __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_is_ok"))) TS_CResult_ChannelInfoDecodeErrorZ_is_ok(uint64_t o) {
13311 LDKCResult_ChannelInfoDecodeErrorZ* o_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(o);
13312 jboolean ret_conv = CResult_ChannelInfoDecodeErrorZ_is_ok(o_conv);
13316 void __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_free"))) TS_CResult_ChannelInfoDecodeErrorZ_free(uint64_t _res) {
13317 if (!ptr_is_owned(_res)) return;
13318 void* _res_ptr = untag_ptr(_res);
13319 CHECK_ACCESS(_res_ptr);
13320 LDKCResult_ChannelInfoDecodeErrorZ _res_conv = *(LDKCResult_ChannelInfoDecodeErrorZ*)(_res_ptr);
13321 FREE(untag_ptr(_res));
13322 CResult_ChannelInfoDecodeErrorZ_free(_res_conv);
13325 static inline uint64_t CResult_ChannelInfoDecodeErrorZ_clone_ptr(LDKCResult_ChannelInfoDecodeErrorZ *NONNULL_PTR arg) {
13326 LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
13327 *ret_conv = CResult_ChannelInfoDecodeErrorZ_clone(arg);
13328 return tag_ptr(ret_conv, true);
13330 int64_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelInfoDecodeErrorZ_clone_ptr(uint64_t arg) {
13331 LDKCResult_ChannelInfoDecodeErrorZ* arg_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(arg);
13332 int64_t ret_conv = CResult_ChannelInfoDecodeErrorZ_clone_ptr(arg_conv);
13336 uint64_t __attribute__((export_name("TS_CResult_ChannelInfoDecodeErrorZ_clone"))) TS_CResult_ChannelInfoDecodeErrorZ_clone(uint64_t orig) {
13337 LDKCResult_ChannelInfoDecodeErrorZ* orig_conv = (LDKCResult_ChannelInfoDecodeErrorZ*)untag_ptr(orig);
13338 LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
13339 *ret_conv = CResult_ChannelInfoDecodeErrorZ_clone(orig_conv);
13340 return tag_ptr(ret_conv, true);
13343 uint64_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_ok"))) TS_CResult_RoutingFeesDecodeErrorZ_ok(uint64_t o) {
13344 LDKRoutingFees o_conv;
13345 o_conv.inner = untag_ptr(o);
13346 o_conv.is_owned = ptr_is_owned(o);
13347 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
13348 o_conv = RoutingFees_clone(&o_conv);
13349 LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
13350 *ret_conv = CResult_RoutingFeesDecodeErrorZ_ok(o_conv);
13351 return tag_ptr(ret_conv, true);
13354 uint64_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_err"))) TS_CResult_RoutingFeesDecodeErrorZ_err(uint64_t e) {
13355 LDKDecodeError e_conv;
13356 e_conv.inner = untag_ptr(e);
13357 e_conv.is_owned = ptr_is_owned(e);
13358 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13359 e_conv = DecodeError_clone(&e_conv);
13360 LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
13361 *ret_conv = CResult_RoutingFeesDecodeErrorZ_err(e_conv);
13362 return tag_ptr(ret_conv, true);
13365 jboolean __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_is_ok"))) TS_CResult_RoutingFeesDecodeErrorZ_is_ok(uint64_t o) {
13366 LDKCResult_RoutingFeesDecodeErrorZ* o_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(o);
13367 jboolean ret_conv = CResult_RoutingFeesDecodeErrorZ_is_ok(o_conv);
13371 void __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_free"))) TS_CResult_RoutingFeesDecodeErrorZ_free(uint64_t _res) {
13372 if (!ptr_is_owned(_res)) return;
13373 void* _res_ptr = untag_ptr(_res);
13374 CHECK_ACCESS(_res_ptr);
13375 LDKCResult_RoutingFeesDecodeErrorZ _res_conv = *(LDKCResult_RoutingFeesDecodeErrorZ*)(_res_ptr);
13376 FREE(untag_ptr(_res));
13377 CResult_RoutingFeesDecodeErrorZ_free(_res_conv);
13380 static inline uint64_t CResult_RoutingFeesDecodeErrorZ_clone_ptr(LDKCResult_RoutingFeesDecodeErrorZ *NONNULL_PTR arg) {
13381 LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
13382 *ret_conv = CResult_RoutingFeesDecodeErrorZ_clone(arg);
13383 return tag_ptr(ret_conv, true);
13385 int64_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_clone_ptr"))) TS_CResult_RoutingFeesDecodeErrorZ_clone_ptr(uint64_t arg) {
13386 LDKCResult_RoutingFeesDecodeErrorZ* arg_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(arg);
13387 int64_t ret_conv = CResult_RoutingFeesDecodeErrorZ_clone_ptr(arg_conv);
13391 uint64_t __attribute__((export_name("TS_CResult_RoutingFeesDecodeErrorZ_clone"))) TS_CResult_RoutingFeesDecodeErrorZ_clone(uint64_t orig) {
13392 LDKCResult_RoutingFeesDecodeErrorZ* orig_conv = (LDKCResult_RoutingFeesDecodeErrorZ*)untag_ptr(orig);
13393 LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
13394 *ret_conv = CResult_RoutingFeesDecodeErrorZ_clone(orig_conv);
13395 return tag_ptr(ret_conv, true);
13398 void __attribute__((export_name("TS_CVec_NetAddressZ_free"))) TS_CVec_NetAddressZ_free(uint64_tArray _res) {
13399 LDKCVec_NetAddressZ _res_constr;
13400 _res_constr.datalen = _res->arr_len;
13401 if (_res_constr.datalen > 0)
13402 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
13404 _res_constr.data = NULL;
13405 uint64_t* _res_vals = _res->elems;
13406 for (size_t m = 0; m < _res_constr.datalen; m++) {
13407 uint64_t _res_conv_12 = _res_vals[m];
13408 void* _res_conv_12_ptr = untag_ptr(_res_conv_12);
13409 CHECK_ACCESS(_res_conv_12_ptr);
13410 LDKNetAddress _res_conv_12_conv = *(LDKNetAddress*)(_res_conv_12_ptr);
13411 FREE(untag_ptr(_res_conv_12));
13412 _res_constr.data[m] = _res_conv_12_conv;
13415 CVec_NetAddressZ_free(_res_constr);
13418 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_ok"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_ok(uint64_t o) {
13419 LDKNodeAnnouncementInfo o_conv;
13420 o_conv.inner = untag_ptr(o);
13421 o_conv.is_owned = ptr_is_owned(o);
13422 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
13423 o_conv = NodeAnnouncementInfo_clone(&o_conv);
13424 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
13425 *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_ok(o_conv);
13426 return tag_ptr(ret_conv, true);
13429 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_err"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_err(uint64_t e) {
13430 LDKDecodeError e_conv;
13431 e_conv.inner = untag_ptr(e);
13432 e_conv.is_owned = ptr_is_owned(e);
13433 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13434 e_conv = DecodeError_clone(&e_conv);
13435 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
13436 *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_err(e_conv);
13437 return tag_ptr(ret_conv, true);
13440 jboolean __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(uint64_t o) {
13441 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* o_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(o);
13442 jboolean ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_is_ok(o_conv);
13446 void __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_free"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_free(uint64_t _res) {
13447 if (!ptr_is_owned(_res)) return;
13448 void* _res_ptr = untag_ptr(_res);
13449 CHECK_ACCESS(_res_ptr);
13450 LDKCResult_NodeAnnouncementInfoDecodeErrorZ _res_conv = *(LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)(_res_ptr);
13451 FREE(untag_ptr(_res));
13452 CResult_NodeAnnouncementInfoDecodeErrorZ_free(_res_conv);
13455 static inline uint64_t CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementInfoDecodeErrorZ *NONNULL_PTR arg) {
13456 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
13457 *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone(arg);
13458 return tag_ptr(ret_conv, true);
13460 int64_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(uint64_t arg) {
13461 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* arg_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(arg);
13462 int64_t ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone_ptr(arg_conv);
13466 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementInfoDecodeErrorZ_clone"))) TS_CResult_NodeAnnouncementInfoDecodeErrorZ_clone(uint64_t orig) {
13467 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* orig_conv = (LDKCResult_NodeAnnouncementInfoDecodeErrorZ*)untag_ptr(orig);
13468 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
13469 *ret_conv = CResult_NodeAnnouncementInfoDecodeErrorZ_clone(orig_conv);
13470 return tag_ptr(ret_conv, true);
13473 uint64_t __attribute__((export_name("TS_CResult_NodeAliasDecodeErrorZ_ok"))) TS_CResult_NodeAliasDecodeErrorZ_ok(uint64_t o) {
13474 LDKNodeAlias o_conv;
13475 o_conv.inner = untag_ptr(o);
13476 o_conv.is_owned = ptr_is_owned(o);
13477 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
13478 o_conv = NodeAlias_clone(&o_conv);
13479 LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ");
13480 *ret_conv = CResult_NodeAliasDecodeErrorZ_ok(o_conv);
13481 return tag_ptr(ret_conv, true);
13484 uint64_t __attribute__((export_name("TS_CResult_NodeAliasDecodeErrorZ_err"))) TS_CResult_NodeAliasDecodeErrorZ_err(uint64_t e) {
13485 LDKDecodeError e_conv;
13486 e_conv.inner = untag_ptr(e);
13487 e_conv.is_owned = ptr_is_owned(e);
13488 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13489 e_conv = DecodeError_clone(&e_conv);
13490 LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ");
13491 *ret_conv = CResult_NodeAliasDecodeErrorZ_err(e_conv);
13492 return tag_ptr(ret_conv, true);
13495 jboolean __attribute__((export_name("TS_CResult_NodeAliasDecodeErrorZ_is_ok"))) TS_CResult_NodeAliasDecodeErrorZ_is_ok(uint64_t o) {
13496 LDKCResult_NodeAliasDecodeErrorZ* o_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(o);
13497 jboolean ret_conv = CResult_NodeAliasDecodeErrorZ_is_ok(o_conv);
13501 void __attribute__((export_name("TS_CResult_NodeAliasDecodeErrorZ_free"))) TS_CResult_NodeAliasDecodeErrorZ_free(uint64_t _res) {
13502 if (!ptr_is_owned(_res)) return;
13503 void* _res_ptr = untag_ptr(_res);
13504 CHECK_ACCESS(_res_ptr);
13505 LDKCResult_NodeAliasDecodeErrorZ _res_conv = *(LDKCResult_NodeAliasDecodeErrorZ*)(_res_ptr);
13506 FREE(untag_ptr(_res));
13507 CResult_NodeAliasDecodeErrorZ_free(_res_conv);
13510 static inline uint64_t CResult_NodeAliasDecodeErrorZ_clone_ptr(LDKCResult_NodeAliasDecodeErrorZ *NONNULL_PTR arg) {
13511 LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ");
13512 *ret_conv = CResult_NodeAliasDecodeErrorZ_clone(arg);
13513 return tag_ptr(ret_conv, true);
13515 int64_t __attribute__((export_name("TS_CResult_NodeAliasDecodeErrorZ_clone_ptr"))) TS_CResult_NodeAliasDecodeErrorZ_clone_ptr(uint64_t arg) {
13516 LDKCResult_NodeAliasDecodeErrorZ* arg_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(arg);
13517 int64_t ret_conv = CResult_NodeAliasDecodeErrorZ_clone_ptr(arg_conv);
13521 uint64_t __attribute__((export_name("TS_CResult_NodeAliasDecodeErrorZ_clone"))) TS_CResult_NodeAliasDecodeErrorZ_clone(uint64_t orig) {
13522 LDKCResult_NodeAliasDecodeErrorZ* orig_conv = (LDKCResult_NodeAliasDecodeErrorZ*)untag_ptr(orig);
13523 LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ");
13524 *ret_conv = CResult_NodeAliasDecodeErrorZ_clone(orig_conv);
13525 return tag_ptr(ret_conv, true);
13528 uint64_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_ok"))) TS_CResult_NodeInfoDecodeErrorZ_ok(uint64_t o) {
13529 LDKNodeInfo o_conv;
13530 o_conv.inner = untag_ptr(o);
13531 o_conv.is_owned = ptr_is_owned(o);
13532 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
13533 o_conv = NodeInfo_clone(&o_conv);
13534 LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
13535 *ret_conv = CResult_NodeInfoDecodeErrorZ_ok(o_conv);
13536 return tag_ptr(ret_conv, true);
13539 uint64_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_err"))) TS_CResult_NodeInfoDecodeErrorZ_err(uint64_t e) {
13540 LDKDecodeError e_conv;
13541 e_conv.inner = untag_ptr(e);
13542 e_conv.is_owned = ptr_is_owned(e);
13543 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13544 e_conv = DecodeError_clone(&e_conv);
13545 LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
13546 *ret_conv = CResult_NodeInfoDecodeErrorZ_err(e_conv);
13547 return tag_ptr(ret_conv, true);
13550 jboolean __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_is_ok"))) TS_CResult_NodeInfoDecodeErrorZ_is_ok(uint64_t o) {
13551 LDKCResult_NodeInfoDecodeErrorZ* o_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(o);
13552 jboolean ret_conv = CResult_NodeInfoDecodeErrorZ_is_ok(o_conv);
13556 void __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_free"))) TS_CResult_NodeInfoDecodeErrorZ_free(uint64_t _res) {
13557 if (!ptr_is_owned(_res)) return;
13558 void* _res_ptr = untag_ptr(_res);
13559 CHECK_ACCESS(_res_ptr);
13560 LDKCResult_NodeInfoDecodeErrorZ _res_conv = *(LDKCResult_NodeInfoDecodeErrorZ*)(_res_ptr);
13561 FREE(untag_ptr(_res));
13562 CResult_NodeInfoDecodeErrorZ_free(_res_conv);
13565 static inline uint64_t CResult_NodeInfoDecodeErrorZ_clone_ptr(LDKCResult_NodeInfoDecodeErrorZ *NONNULL_PTR arg) {
13566 LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
13567 *ret_conv = CResult_NodeInfoDecodeErrorZ_clone(arg);
13568 return tag_ptr(ret_conv, true);
13570 int64_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_clone_ptr"))) TS_CResult_NodeInfoDecodeErrorZ_clone_ptr(uint64_t arg) {
13571 LDKCResult_NodeInfoDecodeErrorZ* arg_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(arg);
13572 int64_t ret_conv = CResult_NodeInfoDecodeErrorZ_clone_ptr(arg_conv);
13576 uint64_t __attribute__((export_name("TS_CResult_NodeInfoDecodeErrorZ_clone"))) TS_CResult_NodeInfoDecodeErrorZ_clone(uint64_t orig) {
13577 LDKCResult_NodeInfoDecodeErrorZ* orig_conv = (LDKCResult_NodeInfoDecodeErrorZ*)untag_ptr(orig);
13578 LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
13579 *ret_conv = CResult_NodeInfoDecodeErrorZ_clone(orig_conv);
13580 return tag_ptr(ret_conv, true);
13583 uint64_t __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_ok"))) TS_CResult_NetworkGraphDecodeErrorZ_ok(uint64_t o) {
13584 LDKNetworkGraph o_conv;
13585 o_conv.inner = untag_ptr(o);
13586 o_conv.is_owned = ptr_is_owned(o);
13587 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
13588 // WARNING: we need a move here but no clone is available for LDKNetworkGraph
13590 LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ");
13591 *ret_conv = CResult_NetworkGraphDecodeErrorZ_ok(o_conv);
13592 return tag_ptr(ret_conv, true);
13595 uint64_t __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_err"))) TS_CResult_NetworkGraphDecodeErrorZ_err(uint64_t e) {
13596 LDKDecodeError e_conv;
13597 e_conv.inner = untag_ptr(e);
13598 e_conv.is_owned = ptr_is_owned(e);
13599 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13600 e_conv = DecodeError_clone(&e_conv);
13601 LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ");
13602 *ret_conv = CResult_NetworkGraphDecodeErrorZ_err(e_conv);
13603 return tag_ptr(ret_conv, true);
13606 jboolean __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_is_ok"))) TS_CResult_NetworkGraphDecodeErrorZ_is_ok(uint64_t o) {
13607 LDKCResult_NetworkGraphDecodeErrorZ* o_conv = (LDKCResult_NetworkGraphDecodeErrorZ*)untag_ptr(o);
13608 jboolean ret_conv = CResult_NetworkGraphDecodeErrorZ_is_ok(o_conv);
13612 void __attribute__((export_name("TS_CResult_NetworkGraphDecodeErrorZ_free"))) TS_CResult_NetworkGraphDecodeErrorZ_free(uint64_t _res) {
13613 if (!ptr_is_owned(_res)) return;
13614 void* _res_ptr = untag_ptr(_res);
13615 CHECK_ACCESS(_res_ptr);
13616 LDKCResult_NetworkGraphDecodeErrorZ _res_conv = *(LDKCResult_NetworkGraphDecodeErrorZ*)(_res_ptr);
13617 FREE(untag_ptr(_res));
13618 CResult_NetworkGraphDecodeErrorZ_free(_res_conv);
13621 uint64_t __attribute__((export_name("TS_COption_CVec_NetAddressZZ_some"))) TS_COption_CVec_NetAddressZZ_some(uint64_tArray o) {
13622 LDKCVec_NetAddressZ o_constr;
13623 o_constr.datalen = o->arr_len;
13624 if (o_constr.datalen > 0)
13625 o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
13627 o_constr.data = NULL;
13628 uint64_t* o_vals = o->elems;
13629 for (size_t m = 0; m < o_constr.datalen; m++) {
13630 uint64_t o_conv_12 = o_vals[m];
13631 void* o_conv_12_ptr = untag_ptr(o_conv_12);
13632 CHECK_ACCESS(o_conv_12_ptr);
13633 LDKNetAddress o_conv_12_conv = *(LDKNetAddress*)(o_conv_12_ptr);
13634 o_conv_12_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(o_conv_12));
13635 o_constr.data[m] = o_conv_12_conv;
13638 LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
13639 *ret_copy = COption_CVec_NetAddressZZ_some(o_constr);
13640 uint64_t ret_ref = tag_ptr(ret_copy, true);
13644 uint64_t __attribute__((export_name("TS_COption_CVec_NetAddressZZ_none"))) TS_COption_CVec_NetAddressZZ_none() {
13645 LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
13646 *ret_copy = COption_CVec_NetAddressZZ_none();
13647 uint64_t ret_ref = tag_ptr(ret_copy, true);
13651 void __attribute__((export_name("TS_COption_CVec_NetAddressZZ_free"))) TS_COption_CVec_NetAddressZZ_free(uint64_t _res) {
13652 if (!ptr_is_owned(_res)) return;
13653 void* _res_ptr = untag_ptr(_res);
13654 CHECK_ACCESS(_res_ptr);
13655 LDKCOption_CVec_NetAddressZZ _res_conv = *(LDKCOption_CVec_NetAddressZZ*)(_res_ptr);
13656 FREE(untag_ptr(_res));
13657 COption_CVec_NetAddressZZ_free(_res_conv);
13660 static inline uint64_t COption_CVec_NetAddressZZ_clone_ptr(LDKCOption_CVec_NetAddressZZ *NONNULL_PTR arg) {
13661 LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
13662 *ret_copy = COption_CVec_NetAddressZZ_clone(arg);
13663 uint64_t ret_ref = tag_ptr(ret_copy, true);
13666 int64_t __attribute__((export_name("TS_COption_CVec_NetAddressZZ_clone_ptr"))) TS_COption_CVec_NetAddressZZ_clone_ptr(uint64_t arg) {
13667 LDKCOption_CVec_NetAddressZZ* arg_conv = (LDKCOption_CVec_NetAddressZZ*)untag_ptr(arg);
13668 int64_t ret_conv = COption_CVec_NetAddressZZ_clone_ptr(arg_conv);
13672 uint64_t __attribute__((export_name("TS_COption_CVec_NetAddressZZ_clone"))) TS_COption_CVec_NetAddressZZ_clone(uint64_t orig) {
13673 LDKCOption_CVec_NetAddressZZ* orig_conv = (LDKCOption_CVec_NetAddressZZ*)untag_ptr(orig);
13674 LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
13675 *ret_copy = COption_CVec_NetAddressZZ_clone(orig_conv);
13676 uint64_t ret_ref = tag_ptr(ret_copy, true);
13680 uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(uint64_t o) {
13681 LDKDelayedPaymentOutputDescriptor o_conv;
13682 o_conv.inner = untag_ptr(o);
13683 o_conv.is_owned = ptr_is_owned(o);
13684 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
13685 o_conv = DelayedPaymentOutputDescriptor_clone(&o_conv);
13686 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
13687 *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_ok(o_conv);
13688 return tag_ptr(ret_conv, true);
13691 uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(uint64_t e) {
13692 LDKDecodeError e_conv;
13693 e_conv.inner = untag_ptr(e);
13694 e_conv.is_owned = ptr_is_owned(e);
13695 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13696 e_conv = DecodeError_clone(&e_conv);
13697 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
13698 *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_err(e_conv);
13699 return tag_ptr(ret_conv, true);
13702 jboolean __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(uint64_t o) {
13703 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(o);
13704 jboolean ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_is_ok(o_conv);
13708 void __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(uint64_t _res) {
13709 if (!ptr_is_owned(_res)) return;
13710 void* _res_ptr = untag_ptr(_res);
13711 CHECK_ACCESS(_res_ptr);
13712 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)(_res_ptr);
13713 FREE(untag_ptr(_res));
13714 CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_free(_res_conv);
13717 static inline uint64_t CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) {
13718 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
13719 *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(arg);
13720 return tag_ptr(ret_conv, true);
13722 int64_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(uint64_t arg) {
13723 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(arg);
13724 int64_t ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv);
13728 uint64_t __attribute__((export_name("TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone"))) TS_CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(uint64_t orig) {
13729 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(orig);
13730 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
13731 *ret_conv = CResult_DelayedPaymentOutputDescriptorDecodeErrorZ_clone(orig_conv);
13732 return tag_ptr(ret_conv, true);
13735 uint64_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(uint64_t o) {
13736 LDKStaticPaymentOutputDescriptor o_conv;
13737 o_conv.inner = untag_ptr(o);
13738 o_conv.is_owned = ptr_is_owned(o);
13739 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
13740 o_conv = StaticPaymentOutputDescriptor_clone(&o_conv);
13741 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
13742 *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_ok(o_conv);
13743 return tag_ptr(ret_conv, true);
13746 uint64_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(uint64_t e) {
13747 LDKDecodeError e_conv;
13748 e_conv.inner = untag_ptr(e);
13749 e_conv.is_owned = ptr_is_owned(e);
13750 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13751 e_conv = DecodeError_clone(&e_conv);
13752 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
13753 *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_err(e_conv);
13754 return tag_ptr(ret_conv, true);
13757 jboolean __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(uint64_t o) {
13758 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(o);
13759 jboolean ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_is_ok(o_conv);
13763 void __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(uint64_t _res) {
13764 if (!ptr_is_owned(_res)) return;
13765 void* _res_ptr = untag_ptr(_res);
13766 CHECK_ACCESS(_res_ptr);
13767 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)(_res_ptr);
13768 FREE(untag_ptr(_res));
13769 CResult_StaticPaymentOutputDescriptorDecodeErrorZ_free(_res_conv);
13772 static inline uint64_t CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) {
13773 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
13774 *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(arg);
13775 return tag_ptr(ret_conv, true);
13777 int64_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(uint64_t arg) {
13778 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(arg);
13779 int64_t ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv);
13783 uint64_t __attribute__((export_name("TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone"))) TS_CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(uint64_t orig) {
13784 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ*)untag_ptr(orig);
13785 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
13786 *ret_conv = CResult_StaticPaymentOutputDescriptorDecodeErrorZ_clone(orig_conv);
13787 return tag_ptr(ret_conv, true);
13790 uint64_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_ok"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_ok(uint64_t o) {
13791 void* o_ptr = untag_ptr(o);
13792 CHECK_ACCESS(o_ptr);
13793 LDKSpendableOutputDescriptor o_conv = *(LDKSpendableOutputDescriptor*)(o_ptr);
13794 o_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(o));
13795 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
13796 *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_ok(o_conv);
13797 return tag_ptr(ret_conv, true);
13800 uint64_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_err"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_err(uint64_t e) {
13801 LDKDecodeError e_conv;
13802 e_conv.inner = untag_ptr(e);
13803 e_conv.is_owned = ptr_is_owned(e);
13804 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
13805 e_conv = DecodeError_clone(&e_conv);
13806 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
13807 *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_err(e_conv);
13808 return tag_ptr(ret_conv, true);
13811 jboolean __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(uint64_t o) {
13812 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* o_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(o);
13813 jboolean ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_is_ok(o_conv);
13817 void __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_free"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_free(uint64_t _res) {
13818 if (!ptr_is_owned(_res)) return;
13819 void* _res_ptr = untag_ptr(_res);
13820 CHECK_ACCESS(_res_ptr);
13821 LDKCResult_SpendableOutputDescriptorDecodeErrorZ _res_conv = *(LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)(_res_ptr);
13822 FREE(untag_ptr(_res));
13823 CResult_SpendableOutputDescriptorDecodeErrorZ_free(_res_conv);
13826 static inline uint64_t CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(LDKCResult_SpendableOutputDescriptorDecodeErrorZ *NONNULL_PTR arg) {
13827 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
13828 *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone(arg);
13829 return tag_ptr(ret_conv, true);
13831 int64_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(uint64_t arg) {
13832 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* arg_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(arg);
13833 int64_t ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone_ptr(arg_conv);
13837 uint64_t __attribute__((export_name("TS_CResult_SpendableOutputDescriptorDecodeErrorZ_clone"))) TS_CResult_SpendableOutputDescriptorDecodeErrorZ_clone(uint64_t orig) {
13838 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* orig_conv = (LDKCResult_SpendableOutputDescriptorDecodeErrorZ*)untag_ptr(orig);
13839 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
13840 *ret_conv = CResult_SpendableOutputDescriptorDecodeErrorZ_clone(orig_conv);
13841 return tag_ptr(ret_conv, true);
13844 void __attribute__((export_name("TS_CVec_PaymentPreimageZ_free"))) TS_CVec_PaymentPreimageZ_free(ptrArray _res) {
13845 LDKCVec_PaymentPreimageZ _res_constr;
13846 _res_constr.datalen = _res->arr_len;
13847 if (_res_constr.datalen > 0)
13848 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_PaymentPreimageZ Elements");
13850 _res_constr.data = NULL;
13851 int8_tArray* _res_vals = (void*) _res->elems;
13852 for (size_t m = 0; m < _res_constr.datalen; m++) {
13853 int8_tArray _res_conv_12 = _res_vals[m];
13854 LDKThirtyTwoBytes _res_conv_12_ref;
13855 CHECK(_res_conv_12->arr_len == 32);
13856 memcpy(_res_conv_12_ref.data, _res_conv_12->elems, 32); FREE(_res_conv_12);
13857 _res_constr.data[m] = _res_conv_12_ref;
13860 CVec_PaymentPreimageZ_free(_res_constr);
13863 static inline uint64_t C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(LDKC2Tuple_SignatureCVec_SignatureZZ *NONNULL_PTR arg) {
13864 LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
13865 *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone(arg);
13866 return tag_ptr(ret_conv, true);
13868 int64_t __attribute__((export_name("TS_C2Tuple_SignatureCVec_SignatureZZ_clone_ptr"))) TS_C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(uint64_t arg) {
13869 LDKC2Tuple_SignatureCVec_SignatureZZ* arg_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)untag_ptr(arg);
13870 int64_t ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone_ptr(arg_conv);
13874 uint64_t __attribute__((export_name("TS_C2Tuple_SignatureCVec_SignatureZZ_clone"))) TS_C2Tuple_SignatureCVec_SignatureZZ_clone(uint64_t orig) {
13875 LDKC2Tuple_SignatureCVec_SignatureZZ* orig_conv = (LDKC2Tuple_SignatureCVec_SignatureZZ*)untag_ptr(orig);
13876 LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
13877 *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_clone(orig_conv);
13878 return tag_ptr(ret_conv, true);
13881 uint64_t __attribute__((export_name("TS_C2Tuple_SignatureCVec_SignatureZZ_new"))) TS_C2Tuple_SignatureCVec_SignatureZZ_new(int8_tArray a, ptrArray b) {
13882 LDKSignature a_ref;
13883 CHECK(a->arr_len == 64);
13884 memcpy(a_ref.compact_form, a->elems, 64); FREE(a);
13885 LDKCVec_SignatureZ b_constr;
13886 b_constr.datalen = b->arr_len;
13887 if (b_constr.datalen > 0)
13888 b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
13890 b_constr.data = NULL;
13891 int8_tArray* b_vals = (void*) b->elems;
13892 for (size_t m = 0; m < b_constr.datalen; m++) {
13893 int8_tArray b_conv_12 = b_vals[m];
13894 LDKSignature b_conv_12_ref;
13895 CHECK(b_conv_12->arr_len == 64);
13896 memcpy(b_conv_12_ref.compact_form, b_conv_12->elems, 64); FREE(b_conv_12);
13897 b_constr.data[m] = b_conv_12_ref;
13900 LDKC2Tuple_SignatureCVec_SignatureZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureCVec_SignatureZZ), "LDKC2Tuple_SignatureCVec_SignatureZZ");
13901 *ret_conv = C2Tuple_SignatureCVec_SignatureZZ_new(a_ref, b_constr);
13902 return tag_ptr(ret_conv, true);
13905 void __attribute__((export_name("TS_C2Tuple_SignatureCVec_SignatureZZ_free"))) TS_C2Tuple_SignatureCVec_SignatureZZ_free(uint64_t _res) {
13906 if (!ptr_is_owned(_res)) return;
13907 void* _res_ptr = untag_ptr(_res);
13908 CHECK_ACCESS(_res_ptr);
13909 LDKC2Tuple_SignatureCVec_SignatureZZ _res_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)(_res_ptr);
13910 FREE(untag_ptr(_res));
13911 C2Tuple_SignatureCVec_SignatureZZ_free(_res_conv);
13914 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(uint64_t o) {
13915 void* o_ptr = untag_ptr(o);
13916 CHECK_ACCESS(o_ptr);
13917 LDKC2Tuple_SignatureCVec_SignatureZZ o_conv = *(LDKC2Tuple_SignatureCVec_SignatureZZ*)(o_ptr);
13918 o_conv = C2Tuple_SignatureCVec_SignatureZZ_clone((LDKC2Tuple_SignatureCVec_SignatureZZ*)untag_ptr(o));
13919 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
13920 *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_ok(o_conv);
13921 return tag_ptr(ret_conv, true);
13924 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err() {
13925 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
13926 *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_err();
13927 return tag_ptr(ret_conv, true);
13930 jboolean __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(uint64_t o) {
13931 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* o_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)untag_ptr(o);
13932 jboolean ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_is_ok(o_conv);
13936 void __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(uint64_t _res) {
13937 if (!ptr_is_owned(_res)) return;
13938 void* _res_ptr = untag_ptr(_res);
13939 CHECK_ACCESS(_res_ptr);
13940 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ _res_conv = *(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)(_res_ptr);
13941 FREE(untag_ptr(_res));
13942 CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_free(_res_conv);
13945 static inline uint64_t CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ *NONNULL_PTR arg) {
13946 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
13947 *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(arg);
13948 return tag_ptr(ret_conv, true);
13950 int64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(uint64_t arg) {
13951 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* arg_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)untag_ptr(arg);
13952 int64_t ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone_ptr(arg_conv);
13956 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone"))) TS_CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(uint64_t orig) {
13957 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* orig_conv = (LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ*)untag_ptr(orig);
13958 LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ), "LDKCResult_C2Tuple_SignatureCVec_SignatureZZNoneZ");
13959 *ret_conv = CResult_C2Tuple_SignatureCVec_SignatureZZNoneZ_clone(orig_conv);
13960 return tag_ptr(ret_conv, true);
13963 uint64_t __attribute__((export_name("TS_CResult_SignatureNoneZ_ok"))) TS_CResult_SignatureNoneZ_ok(int8_tArray o) {
13964 LDKSignature o_ref;
13965 CHECK(o->arr_len == 64);
13966 memcpy(o_ref.compact_form, o->elems, 64); FREE(o);
13967 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
13968 *ret_conv = CResult_SignatureNoneZ_ok(o_ref);
13969 return tag_ptr(ret_conv, true);
13972 uint64_t __attribute__((export_name("TS_CResult_SignatureNoneZ_err"))) TS_CResult_SignatureNoneZ_err() {
13973 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
13974 *ret_conv = CResult_SignatureNoneZ_err();
13975 return tag_ptr(ret_conv, true);
13978 jboolean __attribute__((export_name("TS_CResult_SignatureNoneZ_is_ok"))) TS_CResult_SignatureNoneZ_is_ok(uint64_t o) {
13979 LDKCResult_SignatureNoneZ* o_conv = (LDKCResult_SignatureNoneZ*)untag_ptr(o);
13980 jboolean ret_conv = CResult_SignatureNoneZ_is_ok(o_conv);
13984 void __attribute__((export_name("TS_CResult_SignatureNoneZ_free"))) TS_CResult_SignatureNoneZ_free(uint64_t _res) {
13985 if (!ptr_is_owned(_res)) return;
13986 void* _res_ptr = untag_ptr(_res);
13987 CHECK_ACCESS(_res_ptr);
13988 LDKCResult_SignatureNoneZ _res_conv = *(LDKCResult_SignatureNoneZ*)(_res_ptr);
13989 FREE(untag_ptr(_res));
13990 CResult_SignatureNoneZ_free(_res_conv);
13993 static inline uint64_t CResult_SignatureNoneZ_clone_ptr(LDKCResult_SignatureNoneZ *NONNULL_PTR arg) {
13994 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
13995 *ret_conv = CResult_SignatureNoneZ_clone(arg);
13996 return tag_ptr(ret_conv, true);
13998 int64_t __attribute__((export_name("TS_CResult_SignatureNoneZ_clone_ptr"))) TS_CResult_SignatureNoneZ_clone_ptr(uint64_t arg) {
13999 LDKCResult_SignatureNoneZ* arg_conv = (LDKCResult_SignatureNoneZ*)untag_ptr(arg);
14000 int64_t ret_conv = CResult_SignatureNoneZ_clone_ptr(arg_conv);
14004 uint64_t __attribute__((export_name("TS_CResult_SignatureNoneZ_clone"))) TS_CResult_SignatureNoneZ_clone(uint64_t orig) {
14005 LDKCResult_SignatureNoneZ* orig_conv = (LDKCResult_SignatureNoneZ*)untag_ptr(orig);
14006 LDKCResult_SignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SignatureNoneZ), "LDKCResult_SignatureNoneZ");
14007 *ret_conv = CResult_SignatureNoneZ_clone(orig_conv);
14008 return tag_ptr(ret_conv, true);
14011 static inline uint64_t C2Tuple_SignatureSignatureZ_clone_ptr(LDKC2Tuple_SignatureSignatureZ *NONNULL_PTR arg) {
14012 LDKC2Tuple_SignatureSignatureZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureSignatureZ), "LDKC2Tuple_SignatureSignatureZ");
14013 *ret_conv = C2Tuple_SignatureSignatureZ_clone(arg);
14014 return tag_ptr(ret_conv, true);
14016 int64_t __attribute__((export_name("TS_C2Tuple_SignatureSignatureZ_clone_ptr"))) TS_C2Tuple_SignatureSignatureZ_clone_ptr(uint64_t arg) {
14017 LDKC2Tuple_SignatureSignatureZ* arg_conv = (LDKC2Tuple_SignatureSignatureZ*)untag_ptr(arg);
14018 int64_t ret_conv = C2Tuple_SignatureSignatureZ_clone_ptr(arg_conv);
14022 uint64_t __attribute__((export_name("TS_C2Tuple_SignatureSignatureZ_clone"))) TS_C2Tuple_SignatureSignatureZ_clone(uint64_t orig) {
14023 LDKC2Tuple_SignatureSignatureZ* orig_conv = (LDKC2Tuple_SignatureSignatureZ*)untag_ptr(orig);
14024 LDKC2Tuple_SignatureSignatureZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureSignatureZ), "LDKC2Tuple_SignatureSignatureZ");
14025 *ret_conv = C2Tuple_SignatureSignatureZ_clone(orig_conv);
14026 return tag_ptr(ret_conv, true);
14029 uint64_t __attribute__((export_name("TS_C2Tuple_SignatureSignatureZ_new"))) TS_C2Tuple_SignatureSignatureZ_new(int8_tArray a, int8_tArray b) {
14030 LDKSignature a_ref;
14031 CHECK(a->arr_len == 64);
14032 memcpy(a_ref.compact_form, a->elems, 64); FREE(a);
14033 LDKSignature b_ref;
14034 CHECK(b->arr_len == 64);
14035 memcpy(b_ref.compact_form, b->elems, 64); FREE(b);
14036 LDKC2Tuple_SignatureSignatureZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_SignatureSignatureZ), "LDKC2Tuple_SignatureSignatureZ");
14037 *ret_conv = C2Tuple_SignatureSignatureZ_new(a_ref, b_ref);
14038 return tag_ptr(ret_conv, true);
14041 void __attribute__((export_name("TS_C2Tuple_SignatureSignatureZ_free"))) TS_C2Tuple_SignatureSignatureZ_free(uint64_t _res) {
14042 if (!ptr_is_owned(_res)) return;
14043 void* _res_ptr = untag_ptr(_res);
14044 CHECK_ACCESS(_res_ptr);
14045 LDKC2Tuple_SignatureSignatureZ _res_conv = *(LDKC2Tuple_SignatureSignatureZ*)(_res_ptr);
14046 FREE(untag_ptr(_res));
14047 C2Tuple_SignatureSignatureZ_free(_res_conv);
14050 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureSignatureZNoneZ_ok"))) TS_CResult_C2Tuple_SignatureSignatureZNoneZ_ok(uint64_t o) {
14051 void* o_ptr = untag_ptr(o);
14052 CHECK_ACCESS(o_ptr);
14053 LDKC2Tuple_SignatureSignatureZ o_conv = *(LDKC2Tuple_SignatureSignatureZ*)(o_ptr);
14054 o_conv = C2Tuple_SignatureSignatureZ_clone((LDKC2Tuple_SignatureSignatureZ*)untag_ptr(o));
14055 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ");
14056 *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_ok(o_conv);
14057 return tag_ptr(ret_conv, true);
14060 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureSignatureZNoneZ_err"))) TS_CResult_C2Tuple_SignatureSignatureZNoneZ_err() {
14061 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ");
14062 *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_err();
14063 return tag_ptr(ret_conv, true);
14066 jboolean __attribute__((export_name("TS_CResult_C2Tuple_SignatureSignatureZNoneZ_is_ok"))) TS_CResult_C2Tuple_SignatureSignatureZNoneZ_is_ok(uint64_t o) {
14067 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* o_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)untag_ptr(o);
14068 jboolean ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_is_ok(o_conv);
14072 void __attribute__((export_name("TS_CResult_C2Tuple_SignatureSignatureZNoneZ_free"))) TS_CResult_C2Tuple_SignatureSignatureZNoneZ_free(uint64_t _res) {
14073 if (!ptr_is_owned(_res)) return;
14074 void* _res_ptr = untag_ptr(_res);
14075 CHECK_ACCESS(_res_ptr);
14076 LDKCResult_C2Tuple_SignatureSignatureZNoneZ _res_conv = *(LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)(_res_ptr);
14077 FREE(untag_ptr(_res));
14078 CResult_C2Tuple_SignatureSignatureZNoneZ_free(_res_conv);
14081 static inline uint64_t CResult_C2Tuple_SignatureSignatureZNoneZ_clone_ptr(LDKCResult_C2Tuple_SignatureSignatureZNoneZ *NONNULL_PTR arg) {
14082 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ");
14083 *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_clone(arg);
14084 return tag_ptr(ret_conv, true);
14086 int64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureSignatureZNoneZ_clone_ptr"))) TS_CResult_C2Tuple_SignatureSignatureZNoneZ_clone_ptr(uint64_t arg) {
14087 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* arg_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)untag_ptr(arg);
14088 int64_t ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_clone_ptr(arg_conv);
14092 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_SignatureSignatureZNoneZ_clone"))) TS_CResult_C2Tuple_SignatureSignatureZNoneZ_clone(uint64_t orig) {
14093 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* orig_conv = (LDKCResult_C2Tuple_SignatureSignatureZNoneZ*)untag_ptr(orig);
14094 LDKCResult_C2Tuple_SignatureSignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_SignatureSignatureZNoneZ), "LDKCResult_C2Tuple_SignatureSignatureZNoneZ");
14095 *ret_conv = CResult_C2Tuple_SignatureSignatureZNoneZ_clone(orig_conv);
14096 return tag_ptr(ret_conv, true);
14099 uint64_t __attribute__((export_name("TS_CResult_SecretKeyNoneZ_ok"))) TS_CResult_SecretKeyNoneZ_ok(int8_tArray o) {
14100 LDKSecretKey o_ref;
14101 CHECK(o->arr_len == 32);
14102 memcpy(o_ref.bytes, o->elems, 32); FREE(o);
14103 LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ");
14104 *ret_conv = CResult_SecretKeyNoneZ_ok(o_ref);
14105 return tag_ptr(ret_conv, true);
14108 uint64_t __attribute__((export_name("TS_CResult_SecretKeyNoneZ_err"))) TS_CResult_SecretKeyNoneZ_err() {
14109 LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ");
14110 *ret_conv = CResult_SecretKeyNoneZ_err();
14111 return tag_ptr(ret_conv, true);
14114 jboolean __attribute__((export_name("TS_CResult_SecretKeyNoneZ_is_ok"))) TS_CResult_SecretKeyNoneZ_is_ok(uint64_t o) {
14115 LDKCResult_SecretKeyNoneZ* o_conv = (LDKCResult_SecretKeyNoneZ*)untag_ptr(o);
14116 jboolean ret_conv = CResult_SecretKeyNoneZ_is_ok(o_conv);
14120 void __attribute__((export_name("TS_CResult_SecretKeyNoneZ_free"))) TS_CResult_SecretKeyNoneZ_free(uint64_t _res) {
14121 if (!ptr_is_owned(_res)) return;
14122 void* _res_ptr = untag_ptr(_res);
14123 CHECK_ACCESS(_res_ptr);
14124 LDKCResult_SecretKeyNoneZ _res_conv = *(LDKCResult_SecretKeyNoneZ*)(_res_ptr);
14125 FREE(untag_ptr(_res));
14126 CResult_SecretKeyNoneZ_free(_res_conv);
14129 static inline uint64_t CResult_SecretKeyNoneZ_clone_ptr(LDKCResult_SecretKeyNoneZ *NONNULL_PTR arg) {
14130 LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ");
14131 *ret_conv = CResult_SecretKeyNoneZ_clone(arg);
14132 return tag_ptr(ret_conv, true);
14134 int64_t __attribute__((export_name("TS_CResult_SecretKeyNoneZ_clone_ptr"))) TS_CResult_SecretKeyNoneZ_clone_ptr(uint64_t arg) {
14135 LDKCResult_SecretKeyNoneZ* arg_conv = (LDKCResult_SecretKeyNoneZ*)untag_ptr(arg);
14136 int64_t ret_conv = CResult_SecretKeyNoneZ_clone_ptr(arg_conv);
14140 uint64_t __attribute__((export_name("TS_CResult_SecretKeyNoneZ_clone"))) TS_CResult_SecretKeyNoneZ_clone(uint64_t orig) {
14141 LDKCResult_SecretKeyNoneZ* orig_conv = (LDKCResult_SecretKeyNoneZ*)untag_ptr(orig);
14142 LDKCResult_SecretKeyNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyNoneZ), "LDKCResult_SecretKeyNoneZ");
14143 *ret_conv = CResult_SecretKeyNoneZ_clone(orig_conv);
14144 return tag_ptr(ret_conv, true);
14147 uint64_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_ok"))) TS_CResult_SignDecodeErrorZ_ok(uint64_t o) {
14148 void* o_ptr = untag_ptr(o);
14149 CHECK_ACCESS(o_ptr);
14150 LDKSign o_conv = *(LDKSign*)(o_ptr);
14151 if (o_conv.free == LDKSign_JCalls_free) {
14152 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
14153 LDKSign_JCalls_cloned(&o_conv);
14155 LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
14156 *ret_conv = CResult_SignDecodeErrorZ_ok(o_conv);
14157 return tag_ptr(ret_conv, true);
14160 uint64_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_err"))) TS_CResult_SignDecodeErrorZ_err(uint64_t e) {
14161 LDKDecodeError e_conv;
14162 e_conv.inner = untag_ptr(e);
14163 e_conv.is_owned = ptr_is_owned(e);
14164 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
14165 e_conv = DecodeError_clone(&e_conv);
14166 LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
14167 *ret_conv = CResult_SignDecodeErrorZ_err(e_conv);
14168 return tag_ptr(ret_conv, true);
14171 jboolean __attribute__((export_name("TS_CResult_SignDecodeErrorZ_is_ok"))) TS_CResult_SignDecodeErrorZ_is_ok(uint64_t o) {
14172 LDKCResult_SignDecodeErrorZ* o_conv = (LDKCResult_SignDecodeErrorZ*)untag_ptr(o);
14173 jboolean ret_conv = CResult_SignDecodeErrorZ_is_ok(o_conv);
14177 void __attribute__((export_name("TS_CResult_SignDecodeErrorZ_free"))) TS_CResult_SignDecodeErrorZ_free(uint64_t _res) {
14178 if (!ptr_is_owned(_res)) return;
14179 void* _res_ptr = untag_ptr(_res);
14180 CHECK_ACCESS(_res_ptr);
14181 LDKCResult_SignDecodeErrorZ _res_conv = *(LDKCResult_SignDecodeErrorZ*)(_res_ptr);
14182 FREE(untag_ptr(_res));
14183 CResult_SignDecodeErrorZ_free(_res_conv);
14186 static inline uint64_t CResult_SignDecodeErrorZ_clone_ptr(LDKCResult_SignDecodeErrorZ *NONNULL_PTR arg) {
14187 LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
14188 *ret_conv = CResult_SignDecodeErrorZ_clone(arg);
14189 return tag_ptr(ret_conv, true);
14191 int64_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_clone_ptr"))) TS_CResult_SignDecodeErrorZ_clone_ptr(uint64_t arg) {
14192 LDKCResult_SignDecodeErrorZ* arg_conv = (LDKCResult_SignDecodeErrorZ*)untag_ptr(arg);
14193 int64_t ret_conv = CResult_SignDecodeErrorZ_clone_ptr(arg_conv);
14197 uint64_t __attribute__((export_name("TS_CResult_SignDecodeErrorZ_clone"))) TS_CResult_SignDecodeErrorZ_clone(uint64_t orig) {
14198 LDKCResult_SignDecodeErrorZ* orig_conv = (LDKCResult_SignDecodeErrorZ*)untag_ptr(orig);
14199 LDKCResult_SignDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignDecodeErrorZ), "LDKCResult_SignDecodeErrorZ");
14200 *ret_conv = CResult_SignDecodeErrorZ_clone(orig_conv);
14201 return tag_ptr(ret_conv, true);
14204 void __attribute__((export_name("TS_CVec_u5Z_free"))) TS_CVec_u5Z_free(ptrArray _res) {
14205 LDKCVec_u5Z _res_constr;
14206 _res_constr.datalen = _res->arr_len;
14207 if (_res_constr.datalen > 0)
14208 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKu5), "LDKCVec_u5Z Elements");
14210 _res_constr.data = NULL;
14211 int8_t* _res_vals = (void*) _res->elems;
14212 for (size_t h = 0; h < _res_constr.datalen; h++) {
14213 int8_t _res_conv_7 = _res_vals[h];
14215 _res_constr.data[h] = (LDKu5){ ._0 = _res_conv_7 };
14218 CVec_u5Z_free(_res_constr);
14221 uint64_t __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_ok"))) TS_CResult_RecoverableSignatureNoneZ_ok(int8_tArray o) {
14222 LDKRecoverableSignature o_ref;
14223 CHECK(o->arr_len == 68);
14224 memcpy(o_ref.serialized_form, o->elems, 68); FREE(o);
14225 LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
14226 *ret_conv = CResult_RecoverableSignatureNoneZ_ok(o_ref);
14227 return tag_ptr(ret_conv, true);
14230 uint64_t __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_err"))) TS_CResult_RecoverableSignatureNoneZ_err() {
14231 LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
14232 *ret_conv = CResult_RecoverableSignatureNoneZ_err();
14233 return tag_ptr(ret_conv, true);
14236 jboolean __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_is_ok"))) TS_CResult_RecoverableSignatureNoneZ_is_ok(uint64_t o) {
14237 LDKCResult_RecoverableSignatureNoneZ* o_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(o);
14238 jboolean ret_conv = CResult_RecoverableSignatureNoneZ_is_ok(o_conv);
14242 void __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_free"))) TS_CResult_RecoverableSignatureNoneZ_free(uint64_t _res) {
14243 if (!ptr_is_owned(_res)) return;
14244 void* _res_ptr = untag_ptr(_res);
14245 CHECK_ACCESS(_res_ptr);
14246 LDKCResult_RecoverableSignatureNoneZ _res_conv = *(LDKCResult_RecoverableSignatureNoneZ*)(_res_ptr);
14247 FREE(untag_ptr(_res));
14248 CResult_RecoverableSignatureNoneZ_free(_res_conv);
14251 static inline uint64_t CResult_RecoverableSignatureNoneZ_clone_ptr(LDKCResult_RecoverableSignatureNoneZ *NONNULL_PTR arg) {
14252 LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
14253 *ret_conv = CResult_RecoverableSignatureNoneZ_clone(arg);
14254 return tag_ptr(ret_conv, true);
14256 int64_t __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_clone_ptr"))) TS_CResult_RecoverableSignatureNoneZ_clone_ptr(uint64_t arg) {
14257 LDKCResult_RecoverableSignatureNoneZ* arg_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(arg);
14258 int64_t ret_conv = CResult_RecoverableSignatureNoneZ_clone_ptr(arg_conv);
14262 uint64_t __attribute__((export_name("TS_CResult_RecoverableSignatureNoneZ_clone"))) TS_CResult_RecoverableSignatureNoneZ_clone(uint64_t orig) {
14263 LDKCResult_RecoverableSignatureNoneZ* orig_conv = (LDKCResult_RecoverableSignatureNoneZ*)untag_ptr(orig);
14264 LDKCResult_RecoverableSignatureNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_RecoverableSignatureNoneZ), "LDKCResult_RecoverableSignatureNoneZ");
14265 *ret_conv = CResult_RecoverableSignatureNoneZ_clone(orig_conv);
14266 return tag_ptr(ret_conv, true);
14269 void __attribute__((export_name("TS_CVec_u8Z_free"))) TS_CVec_u8Z_free(int8_tArray _res) {
14270 LDKCVec_u8Z _res_ref;
14271 _res_ref.datalen = _res->arr_len;
14272 _res_ref.data = MALLOC(_res_ref.datalen, "LDKCVec_u8Z Bytes");
14273 memcpy(_res_ref.data, _res->elems, _res_ref.datalen); FREE(_res);
14274 CVec_u8Z_free(_res_ref);
14277 void __attribute__((export_name("TS_CVec_CVec_u8ZZ_free"))) TS_CVec_CVec_u8ZZ_free(ptrArray _res) {
14278 LDKCVec_CVec_u8ZZ _res_constr;
14279 _res_constr.datalen = _res->arr_len;
14280 if (_res_constr.datalen > 0)
14281 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCVec_u8Z), "LDKCVec_CVec_u8ZZ Elements");
14283 _res_constr.data = NULL;
14284 int8_tArray* _res_vals = (void*) _res->elems;
14285 for (size_t m = 0; m < _res_constr.datalen; m++) {
14286 int8_tArray _res_conv_12 = _res_vals[m];
14287 LDKCVec_u8Z _res_conv_12_ref;
14288 _res_conv_12_ref.datalen = _res_conv_12->arr_len;
14289 _res_conv_12_ref.data = MALLOC(_res_conv_12_ref.datalen, "LDKCVec_u8Z Bytes");
14290 memcpy(_res_conv_12_ref.data, _res_conv_12->elems, _res_conv_12_ref.datalen); FREE(_res_conv_12);
14291 _res_constr.data[m] = _res_conv_12_ref;
14294 CVec_CVec_u8ZZ_free(_res_constr);
14297 uint64_t __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_ok"))) TS_CResult_CVec_CVec_u8ZZNoneZ_ok(ptrArray o) {
14298 LDKCVec_CVec_u8ZZ o_constr;
14299 o_constr.datalen = o->arr_len;
14300 if (o_constr.datalen > 0)
14301 o_constr.data = MALLOC(o_constr.datalen * sizeof(LDKCVec_u8Z), "LDKCVec_CVec_u8ZZ Elements");
14303 o_constr.data = NULL;
14304 int8_tArray* o_vals = (void*) o->elems;
14305 for (size_t m = 0; m < o_constr.datalen; m++) {
14306 int8_tArray o_conv_12 = o_vals[m];
14307 LDKCVec_u8Z o_conv_12_ref;
14308 o_conv_12_ref.datalen = o_conv_12->arr_len;
14309 o_conv_12_ref.data = MALLOC(o_conv_12_ref.datalen, "LDKCVec_u8Z Bytes");
14310 memcpy(o_conv_12_ref.data, o_conv_12->elems, o_conv_12_ref.datalen); FREE(o_conv_12);
14311 o_constr.data[m] = o_conv_12_ref;
14314 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
14315 *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_ok(o_constr);
14316 return tag_ptr(ret_conv, true);
14319 uint64_t __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_err"))) TS_CResult_CVec_CVec_u8ZZNoneZ_err() {
14320 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
14321 *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_err();
14322 return tag_ptr(ret_conv, true);
14325 jboolean __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_is_ok"))) TS_CResult_CVec_CVec_u8ZZNoneZ_is_ok(uint64_t o) {
14326 LDKCResult_CVec_CVec_u8ZZNoneZ* o_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(o);
14327 jboolean ret_conv = CResult_CVec_CVec_u8ZZNoneZ_is_ok(o_conv);
14331 void __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_free"))) TS_CResult_CVec_CVec_u8ZZNoneZ_free(uint64_t _res) {
14332 if (!ptr_is_owned(_res)) return;
14333 void* _res_ptr = untag_ptr(_res);
14334 CHECK_ACCESS(_res_ptr);
14335 LDKCResult_CVec_CVec_u8ZZNoneZ _res_conv = *(LDKCResult_CVec_CVec_u8ZZNoneZ*)(_res_ptr);
14336 FREE(untag_ptr(_res));
14337 CResult_CVec_CVec_u8ZZNoneZ_free(_res_conv);
14340 static inline uint64_t CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(LDKCResult_CVec_CVec_u8ZZNoneZ *NONNULL_PTR arg) {
14341 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
14342 *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone(arg);
14343 return tag_ptr(ret_conv, true);
14345 int64_t __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_clone_ptr"))) TS_CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(uint64_t arg) {
14346 LDKCResult_CVec_CVec_u8ZZNoneZ* arg_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(arg);
14347 int64_t ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone_ptr(arg_conv);
14351 uint64_t __attribute__((export_name("TS_CResult_CVec_CVec_u8ZZNoneZ_clone"))) TS_CResult_CVec_CVec_u8ZZNoneZ_clone(uint64_t orig) {
14352 LDKCResult_CVec_CVec_u8ZZNoneZ* orig_conv = (LDKCResult_CVec_CVec_u8ZZNoneZ*)untag_ptr(orig);
14353 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
14354 *ret_conv = CResult_CVec_CVec_u8ZZNoneZ_clone(orig_conv);
14355 return tag_ptr(ret_conv, true);
14358 uint64_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_ok"))) TS_CResult_InMemorySignerDecodeErrorZ_ok(uint64_t o) {
14359 LDKInMemorySigner o_conv;
14360 o_conv.inner = untag_ptr(o);
14361 o_conv.is_owned = ptr_is_owned(o);
14362 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
14363 o_conv = InMemorySigner_clone(&o_conv);
14364 LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
14365 *ret_conv = CResult_InMemorySignerDecodeErrorZ_ok(o_conv);
14366 return tag_ptr(ret_conv, true);
14369 uint64_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_err"))) TS_CResult_InMemorySignerDecodeErrorZ_err(uint64_t e) {
14370 LDKDecodeError e_conv;
14371 e_conv.inner = untag_ptr(e);
14372 e_conv.is_owned = ptr_is_owned(e);
14373 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
14374 e_conv = DecodeError_clone(&e_conv);
14375 LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
14376 *ret_conv = CResult_InMemorySignerDecodeErrorZ_err(e_conv);
14377 return tag_ptr(ret_conv, true);
14380 jboolean __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_is_ok"))) TS_CResult_InMemorySignerDecodeErrorZ_is_ok(uint64_t o) {
14381 LDKCResult_InMemorySignerDecodeErrorZ* o_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(o);
14382 jboolean ret_conv = CResult_InMemorySignerDecodeErrorZ_is_ok(o_conv);
14386 void __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_free"))) TS_CResult_InMemorySignerDecodeErrorZ_free(uint64_t _res) {
14387 if (!ptr_is_owned(_res)) return;
14388 void* _res_ptr = untag_ptr(_res);
14389 CHECK_ACCESS(_res_ptr);
14390 LDKCResult_InMemorySignerDecodeErrorZ _res_conv = *(LDKCResult_InMemorySignerDecodeErrorZ*)(_res_ptr);
14391 FREE(untag_ptr(_res));
14392 CResult_InMemorySignerDecodeErrorZ_free(_res_conv);
14395 static inline uint64_t CResult_InMemorySignerDecodeErrorZ_clone_ptr(LDKCResult_InMemorySignerDecodeErrorZ *NONNULL_PTR arg) {
14396 LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
14397 *ret_conv = CResult_InMemorySignerDecodeErrorZ_clone(arg);
14398 return tag_ptr(ret_conv, true);
14400 int64_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_clone_ptr"))) TS_CResult_InMemorySignerDecodeErrorZ_clone_ptr(uint64_t arg) {
14401 LDKCResult_InMemorySignerDecodeErrorZ* arg_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(arg);
14402 int64_t ret_conv = CResult_InMemorySignerDecodeErrorZ_clone_ptr(arg_conv);
14406 uint64_t __attribute__((export_name("TS_CResult_InMemorySignerDecodeErrorZ_clone"))) TS_CResult_InMemorySignerDecodeErrorZ_clone(uint64_t orig) {
14407 LDKCResult_InMemorySignerDecodeErrorZ* orig_conv = (LDKCResult_InMemorySignerDecodeErrorZ*)untag_ptr(orig);
14408 LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
14409 *ret_conv = CResult_InMemorySignerDecodeErrorZ_clone(orig_conv);
14410 return tag_ptr(ret_conv, true);
14413 void __attribute__((export_name("TS_CVec_TxOutZ_free"))) TS_CVec_TxOutZ_free(uint64_tArray _res) {
14414 LDKCVec_TxOutZ _res_constr;
14415 _res_constr.datalen = _res->arr_len;
14416 if (_res_constr.datalen > 0)
14417 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements");
14419 _res_constr.data = NULL;
14420 uint64_t* _res_vals = _res->elems;
14421 for (size_t h = 0; h < _res_constr.datalen; h++) {
14422 uint64_t _res_conv_7 = _res_vals[h];
14423 void* _res_conv_7_ptr = untag_ptr(_res_conv_7);
14424 CHECK_ACCESS(_res_conv_7_ptr);
14425 LDKTxOut _res_conv_7_conv = *(LDKTxOut*)(_res_conv_7_ptr);
14426 FREE(untag_ptr(_res_conv_7));
14427 _res_constr.data[h] = _res_conv_7_conv;
14430 CVec_TxOutZ_free(_res_constr);
14433 uint64_t __attribute__((export_name("TS_CResult_TransactionNoneZ_ok"))) TS_CResult_TransactionNoneZ_ok(int8_tArray o) {
14434 LDKTransaction o_ref;
14435 o_ref.datalen = o->arr_len;
14436 o_ref.data = MALLOC(o_ref.datalen, "LDKTransaction Bytes");
14437 memcpy(o_ref.data, o->elems, o_ref.datalen); FREE(o);
14438 o_ref.data_is_owned = true;
14439 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
14440 *ret_conv = CResult_TransactionNoneZ_ok(o_ref);
14441 return tag_ptr(ret_conv, true);
14444 uint64_t __attribute__((export_name("TS_CResult_TransactionNoneZ_err"))) TS_CResult_TransactionNoneZ_err() {
14445 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
14446 *ret_conv = CResult_TransactionNoneZ_err();
14447 return tag_ptr(ret_conv, true);
14450 jboolean __attribute__((export_name("TS_CResult_TransactionNoneZ_is_ok"))) TS_CResult_TransactionNoneZ_is_ok(uint64_t o) {
14451 LDKCResult_TransactionNoneZ* o_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(o);
14452 jboolean ret_conv = CResult_TransactionNoneZ_is_ok(o_conv);
14456 void __attribute__((export_name("TS_CResult_TransactionNoneZ_free"))) TS_CResult_TransactionNoneZ_free(uint64_t _res) {
14457 if (!ptr_is_owned(_res)) return;
14458 void* _res_ptr = untag_ptr(_res);
14459 CHECK_ACCESS(_res_ptr);
14460 LDKCResult_TransactionNoneZ _res_conv = *(LDKCResult_TransactionNoneZ*)(_res_ptr);
14461 FREE(untag_ptr(_res));
14462 CResult_TransactionNoneZ_free(_res_conv);
14465 static inline uint64_t CResult_TransactionNoneZ_clone_ptr(LDKCResult_TransactionNoneZ *NONNULL_PTR arg) {
14466 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
14467 *ret_conv = CResult_TransactionNoneZ_clone(arg);
14468 return tag_ptr(ret_conv, true);
14470 int64_t __attribute__((export_name("TS_CResult_TransactionNoneZ_clone_ptr"))) TS_CResult_TransactionNoneZ_clone_ptr(uint64_t arg) {
14471 LDKCResult_TransactionNoneZ* arg_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(arg);
14472 int64_t ret_conv = CResult_TransactionNoneZ_clone_ptr(arg_conv);
14476 uint64_t __attribute__((export_name("TS_CResult_TransactionNoneZ_clone"))) TS_CResult_TransactionNoneZ_clone(uint64_t orig) {
14477 LDKCResult_TransactionNoneZ* orig_conv = (LDKCResult_TransactionNoneZ*)untag_ptr(orig);
14478 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
14479 *ret_conv = CResult_TransactionNoneZ_clone(orig_conv);
14480 return tag_ptr(ret_conv, true);
14483 uint64_t __attribute__((export_name("TS_COption_u16Z_some"))) TS_COption_u16Z_some(int16_t o) {
14484 LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
14485 *ret_copy = COption_u16Z_some(o);
14486 uint64_t ret_ref = tag_ptr(ret_copy, true);
14490 uint64_t __attribute__((export_name("TS_COption_u16Z_none"))) TS_COption_u16Z_none() {
14491 LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
14492 *ret_copy = COption_u16Z_none();
14493 uint64_t ret_ref = tag_ptr(ret_copy, true);
14497 void __attribute__((export_name("TS_COption_u16Z_free"))) TS_COption_u16Z_free(uint64_t _res) {
14498 if (!ptr_is_owned(_res)) return;
14499 void* _res_ptr = untag_ptr(_res);
14500 CHECK_ACCESS(_res_ptr);
14501 LDKCOption_u16Z _res_conv = *(LDKCOption_u16Z*)(_res_ptr);
14502 FREE(untag_ptr(_res));
14503 COption_u16Z_free(_res_conv);
14506 static inline uint64_t COption_u16Z_clone_ptr(LDKCOption_u16Z *NONNULL_PTR arg) {
14507 LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
14508 *ret_copy = COption_u16Z_clone(arg);
14509 uint64_t ret_ref = tag_ptr(ret_copy, true);
14512 int64_t __attribute__((export_name("TS_COption_u16Z_clone_ptr"))) TS_COption_u16Z_clone_ptr(uint64_t arg) {
14513 LDKCOption_u16Z* arg_conv = (LDKCOption_u16Z*)untag_ptr(arg);
14514 int64_t ret_conv = COption_u16Z_clone_ptr(arg_conv);
14518 uint64_t __attribute__((export_name("TS_COption_u16Z_clone"))) TS_COption_u16Z_clone(uint64_t orig) {
14519 LDKCOption_u16Z* orig_conv = (LDKCOption_u16Z*)untag_ptr(orig);
14520 LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
14521 *ret_copy = COption_u16Z_clone(orig_conv);
14522 uint64_t ret_ref = tag_ptr(ret_copy, true);
14526 uint64_t __attribute__((export_name("TS_CResult_NoneAPIErrorZ_ok"))) TS_CResult_NoneAPIErrorZ_ok() {
14527 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
14528 *ret_conv = CResult_NoneAPIErrorZ_ok();
14529 return tag_ptr(ret_conv, true);
14532 uint64_t __attribute__((export_name("TS_CResult_NoneAPIErrorZ_err"))) TS_CResult_NoneAPIErrorZ_err(uint64_t e) {
14533 void* e_ptr = untag_ptr(e);
14534 CHECK_ACCESS(e_ptr);
14535 LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
14536 e_conv = APIError_clone((LDKAPIError*)untag_ptr(e));
14537 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
14538 *ret_conv = CResult_NoneAPIErrorZ_err(e_conv);
14539 return tag_ptr(ret_conv, true);
14542 jboolean __attribute__((export_name("TS_CResult_NoneAPIErrorZ_is_ok"))) TS_CResult_NoneAPIErrorZ_is_ok(uint64_t o) {
14543 LDKCResult_NoneAPIErrorZ* o_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(o);
14544 jboolean ret_conv = CResult_NoneAPIErrorZ_is_ok(o_conv);
14548 void __attribute__((export_name("TS_CResult_NoneAPIErrorZ_free"))) TS_CResult_NoneAPIErrorZ_free(uint64_t _res) {
14549 if (!ptr_is_owned(_res)) return;
14550 void* _res_ptr = untag_ptr(_res);
14551 CHECK_ACCESS(_res_ptr);
14552 LDKCResult_NoneAPIErrorZ _res_conv = *(LDKCResult_NoneAPIErrorZ*)(_res_ptr);
14553 FREE(untag_ptr(_res));
14554 CResult_NoneAPIErrorZ_free(_res_conv);
14557 static inline uint64_t CResult_NoneAPIErrorZ_clone_ptr(LDKCResult_NoneAPIErrorZ *NONNULL_PTR arg) {
14558 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
14559 *ret_conv = CResult_NoneAPIErrorZ_clone(arg);
14560 return tag_ptr(ret_conv, true);
14562 int64_t __attribute__((export_name("TS_CResult_NoneAPIErrorZ_clone_ptr"))) TS_CResult_NoneAPIErrorZ_clone_ptr(uint64_t arg) {
14563 LDKCResult_NoneAPIErrorZ* arg_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(arg);
14564 int64_t ret_conv = CResult_NoneAPIErrorZ_clone_ptr(arg_conv);
14568 uint64_t __attribute__((export_name("TS_CResult_NoneAPIErrorZ_clone"))) TS_CResult_NoneAPIErrorZ_clone(uint64_t orig) {
14569 LDKCResult_NoneAPIErrorZ* orig_conv = (LDKCResult_NoneAPIErrorZ*)untag_ptr(orig);
14570 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
14571 *ret_conv = CResult_NoneAPIErrorZ_clone(orig_conv);
14572 return tag_ptr(ret_conv, true);
14575 void __attribute__((export_name("TS_CVec_CResult_NoneAPIErrorZZ_free"))) TS_CVec_CResult_NoneAPIErrorZZ_free(uint64_tArray _res) {
14576 LDKCVec_CResult_NoneAPIErrorZZ _res_constr;
14577 _res_constr.datalen = _res->arr_len;
14578 if (_res_constr.datalen > 0)
14579 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
14581 _res_constr.data = NULL;
14582 uint64_t* _res_vals = _res->elems;
14583 for (size_t w = 0; w < _res_constr.datalen; w++) {
14584 uint64_t _res_conv_22 = _res_vals[w];
14585 void* _res_conv_22_ptr = untag_ptr(_res_conv_22);
14586 CHECK_ACCESS(_res_conv_22_ptr);
14587 LDKCResult_NoneAPIErrorZ _res_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(_res_conv_22_ptr);
14588 FREE(untag_ptr(_res_conv_22));
14589 _res_constr.data[w] = _res_conv_22_conv;
14592 CVec_CResult_NoneAPIErrorZZ_free(_res_constr);
14595 void __attribute__((export_name("TS_CVec_APIErrorZ_free"))) TS_CVec_APIErrorZ_free(uint64_tArray _res) {
14596 LDKCVec_APIErrorZ _res_constr;
14597 _res_constr.datalen = _res->arr_len;
14598 if (_res_constr.datalen > 0)
14599 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKAPIError), "LDKCVec_APIErrorZ Elements");
14601 _res_constr.data = NULL;
14602 uint64_t* _res_vals = _res->elems;
14603 for (size_t k = 0; k < _res_constr.datalen; k++) {
14604 uint64_t _res_conv_10 = _res_vals[k];
14605 void* _res_conv_10_ptr = untag_ptr(_res_conv_10);
14606 CHECK_ACCESS(_res_conv_10_ptr);
14607 LDKAPIError _res_conv_10_conv = *(LDKAPIError*)(_res_conv_10_ptr);
14608 FREE(untag_ptr(_res_conv_10));
14609 _res_constr.data[k] = _res_conv_10_conv;
14612 CVec_APIErrorZ_free(_res_constr);
14615 uint64_t __attribute__((export_name("TS_CResult__u832APIErrorZ_ok"))) TS_CResult__u832APIErrorZ_ok(int8_tArray o) {
14616 LDKThirtyTwoBytes o_ref;
14617 CHECK(o->arr_len == 32);
14618 memcpy(o_ref.data, o->elems, 32); FREE(o);
14619 LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
14620 *ret_conv = CResult__u832APIErrorZ_ok(o_ref);
14621 return tag_ptr(ret_conv, true);
14624 uint64_t __attribute__((export_name("TS_CResult__u832APIErrorZ_err"))) TS_CResult__u832APIErrorZ_err(uint64_t e) {
14625 void* e_ptr = untag_ptr(e);
14626 CHECK_ACCESS(e_ptr);
14627 LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
14628 e_conv = APIError_clone((LDKAPIError*)untag_ptr(e));
14629 LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
14630 *ret_conv = CResult__u832APIErrorZ_err(e_conv);
14631 return tag_ptr(ret_conv, true);
14634 jboolean __attribute__((export_name("TS_CResult__u832APIErrorZ_is_ok"))) TS_CResult__u832APIErrorZ_is_ok(uint64_t o) {
14635 LDKCResult__u832APIErrorZ* o_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(o);
14636 jboolean ret_conv = CResult__u832APIErrorZ_is_ok(o_conv);
14640 void __attribute__((export_name("TS_CResult__u832APIErrorZ_free"))) TS_CResult__u832APIErrorZ_free(uint64_t _res) {
14641 if (!ptr_is_owned(_res)) return;
14642 void* _res_ptr = untag_ptr(_res);
14643 CHECK_ACCESS(_res_ptr);
14644 LDKCResult__u832APIErrorZ _res_conv = *(LDKCResult__u832APIErrorZ*)(_res_ptr);
14645 FREE(untag_ptr(_res));
14646 CResult__u832APIErrorZ_free(_res_conv);
14649 static inline uint64_t CResult__u832APIErrorZ_clone_ptr(LDKCResult__u832APIErrorZ *NONNULL_PTR arg) {
14650 LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
14651 *ret_conv = CResult__u832APIErrorZ_clone(arg);
14652 return tag_ptr(ret_conv, true);
14654 int64_t __attribute__((export_name("TS_CResult__u832APIErrorZ_clone_ptr"))) TS_CResult__u832APIErrorZ_clone_ptr(uint64_t arg) {
14655 LDKCResult__u832APIErrorZ* arg_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(arg);
14656 int64_t ret_conv = CResult__u832APIErrorZ_clone_ptr(arg_conv);
14660 uint64_t __attribute__((export_name("TS_CResult__u832APIErrorZ_clone"))) TS_CResult__u832APIErrorZ_clone(uint64_t orig) {
14661 LDKCResult__u832APIErrorZ* orig_conv = (LDKCResult__u832APIErrorZ*)untag_ptr(orig);
14662 LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
14663 *ret_conv = CResult__u832APIErrorZ_clone(orig_conv);
14664 return tag_ptr(ret_conv, true);
14667 uint64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_ok"))) TS_CResult_PaymentIdPaymentSendFailureZ_ok(int8_tArray o) {
14668 LDKThirtyTwoBytes o_ref;
14669 CHECK(o->arr_len == 32);
14670 memcpy(o_ref.data, o->elems, 32); FREE(o);
14671 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
14672 *ret_conv = CResult_PaymentIdPaymentSendFailureZ_ok(o_ref);
14673 return tag_ptr(ret_conv, true);
14676 uint64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_err"))) TS_CResult_PaymentIdPaymentSendFailureZ_err(uint64_t e) {
14677 void* e_ptr = untag_ptr(e);
14678 CHECK_ACCESS(e_ptr);
14679 LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr);
14680 e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(e));
14681 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
14682 *ret_conv = CResult_PaymentIdPaymentSendFailureZ_err(e_conv);
14683 return tag_ptr(ret_conv, true);
14686 jboolean __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_is_ok"))) TS_CResult_PaymentIdPaymentSendFailureZ_is_ok(uint64_t o) {
14687 LDKCResult_PaymentIdPaymentSendFailureZ* o_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)untag_ptr(o);
14688 jboolean ret_conv = CResult_PaymentIdPaymentSendFailureZ_is_ok(o_conv);
14692 void __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_free"))) TS_CResult_PaymentIdPaymentSendFailureZ_free(uint64_t _res) {
14693 if (!ptr_is_owned(_res)) return;
14694 void* _res_ptr = untag_ptr(_res);
14695 CHECK_ACCESS(_res_ptr);
14696 LDKCResult_PaymentIdPaymentSendFailureZ _res_conv = *(LDKCResult_PaymentIdPaymentSendFailureZ*)(_res_ptr);
14697 FREE(untag_ptr(_res));
14698 CResult_PaymentIdPaymentSendFailureZ_free(_res_conv);
14701 static inline uint64_t CResult_PaymentIdPaymentSendFailureZ_clone_ptr(LDKCResult_PaymentIdPaymentSendFailureZ *NONNULL_PTR arg) {
14702 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
14703 *ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone(arg);
14704 return tag_ptr(ret_conv, true);
14706 int64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_clone_ptr"))) TS_CResult_PaymentIdPaymentSendFailureZ_clone_ptr(uint64_t arg) {
14707 LDKCResult_PaymentIdPaymentSendFailureZ* arg_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)untag_ptr(arg);
14708 int64_t ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone_ptr(arg_conv);
14712 uint64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentSendFailureZ_clone"))) TS_CResult_PaymentIdPaymentSendFailureZ_clone(uint64_t orig) {
14713 LDKCResult_PaymentIdPaymentSendFailureZ* orig_conv = (LDKCResult_PaymentIdPaymentSendFailureZ*)untag_ptr(orig);
14714 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
14715 *ret_conv = CResult_PaymentIdPaymentSendFailureZ_clone(orig_conv);
14716 return tag_ptr(ret_conv, true);
14719 uint64_t __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_ok"))) TS_CResult_NonePaymentSendFailureZ_ok() {
14720 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
14721 *ret_conv = CResult_NonePaymentSendFailureZ_ok();
14722 return tag_ptr(ret_conv, true);
14725 uint64_t __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_err"))) TS_CResult_NonePaymentSendFailureZ_err(uint64_t e) {
14726 void* e_ptr = untag_ptr(e);
14727 CHECK_ACCESS(e_ptr);
14728 LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr);
14729 e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(e));
14730 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
14731 *ret_conv = CResult_NonePaymentSendFailureZ_err(e_conv);
14732 return tag_ptr(ret_conv, true);
14735 jboolean __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_is_ok"))) TS_CResult_NonePaymentSendFailureZ_is_ok(uint64_t o) {
14736 LDKCResult_NonePaymentSendFailureZ* o_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(o);
14737 jboolean ret_conv = CResult_NonePaymentSendFailureZ_is_ok(o_conv);
14741 void __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_free"))) TS_CResult_NonePaymentSendFailureZ_free(uint64_t _res) {
14742 if (!ptr_is_owned(_res)) return;
14743 void* _res_ptr = untag_ptr(_res);
14744 CHECK_ACCESS(_res_ptr);
14745 LDKCResult_NonePaymentSendFailureZ _res_conv = *(LDKCResult_NonePaymentSendFailureZ*)(_res_ptr);
14746 FREE(untag_ptr(_res));
14747 CResult_NonePaymentSendFailureZ_free(_res_conv);
14750 static inline uint64_t CResult_NonePaymentSendFailureZ_clone_ptr(LDKCResult_NonePaymentSendFailureZ *NONNULL_PTR arg) {
14751 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
14752 *ret_conv = CResult_NonePaymentSendFailureZ_clone(arg);
14753 return tag_ptr(ret_conv, true);
14755 int64_t __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_clone_ptr"))) TS_CResult_NonePaymentSendFailureZ_clone_ptr(uint64_t arg) {
14756 LDKCResult_NonePaymentSendFailureZ* arg_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(arg);
14757 int64_t ret_conv = CResult_NonePaymentSendFailureZ_clone_ptr(arg_conv);
14761 uint64_t __attribute__((export_name("TS_CResult_NonePaymentSendFailureZ_clone"))) TS_CResult_NonePaymentSendFailureZ_clone(uint64_t orig) {
14762 LDKCResult_NonePaymentSendFailureZ* orig_conv = (LDKCResult_NonePaymentSendFailureZ*)untag_ptr(orig);
14763 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
14764 *ret_conv = CResult_NonePaymentSendFailureZ_clone(orig_conv);
14765 return tag_ptr(ret_conv, true);
14768 static inline uint64_t C2Tuple_PaymentHashPaymentIdZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentIdZ *NONNULL_PTR arg) {
14769 LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ");
14770 *ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone(arg);
14771 return tag_ptr(ret_conv, true);
14773 int64_t __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentIdZ_clone_ptr"))) TS_C2Tuple_PaymentHashPaymentIdZ_clone_ptr(uint64_t arg) {
14774 LDKC2Tuple_PaymentHashPaymentIdZ* arg_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)untag_ptr(arg);
14775 int64_t ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone_ptr(arg_conv);
14779 uint64_t __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentIdZ_clone"))) TS_C2Tuple_PaymentHashPaymentIdZ_clone(uint64_t orig) {
14780 LDKC2Tuple_PaymentHashPaymentIdZ* orig_conv = (LDKC2Tuple_PaymentHashPaymentIdZ*)untag_ptr(orig);
14781 LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ");
14782 *ret_conv = C2Tuple_PaymentHashPaymentIdZ_clone(orig_conv);
14783 return tag_ptr(ret_conv, true);
14786 uint64_t __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentIdZ_new"))) TS_C2Tuple_PaymentHashPaymentIdZ_new(int8_tArray a, int8_tArray b) {
14787 LDKThirtyTwoBytes a_ref;
14788 CHECK(a->arr_len == 32);
14789 memcpy(a_ref.data, a->elems, 32); FREE(a);
14790 LDKThirtyTwoBytes b_ref;
14791 CHECK(b->arr_len == 32);
14792 memcpy(b_ref.data, b->elems, 32); FREE(b);
14793 LDKC2Tuple_PaymentHashPaymentIdZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentIdZ), "LDKC2Tuple_PaymentHashPaymentIdZ");
14794 *ret_conv = C2Tuple_PaymentHashPaymentIdZ_new(a_ref, b_ref);
14795 return tag_ptr(ret_conv, true);
14798 void __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentIdZ_free"))) TS_C2Tuple_PaymentHashPaymentIdZ_free(uint64_t _res) {
14799 if (!ptr_is_owned(_res)) return;
14800 void* _res_ptr = untag_ptr(_res);
14801 CHECK_ACCESS(_res_ptr);
14802 LDKC2Tuple_PaymentHashPaymentIdZ _res_conv = *(LDKC2Tuple_PaymentHashPaymentIdZ*)(_res_ptr);
14803 FREE(untag_ptr(_res));
14804 C2Tuple_PaymentHashPaymentIdZ_free(_res_conv);
14807 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(uint64_t o) {
14808 void* o_ptr = untag_ptr(o);
14809 CHECK_ACCESS(o_ptr);
14810 LDKC2Tuple_PaymentHashPaymentIdZ o_conv = *(LDKC2Tuple_PaymentHashPaymentIdZ*)(o_ptr);
14811 o_conv = C2Tuple_PaymentHashPaymentIdZ_clone((LDKC2Tuple_PaymentHashPaymentIdZ*)untag_ptr(o));
14812 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
14813 *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_ok(o_conv);
14814 return tag_ptr(ret_conv, true);
14817 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(uint64_t e) {
14818 void* e_ptr = untag_ptr(e);
14819 CHECK_ACCESS(e_ptr);
14820 LDKPaymentSendFailure e_conv = *(LDKPaymentSendFailure*)(e_ptr);
14821 e_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(e));
14822 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
14823 *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_err(e_conv);
14824 return tag_ptr(ret_conv, true);
14827 jboolean __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(uint64_t o) {
14828 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)untag_ptr(o);
14829 jboolean ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_is_ok(o_conv);
14833 void __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(uint64_t _res) {
14834 if (!ptr_is_owned(_res)) return;
14835 void* _res_ptr = untag_ptr(_res);
14836 CHECK_ACCESS(_res_ptr);
14837 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)(_res_ptr);
14838 FREE(untag_ptr(_res));
14839 CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_free(_res_conv);
14842 static inline uint64_t CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ *NONNULL_PTR arg) {
14843 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
14844 *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(arg);
14845 return tag_ptr(ret_conv, true);
14847 int64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(uint64_t arg) {
14848 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)untag_ptr(arg);
14849 int64_t ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone_ptr(arg_conv);
14853 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone"))) TS_CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(uint64_t orig) {
14854 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ*)untag_ptr(orig);
14855 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
14856 *ret_conv = CResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ_clone(orig_conv);
14857 return tag_ptr(ret_conv, true);
14860 void __attribute__((export_name("TS_CVec_ThirtyTwoBytesZ_free"))) TS_CVec_ThirtyTwoBytesZ_free(ptrArray _res) {
14861 LDKCVec_ThirtyTwoBytesZ _res_constr;
14862 _res_constr.datalen = _res->arr_len;
14863 if (_res_constr.datalen > 0)
14864 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_ThirtyTwoBytesZ Elements");
14866 _res_constr.data = NULL;
14867 int8_tArray* _res_vals = (void*) _res->elems;
14868 for (size_t m = 0; m < _res_constr.datalen; m++) {
14869 int8_tArray _res_conv_12 = _res_vals[m];
14870 LDKThirtyTwoBytes _res_conv_12_ref;
14871 CHECK(_res_conv_12->arr_len == 32);
14872 memcpy(_res_conv_12_ref.data, _res_conv_12->elems, 32); FREE(_res_conv_12);
14873 _res_constr.data[m] = _res_conv_12_ref;
14876 CVec_ThirtyTwoBytesZ_free(_res_constr);
14879 static inline uint64_t C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(LDKC2Tuple_PaymentHashPaymentSecretZ *NONNULL_PTR arg) {
14880 LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
14881 *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone(arg);
14882 return tag_ptr(ret_conv, true);
14884 int64_t __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentSecretZ_clone_ptr"))) TS_C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(uint64_t arg) {
14885 LDKC2Tuple_PaymentHashPaymentSecretZ* arg_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(arg);
14886 int64_t ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone_ptr(arg_conv);
14890 uint64_t __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentSecretZ_clone"))) TS_C2Tuple_PaymentHashPaymentSecretZ_clone(uint64_t orig) {
14891 LDKC2Tuple_PaymentHashPaymentSecretZ* orig_conv = (LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(orig);
14892 LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
14893 *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_clone(orig_conv);
14894 return tag_ptr(ret_conv, true);
14897 uint64_t __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentSecretZ_new"))) TS_C2Tuple_PaymentHashPaymentSecretZ_new(int8_tArray a, int8_tArray b) {
14898 LDKThirtyTwoBytes a_ref;
14899 CHECK(a->arr_len == 32);
14900 memcpy(a_ref.data, a->elems, 32); FREE(a);
14901 LDKThirtyTwoBytes b_ref;
14902 CHECK(b->arr_len == 32);
14903 memcpy(b_ref.data, b->elems, 32); FREE(b);
14904 LDKC2Tuple_PaymentHashPaymentSecretZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PaymentHashPaymentSecretZ), "LDKC2Tuple_PaymentHashPaymentSecretZ");
14905 *ret_conv = C2Tuple_PaymentHashPaymentSecretZ_new(a_ref, b_ref);
14906 return tag_ptr(ret_conv, true);
14909 void __attribute__((export_name("TS_C2Tuple_PaymentHashPaymentSecretZ_free"))) TS_C2Tuple_PaymentHashPaymentSecretZ_free(uint64_t _res) {
14910 if (!ptr_is_owned(_res)) return;
14911 void* _res_ptr = untag_ptr(_res);
14912 CHECK_ACCESS(_res_ptr);
14913 LDKC2Tuple_PaymentHashPaymentSecretZ _res_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(_res_ptr);
14914 FREE(untag_ptr(_res));
14915 C2Tuple_PaymentHashPaymentSecretZ_free(_res_conv);
14918 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(uint64_t o) {
14919 void* o_ptr = untag_ptr(o);
14920 CHECK_ACCESS(o_ptr);
14921 LDKC2Tuple_PaymentHashPaymentSecretZ o_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(o_ptr);
14922 o_conv = C2Tuple_PaymentHashPaymentSecretZ_clone((LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(o));
14923 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
14924 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_ok(o_conv);
14925 return tag_ptr(ret_conv, true);
14928 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err() {
14929 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
14930 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_err();
14931 return tag_ptr(ret_conv, true);
14934 jboolean __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(uint64_t o) {
14935 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)untag_ptr(o);
14936 jboolean ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_is_ok(o_conv);
14940 void __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(uint64_t _res) {
14941 if (!ptr_is_owned(_res)) return;
14942 void* _res_ptr = untag_ptr(_res);
14943 CHECK_ACCESS(_res_ptr);
14944 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)(_res_ptr);
14945 FREE(untag_ptr(_res));
14946 CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_free(_res_conv);
14949 static inline uint64_t CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ *NONNULL_PTR arg) {
14950 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
14951 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(arg);
14952 return tag_ptr(ret_conv, true);
14954 int64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(uint64_t arg) {
14955 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)untag_ptr(arg);
14956 int64_t ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone_ptr(arg_conv);
14960 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(uint64_t orig) {
14961 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ*)untag_ptr(orig);
14962 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
14963 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZNoneZ_clone(orig_conv);
14964 return tag_ptr(ret_conv, true);
14967 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(uint64_t o) {
14968 void* o_ptr = untag_ptr(o);
14969 CHECK_ACCESS(o_ptr);
14970 LDKC2Tuple_PaymentHashPaymentSecretZ o_conv = *(LDKC2Tuple_PaymentHashPaymentSecretZ*)(o_ptr);
14971 o_conv = C2Tuple_PaymentHashPaymentSecretZ_clone((LDKC2Tuple_PaymentHashPaymentSecretZ*)untag_ptr(o));
14972 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
14973 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_ok(o_conv);
14974 return tag_ptr(ret_conv, true);
14977 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(uint64_t e) {
14978 void* e_ptr = untag_ptr(e);
14979 CHECK_ACCESS(e_ptr);
14980 LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
14981 e_conv = APIError_clone((LDKAPIError*)untag_ptr(e));
14982 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
14983 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_err(e_conv);
14984 return tag_ptr(ret_conv, true);
14987 jboolean __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(uint64_t o) {
14988 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* o_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)untag_ptr(o);
14989 jboolean ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_is_ok(o_conv);
14993 void __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(uint64_t _res) {
14994 if (!ptr_is_owned(_res)) return;
14995 void* _res_ptr = untag_ptr(_res);
14996 CHECK_ACCESS(_res_ptr);
14997 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ _res_conv = *(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)(_res_ptr);
14998 FREE(untag_ptr(_res));
14999 CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_free(_res_conv);
15002 static inline uint64_t CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ *NONNULL_PTR arg) {
15003 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
15004 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(arg);
15005 return tag_ptr(ret_conv, true);
15007 int64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(uint64_t arg) {
15008 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* arg_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)untag_ptr(arg);
15009 int64_t ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone_ptr(arg_conv);
15013 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone"))) TS_CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(uint64_t orig) {
15014 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* orig_conv = (LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ*)untag_ptr(orig);
15015 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
15016 *ret_conv = CResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ_clone(orig_conv);
15017 return tag_ptr(ret_conv, true);
15020 uint64_t __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_ok"))) TS_CResult_PaymentSecretNoneZ_ok(int8_tArray o) {
15021 LDKThirtyTwoBytes o_ref;
15022 CHECK(o->arr_len == 32);
15023 memcpy(o_ref.data, o->elems, 32); FREE(o);
15024 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
15025 *ret_conv = CResult_PaymentSecretNoneZ_ok(o_ref);
15026 return tag_ptr(ret_conv, true);
15029 uint64_t __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_err"))) TS_CResult_PaymentSecretNoneZ_err() {
15030 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
15031 *ret_conv = CResult_PaymentSecretNoneZ_err();
15032 return tag_ptr(ret_conv, true);
15035 jboolean __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_is_ok"))) TS_CResult_PaymentSecretNoneZ_is_ok(uint64_t o) {
15036 LDKCResult_PaymentSecretNoneZ* o_conv = (LDKCResult_PaymentSecretNoneZ*)untag_ptr(o);
15037 jboolean ret_conv = CResult_PaymentSecretNoneZ_is_ok(o_conv);
15041 void __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_free"))) TS_CResult_PaymentSecretNoneZ_free(uint64_t _res) {
15042 if (!ptr_is_owned(_res)) return;
15043 void* _res_ptr = untag_ptr(_res);
15044 CHECK_ACCESS(_res_ptr);
15045 LDKCResult_PaymentSecretNoneZ _res_conv = *(LDKCResult_PaymentSecretNoneZ*)(_res_ptr);
15046 FREE(untag_ptr(_res));
15047 CResult_PaymentSecretNoneZ_free(_res_conv);
15050 static inline uint64_t CResult_PaymentSecretNoneZ_clone_ptr(LDKCResult_PaymentSecretNoneZ *NONNULL_PTR arg) {
15051 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
15052 *ret_conv = CResult_PaymentSecretNoneZ_clone(arg);
15053 return tag_ptr(ret_conv, true);
15055 int64_t __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_clone_ptr"))) TS_CResult_PaymentSecretNoneZ_clone_ptr(uint64_t arg) {
15056 LDKCResult_PaymentSecretNoneZ* arg_conv = (LDKCResult_PaymentSecretNoneZ*)untag_ptr(arg);
15057 int64_t ret_conv = CResult_PaymentSecretNoneZ_clone_ptr(arg_conv);
15061 uint64_t __attribute__((export_name("TS_CResult_PaymentSecretNoneZ_clone"))) TS_CResult_PaymentSecretNoneZ_clone(uint64_t orig) {
15062 LDKCResult_PaymentSecretNoneZ* orig_conv = (LDKCResult_PaymentSecretNoneZ*)untag_ptr(orig);
15063 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
15064 *ret_conv = CResult_PaymentSecretNoneZ_clone(orig_conv);
15065 return tag_ptr(ret_conv, true);
15068 uint64_t __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_ok"))) TS_CResult_PaymentSecretAPIErrorZ_ok(int8_tArray o) {
15069 LDKThirtyTwoBytes o_ref;
15070 CHECK(o->arr_len == 32);
15071 memcpy(o_ref.data, o->elems, 32); FREE(o);
15072 LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
15073 *ret_conv = CResult_PaymentSecretAPIErrorZ_ok(o_ref);
15074 return tag_ptr(ret_conv, true);
15077 uint64_t __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_err"))) TS_CResult_PaymentSecretAPIErrorZ_err(uint64_t e) {
15078 void* e_ptr = untag_ptr(e);
15079 CHECK_ACCESS(e_ptr);
15080 LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
15081 e_conv = APIError_clone((LDKAPIError*)untag_ptr(e));
15082 LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
15083 *ret_conv = CResult_PaymentSecretAPIErrorZ_err(e_conv);
15084 return tag_ptr(ret_conv, true);
15087 jboolean __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_is_ok"))) TS_CResult_PaymentSecretAPIErrorZ_is_ok(uint64_t o) {
15088 LDKCResult_PaymentSecretAPIErrorZ* o_conv = (LDKCResult_PaymentSecretAPIErrorZ*)untag_ptr(o);
15089 jboolean ret_conv = CResult_PaymentSecretAPIErrorZ_is_ok(o_conv);
15093 void __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_free"))) TS_CResult_PaymentSecretAPIErrorZ_free(uint64_t _res) {
15094 if (!ptr_is_owned(_res)) return;
15095 void* _res_ptr = untag_ptr(_res);
15096 CHECK_ACCESS(_res_ptr);
15097 LDKCResult_PaymentSecretAPIErrorZ _res_conv = *(LDKCResult_PaymentSecretAPIErrorZ*)(_res_ptr);
15098 FREE(untag_ptr(_res));
15099 CResult_PaymentSecretAPIErrorZ_free(_res_conv);
15102 static inline uint64_t CResult_PaymentSecretAPIErrorZ_clone_ptr(LDKCResult_PaymentSecretAPIErrorZ *NONNULL_PTR arg) {
15103 LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
15104 *ret_conv = CResult_PaymentSecretAPIErrorZ_clone(arg);
15105 return tag_ptr(ret_conv, true);
15107 int64_t __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_clone_ptr"))) TS_CResult_PaymentSecretAPIErrorZ_clone_ptr(uint64_t arg) {
15108 LDKCResult_PaymentSecretAPIErrorZ* arg_conv = (LDKCResult_PaymentSecretAPIErrorZ*)untag_ptr(arg);
15109 int64_t ret_conv = CResult_PaymentSecretAPIErrorZ_clone_ptr(arg_conv);
15113 uint64_t __attribute__((export_name("TS_CResult_PaymentSecretAPIErrorZ_clone"))) TS_CResult_PaymentSecretAPIErrorZ_clone(uint64_t orig) {
15114 LDKCResult_PaymentSecretAPIErrorZ* orig_conv = (LDKCResult_PaymentSecretAPIErrorZ*)untag_ptr(orig);
15115 LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
15116 *ret_conv = CResult_PaymentSecretAPIErrorZ_clone(orig_conv);
15117 return tag_ptr(ret_conv, true);
15120 uint64_t __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_ok"))) TS_CResult_PaymentPreimageAPIErrorZ_ok(int8_tArray o) {
15121 LDKThirtyTwoBytes o_ref;
15122 CHECK(o->arr_len == 32);
15123 memcpy(o_ref.data, o->elems, 32); FREE(o);
15124 LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
15125 *ret_conv = CResult_PaymentPreimageAPIErrorZ_ok(o_ref);
15126 return tag_ptr(ret_conv, true);
15129 uint64_t __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_err"))) TS_CResult_PaymentPreimageAPIErrorZ_err(uint64_t e) {
15130 void* e_ptr = untag_ptr(e);
15131 CHECK_ACCESS(e_ptr);
15132 LDKAPIError e_conv = *(LDKAPIError*)(e_ptr);
15133 e_conv = APIError_clone((LDKAPIError*)untag_ptr(e));
15134 LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
15135 *ret_conv = CResult_PaymentPreimageAPIErrorZ_err(e_conv);
15136 return tag_ptr(ret_conv, true);
15139 jboolean __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_is_ok"))) TS_CResult_PaymentPreimageAPIErrorZ_is_ok(uint64_t o) {
15140 LDKCResult_PaymentPreimageAPIErrorZ* o_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)untag_ptr(o);
15141 jboolean ret_conv = CResult_PaymentPreimageAPIErrorZ_is_ok(o_conv);
15145 void __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_free"))) TS_CResult_PaymentPreimageAPIErrorZ_free(uint64_t _res) {
15146 if (!ptr_is_owned(_res)) return;
15147 void* _res_ptr = untag_ptr(_res);
15148 CHECK_ACCESS(_res_ptr);
15149 LDKCResult_PaymentPreimageAPIErrorZ _res_conv = *(LDKCResult_PaymentPreimageAPIErrorZ*)(_res_ptr);
15150 FREE(untag_ptr(_res));
15151 CResult_PaymentPreimageAPIErrorZ_free(_res_conv);
15154 static inline uint64_t CResult_PaymentPreimageAPIErrorZ_clone_ptr(LDKCResult_PaymentPreimageAPIErrorZ *NONNULL_PTR arg) {
15155 LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
15156 *ret_conv = CResult_PaymentPreimageAPIErrorZ_clone(arg);
15157 return tag_ptr(ret_conv, true);
15159 int64_t __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_clone_ptr"))) TS_CResult_PaymentPreimageAPIErrorZ_clone_ptr(uint64_t arg) {
15160 LDKCResult_PaymentPreimageAPIErrorZ* arg_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)untag_ptr(arg);
15161 int64_t ret_conv = CResult_PaymentPreimageAPIErrorZ_clone_ptr(arg_conv);
15165 uint64_t __attribute__((export_name("TS_CResult_PaymentPreimageAPIErrorZ_clone"))) TS_CResult_PaymentPreimageAPIErrorZ_clone(uint64_t orig) {
15166 LDKCResult_PaymentPreimageAPIErrorZ* orig_conv = (LDKCResult_PaymentPreimageAPIErrorZ*)untag_ptr(orig);
15167 LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
15168 *ret_conv = CResult_PaymentPreimageAPIErrorZ_clone(orig_conv);
15169 return tag_ptr(ret_conv, true);
15172 uint64_t __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_ok"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(uint64_t o) {
15173 LDKCounterpartyForwardingInfo o_conv;
15174 o_conv.inner = untag_ptr(o);
15175 o_conv.is_owned = ptr_is_owned(o);
15176 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
15177 o_conv = CounterpartyForwardingInfo_clone(&o_conv);
15178 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
15179 *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_ok(o_conv);
15180 return tag_ptr(ret_conv, true);
15183 uint64_t __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_err"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_err(uint64_t e) {
15184 LDKDecodeError e_conv;
15185 e_conv.inner = untag_ptr(e);
15186 e_conv.is_owned = ptr_is_owned(e);
15187 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
15188 e_conv = DecodeError_clone(&e_conv);
15189 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
15190 *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_err(e_conv);
15191 return tag_ptr(ret_conv, true);
15194 jboolean __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(uint64_t o) {
15195 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* o_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(o);
15196 jboolean ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_is_ok(o_conv);
15200 void __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_free"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_free(uint64_t _res) {
15201 if (!ptr_is_owned(_res)) return;
15202 void* _res_ptr = untag_ptr(_res);
15203 CHECK_ACCESS(_res_ptr);
15204 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ _res_conv = *(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)(_res_ptr);
15205 FREE(untag_ptr(_res));
15206 CResult_CounterpartyForwardingInfoDecodeErrorZ_free(_res_conv);
15209 static inline uint64_t CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ *NONNULL_PTR arg) {
15210 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
15211 *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(arg);
15212 return tag_ptr(ret_conv, true);
15214 int64_t __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(uint64_t arg) {
15215 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* arg_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(arg);
15216 int64_t ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone_ptr(arg_conv);
15220 uint64_t __attribute__((export_name("TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_clone"))) TS_CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(uint64_t orig) {
15221 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* orig_conv = (LDKCResult_CounterpartyForwardingInfoDecodeErrorZ*)untag_ptr(orig);
15222 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
15223 *ret_conv = CResult_CounterpartyForwardingInfoDecodeErrorZ_clone(orig_conv);
15224 return tag_ptr(ret_conv, true);
15227 uint64_t __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_ok"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_ok(uint64_t o) {
15228 LDKChannelCounterparty o_conv;
15229 o_conv.inner = untag_ptr(o);
15230 o_conv.is_owned = ptr_is_owned(o);
15231 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
15232 o_conv = ChannelCounterparty_clone(&o_conv);
15233 LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
15234 *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_ok(o_conv);
15235 return tag_ptr(ret_conv, true);
15238 uint64_t __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_err"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_err(uint64_t e) {
15239 LDKDecodeError e_conv;
15240 e_conv.inner = untag_ptr(e);
15241 e_conv.is_owned = ptr_is_owned(e);
15242 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
15243 e_conv = DecodeError_clone(&e_conv);
15244 LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
15245 *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_err(e_conv);
15246 return tag_ptr(ret_conv, true);
15249 jboolean __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_is_ok"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_is_ok(uint64_t o) {
15250 LDKCResult_ChannelCounterpartyDecodeErrorZ* o_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(o);
15251 jboolean ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_is_ok(o_conv);
15255 void __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_free"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_free(uint64_t _res) {
15256 if (!ptr_is_owned(_res)) return;
15257 void* _res_ptr = untag_ptr(_res);
15258 CHECK_ACCESS(_res_ptr);
15259 LDKCResult_ChannelCounterpartyDecodeErrorZ _res_conv = *(LDKCResult_ChannelCounterpartyDecodeErrorZ*)(_res_ptr);
15260 FREE(untag_ptr(_res));
15261 CResult_ChannelCounterpartyDecodeErrorZ_free(_res_conv);
15264 static inline uint64_t CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(LDKCResult_ChannelCounterpartyDecodeErrorZ *NONNULL_PTR arg) {
15265 LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
15266 *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone(arg);
15267 return tag_ptr(ret_conv, true);
15269 int64_t __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(uint64_t arg) {
15270 LDKCResult_ChannelCounterpartyDecodeErrorZ* arg_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(arg);
15271 int64_t ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone_ptr(arg_conv);
15275 uint64_t __attribute__((export_name("TS_CResult_ChannelCounterpartyDecodeErrorZ_clone"))) TS_CResult_ChannelCounterpartyDecodeErrorZ_clone(uint64_t orig) {
15276 LDKCResult_ChannelCounterpartyDecodeErrorZ* orig_conv = (LDKCResult_ChannelCounterpartyDecodeErrorZ*)untag_ptr(orig);
15277 LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
15278 *ret_conv = CResult_ChannelCounterpartyDecodeErrorZ_clone(orig_conv);
15279 return tag_ptr(ret_conv, true);
15282 uint64_t __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_ok"))) TS_CResult_ChannelDetailsDecodeErrorZ_ok(uint64_t o) {
15283 LDKChannelDetails o_conv;
15284 o_conv.inner = untag_ptr(o);
15285 o_conv.is_owned = ptr_is_owned(o);
15286 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
15287 o_conv = ChannelDetails_clone(&o_conv);
15288 LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
15289 *ret_conv = CResult_ChannelDetailsDecodeErrorZ_ok(o_conv);
15290 return tag_ptr(ret_conv, true);
15293 uint64_t __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_err"))) TS_CResult_ChannelDetailsDecodeErrorZ_err(uint64_t e) {
15294 LDKDecodeError e_conv;
15295 e_conv.inner = untag_ptr(e);
15296 e_conv.is_owned = ptr_is_owned(e);
15297 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
15298 e_conv = DecodeError_clone(&e_conv);
15299 LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
15300 *ret_conv = CResult_ChannelDetailsDecodeErrorZ_err(e_conv);
15301 return tag_ptr(ret_conv, true);
15304 jboolean __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_is_ok"))) TS_CResult_ChannelDetailsDecodeErrorZ_is_ok(uint64_t o) {
15305 LDKCResult_ChannelDetailsDecodeErrorZ* o_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(o);
15306 jboolean ret_conv = CResult_ChannelDetailsDecodeErrorZ_is_ok(o_conv);
15310 void __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_free"))) TS_CResult_ChannelDetailsDecodeErrorZ_free(uint64_t _res) {
15311 if (!ptr_is_owned(_res)) return;
15312 void* _res_ptr = untag_ptr(_res);
15313 CHECK_ACCESS(_res_ptr);
15314 LDKCResult_ChannelDetailsDecodeErrorZ _res_conv = *(LDKCResult_ChannelDetailsDecodeErrorZ*)(_res_ptr);
15315 FREE(untag_ptr(_res));
15316 CResult_ChannelDetailsDecodeErrorZ_free(_res_conv);
15319 static inline uint64_t CResult_ChannelDetailsDecodeErrorZ_clone_ptr(LDKCResult_ChannelDetailsDecodeErrorZ *NONNULL_PTR arg) {
15320 LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
15321 *ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone(arg);
15322 return tag_ptr(ret_conv, true);
15324 int64_t __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelDetailsDecodeErrorZ_clone_ptr(uint64_t arg) {
15325 LDKCResult_ChannelDetailsDecodeErrorZ* arg_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(arg);
15326 int64_t ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone_ptr(arg_conv);
15330 uint64_t __attribute__((export_name("TS_CResult_ChannelDetailsDecodeErrorZ_clone"))) TS_CResult_ChannelDetailsDecodeErrorZ_clone(uint64_t orig) {
15331 LDKCResult_ChannelDetailsDecodeErrorZ* orig_conv = (LDKCResult_ChannelDetailsDecodeErrorZ*)untag_ptr(orig);
15332 LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
15333 *ret_conv = CResult_ChannelDetailsDecodeErrorZ_clone(orig_conv);
15334 return tag_ptr(ret_conv, true);
15337 uint64_t __attribute__((export_name("TS_CResult_PhantomRouteHintsDecodeErrorZ_ok"))) TS_CResult_PhantomRouteHintsDecodeErrorZ_ok(uint64_t o) {
15338 LDKPhantomRouteHints o_conv;
15339 o_conv.inner = untag_ptr(o);
15340 o_conv.is_owned = ptr_is_owned(o);
15341 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
15342 o_conv = PhantomRouteHints_clone(&o_conv);
15343 LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
15344 *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_ok(o_conv);
15345 return tag_ptr(ret_conv, true);
15348 uint64_t __attribute__((export_name("TS_CResult_PhantomRouteHintsDecodeErrorZ_err"))) TS_CResult_PhantomRouteHintsDecodeErrorZ_err(uint64_t e) {
15349 LDKDecodeError e_conv;
15350 e_conv.inner = untag_ptr(e);
15351 e_conv.is_owned = ptr_is_owned(e);
15352 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
15353 e_conv = DecodeError_clone(&e_conv);
15354 LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
15355 *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_err(e_conv);
15356 return tag_ptr(ret_conv, true);
15359 jboolean __attribute__((export_name("TS_CResult_PhantomRouteHintsDecodeErrorZ_is_ok"))) TS_CResult_PhantomRouteHintsDecodeErrorZ_is_ok(uint64_t o) {
15360 LDKCResult_PhantomRouteHintsDecodeErrorZ* o_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(o);
15361 jboolean ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_is_ok(o_conv);
15365 void __attribute__((export_name("TS_CResult_PhantomRouteHintsDecodeErrorZ_free"))) TS_CResult_PhantomRouteHintsDecodeErrorZ_free(uint64_t _res) {
15366 if (!ptr_is_owned(_res)) return;
15367 void* _res_ptr = untag_ptr(_res);
15368 CHECK_ACCESS(_res_ptr);
15369 LDKCResult_PhantomRouteHintsDecodeErrorZ _res_conv = *(LDKCResult_PhantomRouteHintsDecodeErrorZ*)(_res_ptr);
15370 FREE(untag_ptr(_res));
15371 CResult_PhantomRouteHintsDecodeErrorZ_free(_res_conv);
15374 static inline uint64_t CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr(LDKCResult_PhantomRouteHintsDecodeErrorZ *NONNULL_PTR arg) {
15375 LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
15376 *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_clone(arg);
15377 return tag_ptr(ret_conv, true);
15379 int64_t __attribute__((export_name("TS_CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr"))) TS_CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr(uint64_t arg) {
15380 LDKCResult_PhantomRouteHintsDecodeErrorZ* arg_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(arg);
15381 int64_t ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_clone_ptr(arg_conv);
15385 uint64_t __attribute__((export_name("TS_CResult_PhantomRouteHintsDecodeErrorZ_clone"))) TS_CResult_PhantomRouteHintsDecodeErrorZ_clone(uint64_t orig) {
15386 LDKCResult_PhantomRouteHintsDecodeErrorZ* orig_conv = (LDKCResult_PhantomRouteHintsDecodeErrorZ*)untag_ptr(orig);
15387 LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
15388 *ret_conv = CResult_PhantomRouteHintsDecodeErrorZ_clone(orig_conv);
15389 return tag_ptr(ret_conv, true);
15392 void __attribute__((export_name("TS_CVec_ChannelMonitorZ_free"))) TS_CVec_ChannelMonitorZ_free(uint64_tArray _res) {
15393 LDKCVec_ChannelMonitorZ _res_constr;
15394 _res_constr.datalen = _res->arr_len;
15395 if (_res_constr.datalen > 0)
15396 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKChannelMonitor), "LDKCVec_ChannelMonitorZ Elements");
15398 _res_constr.data = NULL;
15399 uint64_t* _res_vals = _res->elems;
15400 for (size_t q = 0; q < _res_constr.datalen; q++) {
15401 uint64_t _res_conv_16 = _res_vals[q];
15402 LDKChannelMonitor _res_conv_16_conv;
15403 _res_conv_16_conv.inner = untag_ptr(_res_conv_16);
15404 _res_conv_16_conv.is_owned = ptr_is_owned(_res_conv_16);
15405 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv);
15406 _res_constr.data[q] = _res_conv_16_conv;
15409 CVec_ChannelMonitorZ_free(_res_constr);
15412 uint64_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelManagerZ_new"))) TS_C2Tuple_BlockHashChannelManagerZ_new(int8_tArray a, uint64_t b) {
15413 LDKThirtyTwoBytes a_ref;
15414 CHECK(a->arr_len == 32);
15415 memcpy(a_ref.data, a->elems, 32); FREE(a);
15416 LDKChannelManager b_conv;
15417 b_conv.inner = untag_ptr(b);
15418 b_conv.is_owned = ptr_is_owned(b);
15419 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
15420 // WARNING: we need a move here but no clone is available for LDKChannelManager
15422 LDKC2Tuple_BlockHashChannelManagerZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelManagerZ), "LDKC2Tuple_BlockHashChannelManagerZ");
15423 *ret_conv = C2Tuple_BlockHashChannelManagerZ_new(a_ref, b_conv);
15424 return tag_ptr(ret_conv, true);
15427 void __attribute__((export_name("TS_C2Tuple_BlockHashChannelManagerZ_free"))) TS_C2Tuple_BlockHashChannelManagerZ_free(uint64_t _res) {
15428 if (!ptr_is_owned(_res)) return;
15429 void* _res_ptr = untag_ptr(_res);
15430 CHECK_ACCESS(_res_ptr);
15431 LDKC2Tuple_BlockHashChannelManagerZ _res_conv = *(LDKC2Tuple_BlockHashChannelManagerZ*)(_res_ptr);
15432 FREE(untag_ptr(_res));
15433 C2Tuple_BlockHashChannelManagerZ_free(_res_conv);
15436 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(uint64_t o) {
15437 void* o_ptr = untag_ptr(o);
15438 CHECK_ACCESS(o_ptr);
15439 LDKC2Tuple_BlockHashChannelManagerZ o_conv = *(LDKC2Tuple_BlockHashChannelManagerZ*)(o_ptr);
15440 // WARNING: we may need a move here but no clone is available for LDKC2Tuple_BlockHashChannelManagerZ
15441 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ");
15442 *ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_ok(o_conv);
15443 return tag_ptr(ret_conv, true);
15446 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(uint64_t e) {
15447 LDKDecodeError e_conv;
15448 e_conv.inner = untag_ptr(e);
15449 e_conv.is_owned = ptr_is_owned(e);
15450 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
15451 e_conv = DecodeError_clone(&e_conv);
15452 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ");
15453 *ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_err(e_conv);
15454 return tag_ptr(ret_conv, true);
15457 jboolean __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(uint64_t o) {
15458 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* o_conv = (LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)untag_ptr(o);
15459 jboolean ret_conv = CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_is_ok(o_conv);
15463 void __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free"))) TS_CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(uint64_t _res) {
15464 if (!ptr_is_owned(_res)) return;
15465 void* _res_ptr = untag_ptr(_res);
15466 CHECK_ACCESS(_res_ptr);
15467 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ*)(_res_ptr);
15468 FREE(untag_ptr(_res));
15469 CResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ_free(_res_conv);
15472 uint64_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_ok"))) TS_CResult_ChannelConfigDecodeErrorZ_ok(uint64_t o) {
15473 LDKChannelConfig o_conv;
15474 o_conv.inner = untag_ptr(o);
15475 o_conv.is_owned = ptr_is_owned(o);
15476 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
15477 o_conv = ChannelConfig_clone(&o_conv);
15478 LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
15479 *ret_conv = CResult_ChannelConfigDecodeErrorZ_ok(o_conv);
15480 return tag_ptr(ret_conv, true);
15483 uint64_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_err"))) TS_CResult_ChannelConfigDecodeErrorZ_err(uint64_t e) {
15484 LDKDecodeError e_conv;
15485 e_conv.inner = untag_ptr(e);
15486 e_conv.is_owned = ptr_is_owned(e);
15487 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
15488 e_conv = DecodeError_clone(&e_conv);
15489 LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
15490 *ret_conv = CResult_ChannelConfigDecodeErrorZ_err(e_conv);
15491 return tag_ptr(ret_conv, true);
15494 jboolean __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_is_ok"))) TS_CResult_ChannelConfigDecodeErrorZ_is_ok(uint64_t o) {
15495 LDKCResult_ChannelConfigDecodeErrorZ* o_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(o);
15496 jboolean ret_conv = CResult_ChannelConfigDecodeErrorZ_is_ok(o_conv);
15500 void __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_free"))) TS_CResult_ChannelConfigDecodeErrorZ_free(uint64_t _res) {
15501 if (!ptr_is_owned(_res)) return;
15502 void* _res_ptr = untag_ptr(_res);
15503 CHECK_ACCESS(_res_ptr);
15504 LDKCResult_ChannelConfigDecodeErrorZ _res_conv = *(LDKCResult_ChannelConfigDecodeErrorZ*)(_res_ptr);
15505 FREE(untag_ptr(_res));
15506 CResult_ChannelConfigDecodeErrorZ_free(_res_conv);
15509 static inline uint64_t CResult_ChannelConfigDecodeErrorZ_clone_ptr(LDKCResult_ChannelConfigDecodeErrorZ *NONNULL_PTR arg) {
15510 LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
15511 *ret_conv = CResult_ChannelConfigDecodeErrorZ_clone(arg);
15512 return tag_ptr(ret_conv, true);
15514 int64_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelConfigDecodeErrorZ_clone_ptr(uint64_t arg) {
15515 LDKCResult_ChannelConfigDecodeErrorZ* arg_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(arg);
15516 int64_t ret_conv = CResult_ChannelConfigDecodeErrorZ_clone_ptr(arg_conv);
15520 uint64_t __attribute__((export_name("TS_CResult_ChannelConfigDecodeErrorZ_clone"))) TS_CResult_ChannelConfigDecodeErrorZ_clone(uint64_t orig) {
15521 LDKCResult_ChannelConfigDecodeErrorZ* orig_conv = (LDKCResult_ChannelConfigDecodeErrorZ*)untag_ptr(orig);
15522 LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
15523 *ret_conv = CResult_ChannelConfigDecodeErrorZ_clone(orig_conv);
15524 return tag_ptr(ret_conv, true);
15527 uint64_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_ok"))) TS_CResult_OutPointDecodeErrorZ_ok(uint64_t o) {
15528 LDKOutPoint o_conv;
15529 o_conv.inner = untag_ptr(o);
15530 o_conv.is_owned = ptr_is_owned(o);
15531 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
15532 o_conv = OutPoint_clone(&o_conv);
15533 LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
15534 *ret_conv = CResult_OutPointDecodeErrorZ_ok(o_conv);
15535 return tag_ptr(ret_conv, true);
15538 uint64_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_err"))) TS_CResult_OutPointDecodeErrorZ_err(uint64_t e) {
15539 LDKDecodeError e_conv;
15540 e_conv.inner = untag_ptr(e);
15541 e_conv.is_owned = ptr_is_owned(e);
15542 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
15543 e_conv = DecodeError_clone(&e_conv);
15544 LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
15545 *ret_conv = CResult_OutPointDecodeErrorZ_err(e_conv);
15546 return tag_ptr(ret_conv, true);
15549 jboolean __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_is_ok"))) TS_CResult_OutPointDecodeErrorZ_is_ok(uint64_t o) {
15550 LDKCResult_OutPointDecodeErrorZ* o_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(o);
15551 jboolean ret_conv = CResult_OutPointDecodeErrorZ_is_ok(o_conv);
15555 void __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_free"))) TS_CResult_OutPointDecodeErrorZ_free(uint64_t _res) {
15556 if (!ptr_is_owned(_res)) return;
15557 void* _res_ptr = untag_ptr(_res);
15558 CHECK_ACCESS(_res_ptr);
15559 LDKCResult_OutPointDecodeErrorZ _res_conv = *(LDKCResult_OutPointDecodeErrorZ*)(_res_ptr);
15560 FREE(untag_ptr(_res));
15561 CResult_OutPointDecodeErrorZ_free(_res_conv);
15564 static inline uint64_t CResult_OutPointDecodeErrorZ_clone_ptr(LDKCResult_OutPointDecodeErrorZ *NONNULL_PTR arg) {
15565 LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
15566 *ret_conv = CResult_OutPointDecodeErrorZ_clone(arg);
15567 return tag_ptr(ret_conv, true);
15569 int64_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_clone_ptr"))) TS_CResult_OutPointDecodeErrorZ_clone_ptr(uint64_t arg) {
15570 LDKCResult_OutPointDecodeErrorZ* arg_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(arg);
15571 int64_t ret_conv = CResult_OutPointDecodeErrorZ_clone_ptr(arg_conv);
15575 uint64_t __attribute__((export_name("TS_CResult_OutPointDecodeErrorZ_clone"))) TS_CResult_OutPointDecodeErrorZ_clone(uint64_t orig) {
15576 LDKCResult_OutPointDecodeErrorZ* orig_conv = (LDKCResult_OutPointDecodeErrorZ*)untag_ptr(orig);
15577 LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
15578 *ret_conv = CResult_OutPointDecodeErrorZ_clone(orig_conv);
15579 return tag_ptr(ret_conv, true);
15582 uint64_t __attribute__((export_name("TS_COption_TypeZ_some"))) TS_COption_TypeZ_some(uint64_t o) {
15583 void* o_ptr = untag_ptr(o);
15584 CHECK_ACCESS(o_ptr);
15585 LDKType o_conv = *(LDKType*)(o_ptr);
15586 if (o_conv.free == LDKType_JCalls_free) {
15587 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
15588 LDKType_JCalls_cloned(&o_conv);
15590 LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
15591 *ret_copy = COption_TypeZ_some(o_conv);
15592 uint64_t ret_ref = tag_ptr(ret_copy, true);
15596 uint64_t __attribute__((export_name("TS_COption_TypeZ_none"))) TS_COption_TypeZ_none() {
15597 LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
15598 *ret_copy = COption_TypeZ_none();
15599 uint64_t ret_ref = tag_ptr(ret_copy, true);
15603 void __attribute__((export_name("TS_COption_TypeZ_free"))) TS_COption_TypeZ_free(uint64_t _res) {
15604 if (!ptr_is_owned(_res)) return;
15605 void* _res_ptr = untag_ptr(_res);
15606 CHECK_ACCESS(_res_ptr);
15607 LDKCOption_TypeZ _res_conv = *(LDKCOption_TypeZ*)(_res_ptr);
15608 FREE(untag_ptr(_res));
15609 COption_TypeZ_free(_res_conv);
15612 static inline uint64_t COption_TypeZ_clone_ptr(LDKCOption_TypeZ *NONNULL_PTR arg) {
15613 LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
15614 *ret_copy = COption_TypeZ_clone(arg);
15615 uint64_t ret_ref = tag_ptr(ret_copy, true);
15618 int64_t __attribute__((export_name("TS_COption_TypeZ_clone_ptr"))) TS_COption_TypeZ_clone_ptr(uint64_t arg) {
15619 LDKCOption_TypeZ* arg_conv = (LDKCOption_TypeZ*)untag_ptr(arg);
15620 int64_t ret_conv = COption_TypeZ_clone_ptr(arg_conv);
15624 uint64_t __attribute__((export_name("TS_COption_TypeZ_clone"))) TS_COption_TypeZ_clone(uint64_t orig) {
15625 LDKCOption_TypeZ* orig_conv = (LDKCOption_TypeZ*)untag_ptr(orig);
15626 LDKCOption_TypeZ *ret_copy = MALLOC(sizeof(LDKCOption_TypeZ), "LDKCOption_TypeZ");
15627 *ret_copy = COption_TypeZ_clone(orig_conv);
15628 uint64_t ret_ref = tag_ptr(ret_copy, true);
15632 uint64_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_ok"))) TS_CResult_COption_TypeZDecodeErrorZ_ok(uint64_t o) {
15633 void* o_ptr = untag_ptr(o);
15634 CHECK_ACCESS(o_ptr);
15635 LDKCOption_TypeZ o_conv = *(LDKCOption_TypeZ*)(o_ptr);
15636 o_conv = COption_TypeZ_clone((LDKCOption_TypeZ*)untag_ptr(o));
15637 LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
15638 *ret_conv = CResult_COption_TypeZDecodeErrorZ_ok(o_conv);
15639 return tag_ptr(ret_conv, true);
15642 uint64_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_err"))) TS_CResult_COption_TypeZDecodeErrorZ_err(uint64_t e) {
15643 LDKDecodeError e_conv;
15644 e_conv.inner = untag_ptr(e);
15645 e_conv.is_owned = ptr_is_owned(e);
15646 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
15647 e_conv = DecodeError_clone(&e_conv);
15648 LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
15649 *ret_conv = CResult_COption_TypeZDecodeErrorZ_err(e_conv);
15650 return tag_ptr(ret_conv, true);
15653 jboolean __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_is_ok"))) TS_CResult_COption_TypeZDecodeErrorZ_is_ok(uint64_t o) {
15654 LDKCResult_COption_TypeZDecodeErrorZ* o_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(o);
15655 jboolean ret_conv = CResult_COption_TypeZDecodeErrorZ_is_ok(o_conv);
15659 void __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_free"))) TS_CResult_COption_TypeZDecodeErrorZ_free(uint64_t _res) {
15660 if (!ptr_is_owned(_res)) return;
15661 void* _res_ptr = untag_ptr(_res);
15662 CHECK_ACCESS(_res_ptr);
15663 LDKCResult_COption_TypeZDecodeErrorZ _res_conv = *(LDKCResult_COption_TypeZDecodeErrorZ*)(_res_ptr);
15664 FREE(untag_ptr(_res));
15665 CResult_COption_TypeZDecodeErrorZ_free(_res_conv);
15668 static inline uint64_t CResult_COption_TypeZDecodeErrorZ_clone_ptr(LDKCResult_COption_TypeZDecodeErrorZ *NONNULL_PTR arg) {
15669 LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
15670 *ret_conv = CResult_COption_TypeZDecodeErrorZ_clone(arg);
15671 return tag_ptr(ret_conv, true);
15673 int64_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_TypeZDecodeErrorZ_clone_ptr(uint64_t arg) {
15674 LDKCResult_COption_TypeZDecodeErrorZ* arg_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(arg);
15675 int64_t ret_conv = CResult_COption_TypeZDecodeErrorZ_clone_ptr(arg_conv);
15679 uint64_t __attribute__((export_name("TS_CResult_COption_TypeZDecodeErrorZ_clone"))) TS_CResult_COption_TypeZDecodeErrorZ_clone(uint64_t orig) {
15680 LDKCResult_COption_TypeZDecodeErrorZ* orig_conv = (LDKCResult_COption_TypeZDecodeErrorZ*)untag_ptr(orig);
15681 LDKCResult_COption_TypeZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_TypeZDecodeErrorZ), "LDKCResult_COption_TypeZDecodeErrorZ");
15682 *ret_conv = CResult_COption_TypeZDecodeErrorZ_clone(orig_conv);
15683 return tag_ptr(ret_conv, true);
15686 uint64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentErrorZ_ok"))) TS_CResult_PaymentIdPaymentErrorZ_ok(int8_tArray o) {
15687 LDKThirtyTwoBytes o_ref;
15688 CHECK(o->arr_len == 32);
15689 memcpy(o_ref.data, o->elems, 32); FREE(o);
15690 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
15691 *ret_conv = CResult_PaymentIdPaymentErrorZ_ok(o_ref);
15692 return tag_ptr(ret_conv, true);
15695 uint64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentErrorZ_err"))) TS_CResult_PaymentIdPaymentErrorZ_err(uint64_t e) {
15696 void* e_ptr = untag_ptr(e);
15697 CHECK_ACCESS(e_ptr);
15698 LDKPaymentError e_conv = *(LDKPaymentError*)(e_ptr);
15699 e_conv = PaymentError_clone((LDKPaymentError*)untag_ptr(e));
15700 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
15701 *ret_conv = CResult_PaymentIdPaymentErrorZ_err(e_conv);
15702 return tag_ptr(ret_conv, true);
15705 jboolean __attribute__((export_name("TS_CResult_PaymentIdPaymentErrorZ_is_ok"))) TS_CResult_PaymentIdPaymentErrorZ_is_ok(uint64_t o) {
15706 LDKCResult_PaymentIdPaymentErrorZ* o_conv = (LDKCResult_PaymentIdPaymentErrorZ*)untag_ptr(o);
15707 jboolean ret_conv = CResult_PaymentIdPaymentErrorZ_is_ok(o_conv);
15711 void __attribute__((export_name("TS_CResult_PaymentIdPaymentErrorZ_free"))) TS_CResult_PaymentIdPaymentErrorZ_free(uint64_t _res) {
15712 if (!ptr_is_owned(_res)) return;
15713 void* _res_ptr = untag_ptr(_res);
15714 CHECK_ACCESS(_res_ptr);
15715 LDKCResult_PaymentIdPaymentErrorZ _res_conv = *(LDKCResult_PaymentIdPaymentErrorZ*)(_res_ptr);
15716 FREE(untag_ptr(_res));
15717 CResult_PaymentIdPaymentErrorZ_free(_res_conv);
15720 static inline uint64_t CResult_PaymentIdPaymentErrorZ_clone_ptr(LDKCResult_PaymentIdPaymentErrorZ *NONNULL_PTR arg) {
15721 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
15722 *ret_conv = CResult_PaymentIdPaymentErrorZ_clone(arg);
15723 return tag_ptr(ret_conv, true);
15725 int64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentErrorZ_clone_ptr"))) TS_CResult_PaymentIdPaymentErrorZ_clone_ptr(uint64_t arg) {
15726 LDKCResult_PaymentIdPaymentErrorZ* arg_conv = (LDKCResult_PaymentIdPaymentErrorZ*)untag_ptr(arg);
15727 int64_t ret_conv = CResult_PaymentIdPaymentErrorZ_clone_ptr(arg_conv);
15731 uint64_t __attribute__((export_name("TS_CResult_PaymentIdPaymentErrorZ_clone"))) TS_CResult_PaymentIdPaymentErrorZ_clone(uint64_t orig) {
15732 LDKCResult_PaymentIdPaymentErrorZ* orig_conv = (LDKCResult_PaymentIdPaymentErrorZ*)untag_ptr(orig);
15733 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
15734 *ret_conv = CResult_PaymentIdPaymentErrorZ_clone(orig_conv);
15735 return tag_ptr(ret_conv, true);
15738 uint64_t __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_ok"))) TS_CResult_SiPrefixParseErrorZ_ok(uint32_t o) {
15739 LDKSiPrefix o_conv = LDKSiPrefix_from_js(o);
15740 LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
15741 *ret_conv = CResult_SiPrefixParseErrorZ_ok(o_conv);
15742 return tag_ptr(ret_conv, true);
15745 uint64_t __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_err"))) TS_CResult_SiPrefixParseErrorZ_err(uint64_t e) {
15746 void* e_ptr = untag_ptr(e);
15747 CHECK_ACCESS(e_ptr);
15748 LDKParseError e_conv = *(LDKParseError*)(e_ptr);
15749 e_conv = ParseError_clone((LDKParseError*)untag_ptr(e));
15750 LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
15751 *ret_conv = CResult_SiPrefixParseErrorZ_err(e_conv);
15752 return tag_ptr(ret_conv, true);
15755 jboolean __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_is_ok"))) TS_CResult_SiPrefixParseErrorZ_is_ok(uint64_t o) {
15756 LDKCResult_SiPrefixParseErrorZ* o_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(o);
15757 jboolean ret_conv = CResult_SiPrefixParseErrorZ_is_ok(o_conv);
15761 void __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_free"))) TS_CResult_SiPrefixParseErrorZ_free(uint64_t _res) {
15762 if (!ptr_is_owned(_res)) return;
15763 void* _res_ptr = untag_ptr(_res);
15764 CHECK_ACCESS(_res_ptr);
15765 LDKCResult_SiPrefixParseErrorZ _res_conv = *(LDKCResult_SiPrefixParseErrorZ*)(_res_ptr);
15766 FREE(untag_ptr(_res));
15767 CResult_SiPrefixParseErrorZ_free(_res_conv);
15770 static inline uint64_t CResult_SiPrefixParseErrorZ_clone_ptr(LDKCResult_SiPrefixParseErrorZ *NONNULL_PTR arg) {
15771 LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
15772 *ret_conv = CResult_SiPrefixParseErrorZ_clone(arg);
15773 return tag_ptr(ret_conv, true);
15775 int64_t __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_clone_ptr"))) TS_CResult_SiPrefixParseErrorZ_clone_ptr(uint64_t arg) {
15776 LDKCResult_SiPrefixParseErrorZ* arg_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(arg);
15777 int64_t ret_conv = CResult_SiPrefixParseErrorZ_clone_ptr(arg_conv);
15781 uint64_t __attribute__((export_name("TS_CResult_SiPrefixParseErrorZ_clone"))) TS_CResult_SiPrefixParseErrorZ_clone(uint64_t orig) {
15782 LDKCResult_SiPrefixParseErrorZ* orig_conv = (LDKCResult_SiPrefixParseErrorZ*)untag_ptr(orig);
15783 LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
15784 *ret_conv = CResult_SiPrefixParseErrorZ_clone(orig_conv);
15785 return tag_ptr(ret_conv, true);
15788 uint64_t __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_ok"))) TS_CResult_InvoiceParseOrSemanticErrorZ_ok(uint64_t o) {
15790 o_conv.inner = untag_ptr(o);
15791 o_conv.is_owned = ptr_is_owned(o);
15792 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
15793 o_conv = Invoice_clone(&o_conv);
15794 LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
15795 *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_ok(o_conv);
15796 return tag_ptr(ret_conv, true);
15799 uint64_t __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_err"))) TS_CResult_InvoiceParseOrSemanticErrorZ_err(uint64_t e) {
15800 void* e_ptr = untag_ptr(e);
15801 CHECK_ACCESS(e_ptr);
15802 LDKParseOrSemanticError e_conv = *(LDKParseOrSemanticError*)(e_ptr);
15803 e_conv = ParseOrSemanticError_clone((LDKParseOrSemanticError*)untag_ptr(e));
15804 LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
15805 *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_err(e_conv);
15806 return tag_ptr(ret_conv, true);
15809 jboolean __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_is_ok"))) TS_CResult_InvoiceParseOrSemanticErrorZ_is_ok(uint64_t o) {
15810 LDKCResult_InvoiceParseOrSemanticErrorZ* o_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(o);
15811 jboolean ret_conv = CResult_InvoiceParseOrSemanticErrorZ_is_ok(o_conv);
15815 void __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_free"))) TS_CResult_InvoiceParseOrSemanticErrorZ_free(uint64_t _res) {
15816 if (!ptr_is_owned(_res)) return;
15817 void* _res_ptr = untag_ptr(_res);
15818 CHECK_ACCESS(_res_ptr);
15819 LDKCResult_InvoiceParseOrSemanticErrorZ _res_conv = *(LDKCResult_InvoiceParseOrSemanticErrorZ*)(_res_ptr);
15820 FREE(untag_ptr(_res));
15821 CResult_InvoiceParseOrSemanticErrorZ_free(_res_conv);
15824 static inline uint64_t CResult_InvoiceParseOrSemanticErrorZ_clone_ptr(LDKCResult_InvoiceParseOrSemanticErrorZ *NONNULL_PTR arg) {
15825 LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
15826 *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone(arg);
15827 return tag_ptr(ret_conv, true);
15829 int64_t __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_clone_ptr"))) TS_CResult_InvoiceParseOrSemanticErrorZ_clone_ptr(uint64_t arg) {
15830 LDKCResult_InvoiceParseOrSemanticErrorZ* arg_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(arg);
15831 int64_t ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone_ptr(arg_conv);
15835 uint64_t __attribute__((export_name("TS_CResult_InvoiceParseOrSemanticErrorZ_clone"))) TS_CResult_InvoiceParseOrSemanticErrorZ_clone(uint64_t orig) {
15836 LDKCResult_InvoiceParseOrSemanticErrorZ* orig_conv = (LDKCResult_InvoiceParseOrSemanticErrorZ*)untag_ptr(orig);
15837 LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
15838 *ret_conv = CResult_InvoiceParseOrSemanticErrorZ_clone(orig_conv);
15839 return tag_ptr(ret_conv, true);
15842 uint64_t __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_ok"))) TS_CResult_SignedRawInvoiceParseErrorZ_ok(uint64_t o) {
15843 LDKSignedRawInvoice o_conv;
15844 o_conv.inner = untag_ptr(o);
15845 o_conv.is_owned = ptr_is_owned(o);
15846 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
15847 o_conv = SignedRawInvoice_clone(&o_conv);
15848 LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
15849 *ret_conv = CResult_SignedRawInvoiceParseErrorZ_ok(o_conv);
15850 return tag_ptr(ret_conv, true);
15853 uint64_t __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_err"))) TS_CResult_SignedRawInvoiceParseErrorZ_err(uint64_t e) {
15854 void* e_ptr = untag_ptr(e);
15855 CHECK_ACCESS(e_ptr);
15856 LDKParseError e_conv = *(LDKParseError*)(e_ptr);
15857 e_conv = ParseError_clone((LDKParseError*)untag_ptr(e));
15858 LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
15859 *ret_conv = CResult_SignedRawInvoiceParseErrorZ_err(e_conv);
15860 return tag_ptr(ret_conv, true);
15863 jboolean __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_is_ok"))) TS_CResult_SignedRawInvoiceParseErrorZ_is_ok(uint64_t o) {
15864 LDKCResult_SignedRawInvoiceParseErrorZ* o_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(o);
15865 jboolean ret_conv = CResult_SignedRawInvoiceParseErrorZ_is_ok(o_conv);
15869 void __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_free"))) TS_CResult_SignedRawInvoiceParseErrorZ_free(uint64_t _res) {
15870 if (!ptr_is_owned(_res)) return;
15871 void* _res_ptr = untag_ptr(_res);
15872 CHECK_ACCESS(_res_ptr);
15873 LDKCResult_SignedRawInvoiceParseErrorZ _res_conv = *(LDKCResult_SignedRawInvoiceParseErrorZ*)(_res_ptr);
15874 FREE(untag_ptr(_res));
15875 CResult_SignedRawInvoiceParseErrorZ_free(_res_conv);
15878 static inline uint64_t CResult_SignedRawInvoiceParseErrorZ_clone_ptr(LDKCResult_SignedRawInvoiceParseErrorZ *NONNULL_PTR arg) {
15879 LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
15880 *ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone(arg);
15881 return tag_ptr(ret_conv, true);
15883 int64_t __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_clone_ptr"))) TS_CResult_SignedRawInvoiceParseErrorZ_clone_ptr(uint64_t arg) {
15884 LDKCResult_SignedRawInvoiceParseErrorZ* arg_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(arg);
15885 int64_t ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone_ptr(arg_conv);
15889 uint64_t __attribute__((export_name("TS_CResult_SignedRawInvoiceParseErrorZ_clone"))) TS_CResult_SignedRawInvoiceParseErrorZ_clone(uint64_t orig) {
15890 LDKCResult_SignedRawInvoiceParseErrorZ* orig_conv = (LDKCResult_SignedRawInvoiceParseErrorZ*)untag_ptr(orig);
15891 LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
15892 *ret_conv = CResult_SignedRawInvoiceParseErrorZ_clone(orig_conv);
15893 return tag_ptr(ret_conv, true);
15896 static inline uint64_t C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ *NONNULL_PTR arg) {
15897 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
15898 *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(arg);
15899 return tag_ptr(ret_conv, true);
15901 int64_t __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(uint64_t arg) {
15902 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* arg_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(arg);
15903 int64_t ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone_ptr(arg_conv);
15907 uint64_t __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(uint64_t orig) {
15908 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* orig_conv = (LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)untag_ptr(orig);
15909 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
15910 *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_clone(orig_conv);
15911 return tag_ptr(ret_conv, true);
15914 uint64_t __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_new"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(uint64_t a, int8_tArray b, uint64_t c) {
15915 LDKRawInvoice a_conv;
15916 a_conv.inner = untag_ptr(a);
15917 a_conv.is_owned = ptr_is_owned(a);
15918 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
15919 a_conv = RawInvoice_clone(&a_conv);
15920 LDKThirtyTwoBytes b_ref;
15921 CHECK(b->arr_len == 32);
15922 memcpy(b_ref.data, b->elems, 32); FREE(b);
15923 LDKInvoiceSignature c_conv;
15924 c_conv.inner = untag_ptr(c);
15925 c_conv.is_owned = ptr_is_owned(c);
15926 CHECK_INNER_FIELD_ACCESS_OR_NULL(c_conv);
15927 c_conv = InvoiceSignature_clone(&c_conv);
15928 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
15929 *ret_conv = C3Tuple_RawInvoice_u832InvoiceSignatureZ_new(a_conv, b_ref, c_conv);
15930 return tag_ptr(ret_conv, true);
15933 void __attribute__((export_name("TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_free"))) TS_C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(uint64_t _res) {
15934 if (!ptr_is_owned(_res)) return;
15935 void* _res_ptr = untag_ptr(_res);
15936 CHECK_ACCESS(_res_ptr);
15937 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ _res_conv = *(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ*)(_res_ptr);
15938 FREE(untag_ptr(_res));
15939 C3Tuple_RawInvoice_u832InvoiceSignatureZ_free(_res_conv);
15942 uint64_t __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_ok"))) TS_CResult_PayeePubKeyErrorZ_ok(uint64_t o) {
15943 LDKPayeePubKey o_conv;
15944 o_conv.inner = untag_ptr(o);
15945 o_conv.is_owned = ptr_is_owned(o);
15946 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
15947 o_conv = PayeePubKey_clone(&o_conv);
15948 LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
15949 *ret_conv = CResult_PayeePubKeyErrorZ_ok(o_conv);
15950 return tag_ptr(ret_conv, true);
15953 uint64_t __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_err"))) TS_CResult_PayeePubKeyErrorZ_err(uint32_t e) {
15954 LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_js(e);
15955 LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
15956 *ret_conv = CResult_PayeePubKeyErrorZ_err(e_conv);
15957 return tag_ptr(ret_conv, true);
15960 jboolean __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_is_ok"))) TS_CResult_PayeePubKeyErrorZ_is_ok(uint64_t o) {
15961 LDKCResult_PayeePubKeyErrorZ* o_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(o);
15962 jboolean ret_conv = CResult_PayeePubKeyErrorZ_is_ok(o_conv);
15966 void __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_free"))) TS_CResult_PayeePubKeyErrorZ_free(uint64_t _res) {
15967 if (!ptr_is_owned(_res)) return;
15968 void* _res_ptr = untag_ptr(_res);
15969 CHECK_ACCESS(_res_ptr);
15970 LDKCResult_PayeePubKeyErrorZ _res_conv = *(LDKCResult_PayeePubKeyErrorZ*)(_res_ptr);
15971 FREE(untag_ptr(_res));
15972 CResult_PayeePubKeyErrorZ_free(_res_conv);
15975 static inline uint64_t CResult_PayeePubKeyErrorZ_clone_ptr(LDKCResult_PayeePubKeyErrorZ *NONNULL_PTR arg) {
15976 LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
15977 *ret_conv = CResult_PayeePubKeyErrorZ_clone(arg);
15978 return tag_ptr(ret_conv, true);
15980 int64_t __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_clone_ptr"))) TS_CResult_PayeePubKeyErrorZ_clone_ptr(uint64_t arg) {
15981 LDKCResult_PayeePubKeyErrorZ* arg_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(arg);
15982 int64_t ret_conv = CResult_PayeePubKeyErrorZ_clone_ptr(arg_conv);
15986 uint64_t __attribute__((export_name("TS_CResult_PayeePubKeyErrorZ_clone"))) TS_CResult_PayeePubKeyErrorZ_clone(uint64_t orig) {
15987 LDKCResult_PayeePubKeyErrorZ* orig_conv = (LDKCResult_PayeePubKeyErrorZ*)untag_ptr(orig);
15988 LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
15989 *ret_conv = CResult_PayeePubKeyErrorZ_clone(orig_conv);
15990 return tag_ptr(ret_conv, true);
15993 void __attribute__((export_name("TS_CVec_PrivateRouteZ_free"))) TS_CVec_PrivateRouteZ_free(uint64_tArray _res) {
15994 LDKCVec_PrivateRouteZ _res_constr;
15995 _res_constr.datalen = _res->arr_len;
15996 if (_res_constr.datalen > 0)
15997 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKPrivateRoute), "LDKCVec_PrivateRouteZ Elements");
15999 _res_constr.data = NULL;
16000 uint64_t* _res_vals = _res->elems;
16001 for (size_t o = 0; o < _res_constr.datalen; o++) {
16002 uint64_t _res_conv_14 = _res_vals[o];
16003 LDKPrivateRoute _res_conv_14_conv;
16004 _res_conv_14_conv.inner = untag_ptr(_res_conv_14);
16005 _res_conv_14_conv.is_owned = ptr_is_owned(_res_conv_14);
16006 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_14_conv);
16007 _res_constr.data[o] = _res_conv_14_conv;
16010 CVec_PrivateRouteZ_free(_res_constr);
16013 uint64_t __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_ok"))) TS_CResult_PositiveTimestampCreationErrorZ_ok(uint64_t o) {
16014 LDKPositiveTimestamp o_conv;
16015 o_conv.inner = untag_ptr(o);
16016 o_conv.is_owned = ptr_is_owned(o);
16017 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16018 o_conv = PositiveTimestamp_clone(&o_conv);
16019 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
16020 *ret_conv = CResult_PositiveTimestampCreationErrorZ_ok(o_conv);
16021 return tag_ptr(ret_conv, true);
16024 uint64_t __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_err"))) TS_CResult_PositiveTimestampCreationErrorZ_err(uint32_t e) {
16025 LDKCreationError e_conv = LDKCreationError_from_js(e);
16026 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
16027 *ret_conv = CResult_PositiveTimestampCreationErrorZ_err(e_conv);
16028 return tag_ptr(ret_conv, true);
16031 jboolean __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_is_ok"))) TS_CResult_PositiveTimestampCreationErrorZ_is_ok(uint64_t o) {
16032 LDKCResult_PositiveTimestampCreationErrorZ* o_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(o);
16033 jboolean ret_conv = CResult_PositiveTimestampCreationErrorZ_is_ok(o_conv);
16037 void __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_free"))) TS_CResult_PositiveTimestampCreationErrorZ_free(uint64_t _res) {
16038 if (!ptr_is_owned(_res)) return;
16039 void* _res_ptr = untag_ptr(_res);
16040 CHECK_ACCESS(_res_ptr);
16041 LDKCResult_PositiveTimestampCreationErrorZ _res_conv = *(LDKCResult_PositiveTimestampCreationErrorZ*)(_res_ptr);
16042 FREE(untag_ptr(_res));
16043 CResult_PositiveTimestampCreationErrorZ_free(_res_conv);
16046 static inline uint64_t CResult_PositiveTimestampCreationErrorZ_clone_ptr(LDKCResult_PositiveTimestampCreationErrorZ *NONNULL_PTR arg) {
16047 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
16048 *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(arg);
16049 return tag_ptr(ret_conv, true);
16051 int64_t __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_clone_ptr"))) TS_CResult_PositiveTimestampCreationErrorZ_clone_ptr(uint64_t arg) {
16052 LDKCResult_PositiveTimestampCreationErrorZ* arg_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(arg);
16053 int64_t ret_conv = CResult_PositiveTimestampCreationErrorZ_clone_ptr(arg_conv);
16057 uint64_t __attribute__((export_name("TS_CResult_PositiveTimestampCreationErrorZ_clone"))) TS_CResult_PositiveTimestampCreationErrorZ_clone(uint64_t orig) {
16058 LDKCResult_PositiveTimestampCreationErrorZ* orig_conv = (LDKCResult_PositiveTimestampCreationErrorZ*)untag_ptr(orig);
16059 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
16060 *ret_conv = CResult_PositiveTimestampCreationErrorZ_clone(orig_conv);
16061 return tag_ptr(ret_conv, true);
16064 uint64_t __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_ok"))) TS_CResult_NoneSemanticErrorZ_ok() {
16065 LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
16066 *ret_conv = CResult_NoneSemanticErrorZ_ok();
16067 return tag_ptr(ret_conv, true);
16070 uint64_t __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_err"))) TS_CResult_NoneSemanticErrorZ_err(uint32_t e) {
16071 LDKSemanticError e_conv = LDKSemanticError_from_js(e);
16072 LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
16073 *ret_conv = CResult_NoneSemanticErrorZ_err(e_conv);
16074 return tag_ptr(ret_conv, true);
16077 jboolean __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_is_ok"))) TS_CResult_NoneSemanticErrorZ_is_ok(uint64_t o) {
16078 LDKCResult_NoneSemanticErrorZ* o_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(o);
16079 jboolean ret_conv = CResult_NoneSemanticErrorZ_is_ok(o_conv);
16083 void __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_free"))) TS_CResult_NoneSemanticErrorZ_free(uint64_t _res) {
16084 if (!ptr_is_owned(_res)) return;
16085 void* _res_ptr = untag_ptr(_res);
16086 CHECK_ACCESS(_res_ptr);
16087 LDKCResult_NoneSemanticErrorZ _res_conv = *(LDKCResult_NoneSemanticErrorZ*)(_res_ptr);
16088 FREE(untag_ptr(_res));
16089 CResult_NoneSemanticErrorZ_free(_res_conv);
16092 static inline uint64_t CResult_NoneSemanticErrorZ_clone_ptr(LDKCResult_NoneSemanticErrorZ *NONNULL_PTR arg) {
16093 LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
16094 *ret_conv = CResult_NoneSemanticErrorZ_clone(arg);
16095 return tag_ptr(ret_conv, true);
16097 int64_t __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_clone_ptr"))) TS_CResult_NoneSemanticErrorZ_clone_ptr(uint64_t arg) {
16098 LDKCResult_NoneSemanticErrorZ* arg_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(arg);
16099 int64_t ret_conv = CResult_NoneSemanticErrorZ_clone_ptr(arg_conv);
16103 uint64_t __attribute__((export_name("TS_CResult_NoneSemanticErrorZ_clone"))) TS_CResult_NoneSemanticErrorZ_clone(uint64_t orig) {
16104 LDKCResult_NoneSemanticErrorZ* orig_conv = (LDKCResult_NoneSemanticErrorZ*)untag_ptr(orig);
16105 LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
16106 *ret_conv = CResult_NoneSemanticErrorZ_clone(orig_conv);
16107 return tag_ptr(ret_conv, true);
16110 uint64_t __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_ok"))) TS_CResult_InvoiceSemanticErrorZ_ok(uint64_t o) {
16112 o_conv.inner = untag_ptr(o);
16113 o_conv.is_owned = ptr_is_owned(o);
16114 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16115 o_conv = Invoice_clone(&o_conv);
16116 LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
16117 *ret_conv = CResult_InvoiceSemanticErrorZ_ok(o_conv);
16118 return tag_ptr(ret_conv, true);
16121 uint64_t __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_err"))) TS_CResult_InvoiceSemanticErrorZ_err(uint32_t e) {
16122 LDKSemanticError e_conv = LDKSemanticError_from_js(e);
16123 LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
16124 *ret_conv = CResult_InvoiceSemanticErrorZ_err(e_conv);
16125 return tag_ptr(ret_conv, true);
16128 jboolean __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_is_ok"))) TS_CResult_InvoiceSemanticErrorZ_is_ok(uint64_t o) {
16129 LDKCResult_InvoiceSemanticErrorZ* o_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(o);
16130 jboolean ret_conv = CResult_InvoiceSemanticErrorZ_is_ok(o_conv);
16134 void __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_free"))) TS_CResult_InvoiceSemanticErrorZ_free(uint64_t _res) {
16135 if (!ptr_is_owned(_res)) return;
16136 void* _res_ptr = untag_ptr(_res);
16137 CHECK_ACCESS(_res_ptr);
16138 LDKCResult_InvoiceSemanticErrorZ _res_conv = *(LDKCResult_InvoiceSemanticErrorZ*)(_res_ptr);
16139 FREE(untag_ptr(_res));
16140 CResult_InvoiceSemanticErrorZ_free(_res_conv);
16143 static inline uint64_t CResult_InvoiceSemanticErrorZ_clone_ptr(LDKCResult_InvoiceSemanticErrorZ *NONNULL_PTR arg) {
16144 LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
16145 *ret_conv = CResult_InvoiceSemanticErrorZ_clone(arg);
16146 return tag_ptr(ret_conv, true);
16148 int64_t __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_clone_ptr"))) TS_CResult_InvoiceSemanticErrorZ_clone_ptr(uint64_t arg) {
16149 LDKCResult_InvoiceSemanticErrorZ* arg_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(arg);
16150 int64_t ret_conv = CResult_InvoiceSemanticErrorZ_clone_ptr(arg_conv);
16154 uint64_t __attribute__((export_name("TS_CResult_InvoiceSemanticErrorZ_clone"))) TS_CResult_InvoiceSemanticErrorZ_clone(uint64_t orig) {
16155 LDKCResult_InvoiceSemanticErrorZ* orig_conv = (LDKCResult_InvoiceSemanticErrorZ*)untag_ptr(orig);
16156 LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
16157 *ret_conv = CResult_InvoiceSemanticErrorZ_clone(orig_conv);
16158 return tag_ptr(ret_conv, true);
16161 uint64_t __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_ok"))) TS_CResult_DescriptionCreationErrorZ_ok(uint64_t o) {
16162 LDKDescription o_conv;
16163 o_conv.inner = untag_ptr(o);
16164 o_conv.is_owned = ptr_is_owned(o);
16165 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16166 o_conv = Description_clone(&o_conv);
16167 LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
16168 *ret_conv = CResult_DescriptionCreationErrorZ_ok(o_conv);
16169 return tag_ptr(ret_conv, true);
16172 uint64_t __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_err"))) TS_CResult_DescriptionCreationErrorZ_err(uint32_t e) {
16173 LDKCreationError e_conv = LDKCreationError_from_js(e);
16174 LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
16175 *ret_conv = CResult_DescriptionCreationErrorZ_err(e_conv);
16176 return tag_ptr(ret_conv, true);
16179 jboolean __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_is_ok"))) TS_CResult_DescriptionCreationErrorZ_is_ok(uint64_t o) {
16180 LDKCResult_DescriptionCreationErrorZ* o_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(o);
16181 jboolean ret_conv = CResult_DescriptionCreationErrorZ_is_ok(o_conv);
16185 void __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_free"))) TS_CResult_DescriptionCreationErrorZ_free(uint64_t _res) {
16186 if (!ptr_is_owned(_res)) return;
16187 void* _res_ptr = untag_ptr(_res);
16188 CHECK_ACCESS(_res_ptr);
16189 LDKCResult_DescriptionCreationErrorZ _res_conv = *(LDKCResult_DescriptionCreationErrorZ*)(_res_ptr);
16190 FREE(untag_ptr(_res));
16191 CResult_DescriptionCreationErrorZ_free(_res_conv);
16194 static inline uint64_t CResult_DescriptionCreationErrorZ_clone_ptr(LDKCResult_DescriptionCreationErrorZ *NONNULL_PTR arg) {
16195 LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
16196 *ret_conv = CResult_DescriptionCreationErrorZ_clone(arg);
16197 return tag_ptr(ret_conv, true);
16199 int64_t __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_clone_ptr"))) TS_CResult_DescriptionCreationErrorZ_clone_ptr(uint64_t arg) {
16200 LDKCResult_DescriptionCreationErrorZ* arg_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(arg);
16201 int64_t ret_conv = CResult_DescriptionCreationErrorZ_clone_ptr(arg_conv);
16205 uint64_t __attribute__((export_name("TS_CResult_DescriptionCreationErrorZ_clone"))) TS_CResult_DescriptionCreationErrorZ_clone(uint64_t orig) {
16206 LDKCResult_DescriptionCreationErrorZ* orig_conv = (LDKCResult_DescriptionCreationErrorZ*)untag_ptr(orig);
16207 LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
16208 *ret_conv = CResult_DescriptionCreationErrorZ_clone(orig_conv);
16209 return tag_ptr(ret_conv, true);
16212 uint64_t __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_ok"))) TS_CResult_PrivateRouteCreationErrorZ_ok(uint64_t o) {
16213 LDKPrivateRoute o_conv;
16214 o_conv.inner = untag_ptr(o);
16215 o_conv.is_owned = ptr_is_owned(o);
16216 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16217 o_conv = PrivateRoute_clone(&o_conv);
16218 LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
16219 *ret_conv = CResult_PrivateRouteCreationErrorZ_ok(o_conv);
16220 return tag_ptr(ret_conv, true);
16223 uint64_t __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_err"))) TS_CResult_PrivateRouteCreationErrorZ_err(uint32_t e) {
16224 LDKCreationError e_conv = LDKCreationError_from_js(e);
16225 LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
16226 *ret_conv = CResult_PrivateRouteCreationErrorZ_err(e_conv);
16227 return tag_ptr(ret_conv, true);
16230 jboolean __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_is_ok"))) TS_CResult_PrivateRouteCreationErrorZ_is_ok(uint64_t o) {
16231 LDKCResult_PrivateRouteCreationErrorZ* o_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(o);
16232 jboolean ret_conv = CResult_PrivateRouteCreationErrorZ_is_ok(o_conv);
16236 void __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_free"))) TS_CResult_PrivateRouteCreationErrorZ_free(uint64_t _res) {
16237 if (!ptr_is_owned(_res)) return;
16238 void* _res_ptr = untag_ptr(_res);
16239 CHECK_ACCESS(_res_ptr);
16240 LDKCResult_PrivateRouteCreationErrorZ _res_conv = *(LDKCResult_PrivateRouteCreationErrorZ*)(_res_ptr);
16241 FREE(untag_ptr(_res));
16242 CResult_PrivateRouteCreationErrorZ_free(_res_conv);
16245 static inline uint64_t CResult_PrivateRouteCreationErrorZ_clone_ptr(LDKCResult_PrivateRouteCreationErrorZ *NONNULL_PTR arg) {
16246 LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
16247 *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(arg);
16248 return tag_ptr(ret_conv, true);
16250 int64_t __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_clone_ptr"))) TS_CResult_PrivateRouteCreationErrorZ_clone_ptr(uint64_t arg) {
16251 LDKCResult_PrivateRouteCreationErrorZ* arg_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(arg);
16252 int64_t ret_conv = CResult_PrivateRouteCreationErrorZ_clone_ptr(arg_conv);
16256 uint64_t __attribute__((export_name("TS_CResult_PrivateRouteCreationErrorZ_clone"))) TS_CResult_PrivateRouteCreationErrorZ_clone(uint64_t orig) {
16257 LDKCResult_PrivateRouteCreationErrorZ* orig_conv = (LDKCResult_PrivateRouteCreationErrorZ*)untag_ptr(orig);
16258 LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
16259 *ret_conv = CResult_PrivateRouteCreationErrorZ_clone(orig_conv);
16260 return tag_ptr(ret_conv, true);
16263 uint64_t __attribute__((export_name("TS_CResult_StringErrorZ_ok"))) TS_CResult_StringErrorZ_ok(jstring o) {
16264 LDKStr o_conv = str_ref_to_owned_c(o);
16265 LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
16266 *ret_conv = CResult_StringErrorZ_ok(o_conv);
16267 return tag_ptr(ret_conv, true);
16270 uint64_t __attribute__((export_name("TS_CResult_StringErrorZ_err"))) TS_CResult_StringErrorZ_err(uint32_t e) {
16271 LDKSecp256k1Error e_conv = LDKSecp256k1Error_from_js(e);
16272 LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
16273 *ret_conv = CResult_StringErrorZ_err(e_conv);
16274 return tag_ptr(ret_conv, true);
16277 jboolean __attribute__((export_name("TS_CResult_StringErrorZ_is_ok"))) TS_CResult_StringErrorZ_is_ok(uint64_t o) {
16278 LDKCResult_StringErrorZ* o_conv = (LDKCResult_StringErrorZ*)untag_ptr(o);
16279 jboolean ret_conv = CResult_StringErrorZ_is_ok(o_conv);
16283 void __attribute__((export_name("TS_CResult_StringErrorZ_free"))) TS_CResult_StringErrorZ_free(uint64_t _res) {
16284 if (!ptr_is_owned(_res)) return;
16285 void* _res_ptr = untag_ptr(_res);
16286 CHECK_ACCESS(_res_ptr);
16287 LDKCResult_StringErrorZ _res_conv = *(LDKCResult_StringErrorZ*)(_res_ptr);
16288 FREE(untag_ptr(_res));
16289 CResult_StringErrorZ_free(_res_conv);
16292 static inline uint64_t CResult_StringErrorZ_clone_ptr(LDKCResult_StringErrorZ *NONNULL_PTR arg) {
16293 LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
16294 *ret_conv = CResult_StringErrorZ_clone(arg);
16295 return tag_ptr(ret_conv, true);
16297 int64_t __attribute__((export_name("TS_CResult_StringErrorZ_clone_ptr"))) TS_CResult_StringErrorZ_clone_ptr(uint64_t arg) {
16298 LDKCResult_StringErrorZ* arg_conv = (LDKCResult_StringErrorZ*)untag_ptr(arg);
16299 int64_t ret_conv = CResult_StringErrorZ_clone_ptr(arg_conv);
16303 uint64_t __attribute__((export_name("TS_CResult_StringErrorZ_clone"))) TS_CResult_StringErrorZ_clone(uint64_t orig) {
16304 LDKCResult_StringErrorZ* orig_conv = (LDKCResult_StringErrorZ*)untag_ptr(orig);
16305 LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
16306 *ret_conv = CResult_StringErrorZ_clone(orig_conv);
16307 return tag_ptr(ret_conv, true);
16310 uint64_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_ok"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_ok(uint64_t o) {
16311 LDKChannelMonitorUpdate o_conv;
16312 o_conv.inner = untag_ptr(o);
16313 o_conv.is_owned = ptr_is_owned(o);
16314 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16315 o_conv = ChannelMonitorUpdate_clone(&o_conv);
16316 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
16317 *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_ok(o_conv);
16318 return tag_ptr(ret_conv, true);
16321 uint64_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_err"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_err(uint64_t e) {
16322 LDKDecodeError e_conv;
16323 e_conv.inner = untag_ptr(e);
16324 e_conv.is_owned = ptr_is_owned(e);
16325 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
16326 e_conv = DecodeError_clone(&e_conv);
16327 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
16328 *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_err(e_conv);
16329 return tag_ptr(ret_conv, true);
16332 jboolean __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(uint64_t o) {
16333 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* o_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(o);
16334 jboolean ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_is_ok(o_conv);
16338 void __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_free"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_free(uint64_t _res) {
16339 if (!ptr_is_owned(_res)) return;
16340 void* _res_ptr = untag_ptr(_res);
16341 CHECK_ACCESS(_res_ptr);
16342 LDKCResult_ChannelMonitorUpdateDecodeErrorZ _res_conv = *(LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)(_res_ptr);
16343 FREE(untag_ptr(_res));
16344 CResult_ChannelMonitorUpdateDecodeErrorZ_free(_res_conv);
16347 static inline uint64_t CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(LDKCResult_ChannelMonitorUpdateDecodeErrorZ *NONNULL_PTR arg) {
16348 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
16349 *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone(arg);
16350 return tag_ptr(ret_conv, true);
16352 int64_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(uint64_t arg) {
16353 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* arg_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(arg);
16354 int64_t ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone_ptr(arg_conv);
16358 uint64_t __attribute__((export_name("TS_CResult_ChannelMonitorUpdateDecodeErrorZ_clone"))) TS_CResult_ChannelMonitorUpdateDecodeErrorZ_clone(uint64_t orig) {
16359 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* orig_conv = (LDKCResult_ChannelMonitorUpdateDecodeErrorZ*)untag_ptr(orig);
16360 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
16361 *ret_conv = CResult_ChannelMonitorUpdateDecodeErrorZ_clone(orig_conv);
16362 return tag_ptr(ret_conv, true);
16365 uint64_t __attribute__((export_name("TS_COption_MonitorEventZ_some"))) TS_COption_MonitorEventZ_some(uint64_t o) {
16366 void* o_ptr = untag_ptr(o);
16367 CHECK_ACCESS(o_ptr);
16368 LDKMonitorEvent o_conv = *(LDKMonitorEvent*)(o_ptr);
16369 o_conv = MonitorEvent_clone((LDKMonitorEvent*)untag_ptr(o));
16370 LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
16371 *ret_copy = COption_MonitorEventZ_some(o_conv);
16372 uint64_t ret_ref = tag_ptr(ret_copy, true);
16376 uint64_t __attribute__((export_name("TS_COption_MonitorEventZ_none"))) TS_COption_MonitorEventZ_none() {
16377 LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
16378 *ret_copy = COption_MonitorEventZ_none();
16379 uint64_t ret_ref = tag_ptr(ret_copy, true);
16383 void __attribute__((export_name("TS_COption_MonitorEventZ_free"))) TS_COption_MonitorEventZ_free(uint64_t _res) {
16384 if (!ptr_is_owned(_res)) return;
16385 void* _res_ptr = untag_ptr(_res);
16386 CHECK_ACCESS(_res_ptr);
16387 LDKCOption_MonitorEventZ _res_conv = *(LDKCOption_MonitorEventZ*)(_res_ptr);
16388 FREE(untag_ptr(_res));
16389 COption_MonitorEventZ_free(_res_conv);
16392 static inline uint64_t COption_MonitorEventZ_clone_ptr(LDKCOption_MonitorEventZ *NONNULL_PTR arg) {
16393 LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
16394 *ret_copy = COption_MonitorEventZ_clone(arg);
16395 uint64_t ret_ref = tag_ptr(ret_copy, true);
16398 int64_t __attribute__((export_name("TS_COption_MonitorEventZ_clone_ptr"))) TS_COption_MonitorEventZ_clone_ptr(uint64_t arg) {
16399 LDKCOption_MonitorEventZ* arg_conv = (LDKCOption_MonitorEventZ*)untag_ptr(arg);
16400 int64_t ret_conv = COption_MonitorEventZ_clone_ptr(arg_conv);
16404 uint64_t __attribute__((export_name("TS_COption_MonitorEventZ_clone"))) TS_COption_MonitorEventZ_clone(uint64_t orig) {
16405 LDKCOption_MonitorEventZ* orig_conv = (LDKCOption_MonitorEventZ*)untag_ptr(orig);
16406 LDKCOption_MonitorEventZ *ret_copy = MALLOC(sizeof(LDKCOption_MonitorEventZ), "LDKCOption_MonitorEventZ");
16407 *ret_copy = COption_MonitorEventZ_clone(orig_conv);
16408 uint64_t ret_ref = tag_ptr(ret_copy, true);
16412 uint64_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_ok"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_ok(uint64_t o) {
16413 void* o_ptr = untag_ptr(o);
16414 CHECK_ACCESS(o_ptr);
16415 LDKCOption_MonitorEventZ o_conv = *(LDKCOption_MonitorEventZ*)(o_ptr);
16416 o_conv = COption_MonitorEventZ_clone((LDKCOption_MonitorEventZ*)untag_ptr(o));
16417 LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
16418 *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_ok(o_conv);
16419 return tag_ptr(ret_conv, true);
16422 uint64_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_err"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_err(uint64_t e) {
16423 LDKDecodeError e_conv;
16424 e_conv.inner = untag_ptr(e);
16425 e_conv.is_owned = ptr_is_owned(e);
16426 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
16427 e_conv = DecodeError_clone(&e_conv);
16428 LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
16429 *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_err(e_conv);
16430 return tag_ptr(ret_conv, true);
16433 jboolean __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_is_ok"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_is_ok(uint64_t o) {
16434 LDKCResult_COption_MonitorEventZDecodeErrorZ* o_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(o);
16435 jboolean ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_is_ok(o_conv);
16439 void __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_free"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_free(uint64_t _res) {
16440 if (!ptr_is_owned(_res)) return;
16441 void* _res_ptr = untag_ptr(_res);
16442 CHECK_ACCESS(_res_ptr);
16443 LDKCResult_COption_MonitorEventZDecodeErrorZ _res_conv = *(LDKCResult_COption_MonitorEventZDecodeErrorZ*)(_res_ptr);
16444 FREE(untag_ptr(_res));
16445 CResult_COption_MonitorEventZDecodeErrorZ_free(_res_conv);
16448 static inline uint64_t CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(LDKCResult_COption_MonitorEventZDecodeErrorZ *NONNULL_PTR arg) {
16449 LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
16450 *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone(arg);
16451 return tag_ptr(ret_conv, true);
16453 int64_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(uint64_t arg) {
16454 LDKCResult_COption_MonitorEventZDecodeErrorZ* arg_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(arg);
16455 int64_t ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone_ptr(arg_conv);
16459 uint64_t __attribute__((export_name("TS_CResult_COption_MonitorEventZDecodeErrorZ_clone"))) TS_CResult_COption_MonitorEventZDecodeErrorZ_clone(uint64_t orig) {
16460 LDKCResult_COption_MonitorEventZDecodeErrorZ* orig_conv = (LDKCResult_COption_MonitorEventZDecodeErrorZ*)untag_ptr(orig);
16461 LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
16462 *ret_conv = CResult_COption_MonitorEventZDecodeErrorZ_clone(orig_conv);
16463 return tag_ptr(ret_conv, true);
16466 uint64_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_ok"))) TS_CResult_HTLCUpdateDecodeErrorZ_ok(uint64_t o) {
16467 LDKHTLCUpdate o_conv;
16468 o_conv.inner = untag_ptr(o);
16469 o_conv.is_owned = ptr_is_owned(o);
16470 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
16471 o_conv = HTLCUpdate_clone(&o_conv);
16472 LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
16473 *ret_conv = CResult_HTLCUpdateDecodeErrorZ_ok(o_conv);
16474 return tag_ptr(ret_conv, true);
16477 uint64_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_err"))) TS_CResult_HTLCUpdateDecodeErrorZ_err(uint64_t e) {
16478 LDKDecodeError e_conv;
16479 e_conv.inner = untag_ptr(e);
16480 e_conv.is_owned = ptr_is_owned(e);
16481 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
16482 e_conv = DecodeError_clone(&e_conv);
16483 LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
16484 *ret_conv = CResult_HTLCUpdateDecodeErrorZ_err(e_conv);
16485 return tag_ptr(ret_conv, true);
16488 jboolean __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_is_ok"))) TS_CResult_HTLCUpdateDecodeErrorZ_is_ok(uint64_t o) {
16489 LDKCResult_HTLCUpdateDecodeErrorZ* o_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(o);
16490 jboolean ret_conv = CResult_HTLCUpdateDecodeErrorZ_is_ok(o_conv);
16494 void __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_free"))) TS_CResult_HTLCUpdateDecodeErrorZ_free(uint64_t _res) {
16495 if (!ptr_is_owned(_res)) return;
16496 void* _res_ptr = untag_ptr(_res);
16497 CHECK_ACCESS(_res_ptr);
16498 LDKCResult_HTLCUpdateDecodeErrorZ _res_conv = *(LDKCResult_HTLCUpdateDecodeErrorZ*)(_res_ptr);
16499 FREE(untag_ptr(_res));
16500 CResult_HTLCUpdateDecodeErrorZ_free(_res_conv);
16503 static inline uint64_t CResult_HTLCUpdateDecodeErrorZ_clone_ptr(LDKCResult_HTLCUpdateDecodeErrorZ *NONNULL_PTR arg) {
16504 LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
16505 *ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone(arg);
16506 return tag_ptr(ret_conv, true);
16508 int64_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_clone_ptr"))) TS_CResult_HTLCUpdateDecodeErrorZ_clone_ptr(uint64_t arg) {
16509 LDKCResult_HTLCUpdateDecodeErrorZ* arg_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(arg);
16510 int64_t ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone_ptr(arg_conv);
16514 uint64_t __attribute__((export_name("TS_CResult_HTLCUpdateDecodeErrorZ_clone"))) TS_CResult_HTLCUpdateDecodeErrorZ_clone(uint64_t orig) {
16515 LDKCResult_HTLCUpdateDecodeErrorZ* orig_conv = (LDKCResult_HTLCUpdateDecodeErrorZ*)untag_ptr(orig);
16516 LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
16517 *ret_conv = CResult_HTLCUpdateDecodeErrorZ_clone(orig_conv);
16518 return tag_ptr(ret_conv, true);
16521 static inline uint64_t C2Tuple_OutPointScriptZ_clone_ptr(LDKC2Tuple_OutPointScriptZ *NONNULL_PTR arg) {
16522 LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
16523 *ret_conv = C2Tuple_OutPointScriptZ_clone(arg);
16524 return tag_ptr(ret_conv, true);
16526 int64_t __attribute__((export_name("TS_C2Tuple_OutPointScriptZ_clone_ptr"))) TS_C2Tuple_OutPointScriptZ_clone_ptr(uint64_t arg) {
16527 LDKC2Tuple_OutPointScriptZ* arg_conv = (LDKC2Tuple_OutPointScriptZ*)untag_ptr(arg);
16528 int64_t ret_conv = C2Tuple_OutPointScriptZ_clone_ptr(arg_conv);
16532 uint64_t __attribute__((export_name("TS_C2Tuple_OutPointScriptZ_clone"))) TS_C2Tuple_OutPointScriptZ_clone(uint64_t orig) {
16533 LDKC2Tuple_OutPointScriptZ* orig_conv = (LDKC2Tuple_OutPointScriptZ*)untag_ptr(orig);
16534 LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
16535 *ret_conv = C2Tuple_OutPointScriptZ_clone(orig_conv);
16536 return tag_ptr(ret_conv, true);
16539 uint64_t __attribute__((export_name("TS_C2Tuple_OutPointScriptZ_new"))) TS_C2Tuple_OutPointScriptZ_new(uint64_t a, int8_tArray b) {
16540 LDKOutPoint a_conv;
16541 a_conv.inner = untag_ptr(a);
16542 a_conv.is_owned = ptr_is_owned(a);
16543 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
16544 a_conv = OutPoint_clone(&a_conv);
16546 b_ref.datalen = b->arr_len;
16547 b_ref.data = MALLOC(b_ref.datalen, "LDKCVec_u8Z Bytes");
16548 memcpy(b_ref.data, b->elems, b_ref.datalen); FREE(b);
16549 LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
16550 *ret_conv = C2Tuple_OutPointScriptZ_new(a_conv, b_ref);
16551 return tag_ptr(ret_conv, true);
16554 void __attribute__((export_name("TS_C2Tuple_OutPointScriptZ_free"))) TS_C2Tuple_OutPointScriptZ_free(uint64_t _res) {
16555 if (!ptr_is_owned(_res)) return;
16556 void* _res_ptr = untag_ptr(_res);
16557 CHECK_ACCESS(_res_ptr);
16558 LDKC2Tuple_OutPointScriptZ _res_conv = *(LDKC2Tuple_OutPointScriptZ*)(_res_ptr);
16559 FREE(untag_ptr(_res));
16560 C2Tuple_OutPointScriptZ_free(_res_conv);
16563 static inline uint64_t C2Tuple_u32ScriptZ_clone_ptr(LDKC2Tuple_u32ScriptZ *NONNULL_PTR arg) {
16564 LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ");
16565 *ret_conv = C2Tuple_u32ScriptZ_clone(arg);
16566 return tag_ptr(ret_conv, true);
16568 int64_t __attribute__((export_name("TS_C2Tuple_u32ScriptZ_clone_ptr"))) TS_C2Tuple_u32ScriptZ_clone_ptr(uint64_t arg) {
16569 LDKC2Tuple_u32ScriptZ* arg_conv = (LDKC2Tuple_u32ScriptZ*)untag_ptr(arg);
16570 int64_t ret_conv = C2Tuple_u32ScriptZ_clone_ptr(arg_conv);
16574 uint64_t __attribute__((export_name("TS_C2Tuple_u32ScriptZ_clone"))) TS_C2Tuple_u32ScriptZ_clone(uint64_t orig) {
16575 LDKC2Tuple_u32ScriptZ* orig_conv = (LDKC2Tuple_u32ScriptZ*)untag_ptr(orig);
16576 LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ");
16577 *ret_conv = C2Tuple_u32ScriptZ_clone(orig_conv);
16578 return tag_ptr(ret_conv, true);
16581 uint64_t __attribute__((export_name("TS_C2Tuple_u32ScriptZ_new"))) TS_C2Tuple_u32ScriptZ_new(int32_t a, int8_tArray b) {
16583 b_ref.datalen = b->arr_len;
16584 b_ref.data = MALLOC(b_ref.datalen, "LDKCVec_u8Z Bytes");
16585 memcpy(b_ref.data, b->elems, b_ref.datalen); FREE(b);
16586 LDKC2Tuple_u32ScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32ScriptZ), "LDKC2Tuple_u32ScriptZ");
16587 *ret_conv = C2Tuple_u32ScriptZ_new(a, b_ref);
16588 return tag_ptr(ret_conv, true);
16591 void __attribute__((export_name("TS_C2Tuple_u32ScriptZ_free"))) TS_C2Tuple_u32ScriptZ_free(uint64_t _res) {
16592 if (!ptr_is_owned(_res)) return;
16593 void* _res_ptr = untag_ptr(_res);
16594 CHECK_ACCESS(_res_ptr);
16595 LDKC2Tuple_u32ScriptZ _res_conv = *(LDKC2Tuple_u32ScriptZ*)(_res_ptr);
16596 FREE(untag_ptr(_res));
16597 C2Tuple_u32ScriptZ_free(_res_conv);
16600 void __attribute__((export_name("TS_CVec_C2Tuple_u32ScriptZZ_free"))) TS_CVec_C2Tuple_u32ScriptZZ_free(uint64_tArray _res) {
16601 LDKCVec_C2Tuple_u32ScriptZZ _res_constr;
16602 _res_constr.datalen = _res->arr_len;
16603 if (_res_constr.datalen > 0)
16604 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_u32ScriptZ), "LDKCVec_C2Tuple_u32ScriptZZ Elements");
16606 _res_constr.data = NULL;
16607 uint64_t* _res_vals = _res->elems;
16608 for (size_t v = 0; v < _res_constr.datalen; v++) {
16609 uint64_t _res_conv_21 = _res_vals[v];
16610 void* _res_conv_21_ptr = untag_ptr(_res_conv_21);
16611 CHECK_ACCESS(_res_conv_21_ptr);
16612 LDKC2Tuple_u32ScriptZ _res_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(_res_conv_21_ptr);
16613 FREE(untag_ptr(_res_conv_21));
16614 _res_constr.data[v] = _res_conv_21_conv;
16617 CVec_C2Tuple_u32ScriptZZ_free(_res_constr);
16620 static inline uint64_t C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ *NONNULL_PTR arg) {
16621 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ");
16622 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(arg);
16623 return tag_ptr(ret_conv, true);
16625 int64_t __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr"))) TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(uint64_t arg) {
16626 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* arg_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)untag_ptr(arg);
16627 int64_t ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone_ptr(arg_conv);
16631 uint64_t __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone"))) TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(uint64_t orig) {
16632 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* orig_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)untag_ptr(orig);
16633 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ");
16634 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_clone(orig_conv);
16635 return tag_ptr(ret_conv, true);
16638 uint64_t __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new"))) TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(int8_tArray a, uint64_tArray b) {
16639 LDKThirtyTwoBytes a_ref;
16640 CHECK(a->arr_len == 32);
16641 memcpy(a_ref.data, a->elems, 32); FREE(a);
16642 LDKCVec_C2Tuple_u32ScriptZZ b_constr;
16643 b_constr.datalen = b->arr_len;
16644 if (b_constr.datalen > 0)
16645 b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKC2Tuple_u32ScriptZ), "LDKCVec_C2Tuple_u32ScriptZZ Elements");
16647 b_constr.data = NULL;
16648 uint64_t* b_vals = b->elems;
16649 for (size_t v = 0; v < b_constr.datalen; v++) {
16650 uint64_t b_conv_21 = b_vals[v];
16651 void* b_conv_21_ptr = untag_ptr(b_conv_21);
16652 CHECK_ACCESS(b_conv_21_ptr);
16653 LDKC2Tuple_u32ScriptZ b_conv_21_conv = *(LDKC2Tuple_u32ScriptZ*)(b_conv_21_ptr);
16654 b_conv_21_conv = C2Tuple_u32ScriptZ_clone((LDKC2Tuple_u32ScriptZ*)untag_ptr(b_conv_21));
16655 b_constr.data[v] = b_conv_21_conv;
16658 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ");
16659 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_new(a_ref, b_constr);
16660 return tag_ptr(ret_conv, true);
16663 void __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free"))) TS_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(uint64_t _res) {
16664 if (!ptr_is_owned(_res)) return;
16665 void* _res_ptr = untag_ptr(_res);
16666 CHECK_ACCESS(_res_ptr);
16667 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(_res_ptr);
16668 FREE(untag_ptr(_res));
16669 C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ_free(_res_conv);
16672 void __attribute__((export_name("TS_CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free"))) TS_CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(uint64_tArray _res) {
16673 LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ _res_constr;
16674 _res_constr.datalen = _res->arr_len;
16675 if (_res_constr.datalen > 0)
16676 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ Elements");
16678 _res_constr.data = NULL;
16679 uint64_t* _res_vals = _res->elems;
16680 for (size_t o = 0; o < _res_constr.datalen; o++) {
16681 uint64_t _res_conv_40 = _res_vals[o];
16682 void* _res_conv_40_ptr = untag_ptr(_res_conv_40);
16683 CHECK_ACCESS(_res_conv_40_ptr);
16684 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ _res_conv_40_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ*)(_res_conv_40_ptr);
16685 FREE(untag_ptr(_res_conv_40));
16686 _res_constr.data[o] = _res_conv_40_conv;
16689 CVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ_free(_res_constr);
16692 void __attribute__((export_name("TS_CVec_EventZ_free"))) TS_CVec_EventZ_free(uint64_tArray _res) {
16693 LDKCVec_EventZ _res_constr;
16694 _res_constr.datalen = _res->arr_len;
16695 if (_res_constr.datalen > 0)
16696 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKEvent), "LDKCVec_EventZ Elements");
16698 _res_constr.data = NULL;
16699 uint64_t* _res_vals = _res->elems;
16700 for (size_t h = 0; h < _res_constr.datalen; h++) {
16701 uint64_t _res_conv_7 = _res_vals[h];
16702 void* _res_conv_7_ptr = untag_ptr(_res_conv_7);
16703 CHECK_ACCESS(_res_conv_7_ptr);
16704 LDKEvent _res_conv_7_conv = *(LDKEvent*)(_res_conv_7_ptr);
16705 FREE(untag_ptr(_res_conv_7));
16706 _res_constr.data[h] = _res_conv_7_conv;
16709 CVec_EventZ_free(_res_constr);
16712 void __attribute__((export_name("TS_CVec_TransactionZ_free"))) TS_CVec_TransactionZ_free(ptrArray _res) {
16713 LDKCVec_TransactionZ _res_constr;
16714 _res_constr.datalen = _res->arr_len;
16715 if (_res_constr.datalen > 0)
16716 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKTransaction), "LDKCVec_TransactionZ Elements");
16718 _res_constr.data = NULL;
16719 int8_tArray* _res_vals = (void*) _res->elems;
16720 for (size_t m = 0; m < _res_constr.datalen; m++) {
16721 int8_tArray _res_conv_12 = _res_vals[m];
16722 LDKTransaction _res_conv_12_ref;
16723 _res_conv_12_ref.datalen = _res_conv_12->arr_len;
16724 _res_conv_12_ref.data = MALLOC(_res_conv_12_ref.datalen, "LDKTransaction Bytes");
16725 memcpy(_res_conv_12_ref.data, _res_conv_12->elems, _res_conv_12_ref.datalen); FREE(_res_conv_12);
16726 _res_conv_12_ref.data_is_owned = true;
16727 _res_constr.data[m] = _res_conv_12_ref;
16730 CVec_TransactionZ_free(_res_constr);
16733 static inline uint64_t C2Tuple_u32TxOutZ_clone_ptr(LDKC2Tuple_u32TxOutZ *NONNULL_PTR arg) {
16734 LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
16735 *ret_conv = C2Tuple_u32TxOutZ_clone(arg);
16736 return tag_ptr(ret_conv, true);
16738 int64_t __attribute__((export_name("TS_C2Tuple_u32TxOutZ_clone_ptr"))) TS_C2Tuple_u32TxOutZ_clone_ptr(uint64_t arg) {
16739 LDKC2Tuple_u32TxOutZ* arg_conv = (LDKC2Tuple_u32TxOutZ*)untag_ptr(arg);
16740 int64_t ret_conv = C2Tuple_u32TxOutZ_clone_ptr(arg_conv);
16744 uint64_t __attribute__((export_name("TS_C2Tuple_u32TxOutZ_clone"))) TS_C2Tuple_u32TxOutZ_clone(uint64_t orig) {
16745 LDKC2Tuple_u32TxOutZ* orig_conv = (LDKC2Tuple_u32TxOutZ*)untag_ptr(orig);
16746 LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
16747 *ret_conv = C2Tuple_u32TxOutZ_clone(orig_conv);
16748 return tag_ptr(ret_conv, true);
16751 uint64_t __attribute__((export_name("TS_C2Tuple_u32TxOutZ_new"))) TS_C2Tuple_u32TxOutZ_new(int32_t a, uint64_t b) {
16752 void* b_ptr = untag_ptr(b);
16753 CHECK_ACCESS(b_ptr);
16754 LDKTxOut b_conv = *(LDKTxOut*)(b_ptr);
16755 b_conv = TxOut_clone((LDKTxOut*)untag_ptr(b));
16756 LDKC2Tuple_u32TxOutZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_u32TxOutZ), "LDKC2Tuple_u32TxOutZ");
16757 *ret_conv = C2Tuple_u32TxOutZ_new(a, b_conv);
16758 return tag_ptr(ret_conv, true);
16761 void __attribute__((export_name("TS_C2Tuple_u32TxOutZ_free"))) TS_C2Tuple_u32TxOutZ_free(uint64_t _res) {
16762 if (!ptr_is_owned(_res)) return;
16763 void* _res_ptr = untag_ptr(_res);
16764 CHECK_ACCESS(_res_ptr);
16765 LDKC2Tuple_u32TxOutZ _res_conv = *(LDKC2Tuple_u32TxOutZ*)(_res_ptr);
16766 FREE(untag_ptr(_res));
16767 C2Tuple_u32TxOutZ_free(_res_conv);
16770 void __attribute__((export_name("TS_CVec_C2Tuple_u32TxOutZZ_free"))) TS_CVec_C2Tuple_u32TxOutZZ_free(uint64_tArray _res) {
16771 LDKCVec_C2Tuple_u32TxOutZZ _res_constr;
16772 _res_constr.datalen = _res->arr_len;
16773 if (_res_constr.datalen > 0)
16774 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_u32TxOutZ), "LDKCVec_C2Tuple_u32TxOutZZ Elements");
16776 _res_constr.data = NULL;
16777 uint64_t* _res_vals = _res->elems;
16778 for (size_t u = 0; u < _res_constr.datalen; u++) {
16779 uint64_t _res_conv_20 = _res_vals[u];
16780 void* _res_conv_20_ptr = untag_ptr(_res_conv_20);
16781 CHECK_ACCESS(_res_conv_20_ptr);
16782 LDKC2Tuple_u32TxOutZ _res_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(_res_conv_20_ptr);
16783 FREE(untag_ptr(_res_conv_20));
16784 _res_constr.data[u] = _res_conv_20_conv;
16787 CVec_C2Tuple_u32TxOutZZ_free(_res_constr);
16790 static inline uint64_t C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ *NONNULL_PTR arg) {
16791 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
16792 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(arg);
16793 return tag_ptr(ret_conv, true);
16795 int64_t __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr"))) TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(uint64_t arg) {
16796 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* arg_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)untag_ptr(arg);
16797 int64_t ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone_ptr(arg_conv);
16801 uint64_t __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone"))) TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(uint64_t orig) {
16802 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* orig_conv = (LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)untag_ptr(orig);
16803 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
16804 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_clone(orig_conv);
16805 return tag_ptr(ret_conv, true);
16808 uint64_t __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new"))) TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(int8_tArray a, uint64_tArray b) {
16809 LDKThirtyTwoBytes a_ref;
16810 CHECK(a->arr_len == 32);
16811 memcpy(a_ref.data, a->elems, 32); FREE(a);
16812 LDKCVec_C2Tuple_u32TxOutZZ b_constr;
16813 b_constr.datalen = b->arr_len;
16814 if (b_constr.datalen > 0)
16815 b_constr.data = MALLOC(b_constr.datalen * sizeof(LDKC2Tuple_u32TxOutZ), "LDKCVec_C2Tuple_u32TxOutZZ Elements");
16817 b_constr.data = NULL;
16818 uint64_t* b_vals = b->elems;
16819 for (size_t u = 0; u < b_constr.datalen; u++) {
16820 uint64_t b_conv_20 = b_vals[u];
16821 void* b_conv_20_ptr = untag_ptr(b_conv_20);
16822 CHECK_ACCESS(b_conv_20_ptr);
16823 LDKC2Tuple_u32TxOutZ b_conv_20_conv = *(LDKC2Tuple_u32TxOutZ*)(b_conv_20_ptr);
16824 b_conv_20_conv = C2Tuple_u32TxOutZ_clone((LDKC2Tuple_u32TxOutZ*)untag_ptr(b_conv_20));
16825 b_constr.data[u] = b_conv_20_conv;
16828 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
16829 *ret_conv = C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_new(a_ref, b_constr);
16830 return tag_ptr(ret_conv, true);
16833 void __attribute__((export_name("TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free"))) TS_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(uint64_t _res) {
16834 if (!ptr_is_owned(_res)) return;
16835 void* _res_ptr = untag_ptr(_res);
16836 CHECK_ACCESS(_res_ptr);
16837 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(_res_ptr);
16838 FREE(untag_ptr(_res));
16839 C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ_free(_res_conv);
16842 void __attribute__((export_name("TS_CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free"))) TS_CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free(uint64_tArray _res) {
16843 LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ _res_constr;
16844 _res_constr.datalen = _res->arr_len;
16845 if (_res_constr.datalen > 0)
16846 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ Elements");
16848 _res_constr.data = NULL;
16849 uint64_t* _res_vals = _res->elems;
16850 for (size_t n = 0; n < _res_constr.datalen; n++) {
16851 uint64_t _res_conv_39 = _res_vals[n];
16852 void* _res_conv_39_ptr = untag_ptr(_res_conv_39);
16853 CHECK_ACCESS(_res_conv_39_ptr);
16854 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ _res_conv_39_conv = *(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ*)(_res_conv_39_ptr);
16855 FREE(untag_ptr(_res_conv_39));
16856 _res_constr.data[n] = _res_conv_39_conv;
16859 CVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ_free(_res_constr);
16862 void __attribute__((export_name("TS_CVec_BalanceZ_free"))) TS_CVec_BalanceZ_free(uint64_tArray _res) {
16863 LDKCVec_BalanceZ _res_constr;
16864 _res_constr.datalen = _res->arr_len;
16865 if (_res_constr.datalen > 0)
16866 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKBalance), "LDKCVec_BalanceZ Elements");
16868 _res_constr.data = NULL;
16869 uint64_t* _res_vals = _res->elems;
16870 for (size_t j = 0; j < _res_constr.datalen; j++) {
16871 uint64_t _res_conv_9 = _res_vals[j];
16872 void* _res_conv_9_ptr = untag_ptr(_res_conv_9);
16873 CHECK_ACCESS(_res_conv_9_ptr);
16874 LDKBalance _res_conv_9_conv = *(LDKBalance*)(_res_conv_9_ptr);
16875 FREE(untag_ptr(_res_conv_9));
16876 _res_constr.data[j] = _res_conv_9_conv;
16879 CVec_BalanceZ_free(_res_constr);
16882 static inline uint64_t C2Tuple_BlockHashChannelMonitorZ_clone_ptr(LDKC2Tuple_BlockHashChannelMonitorZ *NONNULL_PTR arg) {
16883 LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
16884 *ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone(arg);
16885 return tag_ptr(ret_conv, true);
16887 int64_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_clone_ptr"))) TS_C2Tuple_BlockHashChannelMonitorZ_clone_ptr(uint64_t arg) {
16888 LDKC2Tuple_BlockHashChannelMonitorZ* arg_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(arg);
16889 int64_t ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone_ptr(arg_conv);
16893 uint64_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_clone"))) TS_C2Tuple_BlockHashChannelMonitorZ_clone(uint64_t orig) {
16894 LDKC2Tuple_BlockHashChannelMonitorZ* orig_conv = (LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(orig);
16895 LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
16896 *ret_conv = C2Tuple_BlockHashChannelMonitorZ_clone(orig_conv);
16897 return tag_ptr(ret_conv, true);
16900 uint64_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_new"))) TS_C2Tuple_BlockHashChannelMonitorZ_new(int8_tArray a, uint64_t b) {
16901 LDKThirtyTwoBytes a_ref;
16902 CHECK(a->arr_len == 32);
16903 memcpy(a_ref.data, a->elems, 32); FREE(a);
16904 LDKChannelMonitor b_conv;
16905 b_conv.inner = untag_ptr(b);
16906 b_conv.is_owned = ptr_is_owned(b);
16907 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
16908 b_conv = ChannelMonitor_clone(&b_conv);
16909 LDKC2Tuple_BlockHashChannelMonitorZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_BlockHashChannelMonitorZ), "LDKC2Tuple_BlockHashChannelMonitorZ");
16910 *ret_conv = C2Tuple_BlockHashChannelMonitorZ_new(a_ref, b_conv);
16911 return tag_ptr(ret_conv, true);
16914 void __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_free"))) TS_C2Tuple_BlockHashChannelMonitorZ_free(uint64_t _res) {
16915 if (!ptr_is_owned(_res)) return;
16916 void* _res_ptr = untag_ptr(_res);
16917 CHECK_ACCESS(_res_ptr);
16918 LDKC2Tuple_BlockHashChannelMonitorZ _res_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(_res_ptr);
16919 FREE(untag_ptr(_res));
16920 C2Tuple_BlockHashChannelMonitorZ_free(_res_conv);
16923 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(uint64_t o) {
16924 void* o_ptr = untag_ptr(o);
16925 CHECK_ACCESS(o_ptr);
16926 LDKC2Tuple_BlockHashChannelMonitorZ o_conv = *(LDKC2Tuple_BlockHashChannelMonitorZ*)(o_ptr);
16927 o_conv = C2Tuple_BlockHashChannelMonitorZ_clone((LDKC2Tuple_BlockHashChannelMonitorZ*)untag_ptr(o));
16928 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
16929 *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_ok(o_conv);
16930 return tag_ptr(ret_conv, true);
16933 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(uint64_t e) {
16934 LDKDecodeError e_conv;
16935 e_conv.inner = untag_ptr(e);
16936 e_conv.is_owned = ptr_is_owned(e);
16937 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
16938 e_conv = DecodeError_clone(&e_conv);
16939 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
16940 *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_err(e_conv);
16941 return tag_ptr(ret_conv, true);
16944 jboolean __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(uint64_t o) {
16945 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* o_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(o);
16946 jboolean ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_is_ok(o_conv);
16950 void __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(uint64_t _res) {
16951 if (!ptr_is_owned(_res)) return;
16952 void* _res_ptr = untag_ptr(_res);
16953 CHECK_ACCESS(_res_ptr);
16954 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ _res_conv = *(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)(_res_ptr);
16955 FREE(untag_ptr(_res));
16956 CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_free(_res_conv);
16959 static inline uint64_t CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ *NONNULL_PTR arg) {
16960 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
16961 *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(arg);
16962 return tag_ptr(ret_conv, true);
16964 int64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(uint64_t arg) {
16965 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* arg_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(arg);
16966 int64_t ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone_ptr(arg_conv);
16970 uint64_t __attribute__((export_name("TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone"))) TS_CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(uint64_t orig) {
16971 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* orig_conv = (LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ*)untag_ptr(orig);
16972 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
16973 *ret_conv = CResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ_clone(orig_conv);
16974 return tag_ptr(ret_conv, true);
16977 static inline uint64_t C2Tuple_PublicKeyTypeZ_clone_ptr(LDKC2Tuple_PublicKeyTypeZ *NONNULL_PTR arg) {
16978 LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
16979 *ret_conv = C2Tuple_PublicKeyTypeZ_clone(arg);
16980 return tag_ptr(ret_conv, true);
16982 int64_t __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_clone_ptr"))) TS_C2Tuple_PublicKeyTypeZ_clone_ptr(uint64_t arg) {
16983 LDKC2Tuple_PublicKeyTypeZ* arg_conv = (LDKC2Tuple_PublicKeyTypeZ*)untag_ptr(arg);
16984 int64_t ret_conv = C2Tuple_PublicKeyTypeZ_clone_ptr(arg_conv);
16988 uint64_t __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_clone"))) TS_C2Tuple_PublicKeyTypeZ_clone(uint64_t orig) {
16989 LDKC2Tuple_PublicKeyTypeZ* orig_conv = (LDKC2Tuple_PublicKeyTypeZ*)untag_ptr(orig);
16990 LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
16991 *ret_conv = C2Tuple_PublicKeyTypeZ_clone(orig_conv);
16992 return tag_ptr(ret_conv, true);
16995 uint64_t __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_new"))) TS_C2Tuple_PublicKeyTypeZ_new(int8_tArray a, uint64_t b) {
16996 LDKPublicKey a_ref;
16997 CHECK(a->arr_len == 33);
16998 memcpy(a_ref.compressed_form, a->elems, 33); FREE(a);
16999 void* b_ptr = untag_ptr(b);
17000 CHECK_ACCESS(b_ptr);
17001 LDKType b_conv = *(LDKType*)(b_ptr);
17002 if (b_conv.free == LDKType_JCalls_free) {
17003 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
17004 LDKType_JCalls_cloned(&b_conv);
17006 LDKC2Tuple_PublicKeyTypeZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKC2Tuple_PublicKeyTypeZ");
17007 *ret_conv = C2Tuple_PublicKeyTypeZ_new(a_ref, b_conv);
17008 return tag_ptr(ret_conv, true);
17011 void __attribute__((export_name("TS_C2Tuple_PublicKeyTypeZ_free"))) TS_C2Tuple_PublicKeyTypeZ_free(uint64_t _res) {
17012 if (!ptr_is_owned(_res)) return;
17013 void* _res_ptr = untag_ptr(_res);
17014 CHECK_ACCESS(_res_ptr);
17015 LDKC2Tuple_PublicKeyTypeZ _res_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(_res_ptr);
17016 FREE(untag_ptr(_res));
17017 C2Tuple_PublicKeyTypeZ_free(_res_conv);
17020 void __attribute__((export_name("TS_CVec_C2Tuple_PublicKeyTypeZZ_free"))) TS_CVec_C2Tuple_PublicKeyTypeZZ_free(uint64_tArray _res) {
17021 LDKCVec_C2Tuple_PublicKeyTypeZZ _res_constr;
17022 _res_constr.datalen = _res->arr_len;
17023 if (_res_constr.datalen > 0)
17024 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKC2Tuple_PublicKeyTypeZ), "LDKCVec_C2Tuple_PublicKeyTypeZZ Elements");
17026 _res_constr.data = NULL;
17027 uint64_t* _res_vals = _res->elems;
17028 for (size_t z = 0; z < _res_constr.datalen; z++) {
17029 uint64_t _res_conv_25 = _res_vals[z];
17030 void* _res_conv_25_ptr = untag_ptr(_res_conv_25);
17031 CHECK_ACCESS(_res_conv_25_ptr);
17032 LDKC2Tuple_PublicKeyTypeZ _res_conv_25_conv = *(LDKC2Tuple_PublicKeyTypeZ*)(_res_conv_25_ptr);
17033 FREE(untag_ptr(_res_conv_25));
17034 _res_constr.data[z] = _res_conv_25_conv;
17037 CVec_C2Tuple_PublicKeyTypeZZ_free(_res_constr);
17040 uint64_t __attribute__((export_name("TS_COption_NetAddressZ_some"))) TS_COption_NetAddressZ_some(uint64_t o) {
17041 void* o_ptr = untag_ptr(o);
17042 CHECK_ACCESS(o_ptr);
17043 LDKNetAddress o_conv = *(LDKNetAddress*)(o_ptr);
17044 o_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(o));
17045 LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
17046 *ret_copy = COption_NetAddressZ_some(o_conv);
17047 uint64_t ret_ref = tag_ptr(ret_copy, true);
17051 uint64_t __attribute__((export_name("TS_COption_NetAddressZ_none"))) TS_COption_NetAddressZ_none() {
17052 LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
17053 *ret_copy = COption_NetAddressZ_none();
17054 uint64_t ret_ref = tag_ptr(ret_copy, true);
17058 void __attribute__((export_name("TS_COption_NetAddressZ_free"))) TS_COption_NetAddressZ_free(uint64_t _res) {
17059 if (!ptr_is_owned(_res)) return;
17060 void* _res_ptr = untag_ptr(_res);
17061 CHECK_ACCESS(_res_ptr);
17062 LDKCOption_NetAddressZ _res_conv = *(LDKCOption_NetAddressZ*)(_res_ptr);
17063 FREE(untag_ptr(_res));
17064 COption_NetAddressZ_free(_res_conv);
17067 static inline uint64_t COption_NetAddressZ_clone_ptr(LDKCOption_NetAddressZ *NONNULL_PTR arg) {
17068 LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
17069 *ret_copy = COption_NetAddressZ_clone(arg);
17070 uint64_t ret_ref = tag_ptr(ret_copy, true);
17073 int64_t __attribute__((export_name("TS_COption_NetAddressZ_clone_ptr"))) TS_COption_NetAddressZ_clone_ptr(uint64_t arg) {
17074 LDKCOption_NetAddressZ* arg_conv = (LDKCOption_NetAddressZ*)untag_ptr(arg);
17075 int64_t ret_conv = COption_NetAddressZ_clone_ptr(arg_conv);
17079 uint64_t __attribute__((export_name("TS_COption_NetAddressZ_clone"))) TS_COption_NetAddressZ_clone(uint64_t orig) {
17080 LDKCOption_NetAddressZ* orig_conv = (LDKCOption_NetAddressZ*)untag_ptr(orig);
17081 LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
17082 *ret_copy = COption_NetAddressZ_clone(orig_conv);
17083 uint64_t ret_ref = tag_ptr(ret_copy, true);
17087 uint64_t __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_ok"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_ok(int8_tArray o) {
17089 o_ref.datalen = o->arr_len;
17090 o_ref.data = MALLOC(o_ref.datalen, "LDKCVec_u8Z Bytes");
17091 memcpy(o_ref.data, o->elems, o_ref.datalen); FREE(o);
17092 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
17093 *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_ok(o_ref);
17094 return tag_ptr(ret_conv, true);
17097 uint64_t __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_err"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_err(uint64_t e) {
17098 LDKPeerHandleError e_conv;
17099 e_conv.inner = untag_ptr(e);
17100 e_conv.is_owned = ptr_is_owned(e);
17101 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17102 e_conv = PeerHandleError_clone(&e_conv);
17103 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
17104 *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_err(e_conv);
17105 return tag_ptr(ret_conv, true);
17108 jboolean __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_is_ok"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_is_ok(uint64_t o) {
17109 LDKCResult_CVec_u8ZPeerHandleErrorZ* o_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(o);
17110 jboolean ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_is_ok(o_conv);
17114 void __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_free"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_free(uint64_t _res) {
17115 if (!ptr_is_owned(_res)) return;
17116 void* _res_ptr = untag_ptr(_res);
17117 CHECK_ACCESS(_res_ptr);
17118 LDKCResult_CVec_u8ZPeerHandleErrorZ _res_conv = *(LDKCResult_CVec_u8ZPeerHandleErrorZ*)(_res_ptr);
17119 FREE(untag_ptr(_res));
17120 CResult_CVec_u8ZPeerHandleErrorZ_free(_res_conv);
17123 static inline uint64_t CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(LDKCResult_CVec_u8ZPeerHandleErrorZ *NONNULL_PTR arg) {
17124 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
17125 *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone(arg);
17126 return tag_ptr(ret_conv, true);
17128 int64_t __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(uint64_t arg) {
17129 LDKCResult_CVec_u8ZPeerHandleErrorZ* arg_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(arg);
17130 int64_t ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone_ptr(arg_conv);
17134 uint64_t __attribute__((export_name("TS_CResult_CVec_u8ZPeerHandleErrorZ_clone"))) TS_CResult_CVec_u8ZPeerHandleErrorZ_clone(uint64_t orig) {
17135 LDKCResult_CVec_u8ZPeerHandleErrorZ* orig_conv = (LDKCResult_CVec_u8ZPeerHandleErrorZ*)untag_ptr(orig);
17136 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
17137 *ret_conv = CResult_CVec_u8ZPeerHandleErrorZ_clone(orig_conv);
17138 return tag_ptr(ret_conv, true);
17141 uint64_t __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_ok"))) TS_CResult_NonePeerHandleErrorZ_ok() {
17142 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
17143 *ret_conv = CResult_NonePeerHandleErrorZ_ok();
17144 return tag_ptr(ret_conv, true);
17147 uint64_t __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_err"))) TS_CResult_NonePeerHandleErrorZ_err(uint64_t e) {
17148 LDKPeerHandleError e_conv;
17149 e_conv.inner = untag_ptr(e);
17150 e_conv.is_owned = ptr_is_owned(e);
17151 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17152 e_conv = PeerHandleError_clone(&e_conv);
17153 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
17154 *ret_conv = CResult_NonePeerHandleErrorZ_err(e_conv);
17155 return tag_ptr(ret_conv, true);
17158 jboolean __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_is_ok"))) TS_CResult_NonePeerHandleErrorZ_is_ok(uint64_t o) {
17159 LDKCResult_NonePeerHandleErrorZ* o_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(o);
17160 jboolean ret_conv = CResult_NonePeerHandleErrorZ_is_ok(o_conv);
17164 void __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_free"))) TS_CResult_NonePeerHandleErrorZ_free(uint64_t _res) {
17165 if (!ptr_is_owned(_res)) return;
17166 void* _res_ptr = untag_ptr(_res);
17167 CHECK_ACCESS(_res_ptr);
17168 LDKCResult_NonePeerHandleErrorZ _res_conv = *(LDKCResult_NonePeerHandleErrorZ*)(_res_ptr);
17169 FREE(untag_ptr(_res));
17170 CResult_NonePeerHandleErrorZ_free(_res_conv);
17173 static inline uint64_t CResult_NonePeerHandleErrorZ_clone_ptr(LDKCResult_NonePeerHandleErrorZ *NONNULL_PTR arg) {
17174 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
17175 *ret_conv = CResult_NonePeerHandleErrorZ_clone(arg);
17176 return tag_ptr(ret_conv, true);
17178 int64_t __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_clone_ptr"))) TS_CResult_NonePeerHandleErrorZ_clone_ptr(uint64_t arg) {
17179 LDKCResult_NonePeerHandleErrorZ* arg_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(arg);
17180 int64_t ret_conv = CResult_NonePeerHandleErrorZ_clone_ptr(arg_conv);
17184 uint64_t __attribute__((export_name("TS_CResult_NonePeerHandleErrorZ_clone"))) TS_CResult_NonePeerHandleErrorZ_clone(uint64_t orig) {
17185 LDKCResult_NonePeerHandleErrorZ* orig_conv = (LDKCResult_NonePeerHandleErrorZ*)untag_ptr(orig);
17186 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
17187 *ret_conv = CResult_NonePeerHandleErrorZ_clone(orig_conv);
17188 return tag_ptr(ret_conv, true);
17191 uint64_t __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_ok"))) TS_CResult_boolPeerHandleErrorZ_ok(jboolean o) {
17192 LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
17193 *ret_conv = CResult_boolPeerHandleErrorZ_ok(o);
17194 return tag_ptr(ret_conv, true);
17197 uint64_t __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_err"))) TS_CResult_boolPeerHandleErrorZ_err(uint64_t e) {
17198 LDKPeerHandleError e_conv;
17199 e_conv.inner = untag_ptr(e);
17200 e_conv.is_owned = ptr_is_owned(e);
17201 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17202 e_conv = PeerHandleError_clone(&e_conv);
17203 LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
17204 *ret_conv = CResult_boolPeerHandleErrorZ_err(e_conv);
17205 return tag_ptr(ret_conv, true);
17208 jboolean __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_is_ok"))) TS_CResult_boolPeerHandleErrorZ_is_ok(uint64_t o) {
17209 LDKCResult_boolPeerHandleErrorZ* o_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(o);
17210 jboolean ret_conv = CResult_boolPeerHandleErrorZ_is_ok(o_conv);
17214 void __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_free"))) TS_CResult_boolPeerHandleErrorZ_free(uint64_t _res) {
17215 if (!ptr_is_owned(_res)) return;
17216 void* _res_ptr = untag_ptr(_res);
17217 CHECK_ACCESS(_res_ptr);
17218 LDKCResult_boolPeerHandleErrorZ _res_conv = *(LDKCResult_boolPeerHandleErrorZ*)(_res_ptr);
17219 FREE(untag_ptr(_res));
17220 CResult_boolPeerHandleErrorZ_free(_res_conv);
17223 static inline uint64_t CResult_boolPeerHandleErrorZ_clone_ptr(LDKCResult_boolPeerHandleErrorZ *NONNULL_PTR arg) {
17224 LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
17225 *ret_conv = CResult_boolPeerHandleErrorZ_clone(arg);
17226 return tag_ptr(ret_conv, true);
17228 int64_t __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_clone_ptr"))) TS_CResult_boolPeerHandleErrorZ_clone_ptr(uint64_t arg) {
17229 LDKCResult_boolPeerHandleErrorZ* arg_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(arg);
17230 int64_t ret_conv = CResult_boolPeerHandleErrorZ_clone_ptr(arg_conv);
17234 uint64_t __attribute__((export_name("TS_CResult_boolPeerHandleErrorZ_clone"))) TS_CResult_boolPeerHandleErrorZ_clone(uint64_t orig) {
17235 LDKCResult_boolPeerHandleErrorZ* orig_conv = (LDKCResult_boolPeerHandleErrorZ*)untag_ptr(orig);
17236 LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
17237 *ret_conv = CResult_boolPeerHandleErrorZ_clone(orig_conv);
17238 return tag_ptr(ret_conv, true);
17241 uint64_t __attribute__((export_name("TS_CResult_NoneErrorZ_ok"))) TS_CResult_NoneErrorZ_ok() {
17242 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
17243 *ret_conv = CResult_NoneErrorZ_ok();
17244 return tag_ptr(ret_conv, true);
17247 uint64_t __attribute__((export_name("TS_CResult_NoneErrorZ_err"))) TS_CResult_NoneErrorZ_err(uint32_t e) {
17248 LDKIOError e_conv = LDKIOError_from_js(e);
17249 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
17250 *ret_conv = CResult_NoneErrorZ_err(e_conv);
17251 return tag_ptr(ret_conv, true);
17254 jboolean __attribute__((export_name("TS_CResult_NoneErrorZ_is_ok"))) TS_CResult_NoneErrorZ_is_ok(uint64_t o) {
17255 LDKCResult_NoneErrorZ* o_conv = (LDKCResult_NoneErrorZ*)untag_ptr(o);
17256 jboolean ret_conv = CResult_NoneErrorZ_is_ok(o_conv);
17260 void __attribute__((export_name("TS_CResult_NoneErrorZ_free"))) TS_CResult_NoneErrorZ_free(uint64_t _res) {
17261 if (!ptr_is_owned(_res)) return;
17262 void* _res_ptr = untag_ptr(_res);
17263 CHECK_ACCESS(_res_ptr);
17264 LDKCResult_NoneErrorZ _res_conv = *(LDKCResult_NoneErrorZ*)(_res_ptr);
17265 FREE(untag_ptr(_res));
17266 CResult_NoneErrorZ_free(_res_conv);
17269 static inline uint64_t CResult_NoneErrorZ_clone_ptr(LDKCResult_NoneErrorZ *NONNULL_PTR arg) {
17270 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
17271 *ret_conv = CResult_NoneErrorZ_clone(arg);
17272 return tag_ptr(ret_conv, true);
17274 int64_t __attribute__((export_name("TS_CResult_NoneErrorZ_clone_ptr"))) TS_CResult_NoneErrorZ_clone_ptr(uint64_t arg) {
17275 LDKCResult_NoneErrorZ* arg_conv = (LDKCResult_NoneErrorZ*)untag_ptr(arg);
17276 int64_t ret_conv = CResult_NoneErrorZ_clone_ptr(arg_conv);
17280 uint64_t __attribute__((export_name("TS_CResult_NoneErrorZ_clone"))) TS_CResult_NoneErrorZ_clone(uint64_t orig) {
17281 LDKCResult_NoneErrorZ* orig_conv = (LDKCResult_NoneErrorZ*)untag_ptr(orig);
17282 LDKCResult_NoneErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneErrorZ), "LDKCResult_NoneErrorZ");
17283 *ret_conv = CResult_NoneErrorZ_clone(orig_conv);
17284 return tag_ptr(ret_conv, true);
17287 uint64_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_ok"))) TS_CResult_NetAddressDecodeErrorZ_ok(uint64_t o) {
17288 void* o_ptr = untag_ptr(o);
17289 CHECK_ACCESS(o_ptr);
17290 LDKNetAddress o_conv = *(LDKNetAddress*)(o_ptr);
17291 o_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(o));
17292 LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
17293 *ret_conv = CResult_NetAddressDecodeErrorZ_ok(o_conv);
17294 return tag_ptr(ret_conv, true);
17297 uint64_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_err"))) TS_CResult_NetAddressDecodeErrorZ_err(uint64_t e) {
17298 LDKDecodeError e_conv;
17299 e_conv.inner = untag_ptr(e);
17300 e_conv.is_owned = ptr_is_owned(e);
17301 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17302 e_conv = DecodeError_clone(&e_conv);
17303 LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
17304 *ret_conv = CResult_NetAddressDecodeErrorZ_err(e_conv);
17305 return tag_ptr(ret_conv, true);
17308 jboolean __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_is_ok"))) TS_CResult_NetAddressDecodeErrorZ_is_ok(uint64_t o) {
17309 LDKCResult_NetAddressDecodeErrorZ* o_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(o);
17310 jboolean ret_conv = CResult_NetAddressDecodeErrorZ_is_ok(o_conv);
17314 void __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_free"))) TS_CResult_NetAddressDecodeErrorZ_free(uint64_t _res) {
17315 if (!ptr_is_owned(_res)) return;
17316 void* _res_ptr = untag_ptr(_res);
17317 CHECK_ACCESS(_res_ptr);
17318 LDKCResult_NetAddressDecodeErrorZ _res_conv = *(LDKCResult_NetAddressDecodeErrorZ*)(_res_ptr);
17319 FREE(untag_ptr(_res));
17320 CResult_NetAddressDecodeErrorZ_free(_res_conv);
17323 static inline uint64_t CResult_NetAddressDecodeErrorZ_clone_ptr(LDKCResult_NetAddressDecodeErrorZ *NONNULL_PTR arg) {
17324 LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
17325 *ret_conv = CResult_NetAddressDecodeErrorZ_clone(arg);
17326 return tag_ptr(ret_conv, true);
17328 int64_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_clone_ptr"))) TS_CResult_NetAddressDecodeErrorZ_clone_ptr(uint64_t arg) {
17329 LDKCResult_NetAddressDecodeErrorZ* arg_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(arg);
17330 int64_t ret_conv = CResult_NetAddressDecodeErrorZ_clone_ptr(arg_conv);
17334 uint64_t __attribute__((export_name("TS_CResult_NetAddressDecodeErrorZ_clone"))) TS_CResult_NetAddressDecodeErrorZ_clone(uint64_t orig) {
17335 LDKCResult_NetAddressDecodeErrorZ* orig_conv = (LDKCResult_NetAddressDecodeErrorZ*)untag_ptr(orig);
17336 LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
17337 *ret_conv = CResult_NetAddressDecodeErrorZ_clone(orig_conv);
17338 return tag_ptr(ret_conv, true);
17341 void __attribute__((export_name("TS_CVec_UpdateAddHTLCZ_free"))) TS_CVec_UpdateAddHTLCZ_free(uint64_tArray _res) {
17342 LDKCVec_UpdateAddHTLCZ _res_constr;
17343 _res_constr.datalen = _res->arr_len;
17344 if (_res_constr.datalen > 0)
17345 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements");
17347 _res_constr.data = NULL;
17348 uint64_t* _res_vals = _res->elems;
17349 for (size_t p = 0; p < _res_constr.datalen; p++) {
17350 uint64_t _res_conv_15 = _res_vals[p];
17351 LDKUpdateAddHTLC _res_conv_15_conv;
17352 _res_conv_15_conv.inner = untag_ptr(_res_conv_15);
17353 _res_conv_15_conv.is_owned = ptr_is_owned(_res_conv_15);
17354 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_15_conv);
17355 _res_constr.data[p] = _res_conv_15_conv;
17358 CVec_UpdateAddHTLCZ_free(_res_constr);
17361 void __attribute__((export_name("TS_CVec_UpdateFulfillHTLCZ_free"))) TS_CVec_UpdateFulfillHTLCZ_free(uint64_tArray _res) {
17362 LDKCVec_UpdateFulfillHTLCZ _res_constr;
17363 _res_constr.datalen = _res->arr_len;
17364 if (_res_constr.datalen > 0)
17365 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements");
17367 _res_constr.data = NULL;
17368 uint64_t* _res_vals = _res->elems;
17369 for (size_t t = 0; t < _res_constr.datalen; t++) {
17370 uint64_t _res_conv_19 = _res_vals[t];
17371 LDKUpdateFulfillHTLC _res_conv_19_conv;
17372 _res_conv_19_conv.inner = untag_ptr(_res_conv_19);
17373 _res_conv_19_conv.is_owned = ptr_is_owned(_res_conv_19);
17374 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_19_conv);
17375 _res_constr.data[t] = _res_conv_19_conv;
17378 CVec_UpdateFulfillHTLCZ_free(_res_constr);
17381 void __attribute__((export_name("TS_CVec_UpdateFailHTLCZ_free"))) TS_CVec_UpdateFailHTLCZ_free(uint64_tArray _res) {
17382 LDKCVec_UpdateFailHTLCZ _res_constr;
17383 _res_constr.datalen = _res->arr_len;
17384 if (_res_constr.datalen > 0)
17385 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements");
17387 _res_constr.data = NULL;
17388 uint64_t* _res_vals = _res->elems;
17389 for (size_t q = 0; q < _res_constr.datalen; q++) {
17390 uint64_t _res_conv_16 = _res_vals[q];
17391 LDKUpdateFailHTLC _res_conv_16_conv;
17392 _res_conv_16_conv.inner = untag_ptr(_res_conv_16);
17393 _res_conv_16_conv.is_owned = ptr_is_owned(_res_conv_16);
17394 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_16_conv);
17395 _res_constr.data[q] = _res_conv_16_conv;
17398 CVec_UpdateFailHTLCZ_free(_res_constr);
17401 void __attribute__((export_name("TS_CVec_UpdateFailMalformedHTLCZ_free"))) TS_CVec_UpdateFailMalformedHTLCZ_free(uint64_tArray _res) {
17402 LDKCVec_UpdateFailMalformedHTLCZ _res_constr;
17403 _res_constr.datalen = _res->arr_len;
17404 if (_res_constr.datalen > 0)
17405 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements");
17407 _res_constr.data = NULL;
17408 uint64_t* _res_vals = _res->elems;
17409 for (size_t z = 0; z < _res_constr.datalen; z++) {
17410 uint64_t _res_conv_25 = _res_vals[z];
17411 LDKUpdateFailMalformedHTLC _res_conv_25_conv;
17412 _res_conv_25_conv.inner = untag_ptr(_res_conv_25);
17413 _res_conv_25_conv.is_owned = ptr_is_owned(_res_conv_25);
17414 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_25_conv);
17415 _res_constr.data[z] = _res_conv_25_conv;
17418 CVec_UpdateFailMalformedHTLCZ_free(_res_constr);
17421 uint64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_ok"))) TS_CResult_AcceptChannelDecodeErrorZ_ok(uint64_t o) {
17422 LDKAcceptChannel o_conv;
17423 o_conv.inner = untag_ptr(o);
17424 o_conv.is_owned = ptr_is_owned(o);
17425 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17426 o_conv = AcceptChannel_clone(&o_conv);
17427 LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
17428 *ret_conv = CResult_AcceptChannelDecodeErrorZ_ok(o_conv);
17429 return tag_ptr(ret_conv, true);
17432 uint64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_err"))) TS_CResult_AcceptChannelDecodeErrorZ_err(uint64_t e) {
17433 LDKDecodeError e_conv;
17434 e_conv.inner = untag_ptr(e);
17435 e_conv.is_owned = ptr_is_owned(e);
17436 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17437 e_conv = DecodeError_clone(&e_conv);
17438 LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
17439 *ret_conv = CResult_AcceptChannelDecodeErrorZ_err(e_conv);
17440 return tag_ptr(ret_conv, true);
17443 jboolean __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_is_ok"))) TS_CResult_AcceptChannelDecodeErrorZ_is_ok(uint64_t o) {
17444 LDKCResult_AcceptChannelDecodeErrorZ* o_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(o);
17445 jboolean ret_conv = CResult_AcceptChannelDecodeErrorZ_is_ok(o_conv);
17449 void __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_free"))) TS_CResult_AcceptChannelDecodeErrorZ_free(uint64_t _res) {
17450 if (!ptr_is_owned(_res)) return;
17451 void* _res_ptr = untag_ptr(_res);
17452 CHECK_ACCESS(_res_ptr);
17453 LDKCResult_AcceptChannelDecodeErrorZ _res_conv = *(LDKCResult_AcceptChannelDecodeErrorZ*)(_res_ptr);
17454 FREE(untag_ptr(_res));
17455 CResult_AcceptChannelDecodeErrorZ_free(_res_conv);
17458 static inline uint64_t CResult_AcceptChannelDecodeErrorZ_clone_ptr(LDKCResult_AcceptChannelDecodeErrorZ *NONNULL_PTR arg) {
17459 LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
17460 *ret_conv = CResult_AcceptChannelDecodeErrorZ_clone(arg);
17461 return tag_ptr(ret_conv, true);
17463 int64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_clone_ptr"))) TS_CResult_AcceptChannelDecodeErrorZ_clone_ptr(uint64_t arg) {
17464 LDKCResult_AcceptChannelDecodeErrorZ* arg_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(arg);
17465 int64_t ret_conv = CResult_AcceptChannelDecodeErrorZ_clone_ptr(arg_conv);
17469 uint64_t __attribute__((export_name("TS_CResult_AcceptChannelDecodeErrorZ_clone"))) TS_CResult_AcceptChannelDecodeErrorZ_clone(uint64_t orig) {
17470 LDKCResult_AcceptChannelDecodeErrorZ* orig_conv = (LDKCResult_AcceptChannelDecodeErrorZ*)untag_ptr(orig);
17471 LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
17472 *ret_conv = CResult_AcceptChannelDecodeErrorZ_clone(orig_conv);
17473 return tag_ptr(ret_conv, true);
17476 uint64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_ok"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_ok(uint64_t o) {
17477 LDKAnnouncementSignatures o_conv;
17478 o_conv.inner = untag_ptr(o);
17479 o_conv.is_owned = ptr_is_owned(o);
17480 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17481 o_conv = AnnouncementSignatures_clone(&o_conv);
17482 LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
17483 *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_ok(o_conv);
17484 return tag_ptr(ret_conv, true);
17487 uint64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_err"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_err(uint64_t e) {
17488 LDKDecodeError e_conv;
17489 e_conv.inner = untag_ptr(e);
17490 e_conv.is_owned = ptr_is_owned(e);
17491 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17492 e_conv = DecodeError_clone(&e_conv);
17493 LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
17494 *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_err(e_conv);
17495 return tag_ptr(ret_conv, true);
17498 jboolean __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_is_ok"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(uint64_t o) {
17499 LDKCResult_AnnouncementSignaturesDecodeErrorZ* o_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(o);
17500 jboolean ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_is_ok(o_conv);
17504 void __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_free"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_free(uint64_t _res) {
17505 if (!ptr_is_owned(_res)) return;
17506 void* _res_ptr = untag_ptr(_res);
17507 CHECK_ACCESS(_res_ptr);
17508 LDKCResult_AnnouncementSignaturesDecodeErrorZ _res_conv = *(LDKCResult_AnnouncementSignaturesDecodeErrorZ*)(_res_ptr);
17509 FREE(untag_ptr(_res));
17510 CResult_AnnouncementSignaturesDecodeErrorZ_free(_res_conv);
17513 static inline uint64_t CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(LDKCResult_AnnouncementSignaturesDecodeErrorZ *NONNULL_PTR arg) {
17514 LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
17515 *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_clone(arg);
17516 return tag_ptr(ret_conv, true);
17518 int64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(uint64_t arg) {
17519 LDKCResult_AnnouncementSignaturesDecodeErrorZ* arg_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(arg);
17520 int64_t ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_clone_ptr(arg_conv);
17524 uint64_t __attribute__((export_name("TS_CResult_AnnouncementSignaturesDecodeErrorZ_clone"))) TS_CResult_AnnouncementSignaturesDecodeErrorZ_clone(uint64_t orig) {
17525 LDKCResult_AnnouncementSignaturesDecodeErrorZ* orig_conv = (LDKCResult_AnnouncementSignaturesDecodeErrorZ*)untag_ptr(orig);
17526 LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
17527 *ret_conv = CResult_AnnouncementSignaturesDecodeErrorZ_clone(orig_conv);
17528 return tag_ptr(ret_conv, true);
17531 uint64_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_ok"))) TS_CResult_ChannelReestablishDecodeErrorZ_ok(uint64_t o) {
17532 LDKChannelReestablish o_conv;
17533 o_conv.inner = untag_ptr(o);
17534 o_conv.is_owned = ptr_is_owned(o);
17535 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17536 o_conv = ChannelReestablish_clone(&o_conv);
17537 LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
17538 *ret_conv = CResult_ChannelReestablishDecodeErrorZ_ok(o_conv);
17539 return tag_ptr(ret_conv, true);
17542 uint64_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_err"))) TS_CResult_ChannelReestablishDecodeErrorZ_err(uint64_t e) {
17543 LDKDecodeError e_conv;
17544 e_conv.inner = untag_ptr(e);
17545 e_conv.is_owned = ptr_is_owned(e);
17546 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17547 e_conv = DecodeError_clone(&e_conv);
17548 LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
17549 *ret_conv = CResult_ChannelReestablishDecodeErrorZ_err(e_conv);
17550 return tag_ptr(ret_conv, true);
17553 jboolean __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_is_ok"))) TS_CResult_ChannelReestablishDecodeErrorZ_is_ok(uint64_t o) {
17554 LDKCResult_ChannelReestablishDecodeErrorZ* o_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(o);
17555 jboolean ret_conv = CResult_ChannelReestablishDecodeErrorZ_is_ok(o_conv);
17559 void __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_free"))) TS_CResult_ChannelReestablishDecodeErrorZ_free(uint64_t _res) {
17560 if (!ptr_is_owned(_res)) return;
17561 void* _res_ptr = untag_ptr(_res);
17562 CHECK_ACCESS(_res_ptr);
17563 LDKCResult_ChannelReestablishDecodeErrorZ _res_conv = *(LDKCResult_ChannelReestablishDecodeErrorZ*)(_res_ptr);
17564 FREE(untag_ptr(_res));
17565 CResult_ChannelReestablishDecodeErrorZ_free(_res_conv);
17568 static inline uint64_t CResult_ChannelReestablishDecodeErrorZ_clone_ptr(LDKCResult_ChannelReestablishDecodeErrorZ *NONNULL_PTR arg) {
17569 LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
17570 *ret_conv = CResult_ChannelReestablishDecodeErrorZ_clone(arg);
17571 return tag_ptr(ret_conv, true);
17573 int64_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelReestablishDecodeErrorZ_clone_ptr(uint64_t arg) {
17574 LDKCResult_ChannelReestablishDecodeErrorZ* arg_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(arg);
17575 int64_t ret_conv = CResult_ChannelReestablishDecodeErrorZ_clone_ptr(arg_conv);
17579 uint64_t __attribute__((export_name("TS_CResult_ChannelReestablishDecodeErrorZ_clone"))) TS_CResult_ChannelReestablishDecodeErrorZ_clone(uint64_t orig) {
17580 LDKCResult_ChannelReestablishDecodeErrorZ* orig_conv = (LDKCResult_ChannelReestablishDecodeErrorZ*)untag_ptr(orig);
17581 LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
17582 *ret_conv = CResult_ChannelReestablishDecodeErrorZ_clone(orig_conv);
17583 return tag_ptr(ret_conv, true);
17586 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_ok"))) TS_CResult_ClosingSignedDecodeErrorZ_ok(uint64_t o) {
17587 LDKClosingSigned o_conv;
17588 o_conv.inner = untag_ptr(o);
17589 o_conv.is_owned = ptr_is_owned(o);
17590 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17591 o_conv = ClosingSigned_clone(&o_conv);
17592 LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
17593 *ret_conv = CResult_ClosingSignedDecodeErrorZ_ok(o_conv);
17594 return tag_ptr(ret_conv, true);
17597 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_err"))) TS_CResult_ClosingSignedDecodeErrorZ_err(uint64_t e) {
17598 LDKDecodeError e_conv;
17599 e_conv.inner = untag_ptr(e);
17600 e_conv.is_owned = ptr_is_owned(e);
17601 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17602 e_conv = DecodeError_clone(&e_conv);
17603 LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
17604 *ret_conv = CResult_ClosingSignedDecodeErrorZ_err(e_conv);
17605 return tag_ptr(ret_conv, true);
17608 jboolean __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_is_ok"))) TS_CResult_ClosingSignedDecodeErrorZ_is_ok(uint64_t o) {
17609 LDKCResult_ClosingSignedDecodeErrorZ* o_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(o);
17610 jboolean ret_conv = CResult_ClosingSignedDecodeErrorZ_is_ok(o_conv);
17614 void __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_free"))) TS_CResult_ClosingSignedDecodeErrorZ_free(uint64_t _res) {
17615 if (!ptr_is_owned(_res)) return;
17616 void* _res_ptr = untag_ptr(_res);
17617 CHECK_ACCESS(_res_ptr);
17618 LDKCResult_ClosingSignedDecodeErrorZ _res_conv = *(LDKCResult_ClosingSignedDecodeErrorZ*)(_res_ptr);
17619 FREE(untag_ptr(_res));
17620 CResult_ClosingSignedDecodeErrorZ_free(_res_conv);
17623 static inline uint64_t CResult_ClosingSignedDecodeErrorZ_clone_ptr(LDKCResult_ClosingSignedDecodeErrorZ *NONNULL_PTR arg) {
17624 LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
17625 *ret_conv = CResult_ClosingSignedDecodeErrorZ_clone(arg);
17626 return tag_ptr(ret_conv, true);
17628 int64_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_clone_ptr"))) TS_CResult_ClosingSignedDecodeErrorZ_clone_ptr(uint64_t arg) {
17629 LDKCResult_ClosingSignedDecodeErrorZ* arg_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(arg);
17630 int64_t ret_conv = CResult_ClosingSignedDecodeErrorZ_clone_ptr(arg_conv);
17634 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedDecodeErrorZ_clone"))) TS_CResult_ClosingSignedDecodeErrorZ_clone(uint64_t orig) {
17635 LDKCResult_ClosingSignedDecodeErrorZ* orig_conv = (LDKCResult_ClosingSignedDecodeErrorZ*)untag_ptr(orig);
17636 LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
17637 *ret_conv = CResult_ClosingSignedDecodeErrorZ_clone(orig_conv);
17638 return tag_ptr(ret_conv, true);
17641 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_ok"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(uint64_t o) {
17642 LDKClosingSignedFeeRange o_conv;
17643 o_conv.inner = untag_ptr(o);
17644 o_conv.is_owned = ptr_is_owned(o);
17645 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17646 o_conv = ClosingSignedFeeRange_clone(&o_conv);
17647 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
17648 *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_ok(o_conv);
17649 return tag_ptr(ret_conv, true);
17652 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_err"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_err(uint64_t e) {
17653 LDKDecodeError e_conv;
17654 e_conv.inner = untag_ptr(e);
17655 e_conv.is_owned = ptr_is_owned(e);
17656 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17657 e_conv = DecodeError_clone(&e_conv);
17658 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
17659 *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_err(e_conv);
17660 return tag_ptr(ret_conv, true);
17663 jboolean __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(uint64_t o) {
17664 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* o_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(o);
17665 jboolean ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_is_ok(o_conv);
17669 void __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_free"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_free(uint64_t _res) {
17670 if (!ptr_is_owned(_res)) return;
17671 void* _res_ptr = untag_ptr(_res);
17672 CHECK_ACCESS(_res_ptr);
17673 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ _res_conv = *(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)(_res_ptr);
17674 FREE(untag_ptr(_res));
17675 CResult_ClosingSignedFeeRangeDecodeErrorZ_free(_res_conv);
17678 static inline uint64_t CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ *NONNULL_PTR arg) {
17679 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
17680 *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(arg);
17681 return tag_ptr(ret_conv, true);
17683 int64_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(uint64_t arg) {
17684 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* arg_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(arg);
17685 int64_t ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone_ptr(arg_conv);
17689 uint64_t __attribute__((export_name("TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_clone"))) TS_CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(uint64_t orig) {
17690 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* orig_conv = (LDKCResult_ClosingSignedFeeRangeDecodeErrorZ*)untag_ptr(orig);
17691 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
17692 *ret_conv = CResult_ClosingSignedFeeRangeDecodeErrorZ_clone(orig_conv);
17693 return tag_ptr(ret_conv, true);
17696 uint64_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_ok"))) TS_CResult_CommitmentSignedDecodeErrorZ_ok(uint64_t o) {
17697 LDKCommitmentSigned o_conv;
17698 o_conv.inner = untag_ptr(o);
17699 o_conv.is_owned = ptr_is_owned(o);
17700 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17701 o_conv = CommitmentSigned_clone(&o_conv);
17702 LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
17703 *ret_conv = CResult_CommitmentSignedDecodeErrorZ_ok(o_conv);
17704 return tag_ptr(ret_conv, true);
17707 uint64_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_err"))) TS_CResult_CommitmentSignedDecodeErrorZ_err(uint64_t e) {
17708 LDKDecodeError e_conv;
17709 e_conv.inner = untag_ptr(e);
17710 e_conv.is_owned = ptr_is_owned(e);
17711 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17712 e_conv = DecodeError_clone(&e_conv);
17713 LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
17714 *ret_conv = CResult_CommitmentSignedDecodeErrorZ_err(e_conv);
17715 return tag_ptr(ret_conv, true);
17718 jboolean __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_is_ok"))) TS_CResult_CommitmentSignedDecodeErrorZ_is_ok(uint64_t o) {
17719 LDKCResult_CommitmentSignedDecodeErrorZ* o_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(o);
17720 jboolean ret_conv = CResult_CommitmentSignedDecodeErrorZ_is_ok(o_conv);
17724 void __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_free"))) TS_CResult_CommitmentSignedDecodeErrorZ_free(uint64_t _res) {
17725 if (!ptr_is_owned(_res)) return;
17726 void* _res_ptr = untag_ptr(_res);
17727 CHECK_ACCESS(_res_ptr);
17728 LDKCResult_CommitmentSignedDecodeErrorZ _res_conv = *(LDKCResult_CommitmentSignedDecodeErrorZ*)(_res_ptr);
17729 FREE(untag_ptr(_res));
17730 CResult_CommitmentSignedDecodeErrorZ_free(_res_conv);
17733 static inline uint64_t CResult_CommitmentSignedDecodeErrorZ_clone_ptr(LDKCResult_CommitmentSignedDecodeErrorZ *NONNULL_PTR arg) {
17734 LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
17735 *ret_conv = CResult_CommitmentSignedDecodeErrorZ_clone(arg);
17736 return tag_ptr(ret_conv, true);
17738 int64_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_clone_ptr"))) TS_CResult_CommitmentSignedDecodeErrorZ_clone_ptr(uint64_t arg) {
17739 LDKCResult_CommitmentSignedDecodeErrorZ* arg_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(arg);
17740 int64_t ret_conv = CResult_CommitmentSignedDecodeErrorZ_clone_ptr(arg_conv);
17744 uint64_t __attribute__((export_name("TS_CResult_CommitmentSignedDecodeErrorZ_clone"))) TS_CResult_CommitmentSignedDecodeErrorZ_clone(uint64_t orig) {
17745 LDKCResult_CommitmentSignedDecodeErrorZ* orig_conv = (LDKCResult_CommitmentSignedDecodeErrorZ*)untag_ptr(orig);
17746 LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
17747 *ret_conv = CResult_CommitmentSignedDecodeErrorZ_clone(orig_conv);
17748 return tag_ptr(ret_conv, true);
17751 uint64_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_ok"))) TS_CResult_FundingCreatedDecodeErrorZ_ok(uint64_t o) {
17752 LDKFundingCreated o_conv;
17753 o_conv.inner = untag_ptr(o);
17754 o_conv.is_owned = ptr_is_owned(o);
17755 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17756 o_conv = FundingCreated_clone(&o_conv);
17757 LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
17758 *ret_conv = CResult_FundingCreatedDecodeErrorZ_ok(o_conv);
17759 return tag_ptr(ret_conv, true);
17762 uint64_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_err"))) TS_CResult_FundingCreatedDecodeErrorZ_err(uint64_t e) {
17763 LDKDecodeError e_conv;
17764 e_conv.inner = untag_ptr(e);
17765 e_conv.is_owned = ptr_is_owned(e);
17766 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17767 e_conv = DecodeError_clone(&e_conv);
17768 LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
17769 *ret_conv = CResult_FundingCreatedDecodeErrorZ_err(e_conv);
17770 return tag_ptr(ret_conv, true);
17773 jboolean __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_is_ok"))) TS_CResult_FundingCreatedDecodeErrorZ_is_ok(uint64_t o) {
17774 LDKCResult_FundingCreatedDecodeErrorZ* o_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(o);
17775 jboolean ret_conv = CResult_FundingCreatedDecodeErrorZ_is_ok(o_conv);
17779 void __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_free"))) TS_CResult_FundingCreatedDecodeErrorZ_free(uint64_t _res) {
17780 if (!ptr_is_owned(_res)) return;
17781 void* _res_ptr = untag_ptr(_res);
17782 CHECK_ACCESS(_res_ptr);
17783 LDKCResult_FundingCreatedDecodeErrorZ _res_conv = *(LDKCResult_FundingCreatedDecodeErrorZ*)(_res_ptr);
17784 FREE(untag_ptr(_res));
17785 CResult_FundingCreatedDecodeErrorZ_free(_res_conv);
17788 static inline uint64_t CResult_FundingCreatedDecodeErrorZ_clone_ptr(LDKCResult_FundingCreatedDecodeErrorZ *NONNULL_PTR arg) {
17789 LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
17790 *ret_conv = CResult_FundingCreatedDecodeErrorZ_clone(arg);
17791 return tag_ptr(ret_conv, true);
17793 int64_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_clone_ptr"))) TS_CResult_FundingCreatedDecodeErrorZ_clone_ptr(uint64_t arg) {
17794 LDKCResult_FundingCreatedDecodeErrorZ* arg_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(arg);
17795 int64_t ret_conv = CResult_FundingCreatedDecodeErrorZ_clone_ptr(arg_conv);
17799 uint64_t __attribute__((export_name("TS_CResult_FundingCreatedDecodeErrorZ_clone"))) TS_CResult_FundingCreatedDecodeErrorZ_clone(uint64_t orig) {
17800 LDKCResult_FundingCreatedDecodeErrorZ* orig_conv = (LDKCResult_FundingCreatedDecodeErrorZ*)untag_ptr(orig);
17801 LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
17802 *ret_conv = CResult_FundingCreatedDecodeErrorZ_clone(orig_conv);
17803 return tag_ptr(ret_conv, true);
17806 uint64_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_ok"))) TS_CResult_FundingSignedDecodeErrorZ_ok(uint64_t o) {
17807 LDKFundingSigned o_conv;
17808 o_conv.inner = untag_ptr(o);
17809 o_conv.is_owned = ptr_is_owned(o);
17810 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17811 o_conv = FundingSigned_clone(&o_conv);
17812 LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
17813 *ret_conv = CResult_FundingSignedDecodeErrorZ_ok(o_conv);
17814 return tag_ptr(ret_conv, true);
17817 uint64_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_err"))) TS_CResult_FundingSignedDecodeErrorZ_err(uint64_t e) {
17818 LDKDecodeError e_conv;
17819 e_conv.inner = untag_ptr(e);
17820 e_conv.is_owned = ptr_is_owned(e);
17821 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17822 e_conv = DecodeError_clone(&e_conv);
17823 LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
17824 *ret_conv = CResult_FundingSignedDecodeErrorZ_err(e_conv);
17825 return tag_ptr(ret_conv, true);
17828 jboolean __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_is_ok"))) TS_CResult_FundingSignedDecodeErrorZ_is_ok(uint64_t o) {
17829 LDKCResult_FundingSignedDecodeErrorZ* o_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(o);
17830 jboolean ret_conv = CResult_FundingSignedDecodeErrorZ_is_ok(o_conv);
17834 void __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_free"))) TS_CResult_FundingSignedDecodeErrorZ_free(uint64_t _res) {
17835 if (!ptr_is_owned(_res)) return;
17836 void* _res_ptr = untag_ptr(_res);
17837 CHECK_ACCESS(_res_ptr);
17838 LDKCResult_FundingSignedDecodeErrorZ _res_conv = *(LDKCResult_FundingSignedDecodeErrorZ*)(_res_ptr);
17839 FREE(untag_ptr(_res));
17840 CResult_FundingSignedDecodeErrorZ_free(_res_conv);
17843 static inline uint64_t CResult_FundingSignedDecodeErrorZ_clone_ptr(LDKCResult_FundingSignedDecodeErrorZ *NONNULL_PTR arg) {
17844 LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
17845 *ret_conv = CResult_FundingSignedDecodeErrorZ_clone(arg);
17846 return tag_ptr(ret_conv, true);
17848 int64_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_clone_ptr"))) TS_CResult_FundingSignedDecodeErrorZ_clone_ptr(uint64_t arg) {
17849 LDKCResult_FundingSignedDecodeErrorZ* arg_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(arg);
17850 int64_t ret_conv = CResult_FundingSignedDecodeErrorZ_clone_ptr(arg_conv);
17854 uint64_t __attribute__((export_name("TS_CResult_FundingSignedDecodeErrorZ_clone"))) TS_CResult_FundingSignedDecodeErrorZ_clone(uint64_t orig) {
17855 LDKCResult_FundingSignedDecodeErrorZ* orig_conv = (LDKCResult_FundingSignedDecodeErrorZ*)untag_ptr(orig);
17856 LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
17857 *ret_conv = CResult_FundingSignedDecodeErrorZ_clone(orig_conv);
17858 return tag_ptr(ret_conv, true);
17861 uint64_t __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_ok"))) TS_CResult_ChannelReadyDecodeErrorZ_ok(uint64_t o) {
17862 LDKChannelReady o_conv;
17863 o_conv.inner = untag_ptr(o);
17864 o_conv.is_owned = ptr_is_owned(o);
17865 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17866 o_conv = ChannelReady_clone(&o_conv);
17867 LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
17868 *ret_conv = CResult_ChannelReadyDecodeErrorZ_ok(o_conv);
17869 return tag_ptr(ret_conv, true);
17872 uint64_t __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_err"))) TS_CResult_ChannelReadyDecodeErrorZ_err(uint64_t e) {
17873 LDKDecodeError e_conv;
17874 e_conv.inner = untag_ptr(e);
17875 e_conv.is_owned = ptr_is_owned(e);
17876 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17877 e_conv = DecodeError_clone(&e_conv);
17878 LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
17879 *ret_conv = CResult_ChannelReadyDecodeErrorZ_err(e_conv);
17880 return tag_ptr(ret_conv, true);
17883 jboolean __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_is_ok"))) TS_CResult_ChannelReadyDecodeErrorZ_is_ok(uint64_t o) {
17884 LDKCResult_ChannelReadyDecodeErrorZ* o_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(o);
17885 jboolean ret_conv = CResult_ChannelReadyDecodeErrorZ_is_ok(o_conv);
17889 void __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_free"))) TS_CResult_ChannelReadyDecodeErrorZ_free(uint64_t _res) {
17890 if (!ptr_is_owned(_res)) return;
17891 void* _res_ptr = untag_ptr(_res);
17892 CHECK_ACCESS(_res_ptr);
17893 LDKCResult_ChannelReadyDecodeErrorZ _res_conv = *(LDKCResult_ChannelReadyDecodeErrorZ*)(_res_ptr);
17894 FREE(untag_ptr(_res));
17895 CResult_ChannelReadyDecodeErrorZ_free(_res_conv);
17898 static inline uint64_t CResult_ChannelReadyDecodeErrorZ_clone_ptr(LDKCResult_ChannelReadyDecodeErrorZ *NONNULL_PTR arg) {
17899 LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
17900 *ret_conv = CResult_ChannelReadyDecodeErrorZ_clone(arg);
17901 return tag_ptr(ret_conv, true);
17903 int64_t __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelReadyDecodeErrorZ_clone_ptr(uint64_t arg) {
17904 LDKCResult_ChannelReadyDecodeErrorZ* arg_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(arg);
17905 int64_t ret_conv = CResult_ChannelReadyDecodeErrorZ_clone_ptr(arg_conv);
17909 uint64_t __attribute__((export_name("TS_CResult_ChannelReadyDecodeErrorZ_clone"))) TS_CResult_ChannelReadyDecodeErrorZ_clone(uint64_t orig) {
17910 LDKCResult_ChannelReadyDecodeErrorZ* orig_conv = (LDKCResult_ChannelReadyDecodeErrorZ*)untag_ptr(orig);
17911 LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
17912 *ret_conv = CResult_ChannelReadyDecodeErrorZ_clone(orig_conv);
17913 return tag_ptr(ret_conv, true);
17916 uint64_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_ok"))) TS_CResult_InitDecodeErrorZ_ok(uint64_t o) {
17918 o_conv.inner = untag_ptr(o);
17919 o_conv.is_owned = ptr_is_owned(o);
17920 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17921 o_conv = Init_clone(&o_conv);
17922 LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
17923 *ret_conv = CResult_InitDecodeErrorZ_ok(o_conv);
17924 return tag_ptr(ret_conv, true);
17927 uint64_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_err"))) TS_CResult_InitDecodeErrorZ_err(uint64_t e) {
17928 LDKDecodeError e_conv;
17929 e_conv.inner = untag_ptr(e);
17930 e_conv.is_owned = ptr_is_owned(e);
17931 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17932 e_conv = DecodeError_clone(&e_conv);
17933 LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
17934 *ret_conv = CResult_InitDecodeErrorZ_err(e_conv);
17935 return tag_ptr(ret_conv, true);
17938 jboolean __attribute__((export_name("TS_CResult_InitDecodeErrorZ_is_ok"))) TS_CResult_InitDecodeErrorZ_is_ok(uint64_t o) {
17939 LDKCResult_InitDecodeErrorZ* o_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(o);
17940 jboolean ret_conv = CResult_InitDecodeErrorZ_is_ok(o_conv);
17944 void __attribute__((export_name("TS_CResult_InitDecodeErrorZ_free"))) TS_CResult_InitDecodeErrorZ_free(uint64_t _res) {
17945 if (!ptr_is_owned(_res)) return;
17946 void* _res_ptr = untag_ptr(_res);
17947 CHECK_ACCESS(_res_ptr);
17948 LDKCResult_InitDecodeErrorZ _res_conv = *(LDKCResult_InitDecodeErrorZ*)(_res_ptr);
17949 FREE(untag_ptr(_res));
17950 CResult_InitDecodeErrorZ_free(_res_conv);
17953 static inline uint64_t CResult_InitDecodeErrorZ_clone_ptr(LDKCResult_InitDecodeErrorZ *NONNULL_PTR arg) {
17954 LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
17955 *ret_conv = CResult_InitDecodeErrorZ_clone(arg);
17956 return tag_ptr(ret_conv, true);
17958 int64_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_clone_ptr"))) TS_CResult_InitDecodeErrorZ_clone_ptr(uint64_t arg) {
17959 LDKCResult_InitDecodeErrorZ* arg_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(arg);
17960 int64_t ret_conv = CResult_InitDecodeErrorZ_clone_ptr(arg_conv);
17964 uint64_t __attribute__((export_name("TS_CResult_InitDecodeErrorZ_clone"))) TS_CResult_InitDecodeErrorZ_clone(uint64_t orig) {
17965 LDKCResult_InitDecodeErrorZ* orig_conv = (LDKCResult_InitDecodeErrorZ*)untag_ptr(orig);
17966 LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
17967 *ret_conv = CResult_InitDecodeErrorZ_clone(orig_conv);
17968 return tag_ptr(ret_conv, true);
17971 uint64_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_ok"))) TS_CResult_OpenChannelDecodeErrorZ_ok(uint64_t o) {
17972 LDKOpenChannel o_conv;
17973 o_conv.inner = untag_ptr(o);
17974 o_conv.is_owned = ptr_is_owned(o);
17975 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
17976 o_conv = OpenChannel_clone(&o_conv);
17977 LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
17978 *ret_conv = CResult_OpenChannelDecodeErrorZ_ok(o_conv);
17979 return tag_ptr(ret_conv, true);
17982 uint64_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_err"))) TS_CResult_OpenChannelDecodeErrorZ_err(uint64_t e) {
17983 LDKDecodeError e_conv;
17984 e_conv.inner = untag_ptr(e);
17985 e_conv.is_owned = ptr_is_owned(e);
17986 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
17987 e_conv = DecodeError_clone(&e_conv);
17988 LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
17989 *ret_conv = CResult_OpenChannelDecodeErrorZ_err(e_conv);
17990 return tag_ptr(ret_conv, true);
17993 jboolean __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_is_ok"))) TS_CResult_OpenChannelDecodeErrorZ_is_ok(uint64_t o) {
17994 LDKCResult_OpenChannelDecodeErrorZ* o_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(o);
17995 jboolean ret_conv = CResult_OpenChannelDecodeErrorZ_is_ok(o_conv);
17999 void __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_free"))) TS_CResult_OpenChannelDecodeErrorZ_free(uint64_t _res) {
18000 if (!ptr_is_owned(_res)) return;
18001 void* _res_ptr = untag_ptr(_res);
18002 CHECK_ACCESS(_res_ptr);
18003 LDKCResult_OpenChannelDecodeErrorZ _res_conv = *(LDKCResult_OpenChannelDecodeErrorZ*)(_res_ptr);
18004 FREE(untag_ptr(_res));
18005 CResult_OpenChannelDecodeErrorZ_free(_res_conv);
18008 static inline uint64_t CResult_OpenChannelDecodeErrorZ_clone_ptr(LDKCResult_OpenChannelDecodeErrorZ *NONNULL_PTR arg) {
18009 LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
18010 *ret_conv = CResult_OpenChannelDecodeErrorZ_clone(arg);
18011 return tag_ptr(ret_conv, true);
18013 int64_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_clone_ptr"))) TS_CResult_OpenChannelDecodeErrorZ_clone_ptr(uint64_t arg) {
18014 LDKCResult_OpenChannelDecodeErrorZ* arg_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(arg);
18015 int64_t ret_conv = CResult_OpenChannelDecodeErrorZ_clone_ptr(arg_conv);
18019 uint64_t __attribute__((export_name("TS_CResult_OpenChannelDecodeErrorZ_clone"))) TS_CResult_OpenChannelDecodeErrorZ_clone(uint64_t orig) {
18020 LDKCResult_OpenChannelDecodeErrorZ* orig_conv = (LDKCResult_OpenChannelDecodeErrorZ*)untag_ptr(orig);
18021 LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
18022 *ret_conv = CResult_OpenChannelDecodeErrorZ_clone(orig_conv);
18023 return tag_ptr(ret_conv, true);
18026 uint64_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_ok"))) TS_CResult_RevokeAndACKDecodeErrorZ_ok(uint64_t o) {
18027 LDKRevokeAndACK o_conv;
18028 o_conv.inner = untag_ptr(o);
18029 o_conv.is_owned = ptr_is_owned(o);
18030 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18031 o_conv = RevokeAndACK_clone(&o_conv);
18032 LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
18033 *ret_conv = CResult_RevokeAndACKDecodeErrorZ_ok(o_conv);
18034 return tag_ptr(ret_conv, true);
18037 uint64_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_err"))) TS_CResult_RevokeAndACKDecodeErrorZ_err(uint64_t e) {
18038 LDKDecodeError e_conv;
18039 e_conv.inner = untag_ptr(e);
18040 e_conv.is_owned = ptr_is_owned(e);
18041 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18042 e_conv = DecodeError_clone(&e_conv);
18043 LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
18044 *ret_conv = CResult_RevokeAndACKDecodeErrorZ_err(e_conv);
18045 return tag_ptr(ret_conv, true);
18048 jboolean __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_is_ok"))) TS_CResult_RevokeAndACKDecodeErrorZ_is_ok(uint64_t o) {
18049 LDKCResult_RevokeAndACKDecodeErrorZ* o_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(o);
18050 jboolean ret_conv = CResult_RevokeAndACKDecodeErrorZ_is_ok(o_conv);
18054 void __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_free"))) TS_CResult_RevokeAndACKDecodeErrorZ_free(uint64_t _res) {
18055 if (!ptr_is_owned(_res)) return;
18056 void* _res_ptr = untag_ptr(_res);
18057 CHECK_ACCESS(_res_ptr);
18058 LDKCResult_RevokeAndACKDecodeErrorZ _res_conv = *(LDKCResult_RevokeAndACKDecodeErrorZ*)(_res_ptr);
18059 FREE(untag_ptr(_res));
18060 CResult_RevokeAndACKDecodeErrorZ_free(_res_conv);
18063 static inline uint64_t CResult_RevokeAndACKDecodeErrorZ_clone_ptr(LDKCResult_RevokeAndACKDecodeErrorZ *NONNULL_PTR arg) {
18064 LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
18065 *ret_conv = CResult_RevokeAndACKDecodeErrorZ_clone(arg);
18066 return tag_ptr(ret_conv, true);
18068 int64_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_clone_ptr"))) TS_CResult_RevokeAndACKDecodeErrorZ_clone_ptr(uint64_t arg) {
18069 LDKCResult_RevokeAndACKDecodeErrorZ* arg_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(arg);
18070 int64_t ret_conv = CResult_RevokeAndACKDecodeErrorZ_clone_ptr(arg_conv);
18074 uint64_t __attribute__((export_name("TS_CResult_RevokeAndACKDecodeErrorZ_clone"))) TS_CResult_RevokeAndACKDecodeErrorZ_clone(uint64_t orig) {
18075 LDKCResult_RevokeAndACKDecodeErrorZ* orig_conv = (LDKCResult_RevokeAndACKDecodeErrorZ*)untag_ptr(orig);
18076 LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
18077 *ret_conv = CResult_RevokeAndACKDecodeErrorZ_clone(orig_conv);
18078 return tag_ptr(ret_conv, true);
18081 uint64_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_ok"))) TS_CResult_ShutdownDecodeErrorZ_ok(uint64_t o) {
18082 LDKShutdown o_conv;
18083 o_conv.inner = untag_ptr(o);
18084 o_conv.is_owned = ptr_is_owned(o);
18085 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18086 o_conv = Shutdown_clone(&o_conv);
18087 LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
18088 *ret_conv = CResult_ShutdownDecodeErrorZ_ok(o_conv);
18089 return tag_ptr(ret_conv, true);
18092 uint64_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_err"))) TS_CResult_ShutdownDecodeErrorZ_err(uint64_t e) {
18093 LDKDecodeError e_conv;
18094 e_conv.inner = untag_ptr(e);
18095 e_conv.is_owned = ptr_is_owned(e);
18096 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18097 e_conv = DecodeError_clone(&e_conv);
18098 LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
18099 *ret_conv = CResult_ShutdownDecodeErrorZ_err(e_conv);
18100 return tag_ptr(ret_conv, true);
18103 jboolean __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_is_ok"))) TS_CResult_ShutdownDecodeErrorZ_is_ok(uint64_t o) {
18104 LDKCResult_ShutdownDecodeErrorZ* o_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(o);
18105 jboolean ret_conv = CResult_ShutdownDecodeErrorZ_is_ok(o_conv);
18109 void __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_free"))) TS_CResult_ShutdownDecodeErrorZ_free(uint64_t _res) {
18110 if (!ptr_is_owned(_res)) return;
18111 void* _res_ptr = untag_ptr(_res);
18112 CHECK_ACCESS(_res_ptr);
18113 LDKCResult_ShutdownDecodeErrorZ _res_conv = *(LDKCResult_ShutdownDecodeErrorZ*)(_res_ptr);
18114 FREE(untag_ptr(_res));
18115 CResult_ShutdownDecodeErrorZ_free(_res_conv);
18118 static inline uint64_t CResult_ShutdownDecodeErrorZ_clone_ptr(LDKCResult_ShutdownDecodeErrorZ *NONNULL_PTR arg) {
18119 LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
18120 *ret_conv = CResult_ShutdownDecodeErrorZ_clone(arg);
18121 return tag_ptr(ret_conv, true);
18123 int64_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_clone_ptr"))) TS_CResult_ShutdownDecodeErrorZ_clone_ptr(uint64_t arg) {
18124 LDKCResult_ShutdownDecodeErrorZ* arg_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(arg);
18125 int64_t ret_conv = CResult_ShutdownDecodeErrorZ_clone_ptr(arg_conv);
18129 uint64_t __attribute__((export_name("TS_CResult_ShutdownDecodeErrorZ_clone"))) TS_CResult_ShutdownDecodeErrorZ_clone(uint64_t orig) {
18130 LDKCResult_ShutdownDecodeErrorZ* orig_conv = (LDKCResult_ShutdownDecodeErrorZ*)untag_ptr(orig);
18131 LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
18132 *ret_conv = CResult_ShutdownDecodeErrorZ_clone(orig_conv);
18133 return tag_ptr(ret_conv, true);
18136 uint64_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_ok"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_ok(uint64_t o) {
18137 LDKUpdateFailHTLC o_conv;
18138 o_conv.inner = untag_ptr(o);
18139 o_conv.is_owned = ptr_is_owned(o);
18140 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18141 o_conv = UpdateFailHTLC_clone(&o_conv);
18142 LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
18143 *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_ok(o_conv);
18144 return tag_ptr(ret_conv, true);
18147 uint64_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_err"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_err(uint64_t e) {
18148 LDKDecodeError e_conv;
18149 e_conv.inner = untag_ptr(e);
18150 e_conv.is_owned = ptr_is_owned(e);
18151 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18152 e_conv = DecodeError_clone(&e_conv);
18153 LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
18154 *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_err(e_conv);
18155 return tag_ptr(ret_conv, true);
18158 jboolean __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_is_ok"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_is_ok(uint64_t o) {
18159 LDKCResult_UpdateFailHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(o);
18160 jboolean ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_is_ok(o_conv);
18164 void __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_free"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_free(uint64_t _res) {
18165 if (!ptr_is_owned(_res)) return;
18166 void* _res_ptr = untag_ptr(_res);
18167 CHECK_ACCESS(_res_ptr);
18168 LDKCResult_UpdateFailHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFailHTLCDecodeErrorZ*)(_res_ptr);
18169 FREE(untag_ptr(_res));
18170 CResult_UpdateFailHTLCDecodeErrorZ_free(_res_conv);
18173 static inline uint64_t CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFailHTLCDecodeErrorZ *NONNULL_PTR arg) {
18174 LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
18175 *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_clone(arg);
18176 return tag_ptr(ret_conv, true);
18178 int64_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(uint64_t arg) {
18179 LDKCResult_UpdateFailHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(arg);
18180 int64_t ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_clone_ptr(arg_conv);
18184 uint64_t __attribute__((export_name("TS_CResult_UpdateFailHTLCDecodeErrorZ_clone"))) TS_CResult_UpdateFailHTLCDecodeErrorZ_clone(uint64_t orig) {
18185 LDKCResult_UpdateFailHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFailHTLCDecodeErrorZ*)untag_ptr(orig);
18186 LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
18187 *ret_conv = CResult_UpdateFailHTLCDecodeErrorZ_clone(orig_conv);
18188 return tag_ptr(ret_conv, true);
18191 uint64_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(uint64_t o) {
18192 LDKUpdateFailMalformedHTLC o_conv;
18193 o_conv.inner = untag_ptr(o);
18194 o_conv.is_owned = ptr_is_owned(o);
18195 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18196 o_conv = UpdateFailMalformedHTLC_clone(&o_conv);
18197 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
18198 *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_ok(o_conv);
18199 return tag_ptr(ret_conv, true);
18202 uint64_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_err"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(uint64_t e) {
18203 LDKDecodeError e_conv;
18204 e_conv.inner = untag_ptr(e);
18205 e_conv.is_owned = ptr_is_owned(e);
18206 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18207 e_conv = DecodeError_clone(&e_conv);
18208 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
18209 *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_err(e_conv);
18210 return tag_ptr(ret_conv, true);
18213 jboolean __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(uint64_t o) {
18214 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(o);
18215 jboolean ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_is_ok(o_conv);
18219 void __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_free"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(uint64_t _res) {
18220 if (!ptr_is_owned(_res)) return;
18221 void* _res_ptr = untag_ptr(_res);
18222 CHECK_ACCESS(_res_ptr);
18223 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)(_res_ptr);
18224 FREE(untag_ptr(_res));
18225 CResult_UpdateFailMalformedHTLCDecodeErrorZ_free(_res_conv);
18228 static inline uint64_t CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ *NONNULL_PTR arg) {
18229 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
18230 *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(arg);
18231 return tag_ptr(ret_conv, true);
18233 int64_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(uint64_t arg) {
18234 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(arg);
18235 int64_t ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone_ptr(arg_conv);
18239 uint64_t __attribute__((export_name("TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone"))) TS_CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(uint64_t orig) {
18240 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ*)untag_ptr(orig);
18241 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
18242 *ret_conv = CResult_UpdateFailMalformedHTLCDecodeErrorZ_clone(orig_conv);
18243 return tag_ptr(ret_conv, true);
18246 uint64_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_ok"))) TS_CResult_UpdateFeeDecodeErrorZ_ok(uint64_t o) {
18247 LDKUpdateFee o_conv;
18248 o_conv.inner = untag_ptr(o);
18249 o_conv.is_owned = ptr_is_owned(o);
18250 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18251 o_conv = UpdateFee_clone(&o_conv);
18252 LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
18253 *ret_conv = CResult_UpdateFeeDecodeErrorZ_ok(o_conv);
18254 return tag_ptr(ret_conv, true);
18257 uint64_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_err"))) TS_CResult_UpdateFeeDecodeErrorZ_err(uint64_t e) {
18258 LDKDecodeError e_conv;
18259 e_conv.inner = untag_ptr(e);
18260 e_conv.is_owned = ptr_is_owned(e);
18261 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18262 e_conv = DecodeError_clone(&e_conv);
18263 LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
18264 *ret_conv = CResult_UpdateFeeDecodeErrorZ_err(e_conv);
18265 return tag_ptr(ret_conv, true);
18268 jboolean __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_is_ok"))) TS_CResult_UpdateFeeDecodeErrorZ_is_ok(uint64_t o) {
18269 LDKCResult_UpdateFeeDecodeErrorZ* o_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(o);
18270 jboolean ret_conv = CResult_UpdateFeeDecodeErrorZ_is_ok(o_conv);
18274 void __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_free"))) TS_CResult_UpdateFeeDecodeErrorZ_free(uint64_t _res) {
18275 if (!ptr_is_owned(_res)) return;
18276 void* _res_ptr = untag_ptr(_res);
18277 CHECK_ACCESS(_res_ptr);
18278 LDKCResult_UpdateFeeDecodeErrorZ _res_conv = *(LDKCResult_UpdateFeeDecodeErrorZ*)(_res_ptr);
18279 FREE(untag_ptr(_res));
18280 CResult_UpdateFeeDecodeErrorZ_free(_res_conv);
18283 static inline uint64_t CResult_UpdateFeeDecodeErrorZ_clone_ptr(LDKCResult_UpdateFeeDecodeErrorZ *NONNULL_PTR arg) {
18284 LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
18285 *ret_conv = CResult_UpdateFeeDecodeErrorZ_clone(arg);
18286 return tag_ptr(ret_conv, true);
18288 int64_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_clone_ptr"))) TS_CResult_UpdateFeeDecodeErrorZ_clone_ptr(uint64_t arg) {
18289 LDKCResult_UpdateFeeDecodeErrorZ* arg_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(arg);
18290 int64_t ret_conv = CResult_UpdateFeeDecodeErrorZ_clone_ptr(arg_conv);
18294 uint64_t __attribute__((export_name("TS_CResult_UpdateFeeDecodeErrorZ_clone"))) TS_CResult_UpdateFeeDecodeErrorZ_clone(uint64_t orig) {
18295 LDKCResult_UpdateFeeDecodeErrorZ* orig_conv = (LDKCResult_UpdateFeeDecodeErrorZ*)untag_ptr(orig);
18296 LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
18297 *ret_conv = CResult_UpdateFeeDecodeErrorZ_clone(orig_conv);
18298 return tag_ptr(ret_conv, true);
18301 uint64_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_ok"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_ok(uint64_t o) {
18302 LDKUpdateFulfillHTLC o_conv;
18303 o_conv.inner = untag_ptr(o);
18304 o_conv.is_owned = ptr_is_owned(o);
18305 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18306 o_conv = UpdateFulfillHTLC_clone(&o_conv);
18307 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
18308 *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_ok(o_conv);
18309 return tag_ptr(ret_conv, true);
18312 uint64_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_err"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_err(uint64_t e) {
18313 LDKDecodeError e_conv;
18314 e_conv.inner = untag_ptr(e);
18315 e_conv.is_owned = ptr_is_owned(e);
18316 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18317 e_conv = DecodeError_clone(&e_conv);
18318 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
18319 *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_err(e_conv);
18320 return tag_ptr(ret_conv, true);
18323 jboolean __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(uint64_t o) {
18324 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(o);
18325 jboolean ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_is_ok(o_conv);
18329 void __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_free"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_free(uint64_t _res) {
18330 if (!ptr_is_owned(_res)) return;
18331 void* _res_ptr = untag_ptr(_res);
18332 CHECK_ACCESS(_res_ptr);
18333 LDKCResult_UpdateFulfillHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)(_res_ptr);
18334 FREE(untag_ptr(_res));
18335 CResult_UpdateFulfillHTLCDecodeErrorZ_free(_res_conv);
18338 static inline uint64_t CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateFulfillHTLCDecodeErrorZ *NONNULL_PTR arg) {
18339 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
18340 *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_clone(arg);
18341 return tag_ptr(ret_conv, true);
18343 int64_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(uint64_t arg) {
18344 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(arg);
18345 int64_t ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_clone_ptr(arg_conv);
18349 uint64_t __attribute__((export_name("TS_CResult_UpdateFulfillHTLCDecodeErrorZ_clone"))) TS_CResult_UpdateFulfillHTLCDecodeErrorZ_clone(uint64_t orig) {
18350 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateFulfillHTLCDecodeErrorZ*)untag_ptr(orig);
18351 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
18352 *ret_conv = CResult_UpdateFulfillHTLCDecodeErrorZ_clone(orig_conv);
18353 return tag_ptr(ret_conv, true);
18356 uint64_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_ok"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_ok(uint64_t o) {
18357 LDKUpdateAddHTLC o_conv;
18358 o_conv.inner = untag_ptr(o);
18359 o_conv.is_owned = ptr_is_owned(o);
18360 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18361 o_conv = UpdateAddHTLC_clone(&o_conv);
18362 LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
18363 *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_ok(o_conv);
18364 return tag_ptr(ret_conv, true);
18367 uint64_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_err"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_err(uint64_t e) {
18368 LDKDecodeError e_conv;
18369 e_conv.inner = untag_ptr(e);
18370 e_conv.is_owned = ptr_is_owned(e);
18371 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18372 e_conv = DecodeError_clone(&e_conv);
18373 LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
18374 *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_err(e_conv);
18375 return tag_ptr(ret_conv, true);
18378 jboolean __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_is_ok"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_is_ok(uint64_t o) {
18379 LDKCResult_UpdateAddHTLCDecodeErrorZ* o_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(o);
18380 jboolean ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_is_ok(o_conv);
18384 void __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_free"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_free(uint64_t _res) {
18385 if (!ptr_is_owned(_res)) return;
18386 void* _res_ptr = untag_ptr(_res);
18387 CHECK_ACCESS(_res_ptr);
18388 LDKCResult_UpdateAddHTLCDecodeErrorZ _res_conv = *(LDKCResult_UpdateAddHTLCDecodeErrorZ*)(_res_ptr);
18389 FREE(untag_ptr(_res));
18390 CResult_UpdateAddHTLCDecodeErrorZ_free(_res_conv);
18393 static inline uint64_t CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(LDKCResult_UpdateAddHTLCDecodeErrorZ *NONNULL_PTR arg) {
18394 LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
18395 *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_clone(arg);
18396 return tag_ptr(ret_conv, true);
18398 int64_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(uint64_t arg) {
18399 LDKCResult_UpdateAddHTLCDecodeErrorZ* arg_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(arg);
18400 int64_t ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_clone_ptr(arg_conv);
18404 uint64_t __attribute__((export_name("TS_CResult_UpdateAddHTLCDecodeErrorZ_clone"))) TS_CResult_UpdateAddHTLCDecodeErrorZ_clone(uint64_t orig) {
18405 LDKCResult_UpdateAddHTLCDecodeErrorZ* orig_conv = (LDKCResult_UpdateAddHTLCDecodeErrorZ*)untag_ptr(orig);
18406 LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
18407 *ret_conv = CResult_UpdateAddHTLCDecodeErrorZ_clone(orig_conv);
18408 return tag_ptr(ret_conv, true);
18411 uint64_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_ok"))) TS_CResult_PingDecodeErrorZ_ok(uint64_t o) {
18413 o_conv.inner = untag_ptr(o);
18414 o_conv.is_owned = ptr_is_owned(o);
18415 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18416 o_conv = Ping_clone(&o_conv);
18417 LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
18418 *ret_conv = CResult_PingDecodeErrorZ_ok(o_conv);
18419 return tag_ptr(ret_conv, true);
18422 uint64_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_err"))) TS_CResult_PingDecodeErrorZ_err(uint64_t e) {
18423 LDKDecodeError e_conv;
18424 e_conv.inner = untag_ptr(e);
18425 e_conv.is_owned = ptr_is_owned(e);
18426 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18427 e_conv = DecodeError_clone(&e_conv);
18428 LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
18429 *ret_conv = CResult_PingDecodeErrorZ_err(e_conv);
18430 return tag_ptr(ret_conv, true);
18433 jboolean __attribute__((export_name("TS_CResult_PingDecodeErrorZ_is_ok"))) TS_CResult_PingDecodeErrorZ_is_ok(uint64_t o) {
18434 LDKCResult_PingDecodeErrorZ* o_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(o);
18435 jboolean ret_conv = CResult_PingDecodeErrorZ_is_ok(o_conv);
18439 void __attribute__((export_name("TS_CResult_PingDecodeErrorZ_free"))) TS_CResult_PingDecodeErrorZ_free(uint64_t _res) {
18440 if (!ptr_is_owned(_res)) return;
18441 void* _res_ptr = untag_ptr(_res);
18442 CHECK_ACCESS(_res_ptr);
18443 LDKCResult_PingDecodeErrorZ _res_conv = *(LDKCResult_PingDecodeErrorZ*)(_res_ptr);
18444 FREE(untag_ptr(_res));
18445 CResult_PingDecodeErrorZ_free(_res_conv);
18448 static inline uint64_t CResult_PingDecodeErrorZ_clone_ptr(LDKCResult_PingDecodeErrorZ *NONNULL_PTR arg) {
18449 LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
18450 *ret_conv = CResult_PingDecodeErrorZ_clone(arg);
18451 return tag_ptr(ret_conv, true);
18453 int64_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_clone_ptr"))) TS_CResult_PingDecodeErrorZ_clone_ptr(uint64_t arg) {
18454 LDKCResult_PingDecodeErrorZ* arg_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(arg);
18455 int64_t ret_conv = CResult_PingDecodeErrorZ_clone_ptr(arg_conv);
18459 uint64_t __attribute__((export_name("TS_CResult_PingDecodeErrorZ_clone"))) TS_CResult_PingDecodeErrorZ_clone(uint64_t orig) {
18460 LDKCResult_PingDecodeErrorZ* orig_conv = (LDKCResult_PingDecodeErrorZ*)untag_ptr(orig);
18461 LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
18462 *ret_conv = CResult_PingDecodeErrorZ_clone(orig_conv);
18463 return tag_ptr(ret_conv, true);
18466 uint64_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_ok"))) TS_CResult_PongDecodeErrorZ_ok(uint64_t o) {
18468 o_conv.inner = untag_ptr(o);
18469 o_conv.is_owned = ptr_is_owned(o);
18470 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18471 o_conv = Pong_clone(&o_conv);
18472 LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
18473 *ret_conv = CResult_PongDecodeErrorZ_ok(o_conv);
18474 return tag_ptr(ret_conv, true);
18477 uint64_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_err"))) TS_CResult_PongDecodeErrorZ_err(uint64_t e) {
18478 LDKDecodeError e_conv;
18479 e_conv.inner = untag_ptr(e);
18480 e_conv.is_owned = ptr_is_owned(e);
18481 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18482 e_conv = DecodeError_clone(&e_conv);
18483 LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
18484 *ret_conv = CResult_PongDecodeErrorZ_err(e_conv);
18485 return tag_ptr(ret_conv, true);
18488 jboolean __attribute__((export_name("TS_CResult_PongDecodeErrorZ_is_ok"))) TS_CResult_PongDecodeErrorZ_is_ok(uint64_t o) {
18489 LDKCResult_PongDecodeErrorZ* o_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(o);
18490 jboolean ret_conv = CResult_PongDecodeErrorZ_is_ok(o_conv);
18494 void __attribute__((export_name("TS_CResult_PongDecodeErrorZ_free"))) TS_CResult_PongDecodeErrorZ_free(uint64_t _res) {
18495 if (!ptr_is_owned(_res)) return;
18496 void* _res_ptr = untag_ptr(_res);
18497 CHECK_ACCESS(_res_ptr);
18498 LDKCResult_PongDecodeErrorZ _res_conv = *(LDKCResult_PongDecodeErrorZ*)(_res_ptr);
18499 FREE(untag_ptr(_res));
18500 CResult_PongDecodeErrorZ_free(_res_conv);
18503 static inline uint64_t CResult_PongDecodeErrorZ_clone_ptr(LDKCResult_PongDecodeErrorZ *NONNULL_PTR arg) {
18504 LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
18505 *ret_conv = CResult_PongDecodeErrorZ_clone(arg);
18506 return tag_ptr(ret_conv, true);
18508 int64_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_clone_ptr"))) TS_CResult_PongDecodeErrorZ_clone_ptr(uint64_t arg) {
18509 LDKCResult_PongDecodeErrorZ* arg_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(arg);
18510 int64_t ret_conv = CResult_PongDecodeErrorZ_clone_ptr(arg_conv);
18514 uint64_t __attribute__((export_name("TS_CResult_PongDecodeErrorZ_clone"))) TS_CResult_PongDecodeErrorZ_clone(uint64_t orig) {
18515 LDKCResult_PongDecodeErrorZ* orig_conv = (LDKCResult_PongDecodeErrorZ*)untag_ptr(orig);
18516 LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
18517 *ret_conv = CResult_PongDecodeErrorZ_clone(orig_conv);
18518 return tag_ptr(ret_conv, true);
18521 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(uint64_t o) {
18522 LDKUnsignedChannelAnnouncement o_conv;
18523 o_conv.inner = untag_ptr(o);
18524 o_conv.is_owned = ptr_is_owned(o);
18525 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18526 o_conv = UnsignedChannelAnnouncement_clone(&o_conv);
18527 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
18528 *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_ok(o_conv);
18529 return tag_ptr(ret_conv, true);
18532 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_err"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(uint64_t e) {
18533 LDKDecodeError e_conv;
18534 e_conv.inner = untag_ptr(e);
18535 e_conv.is_owned = ptr_is_owned(e);
18536 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18537 e_conv = DecodeError_clone(&e_conv);
18538 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
18539 *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_err(e_conv);
18540 return tag_ptr(ret_conv, true);
18543 jboolean __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(uint64_t o) {
18544 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* o_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(o);
18545 jboolean ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_is_ok(o_conv);
18549 void __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_free"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(uint64_t _res) {
18550 if (!ptr_is_owned(_res)) return;
18551 void* _res_ptr = untag_ptr(_res);
18552 CHECK_ACCESS(_res_ptr);
18553 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)(_res_ptr);
18554 FREE(untag_ptr(_res));
18555 CResult_UnsignedChannelAnnouncementDecodeErrorZ_free(_res_conv);
18558 static inline uint64_t CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ *NONNULL_PTR arg) {
18559 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
18560 *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(arg);
18561 return tag_ptr(ret_conv, true);
18563 int64_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(uint64_t arg) {
18564 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(arg);
18565 int64_t ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone_ptr(arg_conv);
18569 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone"))) TS_CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(uint64_t orig) {
18570 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ*)untag_ptr(orig);
18571 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
18572 *ret_conv = CResult_UnsignedChannelAnnouncementDecodeErrorZ_clone(orig_conv);
18573 return tag_ptr(ret_conv, true);
18576 uint64_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_ok"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_ok(uint64_t o) {
18577 LDKChannelAnnouncement o_conv;
18578 o_conv.inner = untag_ptr(o);
18579 o_conv.is_owned = ptr_is_owned(o);
18580 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18581 o_conv = ChannelAnnouncement_clone(&o_conv);
18582 LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
18583 *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_ok(o_conv);
18584 return tag_ptr(ret_conv, true);
18587 uint64_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_err"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_err(uint64_t e) {
18588 LDKDecodeError e_conv;
18589 e_conv.inner = untag_ptr(e);
18590 e_conv.is_owned = ptr_is_owned(e);
18591 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18592 e_conv = DecodeError_clone(&e_conv);
18593 LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
18594 *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_err(e_conv);
18595 return tag_ptr(ret_conv, true);
18598 jboolean __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_is_ok"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_is_ok(uint64_t o) {
18599 LDKCResult_ChannelAnnouncementDecodeErrorZ* o_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(o);
18600 jboolean ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_is_ok(o_conv);
18604 void __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_free"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_free(uint64_t _res) {
18605 if (!ptr_is_owned(_res)) return;
18606 void* _res_ptr = untag_ptr(_res);
18607 CHECK_ACCESS(_res_ptr);
18608 LDKCResult_ChannelAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_ChannelAnnouncementDecodeErrorZ*)(_res_ptr);
18609 FREE(untag_ptr(_res));
18610 CResult_ChannelAnnouncementDecodeErrorZ_free(_res_conv);
18613 static inline uint64_t CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_ChannelAnnouncementDecodeErrorZ *NONNULL_PTR arg) {
18614 LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
18615 *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_clone(arg);
18616 return tag_ptr(ret_conv, true);
18618 int64_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(uint64_t arg) {
18619 LDKCResult_ChannelAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(arg);
18620 int64_t ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_clone_ptr(arg_conv);
18624 uint64_t __attribute__((export_name("TS_CResult_ChannelAnnouncementDecodeErrorZ_clone"))) TS_CResult_ChannelAnnouncementDecodeErrorZ_clone(uint64_t orig) {
18625 LDKCResult_ChannelAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_ChannelAnnouncementDecodeErrorZ*)untag_ptr(orig);
18626 LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
18627 *ret_conv = CResult_ChannelAnnouncementDecodeErrorZ_clone(orig_conv);
18628 return tag_ptr(ret_conv, true);
18631 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_ok"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_ok(uint64_t o) {
18632 LDKUnsignedChannelUpdate o_conv;
18633 o_conv.inner = untag_ptr(o);
18634 o_conv.is_owned = ptr_is_owned(o);
18635 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18636 o_conv = UnsignedChannelUpdate_clone(&o_conv);
18637 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
18638 *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_ok(o_conv);
18639 return tag_ptr(ret_conv, true);
18642 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_err"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_err(uint64_t e) {
18643 LDKDecodeError e_conv;
18644 e_conv.inner = untag_ptr(e);
18645 e_conv.is_owned = ptr_is_owned(e);
18646 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18647 e_conv = DecodeError_clone(&e_conv);
18648 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
18649 *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_err(e_conv);
18650 return tag_ptr(ret_conv, true);
18653 jboolean __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(uint64_t o) {
18654 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* o_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(o);
18655 jboolean ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_is_ok(o_conv);
18659 void __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_free"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_free(uint64_t _res) {
18660 if (!ptr_is_owned(_res)) return;
18661 void* _res_ptr = untag_ptr(_res);
18662 CHECK_ACCESS(_res_ptr);
18663 LDKCResult_UnsignedChannelUpdateDecodeErrorZ _res_conv = *(LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)(_res_ptr);
18664 FREE(untag_ptr(_res));
18665 CResult_UnsignedChannelUpdateDecodeErrorZ_free(_res_conv);
18668 static inline uint64_t CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(LDKCResult_UnsignedChannelUpdateDecodeErrorZ *NONNULL_PTR arg) {
18669 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
18670 *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_clone(arg);
18671 return tag_ptr(ret_conv, true);
18673 int64_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(uint64_t arg) {
18674 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* arg_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(arg);
18675 int64_t ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_clone_ptr(arg_conv);
18679 uint64_t __attribute__((export_name("TS_CResult_UnsignedChannelUpdateDecodeErrorZ_clone"))) TS_CResult_UnsignedChannelUpdateDecodeErrorZ_clone(uint64_t orig) {
18680 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* orig_conv = (LDKCResult_UnsignedChannelUpdateDecodeErrorZ*)untag_ptr(orig);
18681 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
18682 *ret_conv = CResult_UnsignedChannelUpdateDecodeErrorZ_clone(orig_conv);
18683 return tag_ptr(ret_conv, true);
18686 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_ok"))) TS_CResult_ChannelUpdateDecodeErrorZ_ok(uint64_t o) {
18687 LDKChannelUpdate o_conv;
18688 o_conv.inner = untag_ptr(o);
18689 o_conv.is_owned = ptr_is_owned(o);
18690 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18691 o_conv = ChannelUpdate_clone(&o_conv);
18692 LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
18693 *ret_conv = CResult_ChannelUpdateDecodeErrorZ_ok(o_conv);
18694 return tag_ptr(ret_conv, true);
18697 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_err"))) TS_CResult_ChannelUpdateDecodeErrorZ_err(uint64_t e) {
18698 LDKDecodeError e_conv;
18699 e_conv.inner = untag_ptr(e);
18700 e_conv.is_owned = ptr_is_owned(e);
18701 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18702 e_conv = DecodeError_clone(&e_conv);
18703 LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
18704 *ret_conv = CResult_ChannelUpdateDecodeErrorZ_err(e_conv);
18705 return tag_ptr(ret_conv, true);
18708 jboolean __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_is_ok"))) TS_CResult_ChannelUpdateDecodeErrorZ_is_ok(uint64_t o) {
18709 LDKCResult_ChannelUpdateDecodeErrorZ* o_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(o);
18710 jboolean ret_conv = CResult_ChannelUpdateDecodeErrorZ_is_ok(o_conv);
18714 void __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_free"))) TS_CResult_ChannelUpdateDecodeErrorZ_free(uint64_t _res) {
18715 if (!ptr_is_owned(_res)) return;
18716 void* _res_ptr = untag_ptr(_res);
18717 CHECK_ACCESS(_res_ptr);
18718 LDKCResult_ChannelUpdateDecodeErrorZ _res_conv = *(LDKCResult_ChannelUpdateDecodeErrorZ*)(_res_ptr);
18719 FREE(untag_ptr(_res));
18720 CResult_ChannelUpdateDecodeErrorZ_free(_res_conv);
18723 static inline uint64_t CResult_ChannelUpdateDecodeErrorZ_clone_ptr(LDKCResult_ChannelUpdateDecodeErrorZ *NONNULL_PTR arg) {
18724 LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
18725 *ret_conv = CResult_ChannelUpdateDecodeErrorZ_clone(arg);
18726 return tag_ptr(ret_conv, true);
18728 int64_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_clone_ptr"))) TS_CResult_ChannelUpdateDecodeErrorZ_clone_ptr(uint64_t arg) {
18729 LDKCResult_ChannelUpdateDecodeErrorZ* arg_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(arg);
18730 int64_t ret_conv = CResult_ChannelUpdateDecodeErrorZ_clone_ptr(arg_conv);
18734 uint64_t __attribute__((export_name("TS_CResult_ChannelUpdateDecodeErrorZ_clone"))) TS_CResult_ChannelUpdateDecodeErrorZ_clone(uint64_t orig) {
18735 LDKCResult_ChannelUpdateDecodeErrorZ* orig_conv = (LDKCResult_ChannelUpdateDecodeErrorZ*)untag_ptr(orig);
18736 LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
18737 *ret_conv = CResult_ChannelUpdateDecodeErrorZ_clone(orig_conv);
18738 return tag_ptr(ret_conv, true);
18741 uint64_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_ok"))) TS_CResult_ErrorMessageDecodeErrorZ_ok(uint64_t o) {
18742 LDKErrorMessage o_conv;
18743 o_conv.inner = untag_ptr(o);
18744 o_conv.is_owned = ptr_is_owned(o);
18745 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18746 o_conv = ErrorMessage_clone(&o_conv);
18747 LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
18748 *ret_conv = CResult_ErrorMessageDecodeErrorZ_ok(o_conv);
18749 return tag_ptr(ret_conv, true);
18752 uint64_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_err"))) TS_CResult_ErrorMessageDecodeErrorZ_err(uint64_t e) {
18753 LDKDecodeError e_conv;
18754 e_conv.inner = untag_ptr(e);
18755 e_conv.is_owned = ptr_is_owned(e);
18756 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18757 e_conv = DecodeError_clone(&e_conv);
18758 LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
18759 *ret_conv = CResult_ErrorMessageDecodeErrorZ_err(e_conv);
18760 return tag_ptr(ret_conv, true);
18763 jboolean __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_is_ok"))) TS_CResult_ErrorMessageDecodeErrorZ_is_ok(uint64_t o) {
18764 LDKCResult_ErrorMessageDecodeErrorZ* o_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(o);
18765 jboolean ret_conv = CResult_ErrorMessageDecodeErrorZ_is_ok(o_conv);
18769 void __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_free"))) TS_CResult_ErrorMessageDecodeErrorZ_free(uint64_t _res) {
18770 if (!ptr_is_owned(_res)) return;
18771 void* _res_ptr = untag_ptr(_res);
18772 CHECK_ACCESS(_res_ptr);
18773 LDKCResult_ErrorMessageDecodeErrorZ _res_conv = *(LDKCResult_ErrorMessageDecodeErrorZ*)(_res_ptr);
18774 FREE(untag_ptr(_res));
18775 CResult_ErrorMessageDecodeErrorZ_free(_res_conv);
18778 static inline uint64_t CResult_ErrorMessageDecodeErrorZ_clone_ptr(LDKCResult_ErrorMessageDecodeErrorZ *NONNULL_PTR arg) {
18779 LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
18780 *ret_conv = CResult_ErrorMessageDecodeErrorZ_clone(arg);
18781 return tag_ptr(ret_conv, true);
18783 int64_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_clone_ptr"))) TS_CResult_ErrorMessageDecodeErrorZ_clone_ptr(uint64_t arg) {
18784 LDKCResult_ErrorMessageDecodeErrorZ* arg_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(arg);
18785 int64_t ret_conv = CResult_ErrorMessageDecodeErrorZ_clone_ptr(arg_conv);
18789 uint64_t __attribute__((export_name("TS_CResult_ErrorMessageDecodeErrorZ_clone"))) TS_CResult_ErrorMessageDecodeErrorZ_clone(uint64_t orig) {
18790 LDKCResult_ErrorMessageDecodeErrorZ* orig_conv = (LDKCResult_ErrorMessageDecodeErrorZ*)untag_ptr(orig);
18791 LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
18792 *ret_conv = CResult_ErrorMessageDecodeErrorZ_clone(orig_conv);
18793 return tag_ptr(ret_conv, true);
18796 uint64_t __attribute__((export_name("TS_CResult_WarningMessageDecodeErrorZ_ok"))) TS_CResult_WarningMessageDecodeErrorZ_ok(uint64_t o) {
18797 LDKWarningMessage o_conv;
18798 o_conv.inner = untag_ptr(o);
18799 o_conv.is_owned = ptr_is_owned(o);
18800 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18801 o_conv = WarningMessage_clone(&o_conv);
18802 LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
18803 *ret_conv = CResult_WarningMessageDecodeErrorZ_ok(o_conv);
18804 return tag_ptr(ret_conv, true);
18807 uint64_t __attribute__((export_name("TS_CResult_WarningMessageDecodeErrorZ_err"))) TS_CResult_WarningMessageDecodeErrorZ_err(uint64_t e) {
18808 LDKDecodeError e_conv;
18809 e_conv.inner = untag_ptr(e);
18810 e_conv.is_owned = ptr_is_owned(e);
18811 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18812 e_conv = DecodeError_clone(&e_conv);
18813 LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
18814 *ret_conv = CResult_WarningMessageDecodeErrorZ_err(e_conv);
18815 return tag_ptr(ret_conv, true);
18818 jboolean __attribute__((export_name("TS_CResult_WarningMessageDecodeErrorZ_is_ok"))) TS_CResult_WarningMessageDecodeErrorZ_is_ok(uint64_t o) {
18819 LDKCResult_WarningMessageDecodeErrorZ* o_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(o);
18820 jboolean ret_conv = CResult_WarningMessageDecodeErrorZ_is_ok(o_conv);
18824 void __attribute__((export_name("TS_CResult_WarningMessageDecodeErrorZ_free"))) TS_CResult_WarningMessageDecodeErrorZ_free(uint64_t _res) {
18825 if (!ptr_is_owned(_res)) return;
18826 void* _res_ptr = untag_ptr(_res);
18827 CHECK_ACCESS(_res_ptr);
18828 LDKCResult_WarningMessageDecodeErrorZ _res_conv = *(LDKCResult_WarningMessageDecodeErrorZ*)(_res_ptr);
18829 FREE(untag_ptr(_res));
18830 CResult_WarningMessageDecodeErrorZ_free(_res_conv);
18833 static inline uint64_t CResult_WarningMessageDecodeErrorZ_clone_ptr(LDKCResult_WarningMessageDecodeErrorZ *NONNULL_PTR arg) {
18834 LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
18835 *ret_conv = CResult_WarningMessageDecodeErrorZ_clone(arg);
18836 return tag_ptr(ret_conv, true);
18838 int64_t __attribute__((export_name("TS_CResult_WarningMessageDecodeErrorZ_clone_ptr"))) TS_CResult_WarningMessageDecodeErrorZ_clone_ptr(uint64_t arg) {
18839 LDKCResult_WarningMessageDecodeErrorZ* arg_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(arg);
18840 int64_t ret_conv = CResult_WarningMessageDecodeErrorZ_clone_ptr(arg_conv);
18844 uint64_t __attribute__((export_name("TS_CResult_WarningMessageDecodeErrorZ_clone"))) TS_CResult_WarningMessageDecodeErrorZ_clone(uint64_t orig) {
18845 LDKCResult_WarningMessageDecodeErrorZ* orig_conv = (LDKCResult_WarningMessageDecodeErrorZ*)untag_ptr(orig);
18846 LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
18847 *ret_conv = CResult_WarningMessageDecodeErrorZ_clone(orig_conv);
18848 return tag_ptr(ret_conv, true);
18851 uint64_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(uint64_t o) {
18852 LDKUnsignedNodeAnnouncement o_conv;
18853 o_conv.inner = untag_ptr(o);
18854 o_conv.is_owned = ptr_is_owned(o);
18855 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18856 o_conv = UnsignedNodeAnnouncement_clone(&o_conv);
18857 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
18858 *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_ok(o_conv);
18859 return tag_ptr(ret_conv, true);
18862 uint64_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_err"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(uint64_t e) {
18863 LDKDecodeError e_conv;
18864 e_conv.inner = untag_ptr(e);
18865 e_conv.is_owned = ptr_is_owned(e);
18866 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18867 e_conv = DecodeError_clone(&e_conv);
18868 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
18869 *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_err(e_conv);
18870 return tag_ptr(ret_conv, true);
18873 jboolean __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(uint64_t o) {
18874 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* o_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(o);
18875 jboolean ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_is_ok(o_conv);
18879 void __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_free"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(uint64_t _res) {
18880 if (!ptr_is_owned(_res)) return;
18881 void* _res_ptr = untag_ptr(_res);
18882 CHECK_ACCESS(_res_ptr);
18883 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)(_res_ptr);
18884 FREE(untag_ptr(_res));
18885 CResult_UnsignedNodeAnnouncementDecodeErrorZ_free(_res_conv);
18888 static inline uint64_t CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ *NONNULL_PTR arg) {
18889 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
18890 *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(arg);
18891 return tag_ptr(ret_conv, true);
18893 int64_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(uint64_t arg) {
18894 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(arg);
18895 int64_t ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone_ptr(arg_conv);
18899 uint64_t __attribute__((export_name("TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone"))) TS_CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(uint64_t orig) {
18900 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ*)untag_ptr(orig);
18901 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
18902 *ret_conv = CResult_UnsignedNodeAnnouncementDecodeErrorZ_clone(orig_conv);
18903 return tag_ptr(ret_conv, true);
18906 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_ok"))) TS_CResult_NodeAnnouncementDecodeErrorZ_ok(uint64_t o) {
18907 LDKNodeAnnouncement o_conv;
18908 o_conv.inner = untag_ptr(o);
18909 o_conv.is_owned = ptr_is_owned(o);
18910 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18911 o_conv = NodeAnnouncement_clone(&o_conv);
18912 LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
18913 *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_ok(o_conv);
18914 return tag_ptr(ret_conv, true);
18917 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_err"))) TS_CResult_NodeAnnouncementDecodeErrorZ_err(uint64_t e) {
18918 LDKDecodeError e_conv;
18919 e_conv.inner = untag_ptr(e);
18920 e_conv.is_owned = ptr_is_owned(e);
18921 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18922 e_conv = DecodeError_clone(&e_conv);
18923 LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
18924 *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_err(e_conv);
18925 return tag_ptr(ret_conv, true);
18928 jboolean __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_is_ok"))) TS_CResult_NodeAnnouncementDecodeErrorZ_is_ok(uint64_t o) {
18929 LDKCResult_NodeAnnouncementDecodeErrorZ* o_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(o);
18930 jboolean ret_conv = CResult_NodeAnnouncementDecodeErrorZ_is_ok(o_conv);
18934 void __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_free"))) TS_CResult_NodeAnnouncementDecodeErrorZ_free(uint64_t _res) {
18935 if (!ptr_is_owned(_res)) return;
18936 void* _res_ptr = untag_ptr(_res);
18937 CHECK_ACCESS(_res_ptr);
18938 LDKCResult_NodeAnnouncementDecodeErrorZ _res_conv = *(LDKCResult_NodeAnnouncementDecodeErrorZ*)(_res_ptr);
18939 FREE(untag_ptr(_res));
18940 CResult_NodeAnnouncementDecodeErrorZ_free(_res_conv);
18943 static inline uint64_t CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(LDKCResult_NodeAnnouncementDecodeErrorZ *NONNULL_PTR arg) {
18944 LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
18945 *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_clone(arg);
18946 return tag_ptr(ret_conv, true);
18948 int64_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_clone_ptr"))) TS_CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(uint64_t arg) {
18949 LDKCResult_NodeAnnouncementDecodeErrorZ* arg_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(arg);
18950 int64_t ret_conv = CResult_NodeAnnouncementDecodeErrorZ_clone_ptr(arg_conv);
18954 uint64_t __attribute__((export_name("TS_CResult_NodeAnnouncementDecodeErrorZ_clone"))) TS_CResult_NodeAnnouncementDecodeErrorZ_clone(uint64_t orig) {
18955 LDKCResult_NodeAnnouncementDecodeErrorZ* orig_conv = (LDKCResult_NodeAnnouncementDecodeErrorZ*)untag_ptr(orig);
18956 LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
18957 *ret_conv = CResult_NodeAnnouncementDecodeErrorZ_clone(orig_conv);
18958 return tag_ptr(ret_conv, true);
18961 uint64_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_ok"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_ok(uint64_t o) {
18962 LDKQueryShortChannelIds o_conv;
18963 o_conv.inner = untag_ptr(o);
18964 o_conv.is_owned = ptr_is_owned(o);
18965 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
18966 o_conv = QueryShortChannelIds_clone(&o_conv);
18967 LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
18968 *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_ok(o_conv);
18969 return tag_ptr(ret_conv, true);
18972 uint64_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_err"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_err(uint64_t e) {
18973 LDKDecodeError e_conv;
18974 e_conv.inner = untag_ptr(e);
18975 e_conv.is_owned = ptr_is_owned(e);
18976 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
18977 e_conv = DecodeError_clone(&e_conv);
18978 LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
18979 *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_err(e_conv);
18980 return tag_ptr(ret_conv, true);
18983 jboolean __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_is_ok"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(uint64_t o) {
18984 LDKCResult_QueryShortChannelIdsDecodeErrorZ* o_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(o);
18985 jboolean ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_is_ok(o_conv);
18989 void __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_free"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_free(uint64_t _res) {
18990 if (!ptr_is_owned(_res)) return;
18991 void* _res_ptr = untag_ptr(_res);
18992 CHECK_ACCESS(_res_ptr);
18993 LDKCResult_QueryShortChannelIdsDecodeErrorZ _res_conv = *(LDKCResult_QueryShortChannelIdsDecodeErrorZ*)(_res_ptr);
18994 FREE(untag_ptr(_res));
18995 CResult_QueryShortChannelIdsDecodeErrorZ_free(_res_conv);
18998 static inline uint64_t CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(LDKCResult_QueryShortChannelIdsDecodeErrorZ *NONNULL_PTR arg) {
18999 LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
19000 *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_clone(arg);
19001 return tag_ptr(ret_conv, true);
19003 int64_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(uint64_t arg) {
19004 LDKCResult_QueryShortChannelIdsDecodeErrorZ* arg_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(arg);
19005 int64_t ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_clone_ptr(arg_conv);
19009 uint64_t __attribute__((export_name("TS_CResult_QueryShortChannelIdsDecodeErrorZ_clone"))) TS_CResult_QueryShortChannelIdsDecodeErrorZ_clone(uint64_t orig) {
19010 LDKCResult_QueryShortChannelIdsDecodeErrorZ* orig_conv = (LDKCResult_QueryShortChannelIdsDecodeErrorZ*)untag_ptr(orig);
19011 LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
19012 *ret_conv = CResult_QueryShortChannelIdsDecodeErrorZ_clone(orig_conv);
19013 return tag_ptr(ret_conv, true);
19016 uint64_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(uint64_t o) {
19017 LDKReplyShortChannelIdsEnd o_conv;
19018 o_conv.inner = untag_ptr(o);
19019 o_conv.is_owned = ptr_is_owned(o);
19020 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19021 o_conv = ReplyShortChannelIdsEnd_clone(&o_conv);
19022 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
19023 *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_ok(o_conv);
19024 return tag_ptr(ret_conv, true);
19027 uint64_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_err"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(uint64_t e) {
19028 LDKDecodeError e_conv;
19029 e_conv.inner = untag_ptr(e);
19030 e_conv.is_owned = ptr_is_owned(e);
19031 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
19032 e_conv = DecodeError_clone(&e_conv);
19033 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
19034 *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_err(e_conv);
19035 return tag_ptr(ret_conv, true);
19038 jboolean __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(uint64_t o) {
19039 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* o_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(o);
19040 jboolean ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_is_ok(o_conv);
19044 void __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_free"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(uint64_t _res) {
19045 if (!ptr_is_owned(_res)) return;
19046 void* _res_ptr = untag_ptr(_res);
19047 CHECK_ACCESS(_res_ptr);
19048 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ _res_conv = *(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)(_res_ptr);
19049 FREE(untag_ptr(_res));
19050 CResult_ReplyShortChannelIdsEndDecodeErrorZ_free(_res_conv);
19053 static inline uint64_t CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ *NONNULL_PTR arg) {
19054 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
19055 *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(arg);
19056 return tag_ptr(ret_conv, true);
19058 int64_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(uint64_t arg) {
19059 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* arg_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(arg);
19060 int64_t ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone_ptr(arg_conv);
19064 uint64_t __attribute__((export_name("TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone"))) TS_CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(uint64_t orig) {
19065 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* orig_conv = (LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ*)untag_ptr(orig);
19066 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
19067 *ret_conv = CResult_ReplyShortChannelIdsEndDecodeErrorZ_clone(orig_conv);
19068 return tag_ptr(ret_conv, true);
19071 uint64_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_ok"))) TS_CResult_QueryChannelRangeDecodeErrorZ_ok(uint64_t o) {
19072 LDKQueryChannelRange o_conv;
19073 o_conv.inner = untag_ptr(o);
19074 o_conv.is_owned = ptr_is_owned(o);
19075 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19076 o_conv = QueryChannelRange_clone(&o_conv);
19077 LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
19078 *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_ok(o_conv);
19079 return tag_ptr(ret_conv, true);
19082 uint64_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_err"))) TS_CResult_QueryChannelRangeDecodeErrorZ_err(uint64_t e) {
19083 LDKDecodeError e_conv;
19084 e_conv.inner = untag_ptr(e);
19085 e_conv.is_owned = ptr_is_owned(e);
19086 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
19087 e_conv = DecodeError_clone(&e_conv);
19088 LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
19089 *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_err(e_conv);
19090 return tag_ptr(ret_conv, true);
19093 jboolean __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_is_ok"))) TS_CResult_QueryChannelRangeDecodeErrorZ_is_ok(uint64_t o) {
19094 LDKCResult_QueryChannelRangeDecodeErrorZ* o_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(o);
19095 jboolean ret_conv = CResult_QueryChannelRangeDecodeErrorZ_is_ok(o_conv);
19099 void __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_free"))) TS_CResult_QueryChannelRangeDecodeErrorZ_free(uint64_t _res) {
19100 if (!ptr_is_owned(_res)) return;
19101 void* _res_ptr = untag_ptr(_res);
19102 CHECK_ACCESS(_res_ptr);
19103 LDKCResult_QueryChannelRangeDecodeErrorZ _res_conv = *(LDKCResult_QueryChannelRangeDecodeErrorZ*)(_res_ptr);
19104 FREE(untag_ptr(_res));
19105 CResult_QueryChannelRangeDecodeErrorZ_free(_res_conv);
19108 static inline uint64_t CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(LDKCResult_QueryChannelRangeDecodeErrorZ *NONNULL_PTR arg) {
19109 LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
19110 *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_clone(arg);
19111 return tag_ptr(ret_conv, true);
19113 int64_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_clone_ptr"))) TS_CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(uint64_t arg) {
19114 LDKCResult_QueryChannelRangeDecodeErrorZ* arg_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(arg);
19115 int64_t ret_conv = CResult_QueryChannelRangeDecodeErrorZ_clone_ptr(arg_conv);
19119 uint64_t __attribute__((export_name("TS_CResult_QueryChannelRangeDecodeErrorZ_clone"))) TS_CResult_QueryChannelRangeDecodeErrorZ_clone(uint64_t orig) {
19120 LDKCResult_QueryChannelRangeDecodeErrorZ* orig_conv = (LDKCResult_QueryChannelRangeDecodeErrorZ*)untag_ptr(orig);
19121 LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
19122 *ret_conv = CResult_QueryChannelRangeDecodeErrorZ_clone(orig_conv);
19123 return tag_ptr(ret_conv, true);
19126 uint64_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_ok"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_ok(uint64_t o) {
19127 LDKReplyChannelRange o_conv;
19128 o_conv.inner = untag_ptr(o);
19129 o_conv.is_owned = ptr_is_owned(o);
19130 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19131 o_conv = ReplyChannelRange_clone(&o_conv);
19132 LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
19133 *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_ok(o_conv);
19134 return tag_ptr(ret_conv, true);
19137 uint64_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_err"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_err(uint64_t e) {
19138 LDKDecodeError e_conv;
19139 e_conv.inner = untag_ptr(e);
19140 e_conv.is_owned = ptr_is_owned(e);
19141 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
19142 e_conv = DecodeError_clone(&e_conv);
19143 LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
19144 *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_err(e_conv);
19145 return tag_ptr(ret_conv, true);
19148 jboolean __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_is_ok"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_is_ok(uint64_t o) {
19149 LDKCResult_ReplyChannelRangeDecodeErrorZ* o_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(o);
19150 jboolean ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_is_ok(o_conv);
19154 void __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_free"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_free(uint64_t _res) {
19155 if (!ptr_is_owned(_res)) return;
19156 void* _res_ptr = untag_ptr(_res);
19157 CHECK_ACCESS(_res_ptr);
19158 LDKCResult_ReplyChannelRangeDecodeErrorZ _res_conv = *(LDKCResult_ReplyChannelRangeDecodeErrorZ*)(_res_ptr);
19159 FREE(untag_ptr(_res));
19160 CResult_ReplyChannelRangeDecodeErrorZ_free(_res_conv);
19163 static inline uint64_t CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(LDKCResult_ReplyChannelRangeDecodeErrorZ *NONNULL_PTR arg) {
19164 LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
19165 *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_clone(arg);
19166 return tag_ptr(ret_conv, true);
19168 int64_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(uint64_t arg) {
19169 LDKCResult_ReplyChannelRangeDecodeErrorZ* arg_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(arg);
19170 int64_t ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_clone_ptr(arg_conv);
19174 uint64_t __attribute__((export_name("TS_CResult_ReplyChannelRangeDecodeErrorZ_clone"))) TS_CResult_ReplyChannelRangeDecodeErrorZ_clone(uint64_t orig) {
19175 LDKCResult_ReplyChannelRangeDecodeErrorZ* orig_conv = (LDKCResult_ReplyChannelRangeDecodeErrorZ*)untag_ptr(orig);
19176 LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
19177 *ret_conv = CResult_ReplyChannelRangeDecodeErrorZ_clone(orig_conv);
19178 return tag_ptr(ret_conv, true);
19181 uint64_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_ok"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_ok(uint64_t o) {
19182 LDKGossipTimestampFilter o_conv;
19183 o_conv.inner = untag_ptr(o);
19184 o_conv.is_owned = ptr_is_owned(o);
19185 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19186 o_conv = GossipTimestampFilter_clone(&o_conv);
19187 LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
19188 *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_ok(o_conv);
19189 return tag_ptr(ret_conv, true);
19192 uint64_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_err"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_err(uint64_t e) {
19193 LDKDecodeError e_conv;
19194 e_conv.inner = untag_ptr(e);
19195 e_conv.is_owned = ptr_is_owned(e);
19196 CHECK_INNER_FIELD_ACCESS_OR_NULL(e_conv);
19197 e_conv = DecodeError_clone(&e_conv);
19198 LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
19199 *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_err(e_conv);
19200 return tag_ptr(ret_conv, true);
19203 jboolean __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_is_ok"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_is_ok(uint64_t o) {
19204 LDKCResult_GossipTimestampFilterDecodeErrorZ* o_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(o);
19205 jboolean ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_is_ok(o_conv);
19209 void __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_free"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_free(uint64_t _res) {
19210 if (!ptr_is_owned(_res)) return;
19211 void* _res_ptr = untag_ptr(_res);
19212 CHECK_ACCESS(_res_ptr);
19213 LDKCResult_GossipTimestampFilterDecodeErrorZ _res_conv = *(LDKCResult_GossipTimestampFilterDecodeErrorZ*)(_res_ptr);
19214 FREE(untag_ptr(_res));
19215 CResult_GossipTimestampFilterDecodeErrorZ_free(_res_conv);
19218 static inline uint64_t CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(LDKCResult_GossipTimestampFilterDecodeErrorZ *NONNULL_PTR arg) {
19219 LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
19220 *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_clone(arg);
19221 return tag_ptr(ret_conv, true);
19223 int64_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(uint64_t arg) {
19224 LDKCResult_GossipTimestampFilterDecodeErrorZ* arg_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(arg);
19225 int64_t ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_clone_ptr(arg_conv);
19229 uint64_t __attribute__((export_name("TS_CResult_GossipTimestampFilterDecodeErrorZ_clone"))) TS_CResult_GossipTimestampFilterDecodeErrorZ_clone(uint64_t orig) {
19230 LDKCResult_GossipTimestampFilterDecodeErrorZ* orig_conv = (LDKCResult_GossipTimestampFilterDecodeErrorZ*)untag_ptr(orig);
19231 LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
19232 *ret_conv = CResult_GossipTimestampFilterDecodeErrorZ_clone(orig_conv);
19233 return tag_ptr(ret_conv, true);
19236 uint64_t __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_ok"))) TS_CResult_InvoiceSignOrCreationErrorZ_ok(uint64_t o) {
19238 o_conv.inner = untag_ptr(o);
19239 o_conv.is_owned = ptr_is_owned(o);
19240 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19241 o_conv = Invoice_clone(&o_conv);
19242 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
19243 *ret_conv = CResult_InvoiceSignOrCreationErrorZ_ok(o_conv);
19244 return tag_ptr(ret_conv, true);
19247 uint64_t __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_err"))) TS_CResult_InvoiceSignOrCreationErrorZ_err(uint64_t e) {
19248 void* e_ptr = untag_ptr(e);
19249 CHECK_ACCESS(e_ptr);
19250 LDKSignOrCreationError e_conv = *(LDKSignOrCreationError*)(e_ptr);
19251 e_conv = SignOrCreationError_clone((LDKSignOrCreationError*)untag_ptr(e));
19252 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
19253 *ret_conv = CResult_InvoiceSignOrCreationErrorZ_err(e_conv);
19254 return tag_ptr(ret_conv, true);
19257 jboolean __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_is_ok"))) TS_CResult_InvoiceSignOrCreationErrorZ_is_ok(uint64_t o) {
19258 LDKCResult_InvoiceSignOrCreationErrorZ* o_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(o);
19259 jboolean ret_conv = CResult_InvoiceSignOrCreationErrorZ_is_ok(o_conv);
19263 void __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_free"))) TS_CResult_InvoiceSignOrCreationErrorZ_free(uint64_t _res) {
19264 if (!ptr_is_owned(_res)) return;
19265 void* _res_ptr = untag_ptr(_res);
19266 CHECK_ACCESS(_res_ptr);
19267 LDKCResult_InvoiceSignOrCreationErrorZ _res_conv = *(LDKCResult_InvoiceSignOrCreationErrorZ*)(_res_ptr);
19268 FREE(untag_ptr(_res));
19269 CResult_InvoiceSignOrCreationErrorZ_free(_res_conv);
19272 static inline uint64_t CResult_InvoiceSignOrCreationErrorZ_clone_ptr(LDKCResult_InvoiceSignOrCreationErrorZ *NONNULL_PTR arg) {
19273 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
19274 *ret_conv = CResult_InvoiceSignOrCreationErrorZ_clone(arg);
19275 return tag_ptr(ret_conv, true);
19277 int64_t __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_clone_ptr"))) TS_CResult_InvoiceSignOrCreationErrorZ_clone_ptr(uint64_t arg) {
19278 LDKCResult_InvoiceSignOrCreationErrorZ* arg_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(arg);
19279 int64_t ret_conv = CResult_InvoiceSignOrCreationErrorZ_clone_ptr(arg_conv);
19283 uint64_t __attribute__((export_name("TS_CResult_InvoiceSignOrCreationErrorZ_clone"))) TS_CResult_InvoiceSignOrCreationErrorZ_clone(uint64_t orig) {
19284 LDKCResult_InvoiceSignOrCreationErrorZ* orig_conv = (LDKCResult_InvoiceSignOrCreationErrorZ*)untag_ptr(orig);
19285 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
19286 *ret_conv = CResult_InvoiceSignOrCreationErrorZ_clone(orig_conv);
19287 return tag_ptr(ret_conv, true);
19290 uint64_t __attribute__((export_name("TS_COption_FilterZ_some"))) TS_COption_FilterZ_some(uint64_t o) {
19291 void* o_ptr = untag_ptr(o);
19292 CHECK_ACCESS(o_ptr);
19293 LDKFilter o_conv = *(LDKFilter*)(o_ptr);
19294 if (o_conv.free == LDKFilter_JCalls_free) {
19295 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
19296 LDKFilter_JCalls_cloned(&o_conv);
19298 LDKCOption_FilterZ *ret_copy = MALLOC(sizeof(LDKCOption_FilterZ), "LDKCOption_FilterZ");
19299 *ret_copy = COption_FilterZ_some(o_conv);
19300 uint64_t ret_ref = tag_ptr(ret_copy, true);
19304 uint64_t __attribute__((export_name("TS_COption_FilterZ_none"))) TS_COption_FilterZ_none() {
19305 LDKCOption_FilterZ *ret_copy = MALLOC(sizeof(LDKCOption_FilterZ), "LDKCOption_FilterZ");
19306 *ret_copy = COption_FilterZ_none();
19307 uint64_t ret_ref = tag_ptr(ret_copy, true);
19311 void __attribute__((export_name("TS_COption_FilterZ_free"))) TS_COption_FilterZ_free(uint64_t _res) {
19312 if (!ptr_is_owned(_res)) return;
19313 void* _res_ptr = untag_ptr(_res);
19314 CHECK_ACCESS(_res_ptr);
19315 LDKCOption_FilterZ _res_conv = *(LDKCOption_FilterZ*)(_res_ptr);
19316 FREE(untag_ptr(_res));
19317 COption_FilterZ_free(_res_conv);
19320 uint64_t __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_ok"))) TS_CResult_LockedChannelMonitorNoneZ_ok(uint64_t o) {
19321 LDKLockedChannelMonitor o_conv;
19322 o_conv.inner = untag_ptr(o);
19323 o_conv.is_owned = ptr_is_owned(o);
19324 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
19325 // WARNING: we need a move here but no clone is available for LDKLockedChannelMonitor
19327 LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ");
19328 *ret_conv = CResult_LockedChannelMonitorNoneZ_ok(o_conv);
19329 return tag_ptr(ret_conv, true);
19332 uint64_t __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_err"))) TS_CResult_LockedChannelMonitorNoneZ_err() {
19333 LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ");
19334 *ret_conv = CResult_LockedChannelMonitorNoneZ_err();
19335 return tag_ptr(ret_conv, true);
19338 jboolean __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_is_ok"))) TS_CResult_LockedChannelMonitorNoneZ_is_ok(uint64_t o) {
19339 LDKCResult_LockedChannelMonitorNoneZ* o_conv = (LDKCResult_LockedChannelMonitorNoneZ*)untag_ptr(o);
19340 jboolean ret_conv = CResult_LockedChannelMonitorNoneZ_is_ok(o_conv);
19344 void __attribute__((export_name("TS_CResult_LockedChannelMonitorNoneZ_free"))) TS_CResult_LockedChannelMonitorNoneZ_free(uint64_t _res) {
19345 if (!ptr_is_owned(_res)) return;
19346 void* _res_ptr = untag_ptr(_res);
19347 CHECK_ACCESS(_res_ptr);
19348 LDKCResult_LockedChannelMonitorNoneZ _res_conv = *(LDKCResult_LockedChannelMonitorNoneZ*)(_res_ptr);
19349 FREE(untag_ptr(_res));
19350 CResult_LockedChannelMonitorNoneZ_free(_res_conv);
19353 void __attribute__((export_name("TS_CVec_OutPointZ_free"))) TS_CVec_OutPointZ_free(uint64_tArray _res) {
19354 LDKCVec_OutPointZ _res_constr;
19355 _res_constr.datalen = _res->arr_len;
19356 if (_res_constr.datalen > 0)
19357 _res_constr.data = MALLOC(_res_constr.datalen * sizeof(LDKOutPoint), "LDKCVec_OutPointZ Elements");
19359 _res_constr.data = NULL;
19360 uint64_t* _res_vals = _res->elems;
19361 for (size_t k = 0; k < _res_constr.datalen; k++) {
19362 uint64_t _res_conv_10 = _res_vals[k];
19363 LDKOutPoint _res_conv_10_conv;
19364 _res_conv_10_conv.inner = untag_ptr(_res_conv_10);
19365 _res_conv_10_conv.is_owned = ptr_is_owned(_res_conv_10);
19366 CHECK_INNER_FIELD_ACCESS_OR_NULL(_res_conv_10_conv);
19367 _res_constr.data[k] = _res_conv_10_conv;
19370 CVec_OutPointZ_free(_res_constr);
19373 void __attribute__((export_name("TS_PaymentPurpose_free"))) TS_PaymentPurpose_free(uint64_t this_ptr) {
19374 if (!ptr_is_owned(this_ptr)) return;
19375 void* this_ptr_ptr = untag_ptr(this_ptr);
19376 CHECK_ACCESS(this_ptr_ptr);
19377 LDKPaymentPurpose this_ptr_conv = *(LDKPaymentPurpose*)(this_ptr_ptr);
19378 FREE(untag_ptr(this_ptr));
19379 PaymentPurpose_free(this_ptr_conv);
19382 static inline uint64_t PaymentPurpose_clone_ptr(LDKPaymentPurpose *NONNULL_PTR arg) {
19383 LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
19384 *ret_copy = PaymentPurpose_clone(arg);
19385 uint64_t ret_ref = tag_ptr(ret_copy, true);
19388 int64_t __attribute__((export_name("TS_PaymentPurpose_clone_ptr"))) TS_PaymentPurpose_clone_ptr(uint64_t arg) {
19389 LDKPaymentPurpose* arg_conv = (LDKPaymentPurpose*)untag_ptr(arg);
19390 int64_t ret_conv = PaymentPurpose_clone_ptr(arg_conv);
19394 uint64_t __attribute__((export_name("TS_PaymentPurpose_clone"))) TS_PaymentPurpose_clone(uint64_t orig) {
19395 LDKPaymentPurpose* orig_conv = (LDKPaymentPurpose*)untag_ptr(orig);
19396 LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
19397 *ret_copy = PaymentPurpose_clone(orig_conv);
19398 uint64_t ret_ref = tag_ptr(ret_copy, true);
19402 uint64_t __attribute__((export_name("TS_PaymentPurpose_invoice_payment"))) TS_PaymentPurpose_invoice_payment(int8_tArray payment_preimage, int8_tArray payment_secret) {
19403 LDKThirtyTwoBytes payment_preimage_ref;
19404 CHECK(payment_preimage->arr_len == 32);
19405 memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage);
19406 LDKThirtyTwoBytes payment_secret_ref;
19407 CHECK(payment_secret->arr_len == 32);
19408 memcpy(payment_secret_ref.data, payment_secret->elems, 32); FREE(payment_secret);
19409 LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
19410 *ret_copy = PaymentPurpose_invoice_payment(payment_preimage_ref, payment_secret_ref);
19411 uint64_t ret_ref = tag_ptr(ret_copy, true);
19415 uint64_t __attribute__((export_name("TS_PaymentPurpose_spontaneous_payment"))) TS_PaymentPurpose_spontaneous_payment(int8_tArray a) {
19416 LDKThirtyTwoBytes a_ref;
19417 CHECK(a->arr_len == 32);
19418 memcpy(a_ref.data, a->elems, 32); FREE(a);
19419 LDKPaymentPurpose *ret_copy = MALLOC(sizeof(LDKPaymentPurpose), "LDKPaymentPurpose");
19420 *ret_copy = PaymentPurpose_spontaneous_payment(a_ref);
19421 uint64_t ret_ref = tag_ptr(ret_copy, true);
19425 int8_tArray __attribute__((export_name("TS_PaymentPurpose_write"))) TS_PaymentPurpose_write(uint64_t obj) {
19426 LDKPaymentPurpose* obj_conv = (LDKPaymentPurpose*)untag_ptr(obj);
19427 LDKCVec_u8Z ret_var = PaymentPurpose_write(obj_conv);
19428 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
19429 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
19430 CVec_u8Z_free(ret_var);
19434 uint64_t __attribute__((export_name("TS_PaymentPurpose_read"))) TS_PaymentPurpose_read(int8_tArray ser) {
19435 LDKu8slice ser_ref;
19436 ser_ref.datalen = ser->arr_len;
19437 ser_ref.data = ser->elems;
19438 LDKCResult_PaymentPurposeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPurposeDecodeErrorZ), "LDKCResult_PaymentPurposeDecodeErrorZ");
19439 *ret_conv = PaymentPurpose_read(ser_ref);
19441 return tag_ptr(ret_conv, true);
19444 void __attribute__((export_name("TS_ClosureReason_free"))) TS_ClosureReason_free(uint64_t this_ptr) {
19445 if (!ptr_is_owned(this_ptr)) return;
19446 void* this_ptr_ptr = untag_ptr(this_ptr);
19447 CHECK_ACCESS(this_ptr_ptr);
19448 LDKClosureReason this_ptr_conv = *(LDKClosureReason*)(this_ptr_ptr);
19449 FREE(untag_ptr(this_ptr));
19450 ClosureReason_free(this_ptr_conv);
19453 static inline uint64_t ClosureReason_clone_ptr(LDKClosureReason *NONNULL_PTR arg) {
19454 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
19455 *ret_copy = ClosureReason_clone(arg);
19456 uint64_t ret_ref = tag_ptr(ret_copy, true);
19459 int64_t __attribute__((export_name("TS_ClosureReason_clone_ptr"))) TS_ClosureReason_clone_ptr(uint64_t arg) {
19460 LDKClosureReason* arg_conv = (LDKClosureReason*)untag_ptr(arg);
19461 int64_t ret_conv = ClosureReason_clone_ptr(arg_conv);
19465 uint64_t __attribute__((export_name("TS_ClosureReason_clone"))) TS_ClosureReason_clone(uint64_t orig) {
19466 LDKClosureReason* orig_conv = (LDKClosureReason*)untag_ptr(orig);
19467 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
19468 *ret_copy = ClosureReason_clone(orig_conv);
19469 uint64_t ret_ref = tag_ptr(ret_copy, true);
19473 uint64_t __attribute__((export_name("TS_ClosureReason_counterparty_force_closed"))) TS_ClosureReason_counterparty_force_closed(jstring peer_msg) {
19474 LDKStr peer_msg_conv = str_ref_to_owned_c(peer_msg);
19475 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
19476 *ret_copy = ClosureReason_counterparty_force_closed(peer_msg_conv);
19477 uint64_t ret_ref = tag_ptr(ret_copy, true);
19481 uint64_t __attribute__((export_name("TS_ClosureReason_holder_force_closed"))) TS_ClosureReason_holder_force_closed() {
19482 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
19483 *ret_copy = ClosureReason_holder_force_closed();
19484 uint64_t ret_ref = tag_ptr(ret_copy, true);
19488 uint64_t __attribute__((export_name("TS_ClosureReason_cooperative_closure"))) TS_ClosureReason_cooperative_closure() {
19489 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
19490 *ret_copy = ClosureReason_cooperative_closure();
19491 uint64_t ret_ref = tag_ptr(ret_copy, true);
19495 uint64_t __attribute__((export_name("TS_ClosureReason_commitment_tx_confirmed"))) TS_ClosureReason_commitment_tx_confirmed() {
19496 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
19497 *ret_copy = ClosureReason_commitment_tx_confirmed();
19498 uint64_t ret_ref = tag_ptr(ret_copy, true);
19502 uint64_t __attribute__((export_name("TS_ClosureReason_funding_timed_out"))) TS_ClosureReason_funding_timed_out() {
19503 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
19504 *ret_copy = ClosureReason_funding_timed_out();
19505 uint64_t ret_ref = tag_ptr(ret_copy, true);
19509 uint64_t __attribute__((export_name("TS_ClosureReason_processing_error"))) TS_ClosureReason_processing_error(jstring err) {
19510 LDKStr err_conv = str_ref_to_owned_c(err);
19511 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
19512 *ret_copy = ClosureReason_processing_error(err_conv);
19513 uint64_t ret_ref = tag_ptr(ret_copy, true);
19517 uint64_t __attribute__((export_name("TS_ClosureReason_disconnected_peer"))) TS_ClosureReason_disconnected_peer() {
19518 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
19519 *ret_copy = ClosureReason_disconnected_peer();
19520 uint64_t ret_ref = tag_ptr(ret_copy, true);
19524 uint64_t __attribute__((export_name("TS_ClosureReason_outdated_channel_manager"))) TS_ClosureReason_outdated_channel_manager() {
19525 LDKClosureReason *ret_copy = MALLOC(sizeof(LDKClosureReason), "LDKClosureReason");
19526 *ret_copy = ClosureReason_outdated_channel_manager();
19527 uint64_t ret_ref = tag_ptr(ret_copy, true);
19531 int8_tArray __attribute__((export_name("TS_ClosureReason_write"))) TS_ClosureReason_write(uint64_t obj) {
19532 LDKClosureReason* obj_conv = (LDKClosureReason*)untag_ptr(obj);
19533 LDKCVec_u8Z ret_var = ClosureReason_write(obj_conv);
19534 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
19535 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
19536 CVec_u8Z_free(ret_var);
19540 uint64_t __attribute__((export_name("TS_ClosureReason_read"))) TS_ClosureReason_read(int8_tArray ser) {
19541 LDKu8slice ser_ref;
19542 ser_ref.datalen = ser->arr_len;
19543 ser_ref.data = ser->elems;
19544 LDKCResult_COption_ClosureReasonZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_ClosureReasonZDecodeErrorZ), "LDKCResult_COption_ClosureReasonZDecodeErrorZ");
19545 *ret_conv = ClosureReason_read(ser_ref);
19547 return tag_ptr(ret_conv, true);
19550 void __attribute__((export_name("TS_HTLCDestination_free"))) TS_HTLCDestination_free(uint64_t this_ptr) {
19551 if (!ptr_is_owned(this_ptr)) return;
19552 void* this_ptr_ptr = untag_ptr(this_ptr);
19553 CHECK_ACCESS(this_ptr_ptr);
19554 LDKHTLCDestination this_ptr_conv = *(LDKHTLCDestination*)(this_ptr_ptr);
19555 FREE(untag_ptr(this_ptr));
19556 HTLCDestination_free(this_ptr_conv);
19559 static inline uint64_t HTLCDestination_clone_ptr(LDKHTLCDestination *NONNULL_PTR arg) {
19560 LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination");
19561 *ret_copy = HTLCDestination_clone(arg);
19562 uint64_t ret_ref = tag_ptr(ret_copy, true);
19565 int64_t __attribute__((export_name("TS_HTLCDestination_clone_ptr"))) TS_HTLCDestination_clone_ptr(uint64_t arg) {
19566 LDKHTLCDestination* arg_conv = (LDKHTLCDestination*)untag_ptr(arg);
19567 int64_t ret_conv = HTLCDestination_clone_ptr(arg_conv);
19571 uint64_t __attribute__((export_name("TS_HTLCDestination_clone"))) TS_HTLCDestination_clone(uint64_t orig) {
19572 LDKHTLCDestination* orig_conv = (LDKHTLCDestination*)untag_ptr(orig);
19573 LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination");
19574 *ret_copy = HTLCDestination_clone(orig_conv);
19575 uint64_t ret_ref = tag_ptr(ret_copy, true);
19579 uint64_t __attribute__((export_name("TS_HTLCDestination_next_hop_channel"))) TS_HTLCDestination_next_hop_channel(int8_tArray node_id, int8_tArray channel_id) {
19580 LDKPublicKey node_id_ref;
19581 CHECK(node_id->arr_len == 33);
19582 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
19583 LDKThirtyTwoBytes channel_id_ref;
19584 CHECK(channel_id->arr_len == 32);
19585 memcpy(channel_id_ref.data, channel_id->elems, 32); FREE(channel_id);
19586 LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination");
19587 *ret_copy = HTLCDestination_next_hop_channel(node_id_ref, channel_id_ref);
19588 uint64_t ret_ref = tag_ptr(ret_copy, true);
19592 uint64_t __attribute__((export_name("TS_HTLCDestination_unknown_next_hop"))) TS_HTLCDestination_unknown_next_hop(int64_t requested_forward_scid) {
19593 LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination");
19594 *ret_copy = HTLCDestination_unknown_next_hop(requested_forward_scid);
19595 uint64_t ret_ref = tag_ptr(ret_copy, true);
19599 uint64_t __attribute__((export_name("TS_HTLCDestination_failed_payment"))) TS_HTLCDestination_failed_payment(int8_tArray payment_hash) {
19600 LDKThirtyTwoBytes payment_hash_ref;
19601 CHECK(payment_hash->arr_len == 32);
19602 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
19603 LDKHTLCDestination *ret_copy = MALLOC(sizeof(LDKHTLCDestination), "LDKHTLCDestination");
19604 *ret_copy = HTLCDestination_failed_payment(payment_hash_ref);
19605 uint64_t ret_ref = tag_ptr(ret_copy, true);
19609 int8_tArray __attribute__((export_name("TS_HTLCDestination_write"))) TS_HTLCDestination_write(uint64_t obj) {
19610 LDKHTLCDestination* obj_conv = (LDKHTLCDestination*)untag_ptr(obj);
19611 LDKCVec_u8Z ret_var = HTLCDestination_write(obj_conv);
19612 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
19613 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
19614 CVec_u8Z_free(ret_var);
19618 uint64_t __attribute__((export_name("TS_HTLCDestination_read"))) TS_HTLCDestination_read(int8_tArray ser) {
19619 LDKu8slice ser_ref;
19620 ser_ref.datalen = ser->arr_len;
19621 ser_ref.data = ser->elems;
19622 LDKCResult_COption_HTLCDestinationZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_HTLCDestinationZDecodeErrorZ), "LDKCResult_COption_HTLCDestinationZDecodeErrorZ");
19623 *ret_conv = HTLCDestination_read(ser_ref);
19625 return tag_ptr(ret_conv, true);
19628 void __attribute__((export_name("TS_Event_free"))) TS_Event_free(uint64_t this_ptr) {
19629 if (!ptr_is_owned(this_ptr)) return;
19630 void* this_ptr_ptr = untag_ptr(this_ptr);
19631 CHECK_ACCESS(this_ptr_ptr);
19632 LDKEvent this_ptr_conv = *(LDKEvent*)(this_ptr_ptr);
19633 FREE(untag_ptr(this_ptr));
19634 Event_free(this_ptr_conv);
19637 static inline uint64_t Event_clone_ptr(LDKEvent *NONNULL_PTR arg) {
19638 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
19639 *ret_copy = Event_clone(arg);
19640 uint64_t ret_ref = tag_ptr(ret_copy, true);
19643 int64_t __attribute__((export_name("TS_Event_clone_ptr"))) TS_Event_clone_ptr(uint64_t arg) {
19644 LDKEvent* arg_conv = (LDKEvent*)untag_ptr(arg);
19645 int64_t ret_conv = Event_clone_ptr(arg_conv);
19649 uint64_t __attribute__((export_name("TS_Event_clone"))) TS_Event_clone(uint64_t orig) {
19650 LDKEvent* orig_conv = (LDKEvent*)untag_ptr(orig);
19651 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
19652 *ret_copy = Event_clone(orig_conv);
19653 uint64_t ret_ref = tag_ptr(ret_copy, true);
19657 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) {
19658 LDKThirtyTwoBytes temporary_channel_id_ref;
19659 CHECK(temporary_channel_id->arr_len == 32);
19660 memcpy(temporary_channel_id_ref.data, temporary_channel_id->elems, 32); FREE(temporary_channel_id);
19661 LDKPublicKey counterparty_node_id_ref;
19662 CHECK(counterparty_node_id->arr_len == 33);
19663 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
19664 LDKCVec_u8Z output_script_ref;
19665 output_script_ref.datalen = output_script->arr_len;
19666 output_script_ref.data = MALLOC(output_script_ref.datalen, "LDKCVec_u8Z Bytes");
19667 memcpy(output_script_ref.data, output_script->elems, output_script_ref.datalen); FREE(output_script);
19668 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
19669 *ret_copy = Event_funding_generation_ready(temporary_channel_id_ref, counterparty_node_id_ref, channel_value_satoshis, output_script_ref, user_channel_id);
19670 uint64_t ret_ref = tag_ptr(ret_copy, true);
19674 uint64_t __attribute__((export_name("TS_Event_payment_received"))) TS_Event_payment_received(int8_tArray payment_hash, int64_t amount_msat, uint64_t purpose) {
19675 LDKThirtyTwoBytes payment_hash_ref;
19676 CHECK(payment_hash->arr_len == 32);
19677 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
19678 void* purpose_ptr = untag_ptr(purpose);
19679 CHECK_ACCESS(purpose_ptr);
19680 LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr);
19681 purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(purpose));
19682 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
19683 *ret_copy = Event_payment_received(payment_hash_ref, amount_msat, purpose_conv);
19684 uint64_t ret_ref = tag_ptr(ret_copy, true);
19688 uint64_t __attribute__((export_name("TS_Event_payment_claimed"))) TS_Event_payment_claimed(int8_tArray payment_hash, int64_t amount_msat, uint64_t purpose) {
19689 LDKThirtyTwoBytes payment_hash_ref;
19690 CHECK(payment_hash->arr_len == 32);
19691 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
19692 void* purpose_ptr = untag_ptr(purpose);
19693 CHECK_ACCESS(purpose_ptr);
19694 LDKPaymentPurpose purpose_conv = *(LDKPaymentPurpose*)(purpose_ptr);
19695 purpose_conv = PaymentPurpose_clone((LDKPaymentPurpose*)untag_ptr(purpose));
19696 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
19697 *ret_copy = Event_payment_claimed(payment_hash_ref, amount_msat, purpose_conv);
19698 uint64_t ret_ref = tag_ptr(ret_copy, true);
19702 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) {
19703 LDKThirtyTwoBytes payment_id_ref;
19704 CHECK(payment_id->arr_len == 32);
19705 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
19706 LDKThirtyTwoBytes payment_preimage_ref;
19707 CHECK(payment_preimage->arr_len == 32);
19708 memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage);
19709 LDKThirtyTwoBytes payment_hash_ref;
19710 CHECK(payment_hash->arr_len == 32);
19711 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
19712 void* fee_paid_msat_ptr = untag_ptr(fee_paid_msat);
19713 CHECK_ACCESS(fee_paid_msat_ptr);
19714 LDKCOption_u64Z fee_paid_msat_conv = *(LDKCOption_u64Z*)(fee_paid_msat_ptr);
19715 fee_paid_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(fee_paid_msat));
19716 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
19717 *ret_copy = Event_payment_sent(payment_id_ref, payment_preimage_ref, payment_hash_ref, fee_paid_msat_conv);
19718 uint64_t ret_ref = tag_ptr(ret_copy, true);
19722 uint64_t __attribute__((export_name("TS_Event_payment_failed"))) TS_Event_payment_failed(int8_tArray payment_id, int8_tArray payment_hash) {
19723 LDKThirtyTwoBytes payment_id_ref;
19724 CHECK(payment_id->arr_len == 32);
19725 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
19726 LDKThirtyTwoBytes payment_hash_ref;
19727 CHECK(payment_hash->arr_len == 32);
19728 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
19729 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
19730 *ret_copy = Event_payment_failed(payment_id_ref, payment_hash_ref);
19731 uint64_t ret_ref = tag_ptr(ret_copy, true);
19735 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) {
19736 LDKThirtyTwoBytes payment_id_ref;
19737 CHECK(payment_id->arr_len == 32);
19738 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
19739 LDKThirtyTwoBytes payment_hash_ref;
19740 CHECK(payment_hash->arr_len == 32);
19741 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
19742 LDKCVec_RouteHopZ path_constr;
19743 path_constr.datalen = path->arr_len;
19744 if (path_constr.datalen > 0)
19745 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
19747 path_constr.data = NULL;
19748 uint64_t* path_vals = path->elems;
19749 for (size_t k = 0; k < path_constr.datalen; k++) {
19750 uint64_t path_conv_10 = path_vals[k];
19751 LDKRouteHop path_conv_10_conv;
19752 path_conv_10_conv.inner = untag_ptr(path_conv_10);
19753 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
19754 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
19755 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
19756 path_constr.data[k] = path_conv_10_conv;
19759 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
19760 *ret_copy = Event_payment_path_successful(payment_id_ref, payment_hash_ref, path_constr);
19761 uint64_t ret_ref = tag_ptr(ret_copy, true);
19765 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) {
19766 LDKThirtyTwoBytes payment_id_ref;
19767 CHECK(payment_id->arr_len == 32);
19768 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
19769 LDKThirtyTwoBytes payment_hash_ref;
19770 CHECK(payment_hash->arr_len == 32);
19771 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
19772 void* network_update_ptr = untag_ptr(network_update);
19773 CHECK_ACCESS(network_update_ptr);
19774 LDKCOption_NetworkUpdateZ network_update_conv = *(LDKCOption_NetworkUpdateZ*)(network_update_ptr);
19775 network_update_conv = COption_NetworkUpdateZ_clone((LDKCOption_NetworkUpdateZ*)untag_ptr(network_update));
19776 LDKCVec_RouteHopZ path_constr;
19777 path_constr.datalen = path->arr_len;
19778 if (path_constr.datalen > 0)
19779 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
19781 path_constr.data = NULL;
19782 uint64_t* path_vals = path->elems;
19783 for (size_t k = 0; k < path_constr.datalen; k++) {
19784 uint64_t path_conv_10 = path_vals[k];
19785 LDKRouteHop path_conv_10_conv;
19786 path_conv_10_conv.inner = untag_ptr(path_conv_10);
19787 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
19788 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
19789 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
19790 path_constr.data[k] = path_conv_10_conv;
19793 void* short_channel_id_ptr = untag_ptr(short_channel_id);
19794 CHECK_ACCESS(short_channel_id_ptr);
19795 LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr);
19796 short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id));
19797 LDKRouteParameters retry_conv;
19798 retry_conv.inner = untag_ptr(retry);
19799 retry_conv.is_owned = ptr_is_owned(retry);
19800 CHECK_INNER_FIELD_ACCESS_OR_NULL(retry_conv);
19801 retry_conv = RouteParameters_clone(&retry_conv);
19802 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
19803 *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);
19804 uint64_t ret_ref = tag_ptr(ret_copy, true);
19808 uint64_t __attribute__((export_name("TS_Event_probe_successful"))) TS_Event_probe_successful(int8_tArray payment_id, int8_tArray payment_hash, uint64_tArray path) {
19809 LDKThirtyTwoBytes payment_id_ref;
19810 CHECK(payment_id->arr_len == 32);
19811 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
19812 LDKThirtyTwoBytes payment_hash_ref;
19813 CHECK(payment_hash->arr_len == 32);
19814 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
19815 LDKCVec_RouteHopZ path_constr;
19816 path_constr.datalen = path->arr_len;
19817 if (path_constr.datalen > 0)
19818 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
19820 path_constr.data = NULL;
19821 uint64_t* path_vals = path->elems;
19822 for (size_t k = 0; k < path_constr.datalen; k++) {
19823 uint64_t path_conv_10 = path_vals[k];
19824 LDKRouteHop path_conv_10_conv;
19825 path_conv_10_conv.inner = untag_ptr(path_conv_10);
19826 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
19827 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
19828 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
19829 path_constr.data[k] = path_conv_10_conv;
19832 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
19833 *ret_copy = Event_probe_successful(payment_id_ref, payment_hash_ref, path_constr);
19834 uint64_t ret_ref = tag_ptr(ret_copy, true);
19838 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) {
19839 LDKThirtyTwoBytes payment_id_ref;
19840 CHECK(payment_id->arr_len == 32);
19841 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
19842 LDKThirtyTwoBytes payment_hash_ref;
19843 CHECK(payment_hash->arr_len == 32);
19844 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
19845 LDKCVec_RouteHopZ path_constr;
19846 path_constr.datalen = path->arr_len;
19847 if (path_constr.datalen > 0)
19848 path_constr.data = MALLOC(path_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
19850 path_constr.data = NULL;
19851 uint64_t* path_vals = path->elems;
19852 for (size_t k = 0; k < path_constr.datalen; k++) {
19853 uint64_t path_conv_10 = path_vals[k];
19854 LDKRouteHop path_conv_10_conv;
19855 path_conv_10_conv.inner = untag_ptr(path_conv_10);
19856 path_conv_10_conv.is_owned = ptr_is_owned(path_conv_10);
19857 CHECK_INNER_FIELD_ACCESS_OR_NULL(path_conv_10_conv);
19858 path_conv_10_conv = RouteHop_clone(&path_conv_10_conv);
19859 path_constr.data[k] = path_conv_10_conv;
19862 void* short_channel_id_ptr = untag_ptr(short_channel_id);
19863 CHECK_ACCESS(short_channel_id_ptr);
19864 LDKCOption_u64Z short_channel_id_conv = *(LDKCOption_u64Z*)(short_channel_id_ptr);
19865 short_channel_id_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id));
19866 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
19867 *ret_copy = Event_probe_failed(payment_id_ref, payment_hash_ref, path_constr, short_channel_id_conv);
19868 uint64_t ret_ref = tag_ptr(ret_copy, true);
19872 uint64_t __attribute__((export_name("TS_Event_pending_htlcs_forwardable"))) TS_Event_pending_htlcs_forwardable(int64_t time_forwardable) {
19873 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
19874 *ret_copy = Event_pending_htlcs_forwardable(time_forwardable);
19875 uint64_t ret_ref = tag_ptr(ret_copy, true);
19879 uint64_t __attribute__((export_name("TS_Event_spendable_outputs"))) TS_Event_spendable_outputs(uint64_tArray outputs) {
19880 LDKCVec_SpendableOutputDescriptorZ outputs_constr;
19881 outputs_constr.datalen = outputs->arr_len;
19882 if (outputs_constr.datalen > 0)
19883 outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
19885 outputs_constr.data = NULL;
19886 uint64_t* outputs_vals = outputs->elems;
19887 for (size_t b = 0; b < outputs_constr.datalen; b++) {
19888 uint64_t outputs_conv_27 = outputs_vals[b];
19889 void* outputs_conv_27_ptr = untag_ptr(outputs_conv_27);
19890 CHECK_ACCESS(outputs_conv_27_ptr);
19891 LDKSpendableOutputDescriptor outputs_conv_27_conv = *(LDKSpendableOutputDescriptor*)(outputs_conv_27_ptr);
19892 outputs_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(outputs_conv_27));
19893 outputs_constr.data[b] = outputs_conv_27_conv;
19896 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
19897 *ret_copy = Event_spendable_outputs(outputs_constr);
19898 uint64_t ret_ref = tag_ptr(ret_copy, true);
19902 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) {
19903 LDKThirtyTwoBytes prev_channel_id_ref;
19904 CHECK(prev_channel_id->arr_len == 32);
19905 memcpy(prev_channel_id_ref.data, prev_channel_id->elems, 32); FREE(prev_channel_id);
19906 LDKThirtyTwoBytes next_channel_id_ref;
19907 CHECK(next_channel_id->arr_len == 32);
19908 memcpy(next_channel_id_ref.data, next_channel_id->elems, 32); FREE(next_channel_id);
19909 void* fee_earned_msat_ptr = untag_ptr(fee_earned_msat);
19910 CHECK_ACCESS(fee_earned_msat_ptr);
19911 LDKCOption_u64Z fee_earned_msat_conv = *(LDKCOption_u64Z*)(fee_earned_msat_ptr);
19912 fee_earned_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(fee_earned_msat));
19913 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
19914 *ret_copy = Event_payment_forwarded(prev_channel_id_ref, next_channel_id_ref, fee_earned_msat_conv, claim_from_onchain_tx);
19915 uint64_t ret_ref = tag_ptr(ret_copy, true);
19919 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) {
19920 LDKThirtyTwoBytes channel_id_ref;
19921 CHECK(channel_id->arr_len == 32);
19922 memcpy(channel_id_ref.data, channel_id->elems, 32); FREE(channel_id);
19923 void* reason_ptr = untag_ptr(reason);
19924 CHECK_ACCESS(reason_ptr);
19925 LDKClosureReason reason_conv = *(LDKClosureReason*)(reason_ptr);
19926 reason_conv = ClosureReason_clone((LDKClosureReason*)untag_ptr(reason));
19927 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
19928 *ret_copy = Event_channel_closed(channel_id_ref, user_channel_id, reason_conv);
19929 uint64_t ret_ref = tag_ptr(ret_copy, true);
19933 uint64_t __attribute__((export_name("TS_Event_discard_funding"))) TS_Event_discard_funding(int8_tArray channel_id, int8_tArray transaction) {
19934 LDKThirtyTwoBytes channel_id_ref;
19935 CHECK(channel_id->arr_len == 32);
19936 memcpy(channel_id_ref.data, channel_id->elems, 32); FREE(channel_id);
19937 LDKTransaction transaction_ref;
19938 transaction_ref.datalen = transaction->arr_len;
19939 transaction_ref.data = MALLOC(transaction_ref.datalen, "LDKTransaction Bytes");
19940 memcpy(transaction_ref.data, transaction->elems, transaction_ref.datalen); FREE(transaction);
19941 transaction_ref.data_is_owned = true;
19942 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
19943 *ret_copy = Event_discard_funding(channel_id_ref, transaction_ref);
19944 uint64_t ret_ref = tag_ptr(ret_copy, true);
19948 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) {
19949 LDKThirtyTwoBytes temporary_channel_id_ref;
19950 CHECK(temporary_channel_id->arr_len == 32);
19951 memcpy(temporary_channel_id_ref.data, temporary_channel_id->elems, 32); FREE(temporary_channel_id);
19952 LDKPublicKey counterparty_node_id_ref;
19953 CHECK(counterparty_node_id->arr_len == 33);
19954 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
19955 LDKChannelTypeFeatures channel_type_conv;
19956 channel_type_conv.inner = untag_ptr(channel_type);
19957 channel_type_conv.is_owned = ptr_is_owned(channel_type);
19958 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_conv);
19959 channel_type_conv = ChannelTypeFeatures_clone(&channel_type_conv);
19960 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
19961 *ret_copy = Event_open_channel_request(temporary_channel_id_ref, counterparty_node_id_ref, funding_satoshis, push_msat, channel_type_conv);
19962 uint64_t ret_ref = tag_ptr(ret_copy, true);
19966 uint64_t __attribute__((export_name("TS_Event_htlchandling_failed"))) TS_Event_htlchandling_failed(int8_tArray prev_channel_id, uint64_t failed_next_destination) {
19967 LDKThirtyTwoBytes prev_channel_id_ref;
19968 CHECK(prev_channel_id->arr_len == 32);
19969 memcpy(prev_channel_id_ref.data, prev_channel_id->elems, 32); FREE(prev_channel_id);
19970 void* failed_next_destination_ptr = untag_ptr(failed_next_destination);
19971 CHECK_ACCESS(failed_next_destination_ptr);
19972 LDKHTLCDestination failed_next_destination_conv = *(LDKHTLCDestination*)(failed_next_destination_ptr);
19973 failed_next_destination_conv = HTLCDestination_clone((LDKHTLCDestination*)untag_ptr(failed_next_destination));
19974 LDKEvent *ret_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
19975 *ret_copy = Event_htlchandling_failed(prev_channel_id_ref, failed_next_destination_conv);
19976 uint64_t ret_ref = tag_ptr(ret_copy, true);
19980 int8_tArray __attribute__((export_name("TS_Event_write"))) TS_Event_write(uint64_t obj) {
19981 LDKEvent* obj_conv = (LDKEvent*)untag_ptr(obj);
19982 LDKCVec_u8Z ret_var = Event_write(obj_conv);
19983 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
19984 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
19985 CVec_u8Z_free(ret_var);
19989 uint64_t __attribute__((export_name("TS_Event_read"))) TS_Event_read(int8_tArray ser) {
19990 LDKu8slice ser_ref;
19991 ser_ref.datalen = ser->arr_len;
19992 ser_ref.data = ser->elems;
19993 LDKCResult_COption_EventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_EventZDecodeErrorZ), "LDKCResult_COption_EventZDecodeErrorZ");
19994 *ret_conv = Event_read(ser_ref);
19996 return tag_ptr(ret_conv, true);
19999 void __attribute__((export_name("TS_MessageSendEvent_free"))) TS_MessageSendEvent_free(uint64_t this_ptr) {
20000 if (!ptr_is_owned(this_ptr)) return;
20001 void* this_ptr_ptr = untag_ptr(this_ptr);
20002 CHECK_ACCESS(this_ptr_ptr);
20003 LDKMessageSendEvent this_ptr_conv = *(LDKMessageSendEvent*)(this_ptr_ptr);
20004 FREE(untag_ptr(this_ptr));
20005 MessageSendEvent_free(this_ptr_conv);
20008 static inline uint64_t MessageSendEvent_clone_ptr(LDKMessageSendEvent *NONNULL_PTR arg) {
20009 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20010 *ret_copy = MessageSendEvent_clone(arg);
20011 uint64_t ret_ref = tag_ptr(ret_copy, true);
20014 int64_t __attribute__((export_name("TS_MessageSendEvent_clone_ptr"))) TS_MessageSendEvent_clone_ptr(uint64_t arg) {
20015 LDKMessageSendEvent* arg_conv = (LDKMessageSendEvent*)untag_ptr(arg);
20016 int64_t ret_conv = MessageSendEvent_clone_ptr(arg_conv);
20020 uint64_t __attribute__((export_name("TS_MessageSendEvent_clone"))) TS_MessageSendEvent_clone(uint64_t orig) {
20021 LDKMessageSendEvent* orig_conv = (LDKMessageSendEvent*)untag_ptr(orig);
20022 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20023 *ret_copy = MessageSendEvent_clone(orig_conv);
20024 uint64_t ret_ref = tag_ptr(ret_copy, true);
20028 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_accept_channel"))) TS_MessageSendEvent_send_accept_channel(int8_tArray node_id, uint64_t msg) {
20029 LDKPublicKey node_id_ref;
20030 CHECK(node_id->arr_len == 33);
20031 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20032 LDKAcceptChannel msg_conv;
20033 msg_conv.inner = untag_ptr(msg);
20034 msg_conv.is_owned = ptr_is_owned(msg);
20035 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20036 msg_conv = AcceptChannel_clone(&msg_conv);
20037 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20038 *ret_copy = MessageSendEvent_send_accept_channel(node_id_ref, msg_conv);
20039 uint64_t ret_ref = tag_ptr(ret_copy, true);
20043 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_open_channel"))) TS_MessageSendEvent_send_open_channel(int8_tArray node_id, uint64_t msg) {
20044 LDKPublicKey node_id_ref;
20045 CHECK(node_id->arr_len == 33);
20046 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20047 LDKOpenChannel msg_conv;
20048 msg_conv.inner = untag_ptr(msg);
20049 msg_conv.is_owned = ptr_is_owned(msg);
20050 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20051 msg_conv = OpenChannel_clone(&msg_conv);
20052 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20053 *ret_copy = MessageSendEvent_send_open_channel(node_id_ref, msg_conv);
20054 uint64_t ret_ref = tag_ptr(ret_copy, true);
20058 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_funding_created"))) TS_MessageSendEvent_send_funding_created(int8_tArray node_id, uint64_t msg) {
20059 LDKPublicKey node_id_ref;
20060 CHECK(node_id->arr_len == 33);
20061 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20062 LDKFundingCreated msg_conv;
20063 msg_conv.inner = untag_ptr(msg);
20064 msg_conv.is_owned = ptr_is_owned(msg);
20065 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20066 msg_conv = FundingCreated_clone(&msg_conv);
20067 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20068 *ret_copy = MessageSendEvent_send_funding_created(node_id_ref, msg_conv);
20069 uint64_t ret_ref = tag_ptr(ret_copy, true);
20073 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_funding_signed"))) TS_MessageSendEvent_send_funding_signed(int8_tArray node_id, uint64_t msg) {
20074 LDKPublicKey node_id_ref;
20075 CHECK(node_id->arr_len == 33);
20076 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20077 LDKFundingSigned msg_conv;
20078 msg_conv.inner = untag_ptr(msg);
20079 msg_conv.is_owned = ptr_is_owned(msg);
20080 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20081 msg_conv = FundingSigned_clone(&msg_conv);
20082 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20083 *ret_copy = MessageSendEvent_send_funding_signed(node_id_ref, msg_conv);
20084 uint64_t ret_ref = tag_ptr(ret_copy, true);
20088 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_channel_ready"))) TS_MessageSendEvent_send_channel_ready(int8_tArray node_id, uint64_t msg) {
20089 LDKPublicKey node_id_ref;
20090 CHECK(node_id->arr_len == 33);
20091 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20092 LDKChannelReady msg_conv;
20093 msg_conv.inner = untag_ptr(msg);
20094 msg_conv.is_owned = ptr_is_owned(msg);
20095 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20096 msg_conv = ChannelReady_clone(&msg_conv);
20097 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20098 *ret_copy = MessageSendEvent_send_channel_ready(node_id_ref, msg_conv);
20099 uint64_t ret_ref = tag_ptr(ret_copy, true);
20103 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_announcement_signatures"))) TS_MessageSendEvent_send_announcement_signatures(int8_tArray node_id, uint64_t msg) {
20104 LDKPublicKey node_id_ref;
20105 CHECK(node_id->arr_len == 33);
20106 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20107 LDKAnnouncementSignatures msg_conv;
20108 msg_conv.inner = untag_ptr(msg);
20109 msg_conv.is_owned = ptr_is_owned(msg);
20110 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20111 msg_conv = AnnouncementSignatures_clone(&msg_conv);
20112 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20113 *ret_copy = MessageSendEvent_send_announcement_signatures(node_id_ref, msg_conv);
20114 uint64_t ret_ref = tag_ptr(ret_copy, true);
20118 uint64_t __attribute__((export_name("TS_MessageSendEvent_update_htlcs"))) TS_MessageSendEvent_update_htlcs(int8_tArray node_id, uint64_t updates) {
20119 LDKPublicKey node_id_ref;
20120 CHECK(node_id->arr_len == 33);
20121 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20122 LDKCommitmentUpdate updates_conv;
20123 updates_conv.inner = untag_ptr(updates);
20124 updates_conv.is_owned = ptr_is_owned(updates);
20125 CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv);
20126 updates_conv = CommitmentUpdate_clone(&updates_conv);
20127 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20128 *ret_copy = MessageSendEvent_update_htlcs(node_id_ref, updates_conv);
20129 uint64_t ret_ref = tag_ptr(ret_copy, true);
20133 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_revoke_and_ack"))) TS_MessageSendEvent_send_revoke_and_ack(int8_tArray node_id, uint64_t msg) {
20134 LDKPublicKey node_id_ref;
20135 CHECK(node_id->arr_len == 33);
20136 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20137 LDKRevokeAndACK msg_conv;
20138 msg_conv.inner = untag_ptr(msg);
20139 msg_conv.is_owned = ptr_is_owned(msg);
20140 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20141 msg_conv = RevokeAndACK_clone(&msg_conv);
20142 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20143 *ret_copy = MessageSendEvent_send_revoke_and_ack(node_id_ref, msg_conv);
20144 uint64_t ret_ref = tag_ptr(ret_copy, true);
20148 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_closing_signed"))) TS_MessageSendEvent_send_closing_signed(int8_tArray node_id, uint64_t msg) {
20149 LDKPublicKey node_id_ref;
20150 CHECK(node_id->arr_len == 33);
20151 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20152 LDKClosingSigned msg_conv;
20153 msg_conv.inner = untag_ptr(msg);
20154 msg_conv.is_owned = ptr_is_owned(msg);
20155 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20156 msg_conv = ClosingSigned_clone(&msg_conv);
20157 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20158 *ret_copy = MessageSendEvent_send_closing_signed(node_id_ref, msg_conv);
20159 uint64_t ret_ref = tag_ptr(ret_copy, true);
20163 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_shutdown"))) TS_MessageSendEvent_send_shutdown(int8_tArray node_id, uint64_t msg) {
20164 LDKPublicKey node_id_ref;
20165 CHECK(node_id->arr_len == 33);
20166 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20167 LDKShutdown msg_conv;
20168 msg_conv.inner = untag_ptr(msg);
20169 msg_conv.is_owned = ptr_is_owned(msg);
20170 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20171 msg_conv = Shutdown_clone(&msg_conv);
20172 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20173 *ret_copy = MessageSendEvent_send_shutdown(node_id_ref, msg_conv);
20174 uint64_t ret_ref = tag_ptr(ret_copy, true);
20178 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_channel_reestablish"))) TS_MessageSendEvent_send_channel_reestablish(int8_tArray node_id, uint64_t msg) {
20179 LDKPublicKey node_id_ref;
20180 CHECK(node_id->arr_len == 33);
20181 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20182 LDKChannelReestablish msg_conv;
20183 msg_conv.inner = untag_ptr(msg);
20184 msg_conv.is_owned = ptr_is_owned(msg);
20185 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20186 msg_conv = ChannelReestablish_clone(&msg_conv);
20187 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20188 *ret_copy = MessageSendEvent_send_channel_reestablish(node_id_ref, msg_conv);
20189 uint64_t ret_ref = tag_ptr(ret_copy, true);
20193 uint64_t __attribute__((export_name("TS_MessageSendEvent_broadcast_channel_announcement"))) TS_MessageSendEvent_broadcast_channel_announcement(uint64_t msg, uint64_t update_msg) {
20194 LDKChannelAnnouncement msg_conv;
20195 msg_conv.inner = untag_ptr(msg);
20196 msg_conv.is_owned = ptr_is_owned(msg);
20197 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20198 msg_conv = ChannelAnnouncement_clone(&msg_conv);
20199 LDKChannelUpdate update_msg_conv;
20200 update_msg_conv.inner = untag_ptr(update_msg);
20201 update_msg_conv.is_owned = ptr_is_owned(update_msg);
20202 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_msg_conv);
20203 update_msg_conv = ChannelUpdate_clone(&update_msg_conv);
20204 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20205 *ret_copy = MessageSendEvent_broadcast_channel_announcement(msg_conv, update_msg_conv);
20206 uint64_t ret_ref = tag_ptr(ret_copy, true);
20210 uint64_t __attribute__((export_name("TS_MessageSendEvent_broadcast_node_announcement"))) TS_MessageSendEvent_broadcast_node_announcement(uint64_t msg) {
20211 LDKNodeAnnouncement msg_conv;
20212 msg_conv.inner = untag_ptr(msg);
20213 msg_conv.is_owned = ptr_is_owned(msg);
20214 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20215 msg_conv = NodeAnnouncement_clone(&msg_conv);
20216 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20217 *ret_copy = MessageSendEvent_broadcast_node_announcement(msg_conv);
20218 uint64_t ret_ref = tag_ptr(ret_copy, true);
20222 uint64_t __attribute__((export_name("TS_MessageSendEvent_broadcast_channel_update"))) TS_MessageSendEvent_broadcast_channel_update(uint64_t msg) {
20223 LDKChannelUpdate msg_conv;
20224 msg_conv.inner = untag_ptr(msg);
20225 msg_conv.is_owned = ptr_is_owned(msg);
20226 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20227 msg_conv = ChannelUpdate_clone(&msg_conv);
20228 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20229 *ret_copy = MessageSendEvent_broadcast_channel_update(msg_conv);
20230 uint64_t ret_ref = tag_ptr(ret_copy, true);
20234 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_channel_update"))) TS_MessageSendEvent_send_channel_update(int8_tArray node_id, uint64_t msg) {
20235 LDKPublicKey node_id_ref;
20236 CHECK(node_id->arr_len == 33);
20237 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20238 LDKChannelUpdate msg_conv;
20239 msg_conv.inner = untag_ptr(msg);
20240 msg_conv.is_owned = ptr_is_owned(msg);
20241 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20242 msg_conv = ChannelUpdate_clone(&msg_conv);
20243 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20244 *ret_copy = MessageSendEvent_send_channel_update(node_id_ref, msg_conv);
20245 uint64_t ret_ref = tag_ptr(ret_copy, true);
20249 uint64_t __attribute__((export_name("TS_MessageSendEvent_handle_error"))) TS_MessageSendEvent_handle_error(int8_tArray node_id, uint64_t action) {
20250 LDKPublicKey node_id_ref;
20251 CHECK(node_id->arr_len == 33);
20252 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20253 void* action_ptr = untag_ptr(action);
20254 CHECK_ACCESS(action_ptr);
20255 LDKErrorAction action_conv = *(LDKErrorAction*)(action_ptr);
20256 action_conv = ErrorAction_clone((LDKErrorAction*)untag_ptr(action));
20257 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20258 *ret_copy = MessageSendEvent_handle_error(node_id_ref, action_conv);
20259 uint64_t ret_ref = tag_ptr(ret_copy, true);
20263 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_channel_range_query"))) TS_MessageSendEvent_send_channel_range_query(int8_tArray node_id, uint64_t msg) {
20264 LDKPublicKey node_id_ref;
20265 CHECK(node_id->arr_len == 33);
20266 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20267 LDKQueryChannelRange msg_conv;
20268 msg_conv.inner = untag_ptr(msg);
20269 msg_conv.is_owned = ptr_is_owned(msg);
20270 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20271 msg_conv = QueryChannelRange_clone(&msg_conv);
20272 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20273 *ret_copy = MessageSendEvent_send_channel_range_query(node_id_ref, msg_conv);
20274 uint64_t ret_ref = tag_ptr(ret_copy, true);
20278 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_short_ids_query"))) TS_MessageSendEvent_send_short_ids_query(int8_tArray node_id, uint64_t msg) {
20279 LDKPublicKey node_id_ref;
20280 CHECK(node_id->arr_len == 33);
20281 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20282 LDKQueryShortChannelIds msg_conv;
20283 msg_conv.inner = untag_ptr(msg);
20284 msg_conv.is_owned = ptr_is_owned(msg);
20285 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20286 msg_conv = QueryShortChannelIds_clone(&msg_conv);
20287 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20288 *ret_copy = MessageSendEvent_send_short_ids_query(node_id_ref, msg_conv);
20289 uint64_t ret_ref = tag_ptr(ret_copy, true);
20293 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_reply_channel_range"))) TS_MessageSendEvent_send_reply_channel_range(int8_tArray node_id, uint64_t msg) {
20294 LDKPublicKey node_id_ref;
20295 CHECK(node_id->arr_len == 33);
20296 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20297 LDKReplyChannelRange msg_conv;
20298 msg_conv.inner = untag_ptr(msg);
20299 msg_conv.is_owned = ptr_is_owned(msg);
20300 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20301 msg_conv = ReplyChannelRange_clone(&msg_conv);
20302 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20303 *ret_copy = MessageSendEvent_send_reply_channel_range(node_id_ref, msg_conv);
20304 uint64_t ret_ref = tag_ptr(ret_copy, true);
20308 uint64_t __attribute__((export_name("TS_MessageSendEvent_send_gossip_timestamp_filter"))) TS_MessageSendEvent_send_gossip_timestamp_filter(int8_tArray node_id, uint64_t msg) {
20309 LDKPublicKey node_id_ref;
20310 CHECK(node_id->arr_len == 33);
20311 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
20312 LDKGossipTimestampFilter msg_conv;
20313 msg_conv.inner = untag_ptr(msg);
20314 msg_conv.is_owned = ptr_is_owned(msg);
20315 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
20316 msg_conv = GossipTimestampFilter_clone(&msg_conv);
20317 LDKMessageSendEvent *ret_copy = MALLOC(sizeof(LDKMessageSendEvent), "LDKMessageSendEvent");
20318 *ret_copy = MessageSendEvent_send_gossip_timestamp_filter(node_id_ref, msg_conv);
20319 uint64_t ret_ref = tag_ptr(ret_copy, true);
20323 void __attribute__((export_name("TS_MessageSendEventsProvider_free"))) TS_MessageSendEventsProvider_free(uint64_t this_ptr) {
20324 if (!ptr_is_owned(this_ptr)) return;
20325 void* this_ptr_ptr = untag_ptr(this_ptr);
20326 CHECK_ACCESS(this_ptr_ptr);
20327 LDKMessageSendEventsProvider this_ptr_conv = *(LDKMessageSendEventsProvider*)(this_ptr_ptr);
20328 FREE(untag_ptr(this_ptr));
20329 MessageSendEventsProvider_free(this_ptr_conv);
20332 void __attribute__((export_name("TS_EventsProvider_free"))) TS_EventsProvider_free(uint64_t this_ptr) {
20333 if (!ptr_is_owned(this_ptr)) return;
20334 void* this_ptr_ptr = untag_ptr(this_ptr);
20335 CHECK_ACCESS(this_ptr_ptr);
20336 LDKEventsProvider this_ptr_conv = *(LDKEventsProvider*)(this_ptr_ptr);
20337 FREE(untag_ptr(this_ptr));
20338 EventsProvider_free(this_ptr_conv);
20341 void __attribute__((export_name("TS_EventHandler_free"))) TS_EventHandler_free(uint64_t this_ptr) {
20342 if (!ptr_is_owned(this_ptr)) return;
20343 void* this_ptr_ptr = untag_ptr(this_ptr);
20344 CHECK_ACCESS(this_ptr_ptr);
20345 LDKEventHandler this_ptr_conv = *(LDKEventHandler*)(this_ptr_ptr);
20346 FREE(untag_ptr(this_ptr));
20347 EventHandler_free(this_ptr_conv);
20350 void __attribute__((export_name("TS_APIError_free"))) TS_APIError_free(uint64_t this_ptr) {
20351 if (!ptr_is_owned(this_ptr)) return;
20352 void* this_ptr_ptr = untag_ptr(this_ptr);
20353 CHECK_ACCESS(this_ptr_ptr);
20354 LDKAPIError this_ptr_conv = *(LDKAPIError*)(this_ptr_ptr);
20355 FREE(untag_ptr(this_ptr));
20356 APIError_free(this_ptr_conv);
20359 static inline uint64_t APIError_clone_ptr(LDKAPIError *NONNULL_PTR arg) {
20360 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
20361 *ret_copy = APIError_clone(arg);
20362 uint64_t ret_ref = tag_ptr(ret_copy, true);
20365 int64_t __attribute__((export_name("TS_APIError_clone_ptr"))) TS_APIError_clone_ptr(uint64_t arg) {
20366 LDKAPIError* arg_conv = (LDKAPIError*)untag_ptr(arg);
20367 int64_t ret_conv = APIError_clone_ptr(arg_conv);
20371 uint64_t __attribute__((export_name("TS_APIError_clone"))) TS_APIError_clone(uint64_t orig) {
20372 LDKAPIError* orig_conv = (LDKAPIError*)untag_ptr(orig);
20373 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
20374 *ret_copy = APIError_clone(orig_conv);
20375 uint64_t ret_ref = tag_ptr(ret_copy, true);
20379 uint64_t __attribute__((export_name("TS_APIError_apimisuse_error"))) TS_APIError_apimisuse_error(jstring err) {
20380 LDKStr err_conv = str_ref_to_owned_c(err);
20381 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
20382 *ret_copy = APIError_apimisuse_error(err_conv);
20383 uint64_t ret_ref = tag_ptr(ret_copy, true);
20387 uint64_t __attribute__((export_name("TS_APIError_fee_rate_too_high"))) TS_APIError_fee_rate_too_high(jstring err, int32_t feerate) {
20388 LDKStr err_conv = str_ref_to_owned_c(err);
20389 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
20390 *ret_copy = APIError_fee_rate_too_high(err_conv, feerate);
20391 uint64_t ret_ref = tag_ptr(ret_copy, true);
20395 uint64_t __attribute__((export_name("TS_APIError_route_error"))) TS_APIError_route_error(jstring err) {
20396 LDKStr err_conv = str_ref_to_owned_c(err);
20397 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
20398 *ret_copy = APIError_route_error(err_conv);
20399 uint64_t ret_ref = tag_ptr(ret_copy, true);
20403 uint64_t __attribute__((export_name("TS_APIError_channel_unavailable"))) TS_APIError_channel_unavailable(jstring err) {
20404 LDKStr err_conv = str_ref_to_owned_c(err);
20405 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
20406 *ret_copy = APIError_channel_unavailable(err_conv);
20407 uint64_t ret_ref = tag_ptr(ret_copy, true);
20411 uint64_t __attribute__((export_name("TS_APIError_monitor_update_failed"))) TS_APIError_monitor_update_failed() {
20412 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
20413 *ret_copy = APIError_monitor_update_failed();
20414 uint64_t ret_ref = tag_ptr(ret_copy, true);
20418 uint64_t __attribute__((export_name("TS_APIError_incompatible_shutdown_script"))) TS_APIError_incompatible_shutdown_script(uint64_t script) {
20419 LDKShutdownScript script_conv;
20420 script_conv.inner = untag_ptr(script);
20421 script_conv.is_owned = ptr_is_owned(script);
20422 CHECK_INNER_FIELD_ACCESS_OR_NULL(script_conv);
20423 script_conv = ShutdownScript_clone(&script_conv);
20424 LDKAPIError *ret_copy = MALLOC(sizeof(LDKAPIError), "LDKAPIError");
20425 *ret_copy = APIError_incompatible_shutdown_script(script_conv);
20426 uint64_t ret_ref = tag_ptr(ret_copy, true);
20430 void __attribute__((export_name("TS_BigSize_free"))) TS_BigSize_free(uint64_t this_obj) {
20431 LDKBigSize this_obj_conv;
20432 this_obj_conv.inner = untag_ptr(this_obj);
20433 this_obj_conv.is_owned = ptr_is_owned(this_obj);
20434 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
20435 BigSize_free(this_obj_conv);
20438 int64_t __attribute__((export_name("TS_BigSize_get_a"))) TS_BigSize_get_a(uint64_t this_ptr) {
20439 LDKBigSize this_ptr_conv;
20440 this_ptr_conv.inner = untag_ptr(this_ptr);
20441 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20442 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20443 this_ptr_conv.is_owned = false;
20444 int64_t ret_conv = BigSize_get_a(&this_ptr_conv);
20448 void __attribute__((export_name("TS_BigSize_set_a"))) TS_BigSize_set_a(uint64_t this_ptr, int64_t val) {
20449 LDKBigSize this_ptr_conv;
20450 this_ptr_conv.inner = untag_ptr(this_ptr);
20451 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20452 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20453 this_ptr_conv.is_owned = false;
20454 BigSize_set_a(&this_ptr_conv, val);
20457 uint64_t __attribute__((export_name("TS_BigSize_new"))) TS_BigSize_new(int64_t a_arg) {
20458 LDKBigSize ret_var = BigSize_new(a_arg);
20459 uint64_t ret_ref = 0;
20460 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
20461 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
20465 void __attribute__((export_name("TS_Hostname_free"))) TS_Hostname_free(uint64_t this_obj) {
20466 LDKHostname this_obj_conv;
20467 this_obj_conv.inner = untag_ptr(this_obj);
20468 this_obj_conv.is_owned = ptr_is_owned(this_obj);
20469 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
20470 Hostname_free(this_obj_conv);
20473 static inline uint64_t Hostname_clone_ptr(LDKHostname *NONNULL_PTR arg) {
20474 LDKHostname ret_var = Hostname_clone(arg);
20475 uint64_t ret_ref = 0;
20476 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
20477 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
20480 int64_t __attribute__((export_name("TS_Hostname_clone_ptr"))) TS_Hostname_clone_ptr(uint64_t arg) {
20481 LDKHostname arg_conv;
20482 arg_conv.inner = untag_ptr(arg);
20483 arg_conv.is_owned = ptr_is_owned(arg);
20484 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
20485 arg_conv.is_owned = false;
20486 int64_t ret_conv = Hostname_clone_ptr(&arg_conv);
20490 uint64_t __attribute__((export_name("TS_Hostname_clone"))) TS_Hostname_clone(uint64_t orig) {
20491 LDKHostname orig_conv;
20492 orig_conv.inner = untag_ptr(orig);
20493 orig_conv.is_owned = ptr_is_owned(orig);
20494 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
20495 orig_conv.is_owned = false;
20496 LDKHostname ret_var = Hostname_clone(&orig_conv);
20497 uint64_t ret_ref = 0;
20498 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
20499 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
20503 int8_t __attribute__((export_name("TS_Hostname_len"))) TS_Hostname_len(uint64_t this_arg) {
20504 LDKHostname this_arg_conv;
20505 this_arg_conv.inner = untag_ptr(this_arg);
20506 this_arg_conv.is_owned = ptr_is_owned(this_arg);
20507 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
20508 this_arg_conv.is_owned = false;
20509 int8_t ret_conv = Hostname_len(&this_arg_conv);
20513 uint64_t __attribute__((export_name("TS_sign"))) TS_sign(int8_tArray msg, int8_tArray sk) {
20514 LDKu8slice msg_ref;
20515 msg_ref.datalen = msg->arr_len;
20516 msg_ref.data = msg->elems;
20517 unsigned char sk_arr[32];
20518 CHECK(sk->arr_len == 32);
20519 memcpy(sk_arr, sk->elems, 32); FREE(sk);
20520 unsigned char (*sk_ref)[32] = &sk_arr;
20521 LDKCResult_StringErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StringErrorZ), "LDKCResult_StringErrorZ");
20522 *ret_conv = sign(msg_ref, sk_ref);
20524 return tag_ptr(ret_conv, true);
20527 uint64_t __attribute__((export_name("TS_recover_pk"))) TS_recover_pk(int8_tArray msg, jstring sig) {
20528 LDKu8slice msg_ref;
20529 msg_ref.datalen = msg->arr_len;
20530 msg_ref.data = msg->elems;
20531 LDKStr sig_conv = str_ref_to_owned_c(sig);
20532 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
20533 *ret_conv = recover_pk(msg_ref, sig_conv);
20535 return tag_ptr(ret_conv, true);
20538 jboolean __attribute__((export_name("TS_verify"))) TS_verify(int8_tArray msg, jstring sig, int8_tArray pk) {
20539 LDKu8slice msg_ref;
20540 msg_ref.datalen = msg->arr_len;
20541 msg_ref.data = msg->elems;
20542 LDKStr sig_conv = str_ref_to_owned_c(sig);
20543 LDKPublicKey pk_ref;
20544 CHECK(pk->arr_len == 33);
20545 memcpy(pk_ref.compressed_form, pk->elems, 33); FREE(pk);
20546 jboolean ret_conv = verify(msg_ref, sig_conv, pk_ref);
20551 int8_tArray __attribute__((export_name("TS_construct_invoice_preimage"))) TS_construct_invoice_preimage(int8_tArray hrp_bytes, ptrArray data_without_signature) {
20552 LDKu8slice hrp_bytes_ref;
20553 hrp_bytes_ref.datalen = hrp_bytes->arr_len;
20554 hrp_bytes_ref.data = hrp_bytes->elems;
20555 LDKCVec_u5Z data_without_signature_constr;
20556 data_without_signature_constr.datalen = data_without_signature->arr_len;
20557 if (data_without_signature_constr.datalen > 0)
20558 data_without_signature_constr.data = MALLOC(data_without_signature_constr.datalen * sizeof(LDKu5), "LDKCVec_u5Z Elements");
20560 data_without_signature_constr.data = NULL;
20561 int8_t* data_without_signature_vals = (void*) data_without_signature->elems;
20562 for (size_t h = 0; h < data_without_signature_constr.datalen; h++) {
20563 int8_t data_without_signature_conv_7 = data_without_signature_vals[h];
20565 data_without_signature_constr.data[h] = (LDKu5){ ._0 = data_without_signature_conv_7 };
20567 FREE(data_without_signature);
20568 LDKCVec_u8Z ret_var = construct_invoice_preimage(hrp_bytes_ref, data_without_signature_constr);
20569 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
20570 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
20571 CVec_u8Z_free(ret_var);
20576 void __attribute__((export_name("TS_Persister_free"))) TS_Persister_free(uint64_t this_ptr) {
20577 if (!ptr_is_owned(this_ptr)) return;
20578 void* this_ptr_ptr = untag_ptr(this_ptr);
20579 CHECK_ACCESS(this_ptr_ptr);
20580 LDKPersister this_ptr_conv = *(LDKPersister*)(this_ptr_ptr);
20581 FREE(untag_ptr(this_ptr));
20582 Persister_free(this_ptr_conv);
20585 uint32_t __attribute__((export_name("TS_Level_clone"))) TS_Level_clone(uint64_t orig) {
20586 LDKLevel* orig_conv = (LDKLevel*)untag_ptr(orig);
20587 uint32_t ret_conv = LDKLevel_to_js(Level_clone(orig_conv));
20591 uint32_t __attribute__((export_name("TS_Level_gossip"))) TS_Level_gossip() {
20592 uint32_t ret_conv = LDKLevel_to_js(Level_gossip());
20596 uint32_t __attribute__((export_name("TS_Level_trace"))) TS_Level_trace() {
20597 uint32_t ret_conv = LDKLevel_to_js(Level_trace());
20601 uint32_t __attribute__((export_name("TS_Level_debug"))) TS_Level_debug() {
20602 uint32_t ret_conv = LDKLevel_to_js(Level_debug());
20606 uint32_t __attribute__((export_name("TS_Level_info"))) TS_Level_info() {
20607 uint32_t ret_conv = LDKLevel_to_js(Level_info());
20611 uint32_t __attribute__((export_name("TS_Level_warn"))) TS_Level_warn() {
20612 uint32_t ret_conv = LDKLevel_to_js(Level_warn());
20616 uint32_t __attribute__((export_name("TS_Level_error"))) TS_Level_error() {
20617 uint32_t ret_conv = LDKLevel_to_js(Level_error());
20621 jboolean __attribute__((export_name("TS_Level_eq"))) TS_Level_eq(uint64_t a, uint64_t b) {
20622 LDKLevel* a_conv = (LDKLevel*)untag_ptr(a);
20623 LDKLevel* b_conv = (LDKLevel*)untag_ptr(b);
20624 jboolean ret_conv = Level_eq(a_conv, b_conv);
20628 int64_t __attribute__((export_name("TS_Level_hash"))) TS_Level_hash(uint64_t o) {
20629 LDKLevel* o_conv = (LDKLevel*)untag_ptr(o);
20630 int64_t ret_conv = Level_hash(o_conv);
20634 uint32_t __attribute__((export_name("TS_Level_max"))) TS_Level_max() {
20635 uint32_t ret_conv = LDKLevel_to_js(Level_max());
20639 void __attribute__((export_name("TS_Record_free"))) TS_Record_free(uint64_t this_obj) {
20640 LDKRecord this_obj_conv;
20641 this_obj_conv.inner = untag_ptr(this_obj);
20642 this_obj_conv.is_owned = ptr_is_owned(this_obj);
20643 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
20644 Record_free(this_obj_conv);
20647 uint32_t __attribute__((export_name("TS_Record_get_level"))) TS_Record_get_level(uint64_t this_ptr) {
20648 LDKRecord this_ptr_conv;
20649 this_ptr_conv.inner = untag_ptr(this_ptr);
20650 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20651 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20652 this_ptr_conv.is_owned = false;
20653 uint32_t ret_conv = LDKLevel_to_js(Record_get_level(&this_ptr_conv));
20657 void __attribute__((export_name("TS_Record_set_level"))) TS_Record_set_level(uint64_t this_ptr, uint32_t val) {
20658 LDKRecord this_ptr_conv;
20659 this_ptr_conv.inner = untag_ptr(this_ptr);
20660 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20661 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20662 this_ptr_conv.is_owned = false;
20663 LDKLevel val_conv = LDKLevel_from_js(val);
20664 Record_set_level(&this_ptr_conv, val_conv);
20667 jstring __attribute__((export_name("TS_Record_get_args"))) TS_Record_get_args(uint64_t this_ptr) {
20668 LDKRecord this_ptr_conv;
20669 this_ptr_conv.inner = untag_ptr(this_ptr);
20670 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20671 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20672 this_ptr_conv.is_owned = false;
20673 LDKStr ret_str = Record_get_args(&this_ptr_conv);
20674 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
20679 void __attribute__((export_name("TS_Record_set_args"))) TS_Record_set_args(uint64_t this_ptr, jstring val) {
20680 LDKRecord this_ptr_conv;
20681 this_ptr_conv.inner = untag_ptr(this_ptr);
20682 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20683 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20684 this_ptr_conv.is_owned = false;
20685 LDKStr val_conv = str_ref_to_owned_c(val);
20686 Record_set_args(&this_ptr_conv, val_conv);
20689 jstring __attribute__((export_name("TS_Record_get_module_path"))) TS_Record_get_module_path(uint64_t this_ptr) {
20690 LDKRecord this_ptr_conv;
20691 this_ptr_conv.inner = untag_ptr(this_ptr);
20692 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20693 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20694 this_ptr_conv.is_owned = false;
20695 LDKStr ret_str = Record_get_module_path(&this_ptr_conv);
20696 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
20701 void __attribute__((export_name("TS_Record_set_module_path"))) TS_Record_set_module_path(uint64_t this_ptr, jstring val) {
20702 LDKRecord this_ptr_conv;
20703 this_ptr_conv.inner = untag_ptr(this_ptr);
20704 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20705 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20706 this_ptr_conv.is_owned = false;
20707 LDKStr val_conv = str_ref_to_owned_c(val);
20708 Record_set_module_path(&this_ptr_conv, val_conv);
20711 jstring __attribute__((export_name("TS_Record_get_file"))) TS_Record_get_file(uint64_t this_ptr) {
20712 LDKRecord this_ptr_conv;
20713 this_ptr_conv.inner = untag_ptr(this_ptr);
20714 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20715 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20716 this_ptr_conv.is_owned = false;
20717 LDKStr ret_str = Record_get_file(&this_ptr_conv);
20718 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
20723 void __attribute__((export_name("TS_Record_set_file"))) TS_Record_set_file(uint64_t this_ptr, jstring val) {
20724 LDKRecord this_ptr_conv;
20725 this_ptr_conv.inner = untag_ptr(this_ptr);
20726 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20727 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20728 this_ptr_conv.is_owned = false;
20729 LDKStr val_conv = str_ref_to_owned_c(val);
20730 Record_set_file(&this_ptr_conv, val_conv);
20733 int32_t __attribute__((export_name("TS_Record_get_line"))) TS_Record_get_line(uint64_t this_ptr) {
20734 LDKRecord this_ptr_conv;
20735 this_ptr_conv.inner = untag_ptr(this_ptr);
20736 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20737 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20738 this_ptr_conv.is_owned = false;
20739 int32_t ret_conv = Record_get_line(&this_ptr_conv);
20743 void __attribute__((export_name("TS_Record_set_line"))) TS_Record_set_line(uint64_t this_ptr, int32_t val) {
20744 LDKRecord this_ptr_conv;
20745 this_ptr_conv.inner = untag_ptr(this_ptr);
20746 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20747 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20748 this_ptr_conv.is_owned = false;
20749 Record_set_line(&this_ptr_conv, val);
20752 static inline uint64_t Record_clone_ptr(LDKRecord *NONNULL_PTR arg) {
20753 LDKRecord ret_var = Record_clone(arg);
20754 uint64_t ret_ref = 0;
20755 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
20756 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
20759 int64_t __attribute__((export_name("TS_Record_clone_ptr"))) TS_Record_clone_ptr(uint64_t arg) {
20760 LDKRecord arg_conv;
20761 arg_conv.inner = untag_ptr(arg);
20762 arg_conv.is_owned = ptr_is_owned(arg);
20763 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
20764 arg_conv.is_owned = false;
20765 int64_t ret_conv = Record_clone_ptr(&arg_conv);
20769 uint64_t __attribute__((export_name("TS_Record_clone"))) TS_Record_clone(uint64_t orig) {
20770 LDKRecord orig_conv;
20771 orig_conv.inner = untag_ptr(orig);
20772 orig_conv.is_owned = ptr_is_owned(orig);
20773 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
20774 orig_conv.is_owned = false;
20775 LDKRecord ret_var = Record_clone(&orig_conv);
20776 uint64_t ret_ref = 0;
20777 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
20778 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
20782 void __attribute__((export_name("TS_Logger_free"))) TS_Logger_free(uint64_t this_ptr) {
20783 if (!ptr_is_owned(this_ptr)) return;
20784 void* this_ptr_ptr = untag_ptr(this_ptr);
20785 CHECK_ACCESS(this_ptr_ptr);
20786 LDKLogger this_ptr_conv = *(LDKLogger*)(this_ptr_ptr);
20787 FREE(untag_ptr(this_ptr));
20788 Logger_free(this_ptr_conv);
20791 void __attribute__((export_name("TS_ChannelHandshakeConfig_free"))) TS_ChannelHandshakeConfig_free(uint64_t this_obj) {
20792 LDKChannelHandshakeConfig this_obj_conv;
20793 this_obj_conv.inner = untag_ptr(this_obj);
20794 this_obj_conv.is_owned = ptr_is_owned(this_obj);
20795 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
20796 ChannelHandshakeConfig_free(this_obj_conv);
20799 int32_t __attribute__((export_name("TS_ChannelHandshakeConfig_get_minimum_depth"))) TS_ChannelHandshakeConfig_get_minimum_depth(uint64_t this_ptr) {
20800 LDKChannelHandshakeConfig this_ptr_conv;
20801 this_ptr_conv.inner = untag_ptr(this_ptr);
20802 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20803 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20804 this_ptr_conv.is_owned = false;
20805 int32_t ret_conv = ChannelHandshakeConfig_get_minimum_depth(&this_ptr_conv);
20809 void __attribute__((export_name("TS_ChannelHandshakeConfig_set_minimum_depth"))) TS_ChannelHandshakeConfig_set_minimum_depth(uint64_t this_ptr, int32_t val) {
20810 LDKChannelHandshakeConfig this_ptr_conv;
20811 this_ptr_conv.inner = untag_ptr(this_ptr);
20812 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20813 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20814 this_ptr_conv.is_owned = false;
20815 ChannelHandshakeConfig_set_minimum_depth(&this_ptr_conv, val);
20818 int16_t __attribute__((export_name("TS_ChannelHandshakeConfig_get_our_to_self_delay"))) TS_ChannelHandshakeConfig_get_our_to_self_delay(uint64_t this_ptr) {
20819 LDKChannelHandshakeConfig this_ptr_conv;
20820 this_ptr_conv.inner = untag_ptr(this_ptr);
20821 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20822 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20823 this_ptr_conv.is_owned = false;
20824 int16_t ret_conv = ChannelHandshakeConfig_get_our_to_self_delay(&this_ptr_conv);
20828 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) {
20829 LDKChannelHandshakeConfig this_ptr_conv;
20830 this_ptr_conv.inner = untag_ptr(this_ptr);
20831 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20832 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20833 this_ptr_conv.is_owned = false;
20834 ChannelHandshakeConfig_set_our_to_self_delay(&this_ptr_conv, val);
20837 int64_t __attribute__((export_name("TS_ChannelHandshakeConfig_get_our_htlc_minimum_msat"))) TS_ChannelHandshakeConfig_get_our_htlc_minimum_msat(uint64_t this_ptr) {
20838 LDKChannelHandshakeConfig this_ptr_conv;
20839 this_ptr_conv.inner = untag_ptr(this_ptr);
20840 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20841 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20842 this_ptr_conv.is_owned = false;
20843 int64_t ret_conv = ChannelHandshakeConfig_get_our_htlc_minimum_msat(&this_ptr_conv);
20847 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) {
20848 LDKChannelHandshakeConfig this_ptr_conv;
20849 this_ptr_conv.inner = untag_ptr(this_ptr);
20850 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20851 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20852 this_ptr_conv.is_owned = false;
20853 ChannelHandshakeConfig_set_our_htlc_minimum_msat(&this_ptr_conv, val);
20856 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) {
20857 LDKChannelHandshakeConfig this_ptr_conv;
20858 this_ptr_conv.inner = untag_ptr(this_ptr);
20859 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20860 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20861 this_ptr_conv.is_owned = false;
20862 int8_t ret_conv = ChannelHandshakeConfig_get_max_inbound_htlc_value_in_flight_percent_of_channel(&this_ptr_conv);
20866 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) {
20867 LDKChannelHandshakeConfig this_ptr_conv;
20868 this_ptr_conv.inner = untag_ptr(this_ptr);
20869 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20870 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20871 this_ptr_conv.is_owned = false;
20872 ChannelHandshakeConfig_set_max_inbound_htlc_value_in_flight_percent_of_channel(&this_ptr_conv, val);
20875 jboolean __attribute__((export_name("TS_ChannelHandshakeConfig_get_negotiate_scid_privacy"))) TS_ChannelHandshakeConfig_get_negotiate_scid_privacy(uint64_t this_ptr) {
20876 LDKChannelHandshakeConfig this_ptr_conv;
20877 this_ptr_conv.inner = untag_ptr(this_ptr);
20878 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20879 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20880 this_ptr_conv.is_owned = false;
20881 jboolean ret_conv = ChannelHandshakeConfig_get_negotiate_scid_privacy(&this_ptr_conv);
20885 void __attribute__((export_name("TS_ChannelHandshakeConfig_set_negotiate_scid_privacy"))) TS_ChannelHandshakeConfig_set_negotiate_scid_privacy(uint64_t this_ptr, jboolean val) {
20886 LDKChannelHandshakeConfig this_ptr_conv;
20887 this_ptr_conv.inner = untag_ptr(this_ptr);
20888 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20889 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20890 this_ptr_conv.is_owned = false;
20891 ChannelHandshakeConfig_set_negotiate_scid_privacy(&this_ptr_conv, val);
20894 jboolean __attribute__((export_name("TS_ChannelHandshakeConfig_get_announced_channel"))) TS_ChannelHandshakeConfig_get_announced_channel(uint64_t this_ptr) {
20895 LDKChannelHandshakeConfig this_ptr_conv;
20896 this_ptr_conv.inner = untag_ptr(this_ptr);
20897 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20898 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20899 this_ptr_conv.is_owned = false;
20900 jboolean ret_conv = ChannelHandshakeConfig_get_announced_channel(&this_ptr_conv);
20904 void __attribute__((export_name("TS_ChannelHandshakeConfig_set_announced_channel"))) TS_ChannelHandshakeConfig_set_announced_channel(uint64_t this_ptr, jboolean val) {
20905 LDKChannelHandshakeConfig this_ptr_conv;
20906 this_ptr_conv.inner = untag_ptr(this_ptr);
20907 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20908 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20909 this_ptr_conv.is_owned = false;
20910 ChannelHandshakeConfig_set_announced_channel(&this_ptr_conv, val);
20913 jboolean __attribute__((export_name("TS_ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey"))) TS_ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(uint64_t this_ptr) {
20914 LDKChannelHandshakeConfig this_ptr_conv;
20915 this_ptr_conv.inner = untag_ptr(this_ptr);
20916 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20917 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20918 this_ptr_conv.is_owned = false;
20919 jboolean ret_conv = ChannelHandshakeConfig_get_commit_upfront_shutdown_pubkey(&this_ptr_conv);
20923 void __attribute__((export_name("TS_ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey"))) TS_ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(uint64_t this_ptr, jboolean val) {
20924 LDKChannelHandshakeConfig this_ptr_conv;
20925 this_ptr_conv.inner = untag_ptr(this_ptr);
20926 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20927 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20928 this_ptr_conv.is_owned = false;
20929 ChannelHandshakeConfig_set_commit_upfront_shutdown_pubkey(&this_ptr_conv, val);
20932 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) {
20933 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);
20934 uint64_t ret_ref = 0;
20935 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
20936 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
20940 static inline uint64_t ChannelHandshakeConfig_clone_ptr(LDKChannelHandshakeConfig *NONNULL_PTR arg) {
20941 LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(arg);
20942 uint64_t ret_ref = 0;
20943 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
20944 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
20947 int64_t __attribute__((export_name("TS_ChannelHandshakeConfig_clone_ptr"))) TS_ChannelHandshakeConfig_clone_ptr(uint64_t arg) {
20948 LDKChannelHandshakeConfig arg_conv;
20949 arg_conv.inner = untag_ptr(arg);
20950 arg_conv.is_owned = ptr_is_owned(arg);
20951 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
20952 arg_conv.is_owned = false;
20953 int64_t ret_conv = ChannelHandshakeConfig_clone_ptr(&arg_conv);
20957 uint64_t __attribute__((export_name("TS_ChannelHandshakeConfig_clone"))) TS_ChannelHandshakeConfig_clone(uint64_t orig) {
20958 LDKChannelHandshakeConfig orig_conv;
20959 orig_conv.inner = untag_ptr(orig);
20960 orig_conv.is_owned = ptr_is_owned(orig);
20961 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
20962 orig_conv.is_owned = false;
20963 LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_clone(&orig_conv);
20964 uint64_t ret_ref = 0;
20965 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
20966 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
20970 uint64_t __attribute__((export_name("TS_ChannelHandshakeConfig_default"))) TS_ChannelHandshakeConfig_default() {
20971 LDKChannelHandshakeConfig ret_var = ChannelHandshakeConfig_default();
20972 uint64_t ret_ref = 0;
20973 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
20974 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
20978 void __attribute__((export_name("TS_ChannelHandshakeLimits_free"))) TS_ChannelHandshakeLimits_free(uint64_t this_obj) {
20979 LDKChannelHandshakeLimits this_obj_conv;
20980 this_obj_conv.inner = untag_ptr(this_obj);
20981 this_obj_conv.is_owned = ptr_is_owned(this_obj);
20982 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
20983 ChannelHandshakeLimits_free(this_obj_conv);
20986 int64_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_min_funding_satoshis"))) TS_ChannelHandshakeLimits_get_min_funding_satoshis(uint64_t this_ptr) {
20987 LDKChannelHandshakeLimits this_ptr_conv;
20988 this_ptr_conv.inner = untag_ptr(this_ptr);
20989 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
20990 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
20991 this_ptr_conv.is_owned = false;
20992 int64_t ret_conv = ChannelHandshakeLimits_get_min_funding_satoshis(&this_ptr_conv);
20996 void __attribute__((export_name("TS_ChannelHandshakeLimits_set_min_funding_satoshis"))) TS_ChannelHandshakeLimits_set_min_funding_satoshis(uint64_t this_ptr, int64_t val) {
20997 LDKChannelHandshakeLimits this_ptr_conv;
20998 this_ptr_conv.inner = untag_ptr(this_ptr);
20999 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21000 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21001 this_ptr_conv.is_owned = false;
21002 ChannelHandshakeLimits_set_min_funding_satoshis(&this_ptr_conv, val);
21005 int64_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_max_funding_satoshis"))) TS_ChannelHandshakeLimits_get_max_funding_satoshis(uint64_t this_ptr) {
21006 LDKChannelHandshakeLimits this_ptr_conv;
21007 this_ptr_conv.inner = untag_ptr(this_ptr);
21008 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21009 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21010 this_ptr_conv.is_owned = false;
21011 int64_t ret_conv = ChannelHandshakeLimits_get_max_funding_satoshis(&this_ptr_conv);
21015 void __attribute__((export_name("TS_ChannelHandshakeLimits_set_max_funding_satoshis"))) TS_ChannelHandshakeLimits_set_max_funding_satoshis(uint64_t this_ptr, int64_t val) {
21016 LDKChannelHandshakeLimits this_ptr_conv;
21017 this_ptr_conv.inner = untag_ptr(this_ptr);
21018 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21019 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21020 this_ptr_conv.is_owned = false;
21021 ChannelHandshakeLimits_set_max_funding_satoshis(&this_ptr_conv, val);
21024 int64_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_max_htlc_minimum_msat"))) TS_ChannelHandshakeLimits_get_max_htlc_minimum_msat(uint64_t this_ptr) {
21025 LDKChannelHandshakeLimits this_ptr_conv;
21026 this_ptr_conv.inner = untag_ptr(this_ptr);
21027 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21028 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21029 this_ptr_conv.is_owned = false;
21030 int64_t ret_conv = ChannelHandshakeLimits_get_max_htlc_minimum_msat(&this_ptr_conv);
21034 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) {
21035 LDKChannelHandshakeLimits this_ptr_conv;
21036 this_ptr_conv.inner = untag_ptr(this_ptr);
21037 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21038 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21039 this_ptr_conv.is_owned = false;
21040 ChannelHandshakeLimits_set_max_htlc_minimum_msat(&this_ptr_conv, val);
21043 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) {
21044 LDKChannelHandshakeLimits this_ptr_conv;
21045 this_ptr_conv.inner = untag_ptr(this_ptr);
21046 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21047 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21048 this_ptr_conv.is_owned = false;
21049 int64_t ret_conv = ChannelHandshakeLimits_get_min_max_htlc_value_in_flight_msat(&this_ptr_conv);
21053 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) {
21054 LDKChannelHandshakeLimits this_ptr_conv;
21055 this_ptr_conv.inner = untag_ptr(this_ptr);
21056 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21057 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21058 this_ptr_conv.is_owned = false;
21059 ChannelHandshakeLimits_set_min_max_htlc_value_in_flight_msat(&this_ptr_conv, val);
21062 int64_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_max_channel_reserve_satoshis"))) TS_ChannelHandshakeLimits_get_max_channel_reserve_satoshis(uint64_t this_ptr) {
21063 LDKChannelHandshakeLimits this_ptr_conv;
21064 this_ptr_conv.inner = untag_ptr(this_ptr);
21065 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21066 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21067 this_ptr_conv.is_owned = false;
21068 int64_t ret_conv = ChannelHandshakeLimits_get_max_channel_reserve_satoshis(&this_ptr_conv);
21072 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) {
21073 LDKChannelHandshakeLimits this_ptr_conv;
21074 this_ptr_conv.inner = untag_ptr(this_ptr);
21075 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21076 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21077 this_ptr_conv.is_owned = false;
21078 ChannelHandshakeLimits_set_max_channel_reserve_satoshis(&this_ptr_conv, val);
21081 int16_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_min_max_accepted_htlcs"))) TS_ChannelHandshakeLimits_get_min_max_accepted_htlcs(uint64_t this_ptr) {
21082 LDKChannelHandshakeLimits this_ptr_conv;
21083 this_ptr_conv.inner = untag_ptr(this_ptr);
21084 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21085 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21086 this_ptr_conv.is_owned = false;
21087 int16_t ret_conv = ChannelHandshakeLimits_get_min_max_accepted_htlcs(&this_ptr_conv);
21091 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) {
21092 LDKChannelHandshakeLimits this_ptr_conv;
21093 this_ptr_conv.inner = untag_ptr(this_ptr);
21094 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21095 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21096 this_ptr_conv.is_owned = false;
21097 ChannelHandshakeLimits_set_min_max_accepted_htlcs(&this_ptr_conv, val);
21100 int32_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_max_minimum_depth"))) TS_ChannelHandshakeLimits_get_max_minimum_depth(uint64_t this_ptr) {
21101 LDKChannelHandshakeLimits this_ptr_conv;
21102 this_ptr_conv.inner = untag_ptr(this_ptr);
21103 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21104 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21105 this_ptr_conv.is_owned = false;
21106 int32_t ret_conv = ChannelHandshakeLimits_get_max_minimum_depth(&this_ptr_conv);
21110 void __attribute__((export_name("TS_ChannelHandshakeLimits_set_max_minimum_depth"))) TS_ChannelHandshakeLimits_set_max_minimum_depth(uint64_t this_ptr, int32_t val) {
21111 LDKChannelHandshakeLimits this_ptr_conv;
21112 this_ptr_conv.inner = untag_ptr(this_ptr);
21113 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21114 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21115 this_ptr_conv.is_owned = false;
21116 ChannelHandshakeLimits_set_max_minimum_depth(&this_ptr_conv, val);
21119 jboolean __attribute__((export_name("TS_ChannelHandshakeLimits_get_trust_own_funding_0conf"))) TS_ChannelHandshakeLimits_get_trust_own_funding_0conf(uint64_t this_ptr) {
21120 LDKChannelHandshakeLimits this_ptr_conv;
21121 this_ptr_conv.inner = untag_ptr(this_ptr);
21122 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21123 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21124 this_ptr_conv.is_owned = false;
21125 jboolean ret_conv = ChannelHandshakeLimits_get_trust_own_funding_0conf(&this_ptr_conv);
21129 void __attribute__((export_name("TS_ChannelHandshakeLimits_set_trust_own_funding_0conf"))) TS_ChannelHandshakeLimits_set_trust_own_funding_0conf(uint64_t this_ptr, jboolean val) {
21130 LDKChannelHandshakeLimits this_ptr_conv;
21131 this_ptr_conv.inner = untag_ptr(this_ptr);
21132 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21133 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21134 this_ptr_conv.is_owned = false;
21135 ChannelHandshakeLimits_set_trust_own_funding_0conf(&this_ptr_conv, val);
21138 jboolean __attribute__((export_name("TS_ChannelHandshakeLimits_get_force_announced_channel_preference"))) TS_ChannelHandshakeLimits_get_force_announced_channel_preference(uint64_t this_ptr) {
21139 LDKChannelHandshakeLimits this_ptr_conv;
21140 this_ptr_conv.inner = untag_ptr(this_ptr);
21141 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21142 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21143 this_ptr_conv.is_owned = false;
21144 jboolean ret_conv = ChannelHandshakeLimits_get_force_announced_channel_preference(&this_ptr_conv);
21148 void __attribute__((export_name("TS_ChannelHandshakeLimits_set_force_announced_channel_preference"))) TS_ChannelHandshakeLimits_set_force_announced_channel_preference(uint64_t this_ptr, jboolean val) {
21149 LDKChannelHandshakeLimits this_ptr_conv;
21150 this_ptr_conv.inner = untag_ptr(this_ptr);
21151 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21152 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21153 this_ptr_conv.is_owned = false;
21154 ChannelHandshakeLimits_set_force_announced_channel_preference(&this_ptr_conv, val);
21157 int16_t __attribute__((export_name("TS_ChannelHandshakeLimits_get_their_to_self_delay"))) TS_ChannelHandshakeLimits_get_their_to_self_delay(uint64_t this_ptr) {
21158 LDKChannelHandshakeLimits this_ptr_conv;
21159 this_ptr_conv.inner = untag_ptr(this_ptr);
21160 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21161 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21162 this_ptr_conv.is_owned = false;
21163 int16_t ret_conv = ChannelHandshakeLimits_get_their_to_self_delay(&this_ptr_conv);
21167 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) {
21168 LDKChannelHandshakeLimits this_ptr_conv;
21169 this_ptr_conv.inner = untag_ptr(this_ptr);
21170 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21171 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21172 this_ptr_conv.is_owned = false;
21173 ChannelHandshakeLimits_set_their_to_self_delay(&this_ptr_conv, val);
21176 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) {
21177 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);
21178 uint64_t ret_ref = 0;
21179 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21180 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21184 static inline uint64_t ChannelHandshakeLimits_clone_ptr(LDKChannelHandshakeLimits *NONNULL_PTR arg) {
21185 LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(arg);
21186 uint64_t ret_ref = 0;
21187 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21188 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21191 int64_t __attribute__((export_name("TS_ChannelHandshakeLimits_clone_ptr"))) TS_ChannelHandshakeLimits_clone_ptr(uint64_t arg) {
21192 LDKChannelHandshakeLimits arg_conv;
21193 arg_conv.inner = untag_ptr(arg);
21194 arg_conv.is_owned = ptr_is_owned(arg);
21195 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
21196 arg_conv.is_owned = false;
21197 int64_t ret_conv = ChannelHandshakeLimits_clone_ptr(&arg_conv);
21201 uint64_t __attribute__((export_name("TS_ChannelHandshakeLimits_clone"))) TS_ChannelHandshakeLimits_clone(uint64_t orig) {
21202 LDKChannelHandshakeLimits orig_conv;
21203 orig_conv.inner = untag_ptr(orig);
21204 orig_conv.is_owned = ptr_is_owned(orig);
21205 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
21206 orig_conv.is_owned = false;
21207 LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_clone(&orig_conv);
21208 uint64_t ret_ref = 0;
21209 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21210 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21214 uint64_t __attribute__((export_name("TS_ChannelHandshakeLimits_default"))) TS_ChannelHandshakeLimits_default() {
21215 LDKChannelHandshakeLimits ret_var = ChannelHandshakeLimits_default();
21216 uint64_t ret_ref = 0;
21217 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21218 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21222 void __attribute__((export_name("TS_ChannelConfig_free"))) TS_ChannelConfig_free(uint64_t this_obj) {
21223 LDKChannelConfig this_obj_conv;
21224 this_obj_conv.inner = untag_ptr(this_obj);
21225 this_obj_conv.is_owned = ptr_is_owned(this_obj);
21226 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
21227 ChannelConfig_free(this_obj_conv);
21230 int32_t __attribute__((export_name("TS_ChannelConfig_get_forwarding_fee_proportional_millionths"))) TS_ChannelConfig_get_forwarding_fee_proportional_millionths(uint64_t this_ptr) {
21231 LDKChannelConfig this_ptr_conv;
21232 this_ptr_conv.inner = untag_ptr(this_ptr);
21233 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21234 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21235 this_ptr_conv.is_owned = false;
21236 int32_t ret_conv = ChannelConfig_get_forwarding_fee_proportional_millionths(&this_ptr_conv);
21240 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) {
21241 LDKChannelConfig this_ptr_conv;
21242 this_ptr_conv.inner = untag_ptr(this_ptr);
21243 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21244 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21245 this_ptr_conv.is_owned = false;
21246 ChannelConfig_set_forwarding_fee_proportional_millionths(&this_ptr_conv, val);
21249 int32_t __attribute__((export_name("TS_ChannelConfig_get_forwarding_fee_base_msat"))) TS_ChannelConfig_get_forwarding_fee_base_msat(uint64_t this_ptr) {
21250 LDKChannelConfig this_ptr_conv;
21251 this_ptr_conv.inner = untag_ptr(this_ptr);
21252 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21253 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21254 this_ptr_conv.is_owned = false;
21255 int32_t ret_conv = ChannelConfig_get_forwarding_fee_base_msat(&this_ptr_conv);
21259 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) {
21260 LDKChannelConfig this_ptr_conv;
21261 this_ptr_conv.inner = untag_ptr(this_ptr);
21262 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21263 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21264 this_ptr_conv.is_owned = false;
21265 ChannelConfig_set_forwarding_fee_base_msat(&this_ptr_conv, val);
21268 int16_t __attribute__((export_name("TS_ChannelConfig_get_cltv_expiry_delta"))) TS_ChannelConfig_get_cltv_expiry_delta(uint64_t this_ptr) {
21269 LDKChannelConfig this_ptr_conv;
21270 this_ptr_conv.inner = untag_ptr(this_ptr);
21271 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21272 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21273 this_ptr_conv.is_owned = false;
21274 int16_t ret_conv = ChannelConfig_get_cltv_expiry_delta(&this_ptr_conv);
21278 void __attribute__((export_name("TS_ChannelConfig_set_cltv_expiry_delta"))) TS_ChannelConfig_set_cltv_expiry_delta(uint64_t this_ptr, int16_t val) {
21279 LDKChannelConfig this_ptr_conv;
21280 this_ptr_conv.inner = untag_ptr(this_ptr);
21281 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21282 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21283 this_ptr_conv.is_owned = false;
21284 ChannelConfig_set_cltv_expiry_delta(&this_ptr_conv, val);
21287 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) {
21288 LDKChannelConfig this_ptr_conv;
21289 this_ptr_conv.inner = untag_ptr(this_ptr);
21290 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21291 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21292 this_ptr_conv.is_owned = false;
21293 int64_t ret_conv = ChannelConfig_get_max_dust_htlc_exposure_msat(&this_ptr_conv);
21297 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) {
21298 LDKChannelConfig this_ptr_conv;
21299 this_ptr_conv.inner = untag_ptr(this_ptr);
21300 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21301 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21302 this_ptr_conv.is_owned = false;
21303 ChannelConfig_set_max_dust_htlc_exposure_msat(&this_ptr_conv, val);
21306 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) {
21307 LDKChannelConfig this_ptr_conv;
21308 this_ptr_conv.inner = untag_ptr(this_ptr);
21309 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21310 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21311 this_ptr_conv.is_owned = false;
21312 int64_t ret_conv = ChannelConfig_get_force_close_avoidance_max_fee_satoshis(&this_ptr_conv);
21316 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) {
21317 LDKChannelConfig this_ptr_conv;
21318 this_ptr_conv.inner = untag_ptr(this_ptr);
21319 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21320 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21321 this_ptr_conv.is_owned = false;
21322 ChannelConfig_set_force_close_avoidance_max_fee_satoshis(&this_ptr_conv, val);
21325 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) {
21326 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);
21327 uint64_t ret_ref = 0;
21328 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21329 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21333 static inline uint64_t ChannelConfig_clone_ptr(LDKChannelConfig *NONNULL_PTR arg) {
21334 LDKChannelConfig ret_var = ChannelConfig_clone(arg);
21335 uint64_t ret_ref = 0;
21336 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21337 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21340 int64_t __attribute__((export_name("TS_ChannelConfig_clone_ptr"))) TS_ChannelConfig_clone_ptr(uint64_t arg) {
21341 LDKChannelConfig arg_conv;
21342 arg_conv.inner = untag_ptr(arg);
21343 arg_conv.is_owned = ptr_is_owned(arg);
21344 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
21345 arg_conv.is_owned = false;
21346 int64_t ret_conv = ChannelConfig_clone_ptr(&arg_conv);
21350 uint64_t __attribute__((export_name("TS_ChannelConfig_clone"))) TS_ChannelConfig_clone(uint64_t orig) {
21351 LDKChannelConfig orig_conv;
21352 orig_conv.inner = untag_ptr(orig);
21353 orig_conv.is_owned = ptr_is_owned(orig);
21354 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
21355 orig_conv.is_owned = false;
21356 LDKChannelConfig ret_var = ChannelConfig_clone(&orig_conv);
21357 uint64_t ret_ref = 0;
21358 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21359 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21363 uint64_t __attribute__((export_name("TS_ChannelConfig_default"))) TS_ChannelConfig_default() {
21364 LDKChannelConfig ret_var = ChannelConfig_default();
21365 uint64_t ret_ref = 0;
21366 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21367 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21371 int8_tArray __attribute__((export_name("TS_ChannelConfig_write"))) TS_ChannelConfig_write(uint64_t obj) {
21372 LDKChannelConfig obj_conv;
21373 obj_conv.inner = untag_ptr(obj);
21374 obj_conv.is_owned = ptr_is_owned(obj);
21375 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
21376 obj_conv.is_owned = false;
21377 LDKCVec_u8Z ret_var = ChannelConfig_write(&obj_conv);
21378 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
21379 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
21380 CVec_u8Z_free(ret_var);
21384 uint64_t __attribute__((export_name("TS_ChannelConfig_read"))) TS_ChannelConfig_read(int8_tArray ser) {
21385 LDKu8slice ser_ref;
21386 ser_ref.datalen = ser->arr_len;
21387 ser_ref.data = ser->elems;
21388 LDKCResult_ChannelConfigDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelConfigDecodeErrorZ), "LDKCResult_ChannelConfigDecodeErrorZ");
21389 *ret_conv = ChannelConfig_read(ser_ref);
21391 return tag_ptr(ret_conv, true);
21394 void __attribute__((export_name("TS_UserConfig_free"))) TS_UserConfig_free(uint64_t this_obj) {
21395 LDKUserConfig this_obj_conv;
21396 this_obj_conv.inner = untag_ptr(this_obj);
21397 this_obj_conv.is_owned = ptr_is_owned(this_obj);
21398 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
21399 UserConfig_free(this_obj_conv);
21402 uint64_t __attribute__((export_name("TS_UserConfig_get_channel_handshake_config"))) TS_UserConfig_get_channel_handshake_config(uint64_t this_ptr) {
21403 LDKUserConfig this_ptr_conv;
21404 this_ptr_conv.inner = untag_ptr(this_ptr);
21405 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21406 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21407 this_ptr_conv.is_owned = false;
21408 LDKChannelHandshakeConfig ret_var = UserConfig_get_channel_handshake_config(&this_ptr_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 void __attribute__((export_name("TS_UserConfig_set_channel_handshake_config"))) TS_UserConfig_set_channel_handshake_config(uint64_t this_ptr, uint64_t val) {
21416 LDKUserConfig this_ptr_conv;
21417 this_ptr_conv.inner = untag_ptr(this_ptr);
21418 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21419 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21420 this_ptr_conv.is_owned = false;
21421 LDKChannelHandshakeConfig val_conv;
21422 val_conv.inner = untag_ptr(val);
21423 val_conv.is_owned = ptr_is_owned(val);
21424 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
21425 val_conv = ChannelHandshakeConfig_clone(&val_conv);
21426 UserConfig_set_channel_handshake_config(&this_ptr_conv, val_conv);
21429 uint64_t __attribute__((export_name("TS_UserConfig_get_channel_handshake_limits"))) TS_UserConfig_get_channel_handshake_limits(uint64_t this_ptr) {
21430 LDKUserConfig this_ptr_conv;
21431 this_ptr_conv.inner = untag_ptr(this_ptr);
21432 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21433 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21434 this_ptr_conv.is_owned = false;
21435 LDKChannelHandshakeLimits ret_var = UserConfig_get_channel_handshake_limits(&this_ptr_conv);
21436 uint64_t ret_ref = 0;
21437 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21438 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21442 void __attribute__((export_name("TS_UserConfig_set_channel_handshake_limits"))) TS_UserConfig_set_channel_handshake_limits(uint64_t this_ptr, uint64_t val) {
21443 LDKUserConfig this_ptr_conv;
21444 this_ptr_conv.inner = untag_ptr(this_ptr);
21445 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21446 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21447 this_ptr_conv.is_owned = false;
21448 LDKChannelHandshakeLimits val_conv;
21449 val_conv.inner = untag_ptr(val);
21450 val_conv.is_owned = ptr_is_owned(val);
21451 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
21452 val_conv = ChannelHandshakeLimits_clone(&val_conv);
21453 UserConfig_set_channel_handshake_limits(&this_ptr_conv, val_conv);
21456 uint64_t __attribute__((export_name("TS_UserConfig_get_channel_config"))) TS_UserConfig_get_channel_config(uint64_t this_ptr) {
21457 LDKUserConfig this_ptr_conv;
21458 this_ptr_conv.inner = untag_ptr(this_ptr);
21459 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21460 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21461 this_ptr_conv.is_owned = false;
21462 LDKChannelConfig ret_var = UserConfig_get_channel_config(&this_ptr_conv);
21463 uint64_t ret_ref = 0;
21464 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21465 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21469 void __attribute__((export_name("TS_UserConfig_set_channel_config"))) TS_UserConfig_set_channel_config(uint64_t this_ptr, uint64_t val) {
21470 LDKUserConfig 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 LDKChannelConfig val_conv;
21476 val_conv.inner = untag_ptr(val);
21477 val_conv.is_owned = ptr_is_owned(val);
21478 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
21479 val_conv = ChannelConfig_clone(&val_conv);
21480 UserConfig_set_channel_config(&this_ptr_conv, val_conv);
21483 jboolean __attribute__((export_name("TS_UserConfig_get_accept_forwards_to_priv_channels"))) TS_UserConfig_get_accept_forwards_to_priv_channels(uint64_t this_ptr) {
21484 LDKUserConfig this_ptr_conv;
21485 this_ptr_conv.inner = untag_ptr(this_ptr);
21486 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21487 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21488 this_ptr_conv.is_owned = false;
21489 jboolean ret_conv = UserConfig_get_accept_forwards_to_priv_channels(&this_ptr_conv);
21493 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) {
21494 LDKUserConfig this_ptr_conv;
21495 this_ptr_conv.inner = untag_ptr(this_ptr);
21496 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21497 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21498 this_ptr_conv.is_owned = false;
21499 UserConfig_set_accept_forwards_to_priv_channels(&this_ptr_conv, val);
21502 jboolean __attribute__((export_name("TS_UserConfig_get_accept_inbound_channels"))) TS_UserConfig_get_accept_inbound_channels(uint64_t this_ptr) {
21503 LDKUserConfig this_ptr_conv;
21504 this_ptr_conv.inner = untag_ptr(this_ptr);
21505 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21506 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21507 this_ptr_conv.is_owned = false;
21508 jboolean ret_conv = UserConfig_get_accept_inbound_channels(&this_ptr_conv);
21512 void __attribute__((export_name("TS_UserConfig_set_accept_inbound_channels"))) TS_UserConfig_set_accept_inbound_channels(uint64_t this_ptr, jboolean val) {
21513 LDKUserConfig this_ptr_conv;
21514 this_ptr_conv.inner = untag_ptr(this_ptr);
21515 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21516 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21517 this_ptr_conv.is_owned = false;
21518 UserConfig_set_accept_inbound_channels(&this_ptr_conv, val);
21521 jboolean __attribute__((export_name("TS_UserConfig_get_manually_accept_inbound_channels"))) TS_UserConfig_get_manually_accept_inbound_channels(uint64_t this_ptr) {
21522 LDKUserConfig this_ptr_conv;
21523 this_ptr_conv.inner = untag_ptr(this_ptr);
21524 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21525 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21526 this_ptr_conv.is_owned = false;
21527 jboolean ret_conv = UserConfig_get_manually_accept_inbound_channels(&this_ptr_conv);
21531 void __attribute__((export_name("TS_UserConfig_set_manually_accept_inbound_channels"))) TS_UserConfig_set_manually_accept_inbound_channels(uint64_t this_ptr, jboolean val) {
21532 LDKUserConfig this_ptr_conv;
21533 this_ptr_conv.inner = untag_ptr(this_ptr);
21534 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21535 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21536 this_ptr_conv.is_owned = false;
21537 UserConfig_set_manually_accept_inbound_channels(&this_ptr_conv, val);
21540 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) {
21541 LDKChannelHandshakeConfig channel_handshake_config_arg_conv;
21542 channel_handshake_config_arg_conv.inner = untag_ptr(channel_handshake_config_arg);
21543 channel_handshake_config_arg_conv.is_owned = ptr_is_owned(channel_handshake_config_arg);
21544 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_handshake_config_arg_conv);
21545 channel_handshake_config_arg_conv = ChannelHandshakeConfig_clone(&channel_handshake_config_arg_conv);
21546 LDKChannelHandshakeLimits channel_handshake_limits_arg_conv;
21547 channel_handshake_limits_arg_conv.inner = untag_ptr(channel_handshake_limits_arg);
21548 channel_handshake_limits_arg_conv.is_owned = ptr_is_owned(channel_handshake_limits_arg);
21549 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_handshake_limits_arg_conv);
21550 channel_handshake_limits_arg_conv = ChannelHandshakeLimits_clone(&channel_handshake_limits_arg_conv);
21551 LDKChannelConfig channel_config_arg_conv;
21552 channel_config_arg_conv.inner = untag_ptr(channel_config_arg);
21553 channel_config_arg_conv.is_owned = ptr_is_owned(channel_config_arg);
21554 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_config_arg_conv);
21555 channel_config_arg_conv = ChannelConfig_clone(&channel_config_arg_conv);
21556 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);
21557 uint64_t ret_ref = 0;
21558 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21559 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21563 static inline uint64_t UserConfig_clone_ptr(LDKUserConfig *NONNULL_PTR arg) {
21564 LDKUserConfig ret_var = UserConfig_clone(arg);
21565 uint64_t ret_ref = 0;
21566 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21567 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21570 int64_t __attribute__((export_name("TS_UserConfig_clone_ptr"))) TS_UserConfig_clone_ptr(uint64_t arg) {
21571 LDKUserConfig arg_conv;
21572 arg_conv.inner = untag_ptr(arg);
21573 arg_conv.is_owned = ptr_is_owned(arg);
21574 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
21575 arg_conv.is_owned = false;
21576 int64_t ret_conv = UserConfig_clone_ptr(&arg_conv);
21580 uint64_t __attribute__((export_name("TS_UserConfig_clone"))) TS_UserConfig_clone(uint64_t orig) {
21581 LDKUserConfig orig_conv;
21582 orig_conv.inner = untag_ptr(orig);
21583 orig_conv.is_owned = ptr_is_owned(orig);
21584 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
21585 orig_conv.is_owned = false;
21586 LDKUserConfig ret_var = UserConfig_clone(&orig_conv);
21587 uint64_t ret_ref = 0;
21588 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21589 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21593 uint64_t __attribute__((export_name("TS_UserConfig_default"))) TS_UserConfig_default() {
21594 LDKUserConfig ret_var = UserConfig_default();
21595 uint64_t ret_ref = 0;
21596 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21597 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21601 void __attribute__((export_name("TS_BestBlock_free"))) TS_BestBlock_free(uint64_t this_obj) {
21602 LDKBestBlock this_obj_conv;
21603 this_obj_conv.inner = untag_ptr(this_obj);
21604 this_obj_conv.is_owned = ptr_is_owned(this_obj);
21605 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
21606 BestBlock_free(this_obj_conv);
21609 static inline uint64_t BestBlock_clone_ptr(LDKBestBlock *NONNULL_PTR arg) {
21610 LDKBestBlock ret_var = BestBlock_clone(arg);
21611 uint64_t ret_ref = 0;
21612 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21613 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21616 int64_t __attribute__((export_name("TS_BestBlock_clone_ptr"))) TS_BestBlock_clone_ptr(uint64_t arg) {
21617 LDKBestBlock arg_conv;
21618 arg_conv.inner = untag_ptr(arg);
21619 arg_conv.is_owned = ptr_is_owned(arg);
21620 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
21621 arg_conv.is_owned = false;
21622 int64_t ret_conv = BestBlock_clone_ptr(&arg_conv);
21626 uint64_t __attribute__((export_name("TS_BestBlock_clone"))) TS_BestBlock_clone(uint64_t orig) {
21627 LDKBestBlock orig_conv;
21628 orig_conv.inner = untag_ptr(orig);
21629 orig_conv.is_owned = ptr_is_owned(orig);
21630 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
21631 orig_conv.is_owned = false;
21632 LDKBestBlock ret_var = BestBlock_clone(&orig_conv);
21633 uint64_t ret_ref = 0;
21634 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21635 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21639 uint64_t __attribute__((export_name("TS_BestBlock_from_genesis"))) TS_BestBlock_from_genesis(uint32_t network) {
21640 LDKNetwork network_conv = LDKNetwork_from_js(network);
21641 LDKBestBlock ret_var = BestBlock_from_genesis(network_conv);
21642 uint64_t ret_ref = 0;
21643 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21644 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21648 uint64_t __attribute__((export_name("TS_BestBlock_new"))) TS_BestBlock_new(int8_tArray block_hash, int32_t height) {
21649 LDKThirtyTwoBytes block_hash_ref;
21650 CHECK(block_hash->arr_len == 32);
21651 memcpy(block_hash_ref.data, block_hash->elems, 32); FREE(block_hash);
21652 LDKBestBlock ret_var = BestBlock_new(block_hash_ref, height);
21653 uint64_t ret_ref = 0;
21654 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21655 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21659 int8_tArray __attribute__((export_name("TS_BestBlock_block_hash"))) TS_BestBlock_block_hash(uint64_t this_arg) {
21660 LDKBestBlock this_arg_conv;
21661 this_arg_conv.inner = untag_ptr(this_arg);
21662 this_arg_conv.is_owned = ptr_is_owned(this_arg);
21663 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
21664 this_arg_conv.is_owned = false;
21665 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
21666 memcpy(ret_arr->elems, BestBlock_block_hash(&this_arg_conv).data, 32);
21670 int32_t __attribute__((export_name("TS_BestBlock_height"))) TS_BestBlock_height(uint64_t this_arg) {
21671 LDKBestBlock this_arg_conv;
21672 this_arg_conv.inner = untag_ptr(this_arg);
21673 this_arg_conv.is_owned = ptr_is_owned(this_arg);
21674 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
21675 this_arg_conv.is_owned = false;
21676 int32_t ret_conv = BestBlock_height(&this_arg_conv);
21680 uint32_t __attribute__((export_name("TS_AccessError_clone"))) TS_AccessError_clone(uint64_t orig) {
21681 LDKAccessError* orig_conv = (LDKAccessError*)untag_ptr(orig);
21682 uint32_t ret_conv = LDKAccessError_to_js(AccessError_clone(orig_conv));
21686 uint32_t __attribute__((export_name("TS_AccessError_unknown_chain"))) TS_AccessError_unknown_chain() {
21687 uint32_t ret_conv = LDKAccessError_to_js(AccessError_unknown_chain());
21691 uint32_t __attribute__((export_name("TS_AccessError_unknown_tx"))) TS_AccessError_unknown_tx() {
21692 uint32_t ret_conv = LDKAccessError_to_js(AccessError_unknown_tx());
21696 void __attribute__((export_name("TS_Access_free"))) TS_Access_free(uint64_t this_ptr) {
21697 if (!ptr_is_owned(this_ptr)) return;
21698 void* this_ptr_ptr = untag_ptr(this_ptr);
21699 CHECK_ACCESS(this_ptr_ptr);
21700 LDKAccess this_ptr_conv = *(LDKAccess*)(this_ptr_ptr);
21701 FREE(untag_ptr(this_ptr));
21702 Access_free(this_ptr_conv);
21705 void __attribute__((export_name("TS_Listen_free"))) TS_Listen_free(uint64_t this_ptr) {
21706 if (!ptr_is_owned(this_ptr)) return;
21707 void* this_ptr_ptr = untag_ptr(this_ptr);
21708 CHECK_ACCESS(this_ptr_ptr);
21709 LDKListen this_ptr_conv = *(LDKListen*)(this_ptr_ptr);
21710 FREE(untag_ptr(this_ptr));
21711 Listen_free(this_ptr_conv);
21714 void __attribute__((export_name("TS_Confirm_free"))) TS_Confirm_free(uint64_t this_ptr) {
21715 if (!ptr_is_owned(this_ptr)) return;
21716 void* this_ptr_ptr = untag_ptr(this_ptr);
21717 CHECK_ACCESS(this_ptr_ptr);
21718 LDKConfirm this_ptr_conv = *(LDKConfirm*)(this_ptr_ptr);
21719 FREE(untag_ptr(this_ptr));
21720 Confirm_free(this_ptr_conv);
21723 uint32_t __attribute__((export_name("TS_ChannelMonitorUpdateErr_clone"))) TS_ChannelMonitorUpdateErr_clone(uint64_t orig) {
21724 LDKChannelMonitorUpdateErr* orig_conv = (LDKChannelMonitorUpdateErr*)untag_ptr(orig);
21725 uint32_t ret_conv = LDKChannelMonitorUpdateErr_to_js(ChannelMonitorUpdateErr_clone(orig_conv));
21729 uint32_t __attribute__((export_name("TS_ChannelMonitorUpdateErr_temporary_failure"))) TS_ChannelMonitorUpdateErr_temporary_failure() {
21730 uint32_t ret_conv = LDKChannelMonitorUpdateErr_to_js(ChannelMonitorUpdateErr_temporary_failure());
21734 uint32_t __attribute__((export_name("TS_ChannelMonitorUpdateErr_permanent_failure"))) TS_ChannelMonitorUpdateErr_permanent_failure() {
21735 uint32_t ret_conv = LDKChannelMonitorUpdateErr_to_js(ChannelMonitorUpdateErr_permanent_failure());
21739 void __attribute__((export_name("TS_Watch_free"))) TS_Watch_free(uint64_t this_ptr) {
21740 if (!ptr_is_owned(this_ptr)) return;
21741 void* this_ptr_ptr = untag_ptr(this_ptr);
21742 CHECK_ACCESS(this_ptr_ptr);
21743 LDKWatch this_ptr_conv = *(LDKWatch*)(this_ptr_ptr);
21744 FREE(untag_ptr(this_ptr));
21745 Watch_free(this_ptr_conv);
21748 void __attribute__((export_name("TS_Filter_free"))) TS_Filter_free(uint64_t this_ptr) {
21749 if (!ptr_is_owned(this_ptr)) return;
21750 void* this_ptr_ptr = untag_ptr(this_ptr);
21751 CHECK_ACCESS(this_ptr_ptr);
21752 LDKFilter this_ptr_conv = *(LDKFilter*)(this_ptr_ptr);
21753 FREE(untag_ptr(this_ptr));
21754 Filter_free(this_ptr_conv);
21757 void __attribute__((export_name("TS_WatchedOutput_free"))) TS_WatchedOutput_free(uint64_t this_obj) {
21758 LDKWatchedOutput this_obj_conv;
21759 this_obj_conv.inner = untag_ptr(this_obj);
21760 this_obj_conv.is_owned = ptr_is_owned(this_obj);
21761 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
21762 WatchedOutput_free(this_obj_conv);
21765 int8_tArray __attribute__((export_name("TS_WatchedOutput_get_block_hash"))) TS_WatchedOutput_get_block_hash(uint64_t this_ptr) {
21766 LDKWatchedOutput this_ptr_conv;
21767 this_ptr_conv.inner = untag_ptr(this_ptr);
21768 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21769 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21770 this_ptr_conv.is_owned = false;
21771 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
21772 memcpy(ret_arr->elems, WatchedOutput_get_block_hash(&this_ptr_conv).data, 32);
21776 void __attribute__((export_name("TS_WatchedOutput_set_block_hash"))) TS_WatchedOutput_set_block_hash(uint64_t this_ptr, int8_tArray val) {
21777 LDKWatchedOutput this_ptr_conv;
21778 this_ptr_conv.inner = untag_ptr(this_ptr);
21779 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21780 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21781 this_ptr_conv.is_owned = false;
21782 LDKThirtyTwoBytes val_ref;
21783 CHECK(val->arr_len == 32);
21784 memcpy(val_ref.data, val->elems, 32); FREE(val);
21785 WatchedOutput_set_block_hash(&this_ptr_conv, val_ref);
21788 uint64_t __attribute__((export_name("TS_WatchedOutput_get_outpoint"))) TS_WatchedOutput_get_outpoint(uint64_t this_ptr) {
21789 LDKWatchedOutput this_ptr_conv;
21790 this_ptr_conv.inner = untag_ptr(this_ptr);
21791 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21792 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21793 this_ptr_conv.is_owned = false;
21794 LDKOutPoint ret_var = WatchedOutput_get_outpoint(&this_ptr_conv);
21795 uint64_t ret_ref = 0;
21796 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21797 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21801 void __attribute__((export_name("TS_WatchedOutput_set_outpoint"))) TS_WatchedOutput_set_outpoint(uint64_t this_ptr, uint64_t val) {
21802 LDKWatchedOutput this_ptr_conv;
21803 this_ptr_conv.inner = untag_ptr(this_ptr);
21804 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21805 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21806 this_ptr_conv.is_owned = false;
21807 LDKOutPoint val_conv;
21808 val_conv.inner = untag_ptr(val);
21809 val_conv.is_owned = ptr_is_owned(val);
21810 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
21811 val_conv = OutPoint_clone(&val_conv);
21812 WatchedOutput_set_outpoint(&this_ptr_conv, val_conv);
21815 int8_tArray __attribute__((export_name("TS_WatchedOutput_get_script_pubkey"))) TS_WatchedOutput_get_script_pubkey(uint64_t this_ptr) {
21816 LDKWatchedOutput this_ptr_conv;
21817 this_ptr_conv.inner = untag_ptr(this_ptr);
21818 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21819 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21820 this_ptr_conv.is_owned = false;
21821 LDKu8slice ret_var = WatchedOutput_get_script_pubkey(&this_ptr_conv);
21822 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
21823 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
21827 void __attribute__((export_name("TS_WatchedOutput_set_script_pubkey"))) TS_WatchedOutput_set_script_pubkey(uint64_t this_ptr, int8_tArray val) {
21828 LDKWatchedOutput this_ptr_conv;
21829 this_ptr_conv.inner = untag_ptr(this_ptr);
21830 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
21831 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
21832 this_ptr_conv.is_owned = false;
21833 LDKCVec_u8Z val_ref;
21834 val_ref.datalen = val->arr_len;
21835 val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes");
21836 memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val);
21837 WatchedOutput_set_script_pubkey(&this_ptr_conv, val_ref);
21840 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) {
21841 LDKThirtyTwoBytes block_hash_arg_ref;
21842 CHECK(block_hash_arg->arr_len == 32);
21843 memcpy(block_hash_arg_ref.data, block_hash_arg->elems, 32); FREE(block_hash_arg);
21844 LDKOutPoint outpoint_arg_conv;
21845 outpoint_arg_conv.inner = untag_ptr(outpoint_arg);
21846 outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg);
21847 CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv);
21848 outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv);
21849 LDKCVec_u8Z script_pubkey_arg_ref;
21850 script_pubkey_arg_ref.datalen = script_pubkey_arg->arr_len;
21851 script_pubkey_arg_ref.data = MALLOC(script_pubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes");
21852 memcpy(script_pubkey_arg_ref.data, script_pubkey_arg->elems, script_pubkey_arg_ref.datalen); FREE(script_pubkey_arg);
21853 LDKWatchedOutput ret_var = WatchedOutput_new(block_hash_arg_ref, outpoint_arg_conv, script_pubkey_arg_ref);
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 static inline uint64_t WatchedOutput_clone_ptr(LDKWatchedOutput *NONNULL_PTR arg) {
21861 LDKWatchedOutput ret_var = WatchedOutput_clone(arg);
21862 uint64_t ret_ref = 0;
21863 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21864 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21867 int64_t __attribute__((export_name("TS_WatchedOutput_clone_ptr"))) TS_WatchedOutput_clone_ptr(uint64_t arg) {
21868 LDKWatchedOutput arg_conv;
21869 arg_conv.inner = untag_ptr(arg);
21870 arg_conv.is_owned = ptr_is_owned(arg);
21871 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
21872 arg_conv.is_owned = false;
21873 int64_t ret_conv = WatchedOutput_clone_ptr(&arg_conv);
21877 uint64_t __attribute__((export_name("TS_WatchedOutput_clone"))) TS_WatchedOutput_clone(uint64_t orig) {
21878 LDKWatchedOutput orig_conv;
21879 orig_conv.inner = untag_ptr(orig);
21880 orig_conv.is_owned = ptr_is_owned(orig);
21881 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
21882 orig_conv.is_owned = false;
21883 LDKWatchedOutput ret_var = WatchedOutput_clone(&orig_conv);
21884 uint64_t ret_ref = 0;
21885 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21886 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21890 int64_t __attribute__((export_name("TS_WatchedOutput_hash"))) TS_WatchedOutput_hash(uint64_t o) {
21891 LDKWatchedOutput o_conv;
21892 o_conv.inner = untag_ptr(o);
21893 o_conv.is_owned = ptr_is_owned(o);
21894 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
21895 o_conv.is_owned = false;
21896 int64_t ret_conv = WatchedOutput_hash(&o_conv);
21900 void __attribute__((export_name("TS_BroadcasterInterface_free"))) TS_BroadcasterInterface_free(uint64_t this_ptr) {
21901 if (!ptr_is_owned(this_ptr)) return;
21902 void* this_ptr_ptr = untag_ptr(this_ptr);
21903 CHECK_ACCESS(this_ptr_ptr);
21904 LDKBroadcasterInterface this_ptr_conv = *(LDKBroadcasterInterface*)(this_ptr_ptr);
21905 FREE(untag_ptr(this_ptr));
21906 BroadcasterInterface_free(this_ptr_conv);
21909 uint32_t __attribute__((export_name("TS_ConfirmationTarget_clone"))) TS_ConfirmationTarget_clone(uint64_t orig) {
21910 LDKConfirmationTarget* orig_conv = (LDKConfirmationTarget*)untag_ptr(orig);
21911 uint32_t ret_conv = LDKConfirmationTarget_to_js(ConfirmationTarget_clone(orig_conv));
21915 uint32_t __attribute__((export_name("TS_ConfirmationTarget_background"))) TS_ConfirmationTarget_background() {
21916 uint32_t ret_conv = LDKConfirmationTarget_to_js(ConfirmationTarget_background());
21920 uint32_t __attribute__((export_name("TS_ConfirmationTarget_normal"))) TS_ConfirmationTarget_normal() {
21921 uint32_t ret_conv = LDKConfirmationTarget_to_js(ConfirmationTarget_normal());
21925 uint32_t __attribute__((export_name("TS_ConfirmationTarget_high_priority"))) TS_ConfirmationTarget_high_priority() {
21926 uint32_t ret_conv = LDKConfirmationTarget_to_js(ConfirmationTarget_high_priority());
21930 jboolean __attribute__((export_name("TS_ConfirmationTarget_eq"))) TS_ConfirmationTarget_eq(uint64_t a, uint64_t b) {
21931 LDKConfirmationTarget* a_conv = (LDKConfirmationTarget*)untag_ptr(a);
21932 LDKConfirmationTarget* b_conv = (LDKConfirmationTarget*)untag_ptr(b);
21933 jboolean ret_conv = ConfirmationTarget_eq(a_conv, b_conv);
21937 void __attribute__((export_name("TS_FeeEstimator_free"))) TS_FeeEstimator_free(uint64_t this_ptr) {
21938 if (!ptr_is_owned(this_ptr)) return;
21939 void* this_ptr_ptr = untag_ptr(this_ptr);
21940 CHECK_ACCESS(this_ptr_ptr);
21941 LDKFeeEstimator this_ptr_conv = *(LDKFeeEstimator*)(this_ptr_ptr);
21942 FREE(untag_ptr(this_ptr));
21943 FeeEstimator_free(this_ptr_conv);
21946 void __attribute__((export_name("TS_MonitorUpdateId_free"))) TS_MonitorUpdateId_free(uint64_t this_obj) {
21947 LDKMonitorUpdateId this_obj_conv;
21948 this_obj_conv.inner = untag_ptr(this_obj);
21949 this_obj_conv.is_owned = ptr_is_owned(this_obj);
21950 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
21951 MonitorUpdateId_free(this_obj_conv);
21954 static inline uint64_t MonitorUpdateId_clone_ptr(LDKMonitorUpdateId *NONNULL_PTR arg) {
21955 LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(arg);
21956 uint64_t ret_ref = 0;
21957 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21958 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21961 int64_t __attribute__((export_name("TS_MonitorUpdateId_clone_ptr"))) TS_MonitorUpdateId_clone_ptr(uint64_t arg) {
21962 LDKMonitorUpdateId arg_conv;
21963 arg_conv.inner = untag_ptr(arg);
21964 arg_conv.is_owned = ptr_is_owned(arg);
21965 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
21966 arg_conv.is_owned = false;
21967 int64_t ret_conv = MonitorUpdateId_clone_ptr(&arg_conv);
21971 uint64_t __attribute__((export_name("TS_MonitorUpdateId_clone"))) TS_MonitorUpdateId_clone(uint64_t orig) {
21972 LDKMonitorUpdateId orig_conv;
21973 orig_conv.inner = untag_ptr(orig);
21974 orig_conv.is_owned = ptr_is_owned(orig);
21975 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
21976 orig_conv.is_owned = false;
21977 LDKMonitorUpdateId ret_var = MonitorUpdateId_clone(&orig_conv);
21978 uint64_t ret_ref = 0;
21979 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
21980 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
21984 int64_t __attribute__((export_name("TS_MonitorUpdateId_hash"))) TS_MonitorUpdateId_hash(uint64_t o) {
21985 LDKMonitorUpdateId o_conv;
21986 o_conv.inner = untag_ptr(o);
21987 o_conv.is_owned = ptr_is_owned(o);
21988 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
21989 o_conv.is_owned = false;
21990 int64_t ret_conv = MonitorUpdateId_hash(&o_conv);
21994 jboolean __attribute__((export_name("TS_MonitorUpdateId_eq"))) TS_MonitorUpdateId_eq(uint64_t a, uint64_t b) {
21995 LDKMonitorUpdateId a_conv;
21996 a_conv.inner = untag_ptr(a);
21997 a_conv.is_owned = ptr_is_owned(a);
21998 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
21999 a_conv.is_owned = false;
22000 LDKMonitorUpdateId b_conv;
22001 b_conv.inner = untag_ptr(b);
22002 b_conv.is_owned = ptr_is_owned(b);
22003 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
22004 b_conv.is_owned = false;
22005 jboolean ret_conv = MonitorUpdateId_eq(&a_conv, &b_conv);
22009 void __attribute__((export_name("TS_Persist_free"))) TS_Persist_free(uint64_t this_ptr) {
22010 if (!ptr_is_owned(this_ptr)) return;
22011 void* this_ptr_ptr = untag_ptr(this_ptr);
22012 CHECK_ACCESS(this_ptr_ptr);
22013 LDKPersist this_ptr_conv = *(LDKPersist*)(this_ptr_ptr);
22014 FREE(untag_ptr(this_ptr));
22015 Persist_free(this_ptr_conv);
22018 void __attribute__((export_name("TS_LockedChannelMonitor_free"))) TS_LockedChannelMonitor_free(uint64_t this_obj) {
22019 LDKLockedChannelMonitor this_obj_conv;
22020 this_obj_conv.inner = untag_ptr(this_obj);
22021 this_obj_conv.is_owned = ptr_is_owned(this_obj);
22022 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
22023 LockedChannelMonitor_free(this_obj_conv);
22026 void __attribute__((export_name("TS_ChainMonitor_free"))) TS_ChainMonitor_free(uint64_t this_obj) {
22027 LDKChainMonitor this_obj_conv;
22028 this_obj_conv.inner = untag_ptr(this_obj);
22029 this_obj_conv.is_owned = ptr_is_owned(this_obj);
22030 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
22031 ChainMonitor_free(this_obj_conv);
22034 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) {
22035 void* chain_source_ptr = untag_ptr(chain_source);
22036 CHECK_ACCESS(chain_source_ptr);
22037 LDKCOption_FilterZ chain_source_conv = *(LDKCOption_FilterZ*)(chain_source_ptr);
22038 // WARNING: we may need a move here but no clone is available for LDKCOption_FilterZ
22039 if (chain_source_conv.tag == LDKCOption_FilterZ_Some) {
22040 // Manually implement clone for Java trait instances
22041 if (chain_source_conv.some.free == LDKFilter_JCalls_free) {
22042 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
22043 LDKFilter_JCalls_cloned(&chain_source_conv.some);
22046 void* broadcaster_ptr = untag_ptr(broadcaster);
22047 CHECK_ACCESS(broadcaster_ptr);
22048 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
22049 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
22050 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
22051 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
22053 void* logger_ptr = untag_ptr(logger);
22054 CHECK_ACCESS(logger_ptr);
22055 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
22056 if (logger_conv.free == LDKLogger_JCalls_free) {
22057 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
22058 LDKLogger_JCalls_cloned(&logger_conv);
22060 void* feeest_ptr = untag_ptr(feeest);
22061 CHECK_ACCESS(feeest_ptr);
22062 LDKFeeEstimator feeest_conv = *(LDKFeeEstimator*)(feeest_ptr);
22063 if (feeest_conv.free == LDKFeeEstimator_JCalls_free) {
22064 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
22065 LDKFeeEstimator_JCalls_cloned(&feeest_conv);
22067 void* persister_ptr = untag_ptr(persister);
22068 CHECK_ACCESS(persister_ptr);
22069 LDKPersist persister_conv = *(LDKPersist*)(persister_ptr);
22070 if (persister_conv.free == LDKPersist_JCalls_free) {
22071 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
22072 LDKPersist_JCalls_cloned(&persister_conv);
22074 LDKChainMonitor ret_var = ChainMonitor_new(chain_source_conv, broadcaster_conv, logger_conv, feeest_conv, persister_conv);
22075 uint64_t ret_ref = 0;
22076 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22077 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22081 uint64_tArray __attribute__((export_name("TS_ChainMonitor_get_claimable_balances"))) TS_ChainMonitor_get_claimable_balances(uint64_t this_arg, uint64_tArray ignored_channels) {
22082 LDKChainMonitor this_arg_conv;
22083 this_arg_conv.inner = untag_ptr(this_arg);
22084 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22085 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22086 this_arg_conv.is_owned = false;
22087 LDKCVec_ChannelDetailsZ ignored_channels_constr;
22088 ignored_channels_constr.datalen = ignored_channels->arr_len;
22089 if (ignored_channels_constr.datalen > 0)
22090 ignored_channels_constr.data = MALLOC(ignored_channels_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
22092 ignored_channels_constr.data = NULL;
22093 uint64_t* ignored_channels_vals = ignored_channels->elems;
22094 for (size_t q = 0; q < ignored_channels_constr.datalen; q++) {
22095 uint64_t ignored_channels_conv_16 = ignored_channels_vals[q];
22096 LDKChannelDetails ignored_channels_conv_16_conv;
22097 ignored_channels_conv_16_conv.inner = untag_ptr(ignored_channels_conv_16);
22098 ignored_channels_conv_16_conv.is_owned = ptr_is_owned(ignored_channels_conv_16);
22099 CHECK_INNER_FIELD_ACCESS_OR_NULL(ignored_channels_conv_16_conv);
22100 ignored_channels_conv_16_conv = ChannelDetails_clone(&ignored_channels_conv_16_conv);
22101 ignored_channels_constr.data[q] = ignored_channels_conv_16_conv;
22103 FREE(ignored_channels);
22104 LDKCVec_BalanceZ ret_var = ChainMonitor_get_claimable_balances(&this_arg_conv, ignored_channels_constr);
22105 uint64_tArray ret_arr = NULL;
22106 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
22107 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
22108 for (size_t j = 0; j < ret_var.datalen; j++) {
22109 LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
22110 *ret_conv_9_copy = ret_var.data[j];
22111 uint64_t ret_conv_9_ref = tag_ptr(ret_conv_9_copy, true);
22112 ret_arr_ptr[j] = ret_conv_9_ref;
22115 FREE(ret_var.data);
22119 uint64_t __attribute__((export_name("TS_ChainMonitor_get_monitor"))) TS_ChainMonitor_get_monitor(uint64_t this_arg, uint64_t funding_txo) {
22120 LDKChainMonitor this_arg_conv;
22121 this_arg_conv.inner = untag_ptr(this_arg);
22122 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22123 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22124 this_arg_conv.is_owned = false;
22125 LDKOutPoint funding_txo_conv;
22126 funding_txo_conv.inner = untag_ptr(funding_txo);
22127 funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
22128 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
22129 funding_txo_conv = OutPoint_clone(&funding_txo_conv);
22130 LDKCResult_LockedChannelMonitorNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_LockedChannelMonitorNoneZ), "LDKCResult_LockedChannelMonitorNoneZ");
22131 *ret_conv = ChainMonitor_get_monitor(&this_arg_conv, funding_txo_conv);
22132 return tag_ptr(ret_conv, true);
22135 uint64_tArray __attribute__((export_name("TS_ChainMonitor_list_monitors"))) TS_ChainMonitor_list_monitors(uint64_t this_arg) {
22136 LDKChainMonitor this_arg_conv;
22137 this_arg_conv.inner = untag_ptr(this_arg);
22138 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22139 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22140 this_arg_conv.is_owned = false;
22141 LDKCVec_OutPointZ ret_var = ChainMonitor_list_monitors(&this_arg_conv);
22142 uint64_tArray ret_arr = NULL;
22143 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
22144 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
22145 for (size_t k = 0; k < ret_var.datalen; k++) {
22146 LDKOutPoint ret_conv_10_var = ret_var.data[k];
22147 uint64_t ret_conv_10_ref = 0;
22148 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_10_var);
22149 ret_conv_10_ref = tag_ptr(ret_conv_10_var.inner, ret_conv_10_var.is_owned);
22150 ret_arr_ptr[k] = ret_conv_10_ref;
22153 FREE(ret_var.data);
22157 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) {
22158 LDKChainMonitor this_arg_conv;
22159 this_arg_conv.inner = untag_ptr(this_arg);
22160 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22161 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22162 this_arg_conv.is_owned = false;
22163 LDKOutPoint funding_txo_conv;
22164 funding_txo_conv.inner = untag_ptr(funding_txo);
22165 funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
22166 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
22167 funding_txo_conv = OutPoint_clone(&funding_txo_conv);
22168 LDKMonitorUpdateId completed_update_id_conv;
22169 completed_update_id_conv.inner = untag_ptr(completed_update_id);
22170 completed_update_id_conv.is_owned = ptr_is_owned(completed_update_id);
22171 CHECK_INNER_FIELD_ACCESS_OR_NULL(completed_update_id_conv);
22172 completed_update_id_conv = MonitorUpdateId_clone(&completed_update_id_conv);
22173 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
22174 *ret_conv = ChainMonitor_channel_monitor_updated(&this_arg_conv, funding_txo_conv, completed_update_id_conv);
22175 return tag_ptr(ret_conv, true);
22178 uint64_t __attribute__((export_name("TS_ChainMonitor_as_Listen"))) TS_ChainMonitor_as_Listen(uint64_t this_arg) {
22179 LDKChainMonitor this_arg_conv;
22180 this_arg_conv.inner = untag_ptr(this_arg);
22181 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22182 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22183 this_arg_conv.is_owned = false;
22184 LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen");
22185 *ret_ret = ChainMonitor_as_Listen(&this_arg_conv);
22186 return tag_ptr(ret_ret, true);
22189 uint64_t __attribute__((export_name("TS_ChainMonitor_as_Confirm"))) TS_ChainMonitor_as_Confirm(uint64_t this_arg) {
22190 LDKChainMonitor this_arg_conv;
22191 this_arg_conv.inner = untag_ptr(this_arg);
22192 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22193 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22194 this_arg_conv.is_owned = false;
22195 LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm");
22196 *ret_ret = ChainMonitor_as_Confirm(&this_arg_conv);
22197 return tag_ptr(ret_ret, true);
22200 uint64_t __attribute__((export_name("TS_ChainMonitor_as_Watch"))) TS_ChainMonitor_as_Watch(uint64_t this_arg) {
22201 LDKChainMonitor this_arg_conv;
22202 this_arg_conv.inner = untag_ptr(this_arg);
22203 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22204 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22205 this_arg_conv.is_owned = false;
22206 LDKWatch* ret_ret = MALLOC(sizeof(LDKWatch), "LDKWatch");
22207 *ret_ret = ChainMonitor_as_Watch(&this_arg_conv);
22208 return tag_ptr(ret_ret, true);
22211 uint64_t __attribute__((export_name("TS_ChainMonitor_as_EventsProvider"))) TS_ChainMonitor_as_EventsProvider(uint64_t this_arg) {
22212 LDKChainMonitor this_arg_conv;
22213 this_arg_conv.inner = untag_ptr(this_arg);
22214 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22215 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22216 this_arg_conv.is_owned = false;
22217 LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
22218 *ret_ret = ChainMonitor_as_EventsProvider(&this_arg_conv);
22219 return tag_ptr(ret_ret, true);
22222 void __attribute__((export_name("TS_ChannelMonitorUpdate_free"))) TS_ChannelMonitorUpdate_free(uint64_t this_obj) {
22223 LDKChannelMonitorUpdate this_obj_conv;
22224 this_obj_conv.inner = untag_ptr(this_obj);
22225 this_obj_conv.is_owned = ptr_is_owned(this_obj);
22226 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
22227 ChannelMonitorUpdate_free(this_obj_conv);
22230 int64_t __attribute__((export_name("TS_ChannelMonitorUpdate_get_update_id"))) TS_ChannelMonitorUpdate_get_update_id(uint64_t this_ptr) {
22231 LDKChannelMonitorUpdate this_ptr_conv;
22232 this_ptr_conv.inner = untag_ptr(this_ptr);
22233 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22234 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22235 this_ptr_conv.is_owned = false;
22236 int64_t ret_conv = ChannelMonitorUpdate_get_update_id(&this_ptr_conv);
22240 void __attribute__((export_name("TS_ChannelMonitorUpdate_set_update_id"))) TS_ChannelMonitorUpdate_set_update_id(uint64_t this_ptr, int64_t val) {
22241 LDKChannelMonitorUpdate this_ptr_conv;
22242 this_ptr_conv.inner = untag_ptr(this_ptr);
22243 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
22244 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
22245 this_ptr_conv.is_owned = false;
22246 ChannelMonitorUpdate_set_update_id(&this_ptr_conv, val);
22249 static inline uint64_t ChannelMonitorUpdate_clone_ptr(LDKChannelMonitorUpdate *NONNULL_PTR arg) {
22250 LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(arg);
22251 uint64_t ret_ref = 0;
22252 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22253 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22256 int64_t __attribute__((export_name("TS_ChannelMonitorUpdate_clone_ptr"))) TS_ChannelMonitorUpdate_clone_ptr(uint64_t arg) {
22257 LDKChannelMonitorUpdate arg_conv;
22258 arg_conv.inner = untag_ptr(arg);
22259 arg_conv.is_owned = ptr_is_owned(arg);
22260 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
22261 arg_conv.is_owned = false;
22262 int64_t ret_conv = ChannelMonitorUpdate_clone_ptr(&arg_conv);
22266 uint64_t __attribute__((export_name("TS_ChannelMonitorUpdate_clone"))) TS_ChannelMonitorUpdate_clone(uint64_t orig) {
22267 LDKChannelMonitorUpdate orig_conv;
22268 orig_conv.inner = untag_ptr(orig);
22269 orig_conv.is_owned = ptr_is_owned(orig);
22270 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
22271 orig_conv.is_owned = false;
22272 LDKChannelMonitorUpdate ret_var = ChannelMonitorUpdate_clone(&orig_conv);
22273 uint64_t ret_ref = 0;
22274 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22275 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22279 int8_tArray __attribute__((export_name("TS_ChannelMonitorUpdate_write"))) TS_ChannelMonitorUpdate_write(uint64_t obj) {
22280 LDKChannelMonitorUpdate obj_conv;
22281 obj_conv.inner = untag_ptr(obj);
22282 obj_conv.is_owned = ptr_is_owned(obj);
22283 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
22284 obj_conv.is_owned = false;
22285 LDKCVec_u8Z ret_var = ChannelMonitorUpdate_write(&obj_conv);
22286 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
22287 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
22288 CVec_u8Z_free(ret_var);
22292 uint64_t __attribute__((export_name("TS_ChannelMonitorUpdate_read"))) TS_ChannelMonitorUpdate_read(int8_tArray ser) {
22293 LDKu8slice ser_ref;
22294 ser_ref.datalen = ser->arr_len;
22295 ser_ref.data = ser->elems;
22296 LDKCResult_ChannelMonitorUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelMonitorUpdateDecodeErrorZ), "LDKCResult_ChannelMonitorUpdateDecodeErrorZ");
22297 *ret_conv = ChannelMonitorUpdate_read(ser_ref);
22299 return tag_ptr(ret_conv, true);
22302 void __attribute__((export_name("TS_MonitorEvent_free"))) TS_MonitorEvent_free(uint64_t this_ptr) {
22303 if (!ptr_is_owned(this_ptr)) return;
22304 void* this_ptr_ptr = untag_ptr(this_ptr);
22305 CHECK_ACCESS(this_ptr_ptr);
22306 LDKMonitorEvent this_ptr_conv = *(LDKMonitorEvent*)(this_ptr_ptr);
22307 FREE(untag_ptr(this_ptr));
22308 MonitorEvent_free(this_ptr_conv);
22311 static inline uint64_t MonitorEvent_clone_ptr(LDKMonitorEvent *NONNULL_PTR arg) {
22312 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
22313 *ret_copy = MonitorEvent_clone(arg);
22314 uint64_t ret_ref = tag_ptr(ret_copy, true);
22317 int64_t __attribute__((export_name("TS_MonitorEvent_clone_ptr"))) TS_MonitorEvent_clone_ptr(uint64_t arg) {
22318 LDKMonitorEvent* arg_conv = (LDKMonitorEvent*)untag_ptr(arg);
22319 int64_t ret_conv = MonitorEvent_clone_ptr(arg_conv);
22323 uint64_t __attribute__((export_name("TS_MonitorEvent_clone"))) TS_MonitorEvent_clone(uint64_t orig) {
22324 LDKMonitorEvent* orig_conv = (LDKMonitorEvent*)untag_ptr(orig);
22325 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
22326 *ret_copy = MonitorEvent_clone(orig_conv);
22327 uint64_t ret_ref = tag_ptr(ret_copy, true);
22331 uint64_t __attribute__((export_name("TS_MonitorEvent_htlcevent"))) TS_MonitorEvent_htlcevent(uint64_t a) {
22332 LDKHTLCUpdate a_conv;
22333 a_conv.inner = untag_ptr(a);
22334 a_conv.is_owned = ptr_is_owned(a);
22335 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
22336 a_conv = HTLCUpdate_clone(&a_conv);
22337 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
22338 *ret_copy = MonitorEvent_htlcevent(a_conv);
22339 uint64_t ret_ref = tag_ptr(ret_copy, true);
22343 uint64_t __attribute__((export_name("TS_MonitorEvent_commitment_tx_confirmed"))) TS_MonitorEvent_commitment_tx_confirmed(uint64_t a) {
22344 LDKOutPoint a_conv;
22345 a_conv.inner = untag_ptr(a);
22346 a_conv.is_owned = ptr_is_owned(a);
22347 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
22348 a_conv = OutPoint_clone(&a_conv);
22349 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
22350 *ret_copy = MonitorEvent_commitment_tx_confirmed(a_conv);
22351 uint64_t ret_ref = tag_ptr(ret_copy, true);
22355 uint64_t __attribute__((export_name("TS_MonitorEvent_update_completed"))) TS_MonitorEvent_update_completed(uint64_t funding_txo, int64_t monitor_update_id) {
22356 LDKOutPoint funding_txo_conv;
22357 funding_txo_conv.inner = untag_ptr(funding_txo);
22358 funding_txo_conv.is_owned = ptr_is_owned(funding_txo);
22359 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_conv);
22360 funding_txo_conv = OutPoint_clone(&funding_txo_conv);
22361 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
22362 *ret_copy = MonitorEvent_update_completed(funding_txo_conv, monitor_update_id);
22363 uint64_t ret_ref = tag_ptr(ret_copy, true);
22367 uint64_t __attribute__((export_name("TS_MonitorEvent_update_failed"))) TS_MonitorEvent_update_failed(uint64_t a) {
22368 LDKOutPoint a_conv;
22369 a_conv.inner = untag_ptr(a);
22370 a_conv.is_owned = ptr_is_owned(a);
22371 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
22372 a_conv = OutPoint_clone(&a_conv);
22373 LDKMonitorEvent *ret_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
22374 *ret_copy = MonitorEvent_update_failed(a_conv);
22375 uint64_t ret_ref = tag_ptr(ret_copy, true);
22379 int8_tArray __attribute__((export_name("TS_MonitorEvent_write"))) TS_MonitorEvent_write(uint64_t obj) {
22380 LDKMonitorEvent* obj_conv = (LDKMonitorEvent*)untag_ptr(obj);
22381 LDKCVec_u8Z ret_var = MonitorEvent_write(obj_conv);
22382 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
22383 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
22384 CVec_u8Z_free(ret_var);
22388 uint64_t __attribute__((export_name("TS_MonitorEvent_read"))) TS_MonitorEvent_read(int8_tArray ser) {
22389 LDKu8slice ser_ref;
22390 ser_ref.datalen = ser->arr_len;
22391 ser_ref.data = ser->elems;
22392 LDKCResult_COption_MonitorEventZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_MonitorEventZDecodeErrorZ), "LDKCResult_COption_MonitorEventZDecodeErrorZ");
22393 *ret_conv = MonitorEvent_read(ser_ref);
22395 return tag_ptr(ret_conv, true);
22398 void __attribute__((export_name("TS_HTLCUpdate_free"))) TS_HTLCUpdate_free(uint64_t this_obj) {
22399 LDKHTLCUpdate this_obj_conv;
22400 this_obj_conv.inner = untag_ptr(this_obj);
22401 this_obj_conv.is_owned = ptr_is_owned(this_obj);
22402 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
22403 HTLCUpdate_free(this_obj_conv);
22406 static inline uint64_t HTLCUpdate_clone_ptr(LDKHTLCUpdate *NONNULL_PTR arg) {
22407 LDKHTLCUpdate ret_var = HTLCUpdate_clone(arg);
22408 uint64_t ret_ref = 0;
22409 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22410 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22413 int64_t __attribute__((export_name("TS_HTLCUpdate_clone_ptr"))) TS_HTLCUpdate_clone_ptr(uint64_t arg) {
22414 LDKHTLCUpdate arg_conv;
22415 arg_conv.inner = untag_ptr(arg);
22416 arg_conv.is_owned = ptr_is_owned(arg);
22417 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
22418 arg_conv.is_owned = false;
22419 int64_t ret_conv = HTLCUpdate_clone_ptr(&arg_conv);
22423 uint64_t __attribute__((export_name("TS_HTLCUpdate_clone"))) TS_HTLCUpdate_clone(uint64_t orig) {
22424 LDKHTLCUpdate orig_conv;
22425 orig_conv.inner = untag_ptr(orig);
22426 orig_conv.is_owned = ptr_is_owned(orig);
22427 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
22428 orig_conv.is_owned = false;
22429 LDKHTLCUpdate ret_var = HTLCUpdate_clone(&orig_conv);
22430 uint64_t ret_ref = 0;
22431 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22432 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22436 int8_tArray __attribute__((export_name("TS_HTLCUpdate_write"))) TS_HTLCUpdate_write(uint64_t obj) {
22437 LDKHTLCUpdate obj_conv;
22438 obj_conv.inner = untag_ptr(obj);
22439 obj_conv.is_owned = ptr_is_owned(obj);
22440 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
22441 obj_conv.is_owned = false;
22442 LDKCVec_u8Z ret_var = HTLCUpdate_write(&obj_conv);
22443 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
22444 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
22445 CVec_u8Z_free(ret_var);
22449 uint64_t __attribute__((export_name("TS_HTLCUpdate_read"))) TS_HTLCUpdate_read(int8_tArray ser) {
22450 LDKu8slice ser_ref;
22451 ser_ref.datalen = ser->arr_len;
22452 ser_ref.data = ser->elems;
22453 LDKCResult_HTLCUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCUpdateDecodeErrorZ), "LDKCResult_HTLCUpdateDecodeErrorZ");
22454 *ret_conv = HTLCUpdate_read(ser_ref);
22456 return tag_ptr(ret_conv, true);
22459 void __attribute__((export_name("TS_Balance_free"))) TS_Balance_free(uint64_t this_ptr) {
22460 if (!ptr_is_owned(this_ptr)) return;
22461 void* this_ptr_ptr = untag_ptr(this_ptr);
22462 CHECK_ACCESS(this_ptr_ptr);
22463 LDKBalance this_ptr_conv = *(LDKBalance*)(this_ptr_ptr);
22464 FREE(untag_ptr(this_ptr));
22465 Balance_free(this_ptr_conv);
22468 static inline uint64_t Balance_clone_ptr(LDKBalance *NONNULL_PTR arg) {
22469 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
22470 *ret_copy = Balance_clone(arg);
22471 uint64_t ret_ref = tag_ptr(ret_copy, true);
22474 int64_t __attribute__((export_name("TS_Balance_clone_ptr"))) TS_Balance_clone_ptr(uint64_t arg) {
22475 LDKBalance* arg_conv = (LDKBalance*)untag_ptr(arg);
22476 int64_t ret_conv = Balance_clone_ptr(arg_conv);
22480 uint64_t __attribute__((export_name("TS_Balance_clone"))) TS_Balance_clone(uint64_t orig) {
22481 LDKBalance* orig_conv = (LDKBalance*)untag_ptr(orig);
22482 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
22483 *ret_copy = Balance_clone(orig_conv);
22484 uint64_t ret_ref = tag_ptr(ret_copy, true);
22488 uint64_t __attribute__((export_name("TS_Balance_claimable_on_channel_close"))) TS_Balance_claimable_on_channel_close(int64_t claimable_amount_satoshis) {
22489 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
22490 *ret_copy = Balance_claimable_on_channel_close(claimable_amount_satoshis);
22491 uint64_t ret_ref = tag_ptr(ret_copy, true);
22495 uint64_t __attribute__((export_name("TS_Balance_claimable_awaiting_confirmations"))) TS_Balance_claimable_awaiting_confirmations(int64_t claimable_amount_satoshis, int32_t confirmation_height) {
22496 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
22497 *ret_copy = Balance_claimable_awaiting_confirmations(claimable_amount_satoshis, confirmation_height);
22498 uint64_t ret_ref = tag_ptr(ret_copy, true);
22502 uint64_t __attribute__((export_name("TS_Balance_contentious_claimable"))) TS_Balance_contentious_claimable(int64_t claimable_amount_satoshis, int32_t timeout_height) {
22503 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
22504 *ret_copy = Balance_contentious_claimable(claimable_amount_satoshis, timeout_height);
22505 uint64_t ret_ref = tag_ptr(ret_copy, true);
22509 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) {
22510 LDKBalance *ret_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
22511 *ret_copy = Balance_maybe_claimable_htlcawaiting_timeout(claimable_amount_satoshis, claimable_height);
22512 uint64_t ret_ref = tag_ptr(ret_copy, true);
22516 jboolean __attribute__((export_name("TS_Balance_eq"))) TS_Balance_eq(uint64_t a, uint64_t b) {
22517 LDKBalance* a_conv = (LDKBalance*)untag_ptr(a);
22518 LDKBalance* b_conv = (LDKBalance*)untag_ptr(b);
22519 jboolean ret_conv = Balance_eq(a_conv, b_conv);
22523 void __attribute__((export_name("TS_ChannelMonitor_free"))) TS_ChannelMonitor_free(uint64_t this_obj) {
22524 LDKChannelMonitor this_obj_conv;
22525 this_obj_conv.inner = untag_ptr(this_obj);
22526 this_obj_conv.is_owned = ptr_is_owned(this_obj);
22527 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
22528 ChannelMonitor_free(this_obj_conv);
22531 static inline uint64_t ChannelMonitor_clone_ptr(LDKChannelMonitor *NONNULL_PTR arg) {
22532 LDKChannelMonitor ret_var = ChannelMonitor_clone(arg);
22533 uint64_t ret_ref = 0;
22534 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22535 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22538 int64_t __attribute__((export_name("TS_ChannelMonitor_clone_ptr"))) TS_ChannelMonitor_clone_ptr(uint64_t arg) {
22539 LDKChannelMonitor arg_conv;
22540 arg_conv.inner = untag_ptr(arg);
22541 arg_conv.is_owned = ptr_is_owned(arg);
22542 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
22543 arg_conv.is_owned = false;
22544 int64_t ret_conv = ChannelMonitor_clone_ptr(&arg_conv);
22548 uint64_t __attribute__((export_name("TS_ChannelMonitor_clone"))) TS_ChannelMonitor_clone(uint64_t orig) {
22549 LDKChannelMonitor orig_conv;
22550 orig_conv.inner = untag_ptr(orig);
22551 orig_conv.is_owned = ptr_is_owned(orig);
22552 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
22553 orig_conv.is_owned = false;
22554 LDKChannelMonitor ret_var = ChannelMonitor_clone(&orig_conv);
22555 uint64_t ret_ref = 0;
22556 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22557 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
22561 int8_tArray __attribute__((export_name("TS_ChannelMonitor_write"))) TS_ChannelMonitor_write(uint64_t obj) {
22562 LDKChannelMonitor obj_conv;
22563 obj_conv.inner = untag_ptr(obj);
22564 obj_conv.is_owned = ptr_is_owned(obj);
22565 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
22566 obj_conv.is_owned = false;
22567 LDKCVec_u8Z ret_var = ChannelMonitor_write(&obj_conv);
22568 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
22569 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
22570 CVec_u8Z_free(ret_var);
22574 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) {
22575 LDKChannelMonitor this_arg_conv;
22576 this_arg_conv.inner = untag_ptr(this_arg);
22577 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22578 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22579 this_arg_conv.is_owned = false;
22580 LDKChannelMonitorUpdate updates_conv;
22581 updates_conv.inner = untag_ptr(updates);
22582 updates_conv.is_owned = ptr_is_owned(updates);
22583 CHECK_INNER_FIELD_ACCESS_OR_NULL(updates_conv);
22584 updates_conv.is_owned = false;
22585 void* broadcaster_ptr = untag_ptr(broadcaster);
22586 if (ptr_is_owned(broadcaster)) { CHECK_ACCESS(broadcaster_ptr); }
22587 LDKBroadcasterInterface* broadcaster_conv = (LDKBroadcasterInterface*)broadcaster_ptr;
22588 void* fee_estimator_ptr = untag_ptr(fee_estimator);
22589 CHECK_ACCESS(fee_estimator_ptr);
22590 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
22591 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
22592 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
22593 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
22595 void* logger_ptr = untag_ptr(logger);
22596 if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); }
22597 LDKLogger* logger_conv = (LDKLogger*)logger_ptr;
22598 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
22599 *ret_conv = ChannelMonitor_update_monitor(&this_arg_conv, &updates_conv, broadcaster_conv, fee_estimator_conv, logger_conv);
22600 return tag_ptr(ret_conv, true);
22603 int64_t __attribute__((export_name("TS_ChannelMonitor_get_latest_update_id"))) TS_ChannelMonitor_get_latest_update_id(uint64_t this_arg) {
22604 LDKChannelMonitor this_arg_conv;
22605 this_arg_conv.inner = untag_ptr(this_arg);
22606 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22607 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22608 this_arg_conv.is_owned = false;
22609 int64_t ret_conv = ChannelMonitor_get_latest_update_id(&this_arg_conv);
22613 uint64_t __attribute__((export_name("TS_ChannelMonitor_get_funding_txo"))) TS_ChannelMonitor_get_funding_txo(uint64_t this_arg) {
22614 LDKChannelMonitor this_arg_conv;
22615 this_arg_conv.inner = untag_ptr(this_arg);
22616 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22617 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22618 this_arg_conv.is_owned = false;
22619 LDKC2Tuple_OutPointScriptZ* ret_conv = MALLOC(sizeof(LDKC2Tuple_OutPointScriptZ), "LDKC2Tuple_OutPointScriptZ");
22620 *ret_conv = ChannelMonitor_get_funding_txo(&this_arg_conv);
22621 return tag_ptr(ret_conv, true);
22624 uint64_tArray __attribute__((export_name("TS_ChannelMonitor_get_outputs_to_watch"))) TS_ChannelMonitor_get_outputs_to_watch(uint64_t this_arg) {
22625 LDKChannelMonitor this_arg_conv;
22626 this_arg_conv.inner = untag_ptr(this_arg);
22627 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22628 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22629 this_arg_conv.is_owned = false;
22630 LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32ScriptZZZZ ret_var = ChannelMonitor_get_outputs_to_watch(&this_arg_conv);
22631 uint64_tArray ret_arr = NULL;
22632 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
22633 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
22634 for (size_t o = 0; o < ret_var.datalen; o++) {
22635 LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ* ret_conv_40_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32ScriptZZZ");
22636 *ret_conv_40_conv = ret_var.data[o];
22637 ret_arr_ptr[o] = tag_ptr(ret_conv_40_conv, true);
22640 FREE(ret_var.data);
22644 void __attribute__((export_name("TS_ChannelMonitor_load_outputs_to_watch"))) TS_ChannelMonitor_load_outputs_to_watch(uint64_t this_arg, uint64_t filter) {
22645 LDKChannelMonitor this_arg_conv;
22646 this_arg_conv.inner = untag_ptr(this_arg);
22647 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22648 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22649 this_arg_conv.is_owned = false;
22650 void* filter_ptr = untag_ptr(filter);
22651 if (ptr_is_owned(filter)) { CHECK_ACCESS(filter_ptr); }
22652 LDKFilter* filter_conv = (LDKFilter*)filter_ptr;
22653 ChannelMonitor_load_outputs_to_watch(&this_arg_conv, filter_conv);
22656 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) {
22657 LDKChannelMonitor this_arg_conv;
22658 this_arg_conv.inner = untag_ptr(this_arg);
22659 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22660 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22661 this_arg_conv.is_owned = false;
22662 LDKCVec_MonitorEventZ ret_var = ChannelMonitor_get_and_clear_pending_monitor_events(&this_arg_conv);
22663 uint64_tArray ret_arr = NULL;
22664 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
22665 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
22666 for (size_t o = 0; o < ret_var.datalen; o++) {
22667 LDKMonitorEvent *ret_conv_14_copy = MALLOC(sizeof(LDKMonitorEvent), "LDKMonitorEvent");
22668 *ret_conv_14_copy = ret_var.data[o];
22669 uint64_t ret_conv_14_ref = tag_ptr(ret_conv_14_copy, true);
22670 ret_arr_ptr[o] = ret_conv_14_ref;
22673 FREE(ret_var.data);
22677 uint64_tArray __attribute__((export_name("TS_ChannelMonitor_get_and_clear_pending_events"))) TS_ChannelMonitor_get_and_clear_pending_events(uint64_t this_arg) {
22678 LDKChannelMonitor this_arg_conv;
22679 this_arg_conv.inner = untag_ptr(this_arg);
22680 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22681 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22682 this_arg_conv.is_owned = false;
22683 LDKCVec_EventZ ret_var = ChannelMonitor_get_and_clear_pending_events(&this_arg_conv);
22684 uint64_tArray ret_arr = NULL;
22685 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
22686 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
22687 for (size_t h = 0; h < ret_var.datalen; h++) {
22688 LDKEvent *ret_conv_7_copy = MALLOC(sizeof(LDKEvent), "LDKEvent");
22689 *ret_conv_7_copy = ret_var.data[h];
22690 uint64_t ret_conv_7_ref = tag_ptr(ret_conv_7_copy, true);
22691 ret_arr_ptr[h] = ret_conv_7_ref;
22694 FREE(ret_var.data);
22698 int8_tArray __attribute__((export_name("TS_ChannelMonitor_get_counterparty_node_id"))) TS_ChannelMonitor_get_counterparty_node_id(uint64_t this_arg) {
22699 LDKChannelMonitor this_arg_conv;
22700 this_arg_conv.inner = untag_ptr(this_arg);
22701 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22702 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22703 this_arg_conv.is_owned = false;
22704 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
22705 memcpy(ret_arr->elems, ChannelMonitor_get_counterparty_node_id(&this_arg_conv).compressed_form, 33);
22709 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) {
22710 LDKChannelMonitor this_arg_conv;
22711 this_arg_conv.inner = untag_ptr(this_arg);
22712 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22713 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22714 this_arg_conv.is_owned = false;
22715 void* logger_ptr = untag_ptr(logger);
22716 if (ptr_is_owned(logger)) { CHECK_ACCESS(logger_ptr); }
22717 LDKLogger* logger_conv = (LDKLogger*)logger_ptr;
22718 LDKCVec_TransactionZ ret_var = ChannelMonitor_get_latest_holder_commitment_txn(&this_arg_conv, logger_conv);
22719 ptrArray ret_arr = NULL;
22720 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
22721 int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8);
22722 for (size_t m = 0; m < ret_var.datalen; m++) {
22723 LDKTransaction ret_conv_12_var = ret_var.data[m];
22724 int8_tArray ret_conv_12_arr = init_int8_tArray(ret_conv_12_var.datalen, __LINE__);
22725 memcpy(ret_conv_12_arr->elems, ret_conv_12_var.data, ret_conv_12_var.datalen);
22726 Transaction_free(ret_conv_12_var);
22727 ret_arr_ptr[m] = ret_conv_12_arr;
22730 FREE(ret_var.data);
22734 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) {
22735 LDKChannelMonitor this_arg_conv;
22736 this_arg_conv.inner = untag_ptr(this_arg);
22737 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22738 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22739 this_arg_conv.is_owned = false;
22740 unsigned char header_arr[80];
22741 CHECK(header->arr_len == 80);
22742 memcpy(header_arr, header->elems, 80); FREE(header);
22743 unsigned char (*header_ref)[80] = &header_arr;
22744 LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr;
22745 txdata_constr.datalen = txdata->arr_len;
22746 if (txdata_constr.datalen > 0)
22747 txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
22749 txdata_constr.data = NULL;
22750 uint64_t* txdata_vals = txdata->elems;
22751 for (size_t c = 0; c < txdata_constr.datalen; c++) {
22752 uint64_t txdata_conv_28 = txdata_vals[c];
22753 void* txdata_conv_28_ptr = untag_ptr(txdata_conv_28);
22754 CHECK_ACCESS(txdata_conv_28_ptr);
22755 LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr);
22756 txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(txdata_conv_28));
22757 txdata_constr.data[c] = txdata_conv_28_conv;
22760 void* broadcaster_ptr = untag_ptr(broadcaster);
22761 CHECK_ACCESS(broadcaster_ptr);
22762 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
22763 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
22764 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
22765 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
22767 void* fee_estimator_ptr = untag_ptr(fee_estimator);
22768 CHECK_ACCESS(fee_estimator_ptr);
22769 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
22770 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
22771 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
22772 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
22774 void* logger_ptr = untag_ptr(logger);
22775 CHECK_ACCESS(logger_ptr);
22776 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
22777 if (logger_conv.free == LDKLogger_JCalls_free) {
22778 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
22779 LDKLogger_JCalls_cloned(&logger_conv);
22781 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);
22782 uint64_tArray ret_arr = NULL;
22783 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
22784 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
22785 for (size_t n = 0; n < ret_var.datalen; n++) {
22786 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
22787 *ret_conv_39_conv = ret_var.data[n];
22788 ret_arr_ptr[n] = tag_ptr(ret_conv_39_conv, true);
22791 FREE(ret_var.data);
22795 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) {
22796 LDKChannelMonitor this_arg_conv;
22797 this_arg_conv.inner = untag_ptr(this_arg);
22798 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22799 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22800 this_arg_conv.is_owned = false;
22801 unsigned char header_arr[80];
22802 CHECK(header->arr_len == 80);
22803 memcpy(header_arr, header->elems, 80); FREE(header);
22804 unsigned char (*header_ref)[80] = &header_arr;
22805 void* broadcaster_ptr = untag_ptr(broadcaster);
22806 CHECK_ACCESS(broadcaster_ptr);
22807 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
22808 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
22809 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
22810 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
22812 void* fee_estimator_ptr = untag_ptr(fee_estimator);
22813 CHECK_ACCESS(fee_estimator_ptr);
22814 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
22815 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
22816 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
22817 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
22819 void* logger_ptr = untag_ptr(logger);
22820 CHECK_ACCESS(logger_ptr);
22821 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
22822 if (logger_conv.free == LDKLogger_JCalls_free) {
22823 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
22824 LDKLogger_JCalls_cloned(&logger_conv);
22826 ChannelMonitor_block_disconnected(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv);
22829 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) {
22830 LDKChannelMonitor this_arg_conv;
22831 this_arg_conv.inner = untag_ptr(this_arg);
22832 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22833 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22834 this_arg_conv.is_owned = false;
22835 unsigned char header_arr[80];
22836 CHECK(header->arr_len == 80);
22837 memcpy(header_arr, header->elems, 80); FREE(header);
22838 unsigned char (*header_ref)[80] = &header_arr;
22839 LDKCVec_C2Tuple_usizeTransactionZZ txdata_constr;
22840 txdata_constr.datalen = txdata->arr_len;
22841 if (txdata_constr.datalen > 0)
22842 txdata_constr.data = MALLOC(txdata_constr.datalen * sizeof(LDKC2Tuple_usizeTransactionZ), "LDKCVec_C2Tuple_usizeTransactionZZ Elements");
22844 txdata_constr.data = NULL;
22845 uint64_t* txdata_vals = txdata->elems;
22846 for (size_t c = 0; c < txdata_constr.datalen; c++) {
22847 uint64_t txdata_conv_28 = txdata_vals[c];
22848 void* txdata_conv_28_ptr = untag_ptr(txdata_conv_28);
22849 CHECK_ACCESS(txdata_conv_28_ptr);
22850 LDKC2Tuple_usizeTransactionZ txdata_conv_28_conv = *(LDKC2Tuple_usizeTransactionZ*)(txdata_conv_28_ptr);
22851 txdata_conv_28_conv = C2Tuple_usizeTransactionZ_clone((LDKC2Tuple_usizeTransactionZ*)untag_ptr(txdata_conv_28));
22852 txdata_constr.data[c] = txdata_conv_28_conv;
22855 void* broadcaster_ptr = untag_ptr(broadcaster);
22856 CHECK_ACCESS(broadcaster_ptr);
22857 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
22858 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
22859 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
22860 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
22862 void* fee_estimator_ptr = untag_ptr(fee_estimator);
22863 CHECK_ACCESS(fee_estimator_ptr);
22864 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
22865 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
22866 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
22867 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
22869 void* logger_ptr = untag_ptr(logger);
22870 CHECK_ACCESS(logger_ptr);
22871 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
22872 if (logger_conv.free == LDKLogger_JCalls_free) {
22873 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
22874 LDKLogger_JCalls_cloned(&logger_conv);
22876 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);
22877 uint64_tArray ret_arr = NULL;
22878 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
22879 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
22880 for (size_t n = 0; n < ret_var.datalen; n++) {
22881 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
22882 *ret_conv_39_conv = ret_var.data[n];
22883 ret_arr_ptr[n] = tag_ptr(ret_conv_39_conv, true);
22886 FREE(ret_var.data);
22890 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) {
22891 LDKChannelMonitor this_arg_conv;
22892 this_arg_conv.inner = untag_ptr(this_arg);
22893 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22894 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22895 this_arg_conv.is_owned = false;
22896 unsigned char txid_arr[32];
22897 CHECK(txid->arr_len == 32);
22898 memcpy(txid_arr, txid->elems, 32); FREE(txid);
22899 unsigned char (*txid_ref)[32] = &txid_arr;
22900 void* broadcaster_ptr = untag_ptr(broadcaster);
22901 CHECK_ACCESS(broadcaster_ptr);
22902 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
22903 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
22904 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
22905 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
22907 void* fee_estimator_ptr = untag_ptr(fee_estimator);
22908 CHECK_ACCESS(fee_estimator_ptr);
22909 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
22910 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
22911 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
22912 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
22914 void* logger_ptr = untag_ptr(logger);
22915 CHECK_ACCESS(logger_ptr);
22916 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
22917 if (logger_conv.free == LDKLogger_JCalls_free) {
22918 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
22919 LDKLogger_JCalls_cloned(&logger_conv);
22921 ChannelMonitor_transaction_unconfirmed(&this_arg_conv, txid_ref, broadcaster_conv, fee_estimator_conv, logger_conv);
22924 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) {
22925 LDKChannelMonitor this_arg_conv;
22926 this_arg_conv.inner = untag_ptr(this_arg);
22927 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22928 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22929 this_arg_conv.is_owned = false;
22930 unsigned char header_arr[80];
22931 CHECK(header->arr_len == 80);
22932 memcpy(header_arr, header->elems, 80); FREE(header);
22933 unsigned char (*header_ref)[80] = &header_arr;
22934 void* broadcaster_ptr = untag_ptr(broadcaster);
22935 CHECK_ACCESS(broadcaster_ptr);
22936 LDKBroadcasterInterface broadcaster_conv = *(LDKBroadcasterInterface*)(broadcaster_ptr);
22937 if (broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
22938 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
22939 LDKBroadcasterInterface_JCalls_cloned(&broadcaster_conv);
22941 void* fee_estimator_ptr = untag_ptr(fee_estimator);
22942 CHECK_ACCESS(fee_estimator_ptr);
22943 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
22944 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
22945 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
22946 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
22948 void* logger_ptr = untag_ptr(logger);
22949 CHECK_ACCESS(logger_ptr);
22950 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
22951 if (logger_conv.free == LDKLogger_JCalls_free) {
22952 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
22953 LDKLogger_JCalls_cloned(&logger_conv);
22955 LDKCVec_C2Tuple_TxidCVec_C2Tuple_u32TxOutZZZZ ret_var = ChannelMonitor_best_block_updated(&this_arg_conv, header_ref, height, broadcaster_conv, fee_estimator_conv, logger_conv);
22956 uint64_tArray ret_arr = NULL;
22957 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
22958 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
22959 for (size_t n = 0; n < ret_var.datalen; n++) {
22960 LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ* ret_conv_39_conv = MALLOC(sizeof(LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ), "LDKC2Tuple_TxidCVec_C2Tuple_u32TxOutZZZ");
22961 *ret_conv_39_conv = ret_var.data[n];
22962 ret_arr_ptr[n] = tag_ptr(ret_conv_39_conv, true);
22965 FREE(ret_var.data);
22969 ptrArray __attribute__((export_name("TS_ChannelMonitor_get_relevant_txids"))) TS_ChannelMonitor_get_relevant_txids(uint64_t this_arg) {
22970 LDKChannelMonitor this_arg_conv;
22971 this_arg_conv.inner = untag_ptr(this_arg);
22972 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22973 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22974 this_arg_conv.is_owned = false;
22975 LDKCVec_TxidZ ret_var = ChannelMonitor_get_relevant_txids(&this_arg_conv);
22976 ptrArray ret_arr = NULL;
22977 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
22978 int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8);
22979 for (size_t m = 0; m < ret_var.datalen; m++) {
22980 int8_tArray ret_conv_12_arr = init_int8_tArray(32, __LINE__);
22981 memcpy(ret_conv_12_arr->elems, ret_var.data[m].data, 32);
22982 ret_arr_ptr[m] = ret_conv_12_arr;
22985 FREE(ret_var.data);
22989 uint64_t __attribute__((export_name("TS_ChannelMonitor_current_best_block"))) TS_ChannelMonitor_current_best_block(uint64_t this_arg) {
22990 LDKChannelMonitor this_arg_conv;
22991 this_arg_conv.inner = untag_ptr(this_arg);
22992 this_arg_conv.is_owned = ptr_is_owned(this_arg);
22993 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
22994 this_arg_conv.is_owned = false;
22995 LDKBestBlock ret_var = ChannelMonitor_current_best_block(&this_arg_conv);
22996 uint64_t ret_ref = 0;
22997 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
22998 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23002 uint64_tArray __attribute__((export_name("TS_ChannelMonitor_get_claimable_balances"))) TS_ChannelMonitor_get_claimable_balances(uint64_t this_arg) {
23003 LDKChannelMonitor this_arg_conv;
23004 this_arg_conv.inner = untag_ptr(this_arg);
23005 this_arg_conv.is_owned = ptr_is_owned(this_arg);
23006 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
23007 this_arg_conv.is_owned = false;
23008 LDKCVec_BalanceZ ret_var = ChannelMonitor_get_claimable_balances(&this_arg_conv);
23009 uint64_tArray ret_arr = NULL;
23010 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
23011 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
23012 for (size_t j = 0; j < ret_var.datalen; j++) {
23013 LDKBalance *ret_conv_9_copy = MALLOC(sizeof(LDKBalance), "LDKBalance");
23014 *ret_conv_9_copy = ret_var.data[j];
23015 uint64_t ret_conv_9_ref = tag_ptr(ret_conv_9_copy, true);
23016 ret_arr_ptr[j] = ret_conv_9_ref;
23019 FREE(ret_var.data);
23023 uint64_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelMonitorZ_read"))) TS_C2Tuple_BlockHashChannelMonitorZ_read(int8_tArray ser, uint64_t arg) {
23024 LDKu8slice ser_ref;
23025 ser_ref.datalen = ser->arr_len;
23026 ser_ref.data = ser->elems;
23027 void* arg_ptr = untag_ptr(arg);
23028 if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); }
23029 LDKKeysInterface* arg_conv = (LDKKeysInterface*)arg_ptr;
23030 LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelMonitorZDecodeErrorZ");
23031 *ret_conv = C2Tuple_BlockHashChannelMonitorZ_read(ser_ref, arg_conv);
23033 return tag_ptr(ret_conv, true);
23036 void __attribute__((export_name("TS_OutPoint_free"))) TS_OutPoint_free(uint64_t this_obj) {
23037 LDKOutPoint this_obj_conv;
23038 this_obj_conv.inner = untag_ptr(this_obj);
23039 this_obj_conv.is_owned = ptr_is_owned(this_obj);
23040 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
23041 OutPoint_free(this_obj_conv);
23044 int8_tArray __attribute__((export_name("TS_OutPoint_get_txid"))) TS_OutPoint_get_txid(uint64_t this_ptr) {
23045 LDKOutPoint this_ptr_conv;
23046 this_ptr_conv.inner = untag_ptr(this_ptr);
23047 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23048 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23049 this_ptr_conv.is_owned = false;
23050 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
23051 memcpy(ret_arr->elems, *OutPoint_get_txid(&this_ptr_conv), 32);
23055 void __attribute__((export_name("TS_OutPoint_set_txid"))) TS_OutPoint_set_txid(uint64_t this_ptr, int8_tArray val) {
23056 LDKOutPoint this_ptr_conv;
23057 this_ptr_conv.inner = untag_ptr(this_ptr);
23058 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23059 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23060 this_ptr_conv.is_owned = false;
23061 LDKThirtyTwoBytes val_ref;
23062 CHECK(val->arr_len == 32);
23063 memcpy(val_ref.data, val->elems, 32); FREE(val);
23064 OutPoint_set_txid(&this_ptr_conv, val_ref);
23067 int16_t __attribute__((export_name("TS_OutPoint_get_index"))) TS_OutPoint_get_index(uint64_t this_ptr) {
23068 LDKOutPoint this_ptr_conv;
23069 this_ptr_conv.inner = untag_ptr(this_ptr);
23070 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23071 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23072 this_ptr_conv.is_owned = false;
23073 int16_t ret_conv = OutPoint_get_index(&this_ptr_conv);
23077 void __attribute__((export_name("TS_OutPoint_set_index"))) TS_OutPoint_set_index(uint64_t this_ptr, int16_t val) {
23078 LDKOutPoint this_ptr_conv;
23079 this_ptr_conv.inner = untag_ptr(this_ptr);
23080 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23081 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23082 this_ptr_conv.is_owned = false;
23083 OutPoint_set_index(&this_ptr_conv, val);
23086 uint64_t __attribute__((export_name("TS_OutPoint_new"))) TS_OutPoint_new(int8_tArray txid_arg, int16_t index_arg) {
23087 LDKThirtyTwoBytes txid_arg_ref;
23088 CHECK(txid_arg->arr_len == 32);
23089 memcpy(txid_arg_ref.data, txid_arg->elems, 32); FREE(txid_arg);
23090 LDKOutPoint ret_var = OutPoint_new(txid_arg_ref, index_arg);
23091 uint64_t ret_ref = 0;
23092 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23093 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23097 static inline uint64_t OutPoint_clone_ptr(LDKOutPoint *NONNULL_PTR arg) {
23098 LDKOutPoint ret_var = OutPoint_clone(arg);
23099 uint64_t ret_ref = 0;
23100 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23101 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23104 int64_t __attribute__((export_name("TS_OutPoint_clone_ptr"))) TS_OutPoint_clone_ptr(uint64_t arg) {
23105 LDKOutPoint arg_conv;
23106 arg_conv.inner = untag_ptr(arg);
23107 arg_conv.is_owned = ptr_is_owned(arg);
23108 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
23109 arg_conv.is_owned = false;
23110 int64_t ret_conv = OutPoint_clone_ptr(&arg_conv);
23114 uint64_t __attribute__((export_name("TS_OutPoint_clone"))) TS_OutPoint_clone(uint64_t orig) {
23115 LDKOutPoint orig_conv;
23116 orig_conv.inner = untag_ptr(orig);
23117 orig_conv.is_owned = ptr_is_owned(orig);
23118 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
23119 orig_conv.is_owned = false;
23120 LDKOutPoint ret_var = OutPoint_clone(&orig_conv);
23121 uint64_t ret_ref = 0;
23122 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23123 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23127 jboolean __attribute__((export_name("TS_OutPoint_eq"))) TS_OutPoint_eq(uint64_t a, uint64_t b) {
23128 LDKOutPoint a_conv;
23129 a_conv.inner = untag_ptr(a);
23130 a_conv.is_owned = ptr_is_owned(a);
23131 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
23132 a_conv.is_owned = false;
23133 LDKOutPoint b_conv;
23134 b_conv.inner = untag_ptr(b);
23135 b_conv.is_owned = ptr_is_owned(b);
23136 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
23137 b_conv.is_owned = false;
23138 jboolean ret_conv = OutPoint_eq(&a_conv, &b_conv);
23142 int64_t __attribute__((export_name("TS_OutPoint_hash"))) TS_OutPoint_hash(uint64_t o) {
23143 LDKOutPoint o_conv;
23144 o_conv.inner = untag_ptr(o);
23145 o_conv.is_owned = ptr_is_owned(o);
23146 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
23147 o_conv.is_owned = false;
23148 int64_t ret_conv = OutPoint_hash(&o_conv);
23152 int8_tArray __attribute__((export_name("TS_OutPoint_to_channel_id"))) TS_OutPoint_to_channel_id(uint64_t this_arg) {
23153 LDKOutPoint this_arg_conv;
23154 this_arg_conv.inner = untag_ptr(this_arg);
23155 this_arg_conv.is_owned = ptr_is_owned(this_arg);
23156 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
23157 this_arg_conv.is_owned = false;
23158 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
23159 memcpy(ret_arr->elems, OutPoint_to_channel_id(&this_arg_conv).data, 32);
23163 int8_tArray __attribute__((export_name("TS_OutPoint_write"))) TS_OutPoint_write(uint64_t obj) {
23164 LDKOutPoint obj_conv;
23165 obj_conv.inner = untag_ptr(obj);
23166 obj_conv.is_owned = ptr_is_owned(obj);
23167 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
23168 obj_conv.is_owned = false;
23169 LDKCVec_u8Z ret_var = OutPoint_write(&obj_conv);
23170 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
23171 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
23172 CVec_u8Z_free(ret_var);
23176 uint64_t __attribute__((export_name("TS_OutPoint_read"))) TS_OutPoint_read(int8_tArray ser) {
23177 LDKu8slice ser_ref;
23178 ser_ref.datalen = ser->arr_len;
23179 ser_ref.data = ser->elems;
23180 LDKCResult_OutPointDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OutPointDecodeErrorZ), "LDKCResult_OutPointDecodeErrorZ");
23181 *ret_conv = OutPoint_read(ser_ref);
23183 return tag_ptr(ret_conv, true);
23186 void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_free"))) TS_DelayedPaymentOutputDescriptor_free(uint64_t this_obj) {
23187 LDKDelayedPaymentOutputDescriptor this_obj_conv;
23188 this_obj_conv.inner = untag_ptr(this_obj);
23189 this_obj_conv.is_owned = ptr_is_owned(this_obj);
23190 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
23191 DelayedPaymentOutputDescriptor_free(this_obj_conv);
23194 uint64_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_get_outpoint"))) TS_DelayedPaymentOutputDescriptor_get_outpoint(uint64_t this_ptr) {
23195 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
23196 this_ptr_conv.inner = untag_ptr(this_ptr);
23197 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23198 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23199 this_ptr_conv.is_owned = false;
23200 LDKOutPoint ret_var = DelayedPaymentOutputDescriptor_get_outpoint(&this_ptr_conv);
23201 uint64_t ret_ref = 0;
23202 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23203 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23207 void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_set_outpoint"))) TS_DelayedPaymentOutputDescriptor_set_outpoint(uint64_t this_ptr, uint64_t val) {
23208 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
23209 this_ptr_conv.inner = untag_ptr(this_ptr);
23210 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23211 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23212 this_ptr_conv.is_owned = false;
23213 LDKOutPoint val_conv;
23214 val_conv.inner = untag_ptr(val);
23215 val_conv.is_owned = ptr_is_owned(val);
23216 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
23217 val_conv = OutPoint_clone(&val_conv);
23218 DelayedPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv);
23221 int8_tArray __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_get_per_commitment_point"))) TS_DelayedPaymentOutputDescriptor_get_per_commitment_point(uint64_t this_ptr) {
23222 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
23223 this_ptr_conv.inner = untag_ptr(this_ptr);
23224 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23225 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23226 this_ptr_conv.is_owned = false;
23227 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
23228 memcpy(ret_arr->elems, DelayedPaymentOutputDescriptor_get_per_commitment_point(&this_ptr_conv).compressed_form, 33);
23232 void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_set_per_commitment_point"))) TS_DelayedPaymentOutputDescriptor_set_per_commitment_point(uint64_t this_ptr, int8_tArray val) {
23233 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
23234 this_ptr_conv.inner = untag_ptr(this_ptr);
23235 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23236 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23237 this_ptr_conv.is_owned = false;
23238 LDKPublicKey val_ref;
23239 CHECK(val->arr_len == 33);
23240 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
23241 DelayedPaymentOutputDescriptor_set_per_commitment_point(&this_ptr_conv, val_ref);
23244 int16_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_get_to_self_delay"))) TS_DelayedPaymentOutputDescriptor_get_to_self_delay(uint64_t this_ptr) {
23245 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
23246 this_ptr_conv.inner = untag_ptr(this_ptr);
23247 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23248 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23249 this_ptr_conv.is_owned = false;
23250 int16_t ret_conv = DelayedPaymentOutputDescriptor_get_to_self_delay(&this_ptr_conv);
23254 void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_set_to_self_delay"))) TS_DelayedPaymentOutputDescriptor_set_to_self_delay(uint64_t this_ptr, int16_t val) {
23255 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
23256 this_ptr_conv.inner = untag_ptr(this_ptr);
23257 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23258 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23259 this_ptr_conv.is_owned = false;
23260 DelayedPaymentOutputDescriptor_set_to_self_delay(&this_ptr_conv, val);
23263 uint64_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_get_output"))) TS_DelayedPaymentOutputDescriptor_get_output(uint64_t this_ptr) {
23264 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
23265 this_ptr_conv.inner = untag_ptr(this_ptr);
23266 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23267 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23268 this_ptr_conv.is_owned = false;
23269 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
23270 *ret_ref = DelayedPaymentOutputDescriptor_get_output(&this_ptr_conv);
23271 return tag_ptr(ret_ref, true);
23274 void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_set_output"))) TS_DelayedPaymentOutputDescriptor_set_output(uint64_t this_ptr, uint64_t val) {
23275 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
23276 this_ptr_conv.inner = untag_ptr(this_ptr);
23277 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23278 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23279 this_ptr_conv.is_owned = false;
23280 void* val_ptr = untag_ptr(val);
23281 CHECK_ACCESS(val_ptr);
23282 LDKTxOut val_conv = *(LDKTxOut*)(val_ptr);
23283 val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val));
23284 DelayedPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv);
23287 int8_tArray __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_get_revocation_pubkey"))) TS_DelayedPaymentOutputDescriptor_get_revocation_pubkey(uint64_t this_ptr) {
23288 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
23289 this_ptr_conv.inner = untag_ptr(this_ptr);
23290 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23291 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23292 this_ptr_conv.is_owned = false;
23293 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
23294 memcpy(ret_arr->elems, DelayedPaymentOutputDescriptor_get_revocation_pubkey(&this_ptr_conv).compressed_form, 33);
23298 void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_set_revocation_pubkey"))) TS_DelayedPaymentOutputDescriptor_set_revocation_pubkey(uint64_t this_ptr, int8_tArray val) {
23299 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
23300 this_ptr_conv.inner = untag_ptr(this_ptr);
23301 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23302 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23303 this_ptr_conv.is_owned = false;
23304 LDKPublicKey val_ref;
23305 CHECK(val->arr_len == 33);
23306 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
23307 DelayedPaymentOutputDescriptor_set_revocation_pubkey(&this_ptr_conv, val_ref);
23310 int8_tArray __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_get_channel_keys_id"))) TS_DelayedPaymentOutputDescriptor_get_channel_keys_id(uint64_t this_ptr) {
23311 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
23312 this_ptr_conv.inner = untag_ptr(this_ptr);
23313 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23314 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23315 this_ptr_conv.is_owned = false;
23316 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
23317 memcpy(ret_arr->elems, *DelayedPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv), 32);
23321 void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_set_channel_keys_id"))) TS_DelayedPaymentOutputDescriptor_set_channel_keys_id(uint64_t this_ptr, int8_tArray val) {
23322 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
23323 this_ptr_conv.inner = untag_ptr(this_ptr);
23324 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23325 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23326 this_ptr_conv.is_owned = false;
23327 LDKThirtyTwoBytes val_ref;
23328 CHECK(val->arr_len == 32);
23329 memcpy(val_ref.data, val->elems, 32); FREE(val);
23330 DelayedPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_ref);
23333 int64_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_get_channel_value_satoshis"))) TS_DelayedPaymentOutputDescriptor_get_channel_value_satoshis(uint64_t this_ptr) {
23334 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
23335 this_ptr_conv.inner = untag_ptr(this_ptr);
23336 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23337 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23338 this_ptr_conv.is_owned = false;
23339 int64_t ret_conv = DelayedPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv);
23343 void __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_set_channel_value_satoshis"))) TS_DelayedPaymentOutputDescriptor_set_channel_value_satoshis(uint64_t this_ptr, int64_t val) {
23344 LDKDelayedPaymentOutputDescriptor this_ptr_conv;
23345 this_ptr_conv.inner = untag_ptr(this_ptr);
23346 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23347 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23348 this_ptr_conv.is_owned = false;
23349 DelayedPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val);
23352 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) {
23353 LDKOutPoint outpoint_arg_conv;
23354 outpoint_arg_conv.inner = untag_ptr(outpoint_arg);
23355 outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg);
23356 CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv);
23357 outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv);
23358 LDKPublicKey per_commitment_point_arg_ref;
23359 CHECK(per_commitment_point_arg->arr_len == 33);
23360 memcpy(per_commitment_point_arg_ref.compressed_form, per_commitment_point_arg->elems, 33); FREE(per_commitment_point_arg);
23361 void* output_arg_ptr = untag_ptr(output_arg);
23362 CHECK_ACCESS(output_arg_ptr);
23363 LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr);
23364 output_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(output_arg));
23365 LDKPublicKey revocation_pubkey_arg_ref;
23366 CHECK(revocation_pubkey_arg->arr_len == 33);
23367 memcpy(revocation_pubkey_arg_ref.compressed_form, revocation_pubkey_arg->elems, 33); FREE(revocation_pubkey_arg);
23368 LDKThirtyTwoBytes channel_keys_id_arg_ref;
23369 CHECK(channel_keys_id_arg->arr_len == 32);
23370 memcpy(channel_keys_id_arg_ref.data, channel_keys_id_arg->elems, 32); FREE(channel_keys_id_arg);
23371 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);
23372 uint64_t ret_ref = 0;
23373 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23374 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23378 static inline uint64_t DelayedPaymentOutputDescriptor_clone_ptr(LDKDelayedPaymentOutputDescriptor *NONNULL_PTR arg) {
23379 LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(arg);
23380 uint64_t ret_ref = 0;
23381 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23382 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23385 int64_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_clone_ptr"))) TS_DelayedPaymentOutputDescriptor_clone_ptr(uint64_t arg) {
23386 LDKDelayedPaymentOutputDescriptor arg_conv;
23387 arg_conv.inner = untag_ptr(arg);
23388 arg_conv.is_owned = ptr_is_owned(arg);
23389 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
23390 arg_conv.is_owned = false;
23391 int64_t ret_conv = DelayedPaymentOutputDescriptor_clone_ptr(&arg_conv);
23395 uint64_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_clone"))) TS_DelayedPaymentOutputDescriptor_clone(uint64_t orig) {
23396 LDKDelayedPaymentOutputDescriptor orig_conv;
23397 orig_conv.inner = untag_ptr(orig);
23398 orig_conv.is_owned = ptr_is_owned(orig);
23399 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
23400 orig_conv.is_owned = false;
23401 LDKDelayedPaymentOutputDescriptor ret_var = DelayedPaymentOutputDescriptor_clone(&orig_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 int8_tArray __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_write"))) TS_DelayedPaymentOutputDescriptor_write(uint64_t obj) {
23409 LDKDelayedPaymentOutputDescriptor obj_conv;
23410 obj_conv.inner = untag_ptr(obj);
23411 obj_conv.is_owned = ptr_is_owned(obj);
23412 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
23413 obj_conv.is_owned = false;
23414 LDKCVec_u8Z ret_var = DelayedPaymentOutputDescriptor_write(&obj_conv);
23415 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
23416 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
23417 CVec_u8Z_free(ret_var);
23421 uint64_t __attribute__((export_name("TS_DelayedPaymentOutputDescriptor_read"))) TS_DelayedPaymentOutputDescriptor_read(int8_tArray ser) {
23422 LDKu8slice ser_ref;
23423 ser_ref.datalen = ser->arr_len;
23424 ser_ref.data = ser->elems;
23425 LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_DelayedPaymentOutputDescriptorDecodeErrorZ");
23426 *ret_conv = DelayedPaymentOutputDescriptor_read(ser_ref);
23428 return tag_ptr(ret_conv, true);
23431 void __attribute__((export_name("TS_StaticPaymentOutputDescriptor_free"))) TS_StaticPaymentOutputDescriptor_free(uint64_t this_obj) {
23432 LDKStaticPaymentOutputDescriptor this_obj_conv;
23433 this_obj_conv.inner = untag_ptr(this_obj);
23434 this_obj_conv.is_owned = ptr_is_owned(this_obj);
23435 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
23436 StaticPaymentOutputDescriptor_free(this_obj_conv);
23439 uint64_t __attribute__((export_name("TS_StaticPaymentOutputDescriptor_get_outpoint"))) TS_StaticPaymentOutputDescriptor_get_outpoint(uint64_t this_ptr) {
23440 LDKStaticPaymentOutputDescriptor this_ptr_conv;
23441 this_ptr_conv.inner = untag_ptr(this_ptr);
23442 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23443 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23444 this_ptr_conv.is_owned = false;
23445 LDKOutPoint ret_var = StaticPaymentOutputDescriptor_get_outpoint(&this_ptr_conv);
23446 uint64_t ret_ref = 0;
23447 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23448 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23452 void __attribute__((export_name("TS_StaticPaymentOutputDescriptor_set_outpoint"))) TS_StaticPaymentOutputDescriptor_set_outpoint(uint64_t this_ptr, uint64_t val) {
23453 LDKStaticPaymentOutputDescriptor this_ptr_conv;
23454 this_ptr_conv.inner = untag_ptr(this_ptr);
23455 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23456 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23457 this_ptr_conv.is_owned = false;
23458 LDKOutPoint val_conv;
23459 val_conv.inner = untag_ptr(val);
23460 val_conv.is_owned = ptr_is_owned(val);
23461 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
23462 val_conv = OutPoint_clone(&val_conv);
23463 StaticPaymentOutputDescriptor_set_outpoint(&this_ptr_conv, val_conv);
23466 uint64_t __attribute__((export_name("TS_StaticPaymentOutputDescriptor_get_output"))) TS_StaticPaymentOutputDescriptor_get_output(uint64_t this_ptr) {
23467 LDKStaticPaymentOutputDescriptor this_ptr_conv;
23468 this_ptr_conv.inner = untag_ptr(this_ptr);
23469 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23470 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23471 this_ptr_conv.is_owned = false;
23472 LDKTxOut* ret_ref = MALLOC(sizeof(LDKTxOut), "LDKTxOut");
23473 *ret_ref = StaticPaymentOutputDescriptor_get_output(&this_ptr_conv);
23474 return tag_ptr(ret_ref, true);
23477 void __attribute__((export_name("TS_StaticPaymentOutputDescriptor_set_output"))) TS_StaticPaymentOutputDescriptor_set_output(uint64_t this_ptr, uint64_t val) {
23478 LDKStaticPaymentOutputDescriptor this_ptr_conv;
23479 this_ptr_conv.inner = untag_ptr(this_ptr);
23480 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23481 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23482 this_ptr_conv.is_owned = false;
23483 void* val_ptr = untag_ptr(val);
23484 CHECK_ACCESS(val_ptr);
23485 LDKTxOut val_conv = *(LDKTxOut*)(val_ptr);
23486 val_conv = TxOut_clone((LDKTxOut*)untag_ptr(val));
23487 StaticPaymentOutputDescriptor_set_output(&this_ptr_conv, val_conv);
23490 int8_tArray __attribute__((export_name("TS_StaticPaymentOutputDescriptor_get_channel_keys_id"))) TS_StaticPaymentOutputDescriptor_get_channel_keys_id(uint64_t this_ptr) {
23491 LDKStaticPaymentOutputDescriptor this_ptr_conv;
23492 this_ptr_conv.inner = untag_ptr(this_ptr);
23493 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23494 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23495 this_ptr_conv.is_owned = false;
23496 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
23497 memcpy(ret_arr->elems, *StaticPaymentOutputDescriptor_get_channel_keys_id(&this_ptr_conv), 32);
23501 void __attribute__((export_name("TS_StaticPaymentOutputDescriptor_set_channel_keys_id"))) TS_StaticPaymentOutputDescriptor_set_channel_keys_id(uint64_t this_ptr, int8_tArray val) {
23502 LDKStaticPaymentOutputDescriptor this_ptr_conv;
23503 this_ptr_conv.inner = untag_ptr(this_ptr);
23504 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23505 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23506 this_ptr_conv.is_owned = false;
23507 LDKThirtyTwoBytes val_ref;
23508 CHECK(val->arr_len == 32);
23509 memcpy(val_ref.data, val->elems, 32); FREE(val);
23510 StaticPaymentOutputDescriptor_set_channel_keys_id(&this_ptr_conv, val_ref);
23513 int64_t __attribute__((export_name("TS_StaticPaymentOutputDescriptor_get_channel_value_satoshis"))) TS_StaticPaymentOutputDescriptor_get_channel_value_satoshis(uint64_t this_ptr) {
23514 LDKStaticPaymentOutputDescriptor this_ptr_conv;
23515 this_ptr_conv.inner = untag_ptr(this_ptr);
23516 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23517 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23518 this_ptr_conv.is_owned = false;
23519 int64_t ret_conv = StaticPaymentOutputDescriptor_get_channel_value_satoshis(&this_ptr_conv);
23523 void __attribute__((export_name("TS_StaticPaymentOutputDescriptor_set_channel_value_satoshis"))) TS_StaticPaymentOutputDescriptor_set_channel_value_satoshis(uint64_t this_ptr, int64_t val) {
23524 LDKStaticPaymentOutputDescriptor this_ptr_conv;
23525 this_ptr_conv.inner = untag_ptr(this_ptr);
23526 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23527 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23528 this_ptr_conv.is_owned = false;
23529 StaticPaymentOutputDescriptor_set_channel_value_satoshis(&this_ptr_conv, val);
23532 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) {
23533 LDKOutPoint outpoint_arg_conv;
23534 outpoint_arg_conv.inner = untag_ptr(outpoint_arg);
23535 outpoint_arg_conv.is_owned = ptr_is_owned(outpoint_arg);
23536 CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_arg_conv);
23537 outpoint_arg_conv = OutPoint_clone(&outpoint_arg_conv);
23538 void* output_arg_ptr = untag_ptr(output_arg);
23539 CHECK_ACCESS(output_arg_ptr);
23540 LDKTxOut output_arg_conv = *(LDKTxOut*)(output_arg_ptr);
23541 output_arg_conv = TxOut_clone((LDKTxOut*)untag_ptr(output_arg));
23542 LDKThirtyTwoBytes channel_keys_id_arg_ref;
23543 CHECK(channel_keys_id_arg->arr_len == 32);
23544 memcpy(channel_keys_id_arg_ref.data, channel_keys_id_arg->elems, 32); FREE(channel_keys_id_arg);
23545 LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_new(outpoint_arg_conv, output_arg_conv, channel_keys_id_arg_ref, channel_value_satoshis_arg);
23546 uint64_t ret_ref = 0;
23547 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23548 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23552 static inline uint64_t StaticPaymentOutputDescriptor_clone_ptr(LDKStaticPaymentOutputDescriptor *NONNULL_PTR arg) {
23553 LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(arg);
23554 uint64_t ret_ref = 0;
23555 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23556 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23559 int64_t __attribute__((export_name("TS_StaticPaymentOutputDescriptor_clone_ptr"))) TS_StaticPaymentOutputDescriptor_clone_ptr(uint64_t arg) {
23560 LDKStaticPaymentOutputDescriptor arg_conv;
23561 arg_conv.inner = untag_ptr(arg);
23562 arg_conv.is_owned = ptr_is_owned(arg);
23563 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
23564 arg_conv.is_owned = false;
23565 int64_t ret_conv = StaticPaymentOutputDescriptor_clone_ptr(&arg_conv);
23569 uint64_t __attribute__((export_name("TS_StaticPaymentOutputDescriptor_clone"))) TS_StaticPaymentOutputDescriptor_clone(uint64_t orig) {
23570 LDKStaticPaymentOutputDescriptor orig_conv;
23571 orig_conv.inner = untag_ptr(orig);
23572 orig_conv.is_owned = ptr_is_owned(orig);
23573 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
23574 orig_conv.is_owned = false;
23575 LDKStaticPaymentOutputDescriptor ret_var = StaticPaymentOutputDescriptor_clone(&orig_conv);
23576 uint64_t ret_ref = 0;
23577 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23578 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23582 int8_tArray __attribute__((export_name("TS_StaticPaymentOutputDescriptor_write"))) TS_StaticPaymentOutputDescriptor_write(uint64_t obj) {
23583 LDKStaticPaymentOutputDescriptor obj_conv;
23584 obj_conv.inner = untag_ptr(obj);
23585 obj_conv.is_owned = ptr_is_owned(obj);
23586 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
23587 obj_conv.is_owned = false;
23588 LDKCVec_u8Z ret_var = StaticPaymentOutputDescriptor_write(&obj_conv);
23589 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
23590 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
23591 CVec_u8Z_free(ret_var);
23595 uint64_t __attribute__((export_name("TS_StaticPaymentOutputDescriptor_read"))) TS_StaticPaymentOutputDescriptor_read(int8_tArray ser) {
23596 LDKu8slice ser_ref;
23597 ser_ref.datalen = ser->arr_len;
23598 ser_ref.data = ser->elems;
23599 LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ), "LDKCResult_StaticPaymentOutputDescriptorDecodeErrorZ");
23600 *ret_conv = StaticPaymentOutputDescriptor_read(ser_ref);
23602 return tag_ptr(ret_conv, true);
23605 void __attribute__((export_name("TS_SpendableOutputDescriptor_free"))) TS_SpendableOutputDescriptor_free(uint64_t this_ptr) {
23606 if (!ptr_is_owned(this_ptr)) return;
23607 void* this_ptr_ptr = untag_ptr(this_ptr);
23608 CHECK_ACCESS(this_ptr_ptr);
23609 LDKSpendableOutputDescriptor this_ptr_conv = *(LDKSpendableOutputDescriptor*)(this_ptr_ptr);
23610 FREE(untag_ptr(this_ptr));
23611 SpendableOutputDescriptor_free(this_ptr_conv);
23614 static inline uint64_t SpendableOutputDescriptor_clone_ptr(LDKSpendableOutputDescriptor *NONNULL_PTR arg) {
23615 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
23616 *ret_copy = SpendableOutputDescriptor_clone(arg);
23617 uint64_t ret_ref = tag_ptr(ret_copy, true);
23620 int64_t __attribute__((export_name("TS_SpendableOutputDescriptor_clone_ptr"))) TS_SpendableOutputDescriptor_clone_ptr(uint64_t arg) {
23621 LDKSpendableOutputDescriptor* arg_conv = (LDKSpendableOutputDescriptor*)untag_ptr(arg);
23622 int64_t ret_conv = SpendableOutputDescriptor_clone_ptr(arg_conv);
23626 uint64_t __attribute__((export_name("TS_SpendableOutputDescriptor_clone"))) TS_SpendableOutputDescriptor_clone(uint64_t orig) {
23627 LDKSpendableOutputDescriptor* orig_conv = (LDKSpendableOutputDescriptor*)untag_ptr(orig);
23628 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
23629 *ret_copy = SpendableOutputDescriptor_clone(orig_conv);
23630 uint64_t ret_ref = tag_ptr(ret_copy, true);
23634 uint64_t __attribute__((export_name("TS_SpendableOutputDescriptor_static_output"))) TS_SpendableOutputDescriptor_static_output(uint64_t outpoint, uint64_t output) {
23635 LDKOutPoint outpoint_conv;
23636 outpoint_conv.inner = untag_ptr(outpoint);
23637 outpoint_conv.is_owned = ptr_is_owned(outpoint);
23638 CHECK_INNER_FIELD_ACCESS_OR_NULL(outpoint_conv);
23639 outpoint_conv = OutPoint_clone(&outpoint_conv);
23640 void* output_ptr = untag_ptr(output);
23641 CHECK_ACCESS(output_ptr);
23642 LDKTxOut output_conv = *(LDKTxOut*)(output_ptr);
23643 output_conv = TxOut_clone((LDKTxOut*)untag_ptr(output));
23644 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
23645 *ret_copy = SpendableOutputDescriptor_static_output(outpoint_conv, output_conv);
23646 uint64_t ret_ref = tag_ptr(ret_copy, true);
23650 uint64_t __attribute__((export_name("TS_SpendableOutputDescriptor_delayed_payment_output"))) TS_SpendableOutputDescriptor_delayed_payment_output(uint64_t a) {
23651 LDKDelayedPaymentOutputDescriptor a_conv;
23652 a_conv.inner = untag_ptr(a);
23653 a_conv.is_owned = ptr_is_owned(a);
23654 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
23655 a_conv = DelayedPaymentOutputDescriptor_clone(&a_conv);
23656 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
23657 *ret_copy = SpendableOutputDescriptor_delayed_payment_output(a_conv);
23658 uint64_t ret_ref = tag_ptr(ret_copy, true);
23662 uint64_t __attribute__((export_name("TS_SpendableOutputDescriptor_static_payment_output"))) TS_SpendableOutputDescriptor_static_payment_output(uint64_t a) {
23663 LDKStaticPaymentOutputDescriptor a_conv;
23664 a_conv.inner = untag_ptr(a);
23665 a_conv.is_owned = ptr_is_owned(a);
23666 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
23667 a_conv = StaticPaymentOutputDescriptor_clone(&a_conv);
23668 LDKSpendableOutputDescriptor *ret_copy = MALLOC(sizeof(LDKSpendableOutputDescriptor), "LDKSpendableOutputDescriptor");
23669 *ret_copy = SpendableOutputDescriptor_static_payment_output(a_conv);
23670 uint64_t ret_ref = tag_ptr(ret_copy, true);
23674 int8_tArray __attribute__((export_name("TS_SpendableOutputDescriptor_write"))) TS_SpendableOutputDescriptor_write(uint64_t obj) {
23675 LDKSpendableOutputDescriptor* obj_conv = (LDKSpendableOutputDescriptor*)untag_ptr(obj);
23676 LDKCVec_u8Z ret_var = SpendableOutputDescriptor_write(obj_conv);
23677 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
23678 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
23679 CVec_u8Z_free(ret_var);
23683 uint64_t __attribute__((export_name("TS_SpendableOutputDescriptor_read"))) TS_SpendableOutputDescriptor_read(int8_tArray ser) {
23684 LDKu8slice ser_ref;
23685 ser_ref.datalen = ser->arr_len;
23686 ser_ref.data = ser->elems;
23687 LDKCResult_SpendableOutputDescriptorDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SpendableOutputDescriptorDecodeErrorZ), "LDKCResult_SpendableOutputDescriptorDecodeErrorZ");
23688 *ret_conv = SpendableOutputDescriptor_read(ser_ref);
23690 return tag_ptr(ret_conv, true);
23693 void __attribute__((export_name("TS_BaseSign_free"))) TS_BaseSign_free(uint64_t this_ptr) {
23694 if (!ptr_is_owned(this_ptr)) return;
23695 void* this_ptr_ptr = untag_ptr(this_ptr);
23696 CHECK_ACCESS(this_ptr_ptr);
23697 LDKBaseSign this_ptr_conv = *(LDKBaseSign*)(this_ptr_ptr);
23698 FREE(untag_ptr(this_ptr));
23699 BaseSign_free(this_ptr_conv);
23702 static inline uint64_t Sign_clone_ptr(LDKSign *NONNULL_PTR arg) {
23703 LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
23704 *ret_ret = Sign_clone(arg);
23705 return tag_ptr(ret_ret, true);
23707 int64_t __attribute__((export_name("TS_Sign_clone_ptr"))) TS_Sign_clone_ptr(uint64_t arg) {
23708 void* arg_ptr = untag_ptr(arg);
23709 if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); }
23710 LDKSign* arg_conv = (LDKSign*)arg_ptr;
23711 int64_t ret_conv = Sign_clone_ptr(arg_conv);
23715 uint64_t __attribute__((export_name("TS_Sign_clone"))) TS_Sign_clone(uint64_t orig) {
23716 void* orig_ptr = untag_ptr(orig);
23717 if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); }
23718 LDKSign* orig_conv = (LDKSign*)orig_ptr;
23719 LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
23720 *ret_ret = Sign_clone(orig_conv);
23721 return tag_ptr(ret_ret, true);
23724 void __attribute__((export_name("TS_Sign_free"))) TS_Sign_free(uint64_t this_ptr) {
23725 if (!ptr_is_owned(this_ptr)) return;
23726 void* this_ptr_ptr = untag_ptr(this_ptr);
23727 CHECK_ACCESS(this_ptr_ptr);
23728 LDKSign this_ptr_conv = *(LDKSign*)(this_ptr_ptr);
23729 FREE(untag_ptr(this_ptr));
23730 Sign_free(this_ptr_conv);
23733 uint32_t __attribute__((export_name("TS_Recipient_clone"))) TS_Recipient_clone(uint64_t orig) {
23734 LDKRecipient* orig_conv = (LDKRecipient*)untag_ptr(orig);
23735 uint32_t ret_conv = LDKRecipient_to_js(Recipient_clone(orig_conv));
23739 uint32_t __attribute__((export_name("TS_Recipient_node"))) TS_Recipient_node() {
23740 uint32_t ret_conv = LDKRecipient_to_js(Recipient_node());
23744 uint32_t __attribute__((export_name("TS_Recipient_phantom_node"))) TS_Recipient_phantom_node() {
23745 uint32_t ret_conv = LDKRecipient_to_js(Recipient_phantom_node());
23749 void __attribute__((export_name("TS_KeysInterface_free"))) TS_KeysInterface_free(uint64_t this_ptr) {
23750 if (!ptr_is_owned(this_ptr)) return;
23751 void* this_ptr_ptr = untag_ptr(this_ptr);
23752 CHECK_ACCESS(this_ptr_ptr);
23753 LDKKeysInterface this_ptr_conv = *(LDKKeysInterface*)(this_ptr_ptr);
23754 FREE(untag_ptr(this_ptr));
23755 KeysInterface_free(this_ptr_conv);
23758 void __attribute__((export_name("TS_InMemorySigner_free"))) TS_InMemorySigner_free(uint64_t this_obj) {
23759 LDKInMemorySigner this_obj_conv;
23760 this_obj_conv.inner = untag_ptr(this_obj);
23761 this_obj_conv.is_owned = ptr_is_owned(this_obj);
23762 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
23763 InMemorySigner_free(this_obj_conv);
23766 int8_tArray __attribute__((export_name("TS_InMemorySigner_get_funding_key"))) TS_InMemorySigner_get_funding_key(uint64_t this_ptr) {
23767 LDKInMemorySigner this_ptr_conv;
23768 this_ptr_conv.inner = untag_ptr(this_ptr);
23769 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23770 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23771 this_ptr_conv.is_owned = false;
23772 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
23773 memcpy(ret_arr->elems, *InMemorySigner_get_funding_key(&this_ptr_conv), 32);
23777 void __attribute__((export_name("TS_InMemorySigner_set_funding_key"))) TS_InMemorySigner_set_funding_key(uint64_t this_ptr, int8_tArray val) {
23778 LDKInMemorySigner this_ptr_conv;
23779 this_ptr_conv.inner = untag_ptr(this_ptr);
23780 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23781 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23782 this_ptr_conv.is_owned = false;
23783 LDKSecretKey val_ref;
23784 CHECK(val->arr_len == 32);
23785 memcpy(val_ref.bytes, val->elems, 32); FREE(val);
23786 InMemorySigner_set_funding_key(&this_ptr_conv, val_ref);
23789 int8_tArray __attribute__((export_name("TS_InMemorySigner_get_revocation_base_key"))) TS_InMemorySigner_get_revocation_base_key(uint64_t this_ptr) {
23790 LDKInMemorySigner this_ptr_conv;
23791 this_ptr_conv.inner = untag_ptr(this_ptr);
23792 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23793 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23794 this_ptr_conv.is_owned = false;
23795 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
23796 memcpy(ret_arr->elems, *InMemorySigner_get_revocation_base_key(&this_ptr_conv), 32);
23800 void __attribute__((export_name("TS_InMemorySigner_set_revocation_base_key"))) TS_InMemorySigner_set_revocation_base_key(uint64_t this_ptr, int8_tArray val) {
23801 LDKInMemorySigner this_ptr_conv;
23802 this_ptr_conv.inner = untag_ptr(this_ptr);
23803 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23804 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23805 this_ptr_conv.is_owned = false;
23806 LDKSecretKey val_ref;
23807 CHECK(val->arr_len == 32);
23808 memcpy(val_ref.bytes, val->elems, 32); FREE(val);
23809 InMemorySigner_set_revocation_base_key(&this_ptr_conv, val_ref);
23812 int8_tArray __attribute__((export_name("TS_InMemorySigner_get_payment_key"))) TS_InMemorySigner_get_payment_key(uint64_t this_ptr) {
23813 LDKInMemorySigner this_ptr_conv;
23814 this_ptr_conv.inner = untag_ptr(this_ptr);
23815 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23816 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23817 this_ptr_conv.is_owned = false;
23818 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
23819 memcpy(ret_arr->elems, *InMemorySigner_get_payment_key(&this_ptr_conv), 32);
23823 void __attribute__((export_name("TS_InMemorySigner_set_payment_key"))) TS_InMemorySigner_set_payment_key(uint64_t this_ptr, int8_tArray val) {
23824 LDKInMemorySigner this_ptr_conv;
23825 this_ptr_conv.inner = untag_ptr(this_ptr);
23826 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23827 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23828 this_ptr_conv.is_owned = false;
23829 LDKSecretKey val_ref;
23830 CHECK(val->arr_len == 32);
23831 memcpy(val_ref.bytes, val->elems, 32); FREE(val);
23832 InMemorySigner_set_payment_key(&this_ptr_conv, val_ref);
23835 int8_tArray __attribute__((export_name("TS_InMemorySigner_get_delayed_payment_base_key"))) TS_InMemorySigner_get_delayed_payment_base_key(uint64_t this_ptr) {
23836 LDKInMemorySigner this_ptr_conv;
23837 this_ptr_conv.inner = untag_ptr(this_ptr);
23838 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23839 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23840 this_ptr_conv.is_owned = false;
23841 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
23842 memcpy(ret_arr->elems, *InMemorySigner_get_delayed_payment_base_key(&this_ptr_conv), 32);
23846 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) {
23847 LDKInMemorySigner this_ptr_conv;
23848 this_ptr_conv.inner = untag_ptr(this_ptr);
23849 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23850 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23851 this_ptr_conv.is_owned = false;
23852 LDKSecretKey val_ref;
23853 CHECK(val->arr_len == 32);
23854 memcpy(val_ref.bytes, val->elems, 32); FREE(val);
23855 InMemorySigner_set_delayed_payment_base_key(&this_ptr_conv, val_ref);
23858 int8_tArray __attribute__((export_name("TS_InMemorySigner_get_htlc_base_key"))) TS_InMemorySigner_get_htlc_base_key(uint64_t this_ptr) {
23859 LDKInMemorySigner this_ptr_conv;
23860 this_ptr_conv.inner = untag_ptr(this_ptr);
23861 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23862 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23863 this_ptr_conv.is_owned = false;
23864 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
23865 memcpy(ret_arr->elems, *InMemorySigner_get_htlc_base_key(&this_ptr_conv), 32);
23869 void __attribute__((export_name("TS_InMemorySigner_set_htlc_base_key"))) TS_InMemorySigner_set_htlc_base_key(uint64_t this_ptr, int8_tArray val) {
23870 LDKInMemorySigner this_ptr_conv;
23871 this_ptr_conv.inner = untag_ptr(this_ptr);
23872 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23873 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23874 this_ptr_conv.is_owned = false;
23875 LDKSecretKey val_ref;
23876 CHECK(val->arr_len == 32);
23877 memcpy(val_ref.bytes, val->elems, 32); FREE(val);
23878 InMemorySigner_set_htlc_base_key(&this_ptr_conv, val_ref);
23881 int8_tArray __attribute__((export_name("TS_InMemorySigner_get_commitment_seed"))) TS_InMemorySigner_get_commitment_seed(uint64_t this_ptr) {
23882 LDKInMemorySigner this_ptr_conv;
23883 this_ptr_conv.inner = untag_ptr(this_ptr);
23884 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23885 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23886 this_ptr_conv.is_owned = false;
23887 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
23888 memcpy(ret_arr->elems, *InMemorySigner_get_commitment_seed(&this_ptr_conv), 32);
23892 void __attribute__((export_name("TS_InMemorySigner_set_commitment_seed"))) TS_InMemorySigner_set_commitment_seed(uint64_t this_ptr, int8_tArray val) {
23893 LDKInMemorySigner this_ptr_conv;
23894 this_ptr_conv.inner = untag_ptr(this_ptr);
23895 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
23896 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
23897 this_ptr_conv.is_owned = false;
23898 LDKThirtyTwoBytes val_ref;
23899 CHECK(val->arr_len == 32);
23900 memcpy(val_ref.data, val->elems, 32); FREE(val);
23901 InMemorySigner_set_commitment_seed(&this_ptr_conv, val_ref);
23904 static inline uint64_t InMemorySigner_clone_ptr(LDKInMemorySigner *NONNULL_PTR arg) {
23905 LDKInMemorySigner ret_var = InMemorySigner_clone(arg);
23906 uint64_t ret_ref = 0;
23907 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23908 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23911 int64_t __attribute__((export_name("TS_InMemorySigner_clone_ptr"))) TS_InMemorySigner_clone_ptr(uint64_t arg) {
23912 LDKInMemorySigner arg_conv;
23913 arg_conv.inner = untag_ptr(arg);
23914 arg_conv.is_owned = ptr_is_owned(arg);
23915 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
23916 arg_conv.is_owned = false;
23917 int64_t ret_conv = InMemorySigner_clone_ptr(&arg_conv);
23921 uint64_t __attribute__((export_name("TS_InMemorySigner_clone"))) TS_InMemorySigner_clone(uint64_t orig) {
23922 LDKInMemorySigner orig_conv;
23923 orig_conv.inner = untag_ptr(orig);
23924 orig_conv.is_owned = ptr_is_owned(orig);
23925 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
23926 orig_conv.is_owned = false;
23927 LDKInMemorySigner ret_var = InMemorySigner_clone(&orig_conv);
23928 uint64_t ret_ref = 0;
23929 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23930 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23934 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) {
23935 LDKSecretKey node_secret_ref;
23936 CHECK(node_secret->arr_len == 32);
23937 memcpy(node_secret_ref.bytes, node_secret->elems, 32); FREE(node_secret);
23938 LDKSecretKey funding_key_ref;
23939 CHECK(funding_key->arr_len == 32);
23940 memcpy(funding_key_ref.bytes, funding_key->elems, 32); FREE(funding_key);
23941 LDKSecretKey revocation_base_key_ref;
23942 CHECK(revocation_base_key->arr_len == 32);
23943 memcpy(revocation_base_key_ref.bytes, revocation_base_key->elems, 32); FREE(revocation_base_key);
23944 LDKSecretKey payment_key_ref;
23945 CHECK(payment_key->arr_len == 32);
23946 memcpy(payment_key_ref.bytes, payment_key->elems, 32); FREE(payment_key);
23947 LDKSecretKey delayed_payment_base_key_ref;
23948 CHECK(delayed_payment_base_key->arr_len == 32);
23949 memcpy(delayed_payment_base_key_ref.bytes, delayed_payment_base_key->elems, 32); FREE(delayed_payment_base_key);
23950 LDKSecretKey htlc_base_key_ref;
23951 CHECK(htlc_base_key->arr_len == 32);
23952 memcpy(htlc_base_key_ref.bytes, htlc_base_key->elems, 32); FREE(htlc_base_key);
23953 LDKThirtyTwoBytes commitment_seed_ref;
23954 CHECK(commitment_seed->arr_len == 32);
23955 memcpy(commitment_seed_ref.data, commitment_seed->elems, 32); FREE(commitment_seed);
23956 LDKThirtyTwoBytes channel_keys_id_ref;
23957 CHECK(channel_keys_id->arr_len == 32);
23958 memcpy(channel_keys_id_ref.data, channel_keys_id->elems, 32); FREE(channel_keys_id);
23959 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);
23960 uint64_t ret_ref = 0;
23961 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23962 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23966 uint64_t __attribute__((export_name("TS_InMemorySigner_counterparty_pubkeys"))) TS_InMemorySigner_counterparty_pubkeys(uint64_t this_arg) {
23967 LDKInMemorySigner this_arg_conv;
23968 this_arg_conv.inner = untag_ptr(this_arg);
23969 this_arg_conv.is_owned = ptr_is_owned(this_arg);
23970 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
23971 this_arg_conv.is_owned = false;
23972 LDKChannelPublicKeys ret_var = InMemorySigner_counterparty_pubkeys(&this_arg_conv);
23973 uint64_t ret_ref = 0;
23974 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
23975 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
23979 int16_t __attribute__((export_name("TS_InMemorySigner_counterparty_selected_contest_delay"))) TS_InMemorySigner_counterparty_selected_contest_delay(uint64_t this_arg) {
23980 LDKInMemorySigner this_arg_conv;
23981 this_arg_conv.inner = untag_ptr(this_arg);
23982 this_arg_conv.is_owned = ptr_is_owned(this_arg);
23983 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
23984 this_arg_conv.is_owned = false;
23985 int16_t ret_conv = InMemorySigner_counterparty_selected_contest_delay(&this_arg_conv);
23989 int16_t __attribute__((export_name("TS_InMemorySigner_holder_selected_contest_delay"))) TS_InMemorySigner_holder_selected_contest_delay(uint64_t this_arg) {
23990 LDKInMemorySigner this_arg_conv;
23991 this_arg_conv.inner = untag_ptr(this_arg);
23992 this_arg_conv.is_owned = ptr_is_owned(this_arg);
23993 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
23994 this_arg_conv.is_owned = false;
23995 int16_t ret_conv = InMemorySigner_holder_selected_contest_delay(&this_arg_conv);
23999 jboolean __attribute__((export_name("TS_InMemorySigner_is_outbound"))) TS_InMemorySigner_is_outbound(uint64_t this_arg) {
24000 LDKInMemorySigner this_arg_conv;
24001 this_arg_conv.inner = untag_ptr(this_arg);
24002 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24003 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24004 this_arg_conv.is_owned = false;
24005 jboolean ret_conv = InMemorySigner_is_outbound(&this_arg_conv);
24009 uint64_t __attribute__((export_name("TS_InMemorySigner_funding_outpoint"))) TS_InMemorySigner_funding_outpoint(uint64_t this_arg) {
24010 LDKInMemorySigner this_arg_conv;
24011 this_arg_conv.inner = untag_ptr(this_arg);
24012 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24013 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24014 this_arg_conv.is_owned = false;
24015 LDKOutPoint ret_var = InMemorySigner_funding_outpoint(&this_arg_conv);
24016 uint64_t ret_ref = 0;
24017 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24018 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24022 uint64_t __attribute__((export_name("TS_InMemorySigner_get_channel_parameters"))) TS_InMemorySigner_get_channel_parameters(uint64_t this_arg) {
24023 LDKInMemorySigner this_arg_conv;
24024 this_arg_conv.inner = untag_ptr(this_arg);
24025 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24026 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24027 this_arg_conv.is_owned = false;
24028 LDKChannelTransactionParameters ret_var = InMemorySigner_get_channel_parameters(&this_arg_conv);
24029 uint64_t ret_ref = 0;
24030 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24031 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24035 jboolean __attribute__((export_name("TS_InMemorySigner_opt_anchors"))) TS_InMemorySigner_opt_anchors(uint64_t this_arg) {
24036 LDKInMemorySigner this_arg_conv;
24037 this_arg_conv.inner = untag_ptr(this_arg);
24038 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24039 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24040 this_arg_conv.is_owned = false;
24041 jboolean ret_conv = InMemorySigner_opt_anchors(&this_arg_conv);
24045 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) {
24046 LDKInMemorySigner this_arg_conv;
24047 this_arg_conv.inner = untag_ptr(this_arg);
24048 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24049 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24050 this_arg_conv.is_owned = false;
24051 LDKTransaction spend_tx_ref;
24052 spend_tx_ref.datalen = spend_tx->arr_len;
24053 spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes");
24054 memcpy(spend_tx_ref.data, spend_tx->elems, spend_tx_ref.datalen); FREE(spend_tx);
24055 spend_tx_ref.data_is_owned = true;
24056 LDKStaticPaymentOutputDescriptor descriptor_conv;
24057 descriptor_conv.inner = untag_ptr(descriptor);
24058 descriptor_conv.is_owned = ptr_is_owned(descriptor);
24059 CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv);
24060 descriptor_conv.is_owned = false;
24061 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
24062 *ret_conv = InMemorySigner_sign_counterparty_payment_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv);
24063 return tag_ptr(ret_conv, true);
24066 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) {
24067 LDKInMemorySigner this_arg_conv;
24068 this_arg_conv.inner = untag_ptr(this_arg);
24069 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24070 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24071 this_arg_conv.is_owned = false;
24072 LDKTransaction spend_tx_ref;
24073 spend_tx_ref.datalen = spend_tx->arr_len;
24074 spend_tx_ref.data = MALLOC(spend_tx_ref.datalen, "LDKTransaction Bytes");
24075 memcpy(spend_tx_ref.data, spend_tx->elems, spend_tx_ref.datalen); FREE(spend_tx);
24076 spend_tx_ref.data_is_owned = true;
24077 LDKDelayedPaymentOutputDescriptor descriptor_conv;
24078 descriptor_conv.inner = untag_ptr(descriptor);
24079 descriptor_conv.is_owned = ptr_is_owned(descriptor);
24080 CHECK_INNER_FIELD_ACCESS_OR_NULL(descriptor_conv);
24081 descriptor_conv.is_owned = false;
24082 LDKCResult_CVec_CVec_u8ZZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_CVec_u8ZZNoneZ), "LDKCResult_CVec_CVec_u8ZZNoneZ");
24083 *ret_conv = InMemorySigner_sign_dynamic_p2wsh_input(&this_arg_conv, spend_tx_ref, input_idx, &descriptor_conv);
24084 return tag_ptr(ret_conv, true);
24087 uint64_t __attribute__((export_name("TS_InMemorySigner_as_BaseSign"))) TS_InMemorySigner_as_BaseSign(uint64_t this_arg) {
24088 LDKInMemorySigner this_arg_conv;
24089 this_arg_conv.inner = untag_ptr(this_arg);
24090 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24091 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24092 this_arg_conv.is_owned = false;
24093 LDKBaseSign* ret_ret = MALLOC(sizeof(LDKBaseSign), "LDKBaseSign");
24094 *ret_ret = InMemorySigner_as_BaseSign(&this_arg_conv);
24095 return tag_ptr(ret_ret, true);
24098 uint64_t __attribute__((export_name("TS_InMemorySigner_as_Sign"))) TS_InMemorySigner_as_Sign(uint64_t this_arg) {
24099 LDKInMemorySigner this_arg_conv;
24100 this_arg_conv.inner = untag_ptr(this_arg);
24101 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24102 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24103 this_arg_conv.is_owned = false;
24104 LDKSign* ret_ret = MALLOC(sizeof(LDKSign), "LDKSign");
24105 *ret_ret = InMemorySigner_as_Sign(&this_arg_conv);
24106 return tag_ptr(ret_ret, true);
24109 int8_tArray __attribute__((export_name("TS_InMemorySigner_write"))) TS_InMemorySigner_write(uint64_t obj) {
24110 LDKInMemorySigner obj_conv;
24111 obj_conv.inner = untag_ptr(obj);
24112 obj_conv.is_owned = ptr_is_owned(obj);
24113 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
24114 obj_conv.is_owned = false;
24115 LDKCVec_u8Z ret_var = InMemorySigner_write(&obj_conv);
24116 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
24117 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
24118 CVec_u8Z_free(ret_var);
24122 uint64_t __attribute__((export_name("TS_InMemorySigner_read"))) TS_InMemorySigner_read(int8_tArray ser, int8_tArray arg) {
24123 LDKu8slice ser_ref;
24124 ser_ref.datalen = ser->arr_len;
24125 ser_ref.data = ser->elems;
24126 LDKSecretKey arg_ref;
24127 CHECK(arg->arr_len == 32);
24128 memcpy(arg_ref.bytes, arg->elems, 32); FREE(arg);
24129 LDKCResult_InMemorySignerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InMemorySignerDecodeErrorZ), "LDKCResult_InMemorySignerDecodeErrorZ");
24130 *ret_conv = InMemorySigner_read(ser_ref, arg_ref);
24132 return tag_ptr(ret_conv, true);
24135 void __attribute__((export_name("TS_KeysManager_free"))) TS_KeysManager_free(uint64_t this_obj) {
24136 LDKKeysManager this_obj_conv;
24137 this_obj_conv.inner = untag_ptr(this_obj);
24138 this_obj_conv.is_owned = ptr_is_owned(this_obj);
24139 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
24140 KeysManager_free(this_obj_conv);
24143 uint64_t __attribute__((export_name("TS_KeysManager_new"))) TS_KeysManager_new(int8_tArray seed, int64_t starting_time_secs, int32_t starting_time_nanos) {
24144 unsigned char seed_arr[32];
24145 CHECK(seed->arr_len == 32);
24146 memcpy(seed_arr, seed->elems, 32); FREE(seed);
24147 unsigned char (*seed_ref)[32] = &seed_arr;
24148 LDKKeysManager ret_var = KeysManager_new(seed_ref, starting_time_secs, starting_time_nanos);
24149 uint64_t ret_ref = 0;
24150 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24151 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24155 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) {
24156 LDKKeysManager this_arg_conv;
24157 this_arg_conv.inner = untag_ptr(this_arg);
24158 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24159 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24160 this_arg_conv.is_owned = false;
24161 unsigned char params_arr[32];
24162 CHECK(params->arr_len == 32);
24163 memcpy(params_arr, params->elems, 32); FREE(params);
24164 unsigned char (*params_ref)[32] = ¶ms_arr;
24165 LDKInMemorySigner ret_var = KeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_ref);
24166 uint64_t ret_ref = 0;
24167 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24168 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24172 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) {
24173 LDKKeysManager this_arg_conv;
24174 this_arg_conv.inner = untag_ptr(this_arg);
24175 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24176 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24177 this_arg_conv.is_owned = false;
24178 LDKCVec_SpendableOutputDescriptorZ descriptors_constr;
24179 descriptors_constr.datalen = descriptors->arr_len;
24180 if (descriptors_constr.datalen > 0)
24181 descriptors_constr.data = MALLOC(descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
24183 descriptors_constr.data = NULL;
24184 uint64_t* descriptors_vals = descriptors->elems;
24185 for (size_t b = 0; b < descriptors_constr.datalen; b++) {
24186 uint64_t descriptors_conv_27 = descriptors_vals[b];
24187 void* descriptors_conv_27_ptr = untag_ptr(descriptors_conv_27);
24188 CHECK_ACCESS(descriptors_conv_27_ptr);
24189 LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(descriptors_conv_27_ptr);
24190 descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(descriptors_conv_27));
24191 descriptors_constr.data[b] = descriptors_conv_27_conv;
24194 LDKCVec_TxOutZ outputs_constr;
24195 outputs_constr.datalen = outputs->arr_len;
24196 if (outputs_constr.datalen > 0)
24197 outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements");
24199 outputs_constr.data = NULL;
24200 uint64_t* outputs_vals = outputs->elems;
24201 for (size_t h = 0; h < outputs_constr.datalen; h++) {
24202 uint64_t outputs_conv_7 = outputs_vals[h];
24203 void* outputs_conv_7_ptr = untag_ptr(outputs_conv_7);
24204 CHECK_ACCESS(outputs_conv_7_ptr);
24205 LDKTxOut outputs_conv_7_conv = *(LDKTxOut*)(outputs_conv_7_ptr);
24206 outputs_conv_7_conv = TxOut_clone((LDKTxOut*)untag_ptr(outputs_conv_7));
24207 outputs_constr.data[h] = outputs_conv_7_conv;
24210 LDKCVec_u8Z change_destination_script_ref;
24211 change_destination_script_ref.datalen = change_destination_script->arr_len;
24212 change_destination_script_ref.data = MALLOC(change_destination_script_ref.datalen, "LDKCVec_u8Z Bytes");
24213 memcpy(change_destination_script_ref.data, change_destination_script->elems, change_destination_script_ref.datalen); FREE(change_destination_script);
24214 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
24215 *ret_conv = KeysManager_spend_spendable_outputs(&this_arg_conv, descriptors_constr, outputs_constr, change_destination_script_ref, feerate_sat_per_1000_weight);
24216 return tag_ptr(ret_conv, true);
24219 uint64_t __attribute__((export_name("TS_KeysManager_as_KeysInterface"))) TS_KeysManager_as_KeysInterface(uint64_t this_arg) {
24220 LDKKeysManager this_arg_conv;
24221 this_arg_conv.inner = untag_ptr(this_arg);
24222 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24223 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24224 this_arg_conv.is_owned = false;
24225 LDKKeysInterface* ret_ret = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
24226 *ret_ret = KeysManager_as_KeysInterface(&this_arg_conv);
24227 return tag_ptr(ret_ret, true);
24230 void __attribute__((export_name("TS_PhantomKeysManager_free"))) TS_PhantomKeysManager_free(uint64_t this_obj) {
24231 LDKPhantomKeysManager this_obj_conv;
24232 this_obj_conv.inner = untag_ptr(this_obj);
24233 this_obj_conv.is_owned = ptr_is_owned(this_obj);
24234 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
24235 PhantomKeysManager_free(this_obj_conv);
24238 uint64_t __attribute__((export_name("TS_PhantomKeysManager_as_KeysInterface"))) TS_PhantomKeysManager_as_KeysInterface(uint64_t this_arg) {
24239 LDKPhantomKeysManager this_arg_conv;
24240 this_arg_conv.inner = untag_ptr(this_arg);
24241 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24242 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24243 this_arg_conv.is_owned = false;
24244 LDKKeysInterface* ret_ret = MALLOC(sizeof(LDKKeysInterface), "LDKKeysInterface");
24245 *ret_ret = PhantomKeysManager_as_KeysInterface(&this_arg_conv);
24246 return tag_ptr(ret_ret, true);
24249 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) {
24250 unsigned char seed_arr[32];
24251 CHECK(seed->arr_len == 32);
24252 memcpy(seed_arr, seed->elems, 32); FREE(seed);
24253 unsigned char (*seed_ref)[32] = &seed_arr;
24254 unsigned char cross_node_seed_arr[32];
24255 CHECK(cross_node_seed->arr_len == 32);
24256 memcpy(cross_node_seed_arr, cross_node_seed->elems, 32); FREE(cross_node_seed);
24257 unsigned char (*cross_node_seed_ref)[32] = &cross_node_seed_arr;
24258 LDKPhantomKeysManager ret_var = PhantomKeysManager_new(seed_ref, starting_time_secs, starting_time_nanos, cross_node_seed_ref);
24259 uint64_t ret_ref = 0;
24260 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24261 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24265 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) {
24266 LDKPhantomKeysManager this_arg_conv;
24267 this_arg_conv.inner = untag_ptr(this_arg);
24268 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24269 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24270 this_arg_conv.is_owned = false;
24271 LDKCVec_SpendableOutputDescriptorZ descriptors_constr;
24272 descriptors_constr.datalen = descriptors->arr_len;
24273 if (descriptors_constr.datalen > 0)
24274 descriptors_constr.data = MALLOC(descriptors_constr.datalen * sizeof(LDKSpendableOutputDescriptor), "LDKCVec_SpendableOutputDescriptorZ Elements");
24276 descriptors_constr.data = NULL;
24277 uint64_t* descriptors_vals = descriptors->elems;
24278 for (size_t b = 0; b < descriptors_constr.datalen; b++) {
24279 uint64_t descriptors_conv_27 = descriptors_vals[b];
24280 void* descriptors_conv_27_ptr = untag_ptr(descriptors_conv_27);
24281 CHECK_ACCESS(descriptors_conv_27_ptr);
24282 LDKSpendableOutputDescriptor descriptors_conv_27_conv = *(LDKSpendableOutputDescriptor*)(descriptors_conv_27_ptr);
24283 descriptors_conv_27_conv = SpendableOutputDescriptor_clone((LDKSpendableOutputDescriptor*)untag_ptr(descriptors_conv_27));
24284 descriptors_constr.data[b] = descriptors_conv_27_conv;
24287 LDKCVec_TxOutZ outputs_constr;
24288 outputs_constr.datalen = outputs->arr_len;
24289 if (outputs_constr.datalen > 0)
24290 outputs_constr.data = MALLOC(outputs_constr.datalen * sizeof(LDKTxOut), "LDKCVec_TxOutZ Elements");
24292 outputs_constr.data = NULL;
24293 uint64_t* outputs_vals = outputs->elems;
24294 for (size_t h = 0; h < outputs_constr.datalen; h++) {
24295 uint64_t outputs_conv_7 = outputs_vals[h];
24296 void* outputs_conv_7_ptr = untag_ptr(outputs_conv_7);
24297 CHECK_ACCESS(outputs_conv_7_ptr);
24298 LDKTxOut outputs_conv_7_conv = *(LDKTxOut*)(outputs_conv_7_ptr);
24299 outputs_conv_7_conv = TxOut_clone((LDKTxOut*)untag_ptr(outputs_conv_7));
24300 outputs_constr.data[h] = outputs_conv_7_conv;
24303 LDKCVec_u8Z change_destination_script_ref;
24304 change_destination_script_ref.datalen = change_destination_script->arr_len;
24305 change_destination_script_ref.data = MALLOC(change_destination_script_ref.datalen, "LDKCVec_u8Z Bytes");
24306 memcpy(change_destination_script_ref.data, change_destination_script->elems, change_destination_script_ref.datalen); FREE(change_destination_script);
24307 LDKCResult_TransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TransactionNoneZ), "LDKCResult_TransactionNoneZ");
24308 *ret_conv = PhantomKeysManager_spend_spendable_outputs(&this_arg_conv, descriptors_constr, outputs_constr, change_destination_script_ref, feerate_sat_per_1000_weight);
24309 return tag_ptr(ret_conv, true);
24312 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) {
24313 LDKPhantomKeysManager this_arg_conv;
24314 this_arg_conv.inner = untag_ptr(this_arg);
24315 this_arg_conv.is_owned = ptr_is_owned(this_arg);
24316 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
24317 this_arg_conv.is_owned = false;
24318 unsigned char params_arr[32];
24319 CHECK(params->arr_len == 32);
24320 memcpy(params_arr, params->elems, 32); FREE(params);
24321 unsigned char (*params_ref)[32] = ¶ms_arr;
24322 LDKInMemorySigner ret_var = PhantomKeysManager_derive_channel_keys(&this_arg_conv, channel_value_satoshis, params_ref);
24323 uint64_t ret_ref = 0;
24324 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24325 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24329 void __attribute__((export_name("TS_ChannelManager_free"))) TS_ChannelManager_free(uint64_t this_obj) {
24330 LDKChannelManager this_obj_conv;
24331 this_obj_conv.inner = untag_ptr(this_obj);
24332 this_obj_conv.is_owned = ptr_is_owned(this_obj);
24333 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
24334 ChannelManager_free(this_obj_conv);
24337 void __attribute__((export_name("TS_ChainParameters_free"))) TS_ChainParameters_free(uint64_t this_obj) {
24338 LDKChainParameters this_obj_conv;
24339 this_obj_conv.inner = untag_ptr(this_obj);
24340 this_obj_conv.is_owned = ptr_is_owned(this_obj);
24341 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
24342 ChainParameters_free(this_obj_conv);
24345 uint32_t __attribute__((export_name("TS_ChainParameters_get_network"))) TS_ChainParameters_get_network(uint64_t this_ptr) {
24346 LDKChainParameters this_ptr_conv;
24347 this_ptr_conv.inner = untag_ptr(this_ptr);
24348 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24349 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24350 this_ptr_conv.is_owned = false;
24351 uint32_t ret_conv = LDKNetwork_to_js(ChainParameters_get_network(&this_ptr_conv));
24355 void __attribute__((export_name("TS_ChainParameters_set_network"))) TS_ChainParameters_set_network(uint64_t this_ptr, uint32_t val) {
24356 LDKChainParameters this_ptr_conv;
24357 this_ptr_conv.inner = untag_ptr(this_ptr);
24358 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24359 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24360 this_ptr_conv.is_owned = false;
24361 LDKNetwork val_conv = LDKNetwork_from_js(val);
24362 ChainParameters_set_network(&this_ptr_conv, val_conv);
24365 uint64_t __attribute__((export_name("TS_ChainParameters_get_best_block"))) TS_ChainParameters_get_best_block(uint64_t this_ptr) {
24366 LDKChainParameters this_ptr_conv;
24367 this_ptr_conv.inner = untag_ptr(this_ptr);
24368 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24369 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24370 this_ptr_conv.is_owned = false;
24371 LDKBestBlock ret_var = ChainParameters_get_best_block(&this_ptr_conv);
24372 uint64_t ret_ref = 0;
24373 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24374 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24378 void __attribute__((export_name("TS_ChainParameters_set_best_block"))) TS_ChainParameters_set_best_block(uint64_t this_ptr, uint64_t val) {
24379 LDKChainParameters this_ptr_conv;
24380 this_ptr_conv.inner = untag_ptr(this_ptr);
24381 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24382 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24383 this_ptr_conv.is_owned = false;
24384 LDKBestBlock val_conv;
24385 val_conv.inner = untag_ptr(val);
24386 val_conv.is_owned = ptr_is_owned(val);
24387 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
24388 val_conv = BestBlock_clone(&val_conv);
24389 ChainParameters_set_best_block(&this_ptr_conv, val_conv);
24392 uint64_t __attribute__((export_name("TS_ChainParameters_new"))) TS_ChainParameters_new(uint32_t network_arg, uint64_t best_block_arg) {
24393 LDKNetwork network_arg_conv = LDKNetwork_from_js(network_arg);
24394 LDKBestBlock best_block_arg_conv;
24395 best_block_arg_conv.inner = untag_ptr(best_block_arg);
24396 best_block_arg_conv.is_owned = ptr_is_owned(best_block_arg);
24397 CHECK_INNER_FIELD_ACCESS_OR_NULL(best_block_arg_conv);
24398 best_block_arg_conv = BestBlock_clone(&best_block_arg_conv);
24399 LDKChainParameters ret_var = ChainParameters_new(network_arg_conv, best_block_arg_conv);
24400 uint64_t ret_ref = 0;
24401 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24402 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24406 static inline uint64_t ChainParameters_clone_ptr(LDKChainParameters *NONNULL_PTR arg) {
24407 LDKChainParameters ret_var = ChainParameters_clone(arg);
24408 uint64_t ret_ref = 0;
24409 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24410 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24413 int64_t __attribute__((export_name("TS_ChainParameters_clone_ptr"))) TS_ChainParameters_clone_ptr(uint64_t arg) {
24414 LDKChainParameters arg_conv;
24415 arg_conv.inner = untag_ptr(arg);
24416 arg_conv.is_owned = ptr_is_owned(arg);
24417 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
24418 arg_conv.is_owned = false;
24419 int64_t ret_conv = ChainParameters_clone_ptr(&arg_conv);
24423 uint64_t __attribute__((export_name("TS_ChainParameters_clone"))) TS_ChainParameters_clone(uint64_t orig) {
24424 LDKChainParameters orig_conv;
24425 orig_conv.inner = untag_ptr(orig);
24426 orig_conv.is_owned = ptr_is_owned(orig);
24427 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
24428 orig_conv.is_owned = false;
24429 LDKChainParameters ret_var = ChainParameters_clone(&orig_conv);
24430 uint64_t ret_ref = 0;
24431 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24432 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24436 void __attribute__((export_name("TS_CounterpartyForwardingInfo_free"))) TS_CounterpartyForwardingInfo_free(uint64_t this_obj) {
24437 LDKCounterpartyForwardingInfo this_obj_conv;
24438 this_obj_conv.inner = untag_ptr(this_obj);
24439 this_obj_conv.is_owned = ptr_is_owned(this_obj);
24440 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
24441 CounterpartyForwardingInfo_free(this_obj_conv);
24444 int32_t __attribute__((export_name("TS_CounterpartyForwardingInfo_get_fee_base_msat"))) TS_CounterpartyForwardingInfo_get_fee_base_msat(uint64_t this_ptr) {
24445 LDKCounterpartyForwardingInfo this_ptr_conv;
24446 this_ptr_conv.inner = untag_ptr(this_ptr);
24447 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24448 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24449 this_ptr_conv.is_owned = false;
24450 int32_t ret_conv = CounterpartyForwardingInfo_get_fee_base_msat(&this_ptr_conv);
24454 void __attribute__((export_name("TS_CounterpartyForwardingInfo_set_fee_base_msat"))) TS_CounterpartyForwardingInfo_set_fee_base_msat(uint64_t this_ptr, int32_t val) {
24455 LDKCounterpartyForwardingInfo this_ptr_conv;
24456 this_ptr_conv.inner = untag_ptr(this_ptr);
24457 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24458 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24459 this_ptr_conv.is_owned = false;
24460 CounterpartyForwardingInfo_set_fee_base_msat(&this_ptr_conv, val);
24463 int32_t __attribute__((export_name("TS_CounterpartyForwardingInfo_get_fee_proportional_millionths"))) TS_CounterpartyForwardingInfo_get_fee_proportional_millionths(uint64_t this_ptr) {
24464 LDKCounterpartyForwardingInfo this_ptr_conv;
24465 this_ptr_conv.inner = untag_ptr(this_ptr);
24466 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24467 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24468 this_ptr_conv.is_owned = false;
24469 int32_t ret_conv = CounterpartyForwardingInfo_get_fee_proportional_millionths(&this_ptr_conv);
24473 void __attribute__((export_name("TS_CounterpartyForwardingInfo_set_fee_proportional_millionths"))) TS_CounterpartyForwardingInfo_set_fee_proportional_millionths(uint64_t this_ptr, int32_t val) {
24474 LDKCounterpartyForwardingInfo this_ptr_conv;
24475 this_ptr_conv.inner = untag_ptr(this_ptr);
24476 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24477 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24478 this_ptr_conv.is_owned = false;
24479 CounterpartyForwardingInfo_set_fee_proportional_millionths(&this_ptr_conv, val);
24482 int16_t __attribute__((export_name("TS_CounterpartyForwardingInfo_get_cltv_expiry_delta"))) TS_CounterpartyForwardingInfo_get_cltv_expiry_delta(uint64_t this_ptr) {
24483 LDKCounterpartyForwardingInfo this_ptr_conv;
24484 this_ptr_conv.inner = untag_ptr(this_ptr);
24485 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24486 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24487 this_ptr_conv.is_owned = false;
24488 int16_t ret_conv = CounterpartyForwardingInfo_get_cltv_expiry_delta(&this_ptr_conv);
24492 void __attribute__((export_name("TS_CounterpartyForwardingInfo_set_cltv_expiry_delta"))) TS_CounterpartyForwardingInfo_set_cltv_expiry_delta(uint64_t this_ptr, int16_t val) {
24493 LDKCounterpartyForwardingInfo this_ptr_conv;
24494 this_ptr_conv.inner = untag_ptr(this_ptr);
24495 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24496 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24497 this_ptr_conv.is_owned = false;
24498 CounterpartyForwardingInfo_set_cltv_expiry_delta(&this_ptr_conv, val);
24501 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) {
24502 LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_new(fee_base_msat_arg, fee_proportional_millionths_arg, cltv_expiry_delta_arg);
24503 uint64_t ret_ref = 0;
24504 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24505 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24509 static inline uint64_t CounterpartyForwardingInfo_clone_ptr(LDKCounterpartyForwardingInfo *NONNULL_PTR arg) {
24510 LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(arg);
24511 uint64_t ret_ref = 0;
24512 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24513 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24516 int64_t __attribute__((export_name("TS_CounterpartyForwardingInfo_clone_ptr"))) TS_CounterpartyForwardingInfo_clone_ptr(uint64_t arg) {
24517 LDKCounterpartyForwardingInfo arg_conv;
24518 arg_conv.inner = untag_ptr(arg);
24519 arg_conv.is_owned = ptr_is_owned(arg);
24520 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
24521 arg_conv.is_owned = false;
24522 int64_t ret_conv = CounterpartyForwardingInfo_clone_ptr(&arg_conv);
24526 uint64_t __attribute__((export_name("TS_CounterpartyForwardingInfo_clone"))) TS_CounterpartyForwardingInfo_clone(uint64_t orig) {
24527 LDKCounterpartyForwardingInfo orig_conv;
24528 orig_conv.inner = untag_ptr(orig);
24529 orig_conv.is_owned = ptr_is_owned(orig);
24530 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
24531 orig_conv.is_owned = false;
24532 LDKCounterpartyForwardingInfo ret_var = CounterpartyForwardingInfo_clone(&orig_conv);
24533 uint64_t ret_ref = 0;
24534 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24535 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24539 void __attribute__((export_name("TS_ChannelCounterparty_free"))) TS_ChannelCounterparty_free(uint64_t this_obj) {
24540 LDKChannelCounterparty this_obj_conv;
24541 this_obj_conv.inner = untag_ptr(this_obj);
24542 this_obj_conv.is_owned = ptr_is_owned(this_obj);
24543 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
24544 ChannelCounterparty_free(this_obj_conv);
24547 int8_tArray __attribute__((export_name("TS_ChannelCounterparty_get_node_id"))) TS_ChannelCounterparty_get_node_id(uint64_t this_ptr) {
24548 LDKChannelCounterparty this_ptr_conv;
24549 this_ptr_conv.inner = untag_ptr(this_ptr);
24550 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24551 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24552 this_ptr_conv.is_owned = false;
24553 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
24554 memcpy(ret_arr->elems, ChannelCounterparty_get_node_id(&this_ptr_conv).compressed_form, 33);
24558 void __attribute__((export_name("TS_ChannelCounterparty_set_node_id"))) TS_ChannelCounterparty_set_node_id(uint64_t this_ptr, int8_tArray val) {
24559 LDKChannelCounterparty this_ptr_conv;
24560 this_ptr_conv.inner = untag_ptr(this_ptr);
24561 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24562 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24563 this_ptr_conv.is_owned = false;
24564 LDKPublicKey val_ref;
24565 CHECK(val->arr_len == 33);
24566 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
24567 ChannelCounterparty_set_node_id(&this_ptr_conv, val_ref);
24570 uint64_t __attribute__((export_name("TS_ChannelCounterparty_get_features"))) TS_ChannelCounterparty_get_features(uint64_t this_ptr) {
24571 LDKChannelCounterparty this_ptr_conv;
24572 this_ptr_conv.inner = untag_ptr(this_ptr);
24573 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24574 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24575 this_ptr_conv.is_owned = false;
24576 LDKInitFeatures ret_var = ChannelCounterparty_get_features(&this_ptr_conv);
24577 uint64_t ret_ref = 0;
24578 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24579 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24583 void __attribute__((export_name("TS_ChannelCounterparty_set_features"))) TS_ChannelCounterparty_set_features(uint64_t this_ptr, uint64_t val) {
24584 LDKChannelCounterparty this_ptr_conv;
24585 this_ptr_conv.inner = untag_ptr(this_ptr);
24586 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24587 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24588 this_ptr_conv.is_owned = false;
24589 LDKInitFeatures val_conv;
24590 val_conv.inner = untag_ptr(val);
24591 val_conv.is_owned = ptr_is_owned(val);
24592 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
24593 val_conv = InitFeatures_clone(&val_conv);
24594 ChannelCounterparty_set_features(&this_ptr_conv, val_conv);
24597 int64_t __attribute__((export_name("TS_ChannelCounterparty_get_unspendable_punishment_reserve"))) TS_ChannelCounterparty_get_unspendable_punishment_reserve(uint64_t this_ptr) {
24598 LDKChannelCounterparty this_ptr_conv;
24599 this_ptr_conv.inner = untag_ptr(this_ptr);
24600 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24601 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24602 this_ptr_conv.is_owned = false;
24603 int64_t ret_conv = ChannelCounterparty_get_unspendable_punishment_reserve(&this_ptr_conv);
24607 void __attribute__((export_name("TS_ChannelCounterparty_set_unspendable_punishment_reserve"))) TS_ChannelCounterparty_set_unspendable_punishment_reserve(uint64_t this_ptr, int64_t val) {
24608 LDKChannelCounterparty this_ptr_conv;
24609 this_ptr_conv.inner = untag_ptr(this_ptr);
24610 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24611 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24612 this_ptr_conv.is_owned = false;
24613 ChannelCounterparty_set_unspendable_punishment_reserve(&this_ptr_conv, val);
24616 uint64_t __attribute__((export_name("TS_ChannelCounterparty_get_forwarding_info"))) TS_ChannelCounterparty_get_forwarding_info(uint64_t this_ptr) {
24617 LDKChannelCounterparty this_ptr_conv;
24618 this_ptr_conv.inner = untag_ptr(this_ptr);
24619 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24620 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24621 this_ptr_conv.is_owned = false;
24622 LDKCounterpartyForwardingInfo ret_var = ChannelCounterparty_get_forwarding_info(&this_ptr_conv);
24623 uint64_t ret_ref = 0;
24624 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24625 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24629 void __attribute__((export_name("TS_ChannelCounterparty_set_forwarding_info"))) TS_ChannelCounterparty_set_forwarding_info(uint64_t this_ptr, uint64_t val) {
24630 LDKChannelCounterparty this_ptr_conv;
24631 this_ptr_conv.inner = untag_ptr(this_ptr);
24632 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24633 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24634 this_ptr_conv.is_owned = false;
24635 LDKCounterpartyForwardingInfo val_conv;
24636 val_conv.inner = untag_ptr(val);
24637 val_conv.is_owned = ptr_is_owned(val);
24638 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
24639 val_conv = CounterpartyForwardingInfo_clone(&val_conv);
24640 ChannelCounterparty_set_forwarding_info(&this_ptr_conv, val_conv);
24643 uint64_t __attribute__((export_name("TS_ChannelCounterparty_get_outbound_htlc_minimum_msat"))) TS_ChannelCounterparty_get_outbound_htlc_minimum_msat(uint64_t this_ptr) {
24644 LDKChannelCounterparty this_ptr_conv;
24645 this_ptr_conv.inner = untag_ptr(this_ptr);
24646 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24647 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24648 this_ptr_conv.is_owned = false;
24649 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
24650 *ret_copy = ChannelCounterparty_get_outbound_htlc_minimum_msat(&this_ptr_conv);
24651 uint64_t ret_ref = tag_ptr(ret_copy, true);
24655 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) {
24656 LDKChannelCounterparty 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 void* val_ptr = untag_ptr(val);
24662 CHECK_ACCESS(val_ptr);
24663 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
24664 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
24665 ChannelCounterparty_set_outbound_htlc_minimum_msat(&this_ptr_conv, val_conv);
24668 uint64_t __attribute__((export_name("TS_ChannelCounterparty_get_outbound_htlc_maximum_msat"))) TS_ChannelCounterparty_get_outbound_htlc_maximum_msat(uint64_t this_ptr) {
24669 LDKChannelCounterparty this_ptr_conv;
24670 this_ptr_conv.inner = untag_ptr(this_ptr);
24671 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24672 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24673 this_ptr_conv.is_owned = false;
24674 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
24675 *ret_copy = ChannelCounterparty_get_outbound_htlc_maximum_msat(&this_ptr_conv);
24676 uint64_t ret_ref = tag_ptr(ret_copy, true);
24680 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) {
24681 LDKChannelCounterparty this_ptr_conv;
24682 this_ptr_conv.inner = untag_ptr(this_ptr);
24683 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24684 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24685 this_ptr_conv.is_owned = false;
24686 void* val_ptr = untag_ptr(val);
24687 CHECK_ACCESS(val_ptr);
24688 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
24689 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
24690 ChannelCounterparty_set_outbound_htlc_maximum_msat(&this_ptr_conv, val_conv);
24693 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) {
24694 LDKPublicKey node_id_arg_ref;
24695 CHECK(node_id_arg->arr_len == 33);
24696 memcpy(node_id_arg_ref.compressed_form, node_id_arg->elems, 33); FREE(node_id_arg);
24697 LDKInitFeatures features_arg_conv;
24698 features_arg_conv.inner = untag_ptr(features_arg);
24699 features_arg_conv.is_owned = ptr_is_owned(features_arg);
24700 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv);
24701 features_arg_conv = InitFeatures_clone(&features_arg_conv);
24702 LDKCounterpartyForwardingInfo forwarding_info_arg_conv;
24703 forwarding_info_arg_conv.inner = untag_ptr(forwarding_info_arg);
24704 forwarding_info_arg_conv.is_owned = ptr_is_owned(forwarding_info_arg);
24705 CHECK_INNER_FIELD_ACCESS_OR_NULL(forwarding_info_arg_conv);
24706 forwarding_info_arg_conv = CounterpartyForwardingInfo_clone(&forwarding_info_arg_conv);
24707 void* outbound_htlc_minimum_msat_arg_ptr = untag_ptr(outbound_htlc_minimum_msat_arg);
24708 CHECK_ACCESS(outbound_htlc_minimum_msat_arg_ptr);
24709 LDKCOption_u64Z outbound_htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(outbound_htlc_minimum_msat_arg_ptr);
24710 outbound_htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_htlc_minimum_msat_arg));
24711 void* outbound_htlc_maximum_msat_arg_ptr = untag_ptr(outbound_htlc_maximum_msat_arg);
24712 CHECK_ACCESS(outbound_htlc_maximum_msat_arg_ptr);
24713 LDKCOption_u64Z outbound_htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(outbound_htlc_maximum_msat_arg_ptr);
24714 outbound_htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_htlc_maximum_msat_arg));
24715 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);
24716 uint64_t ret_ref = 0;
24717 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24718 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24722 static inline uint64_t ChannelCounterparty_clone_ptr(LDKChannelCounterparty *NONNULL_PTR arg) {
24723 LDKChannelCounterparty ret_var = ChannelCounterparty_clone(arg);
24724 uint64_t ret_ref = 0;
24725 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24726 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24729 int64_t __attribute__((export_name("TS_ChannelCounterparty_clone_ptr"))) TS_ChannelCounterparty_clone_ptr(uint64_t arg) {
24730 LDKChannelCounterparty arg_conv;
24731 arg_conv.inner = untag_ptr(arg);
24732 arg_conv.is_owned = ptr_is_owned(arg);
24733 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
24734 arg_conv.is_owned = false;
24735 int64_t ret_conv = ChannelCounterparty_clone_ptr(&arg_conv);
24739 uint64_t __attribute__((export_name("TS_ChannelCounterparty_clone"))) TS_ChannelCounterparty_clone(uint64_t orig) {
24740 LDKChannelCounterparty orig_conv;
24741 orig_conv.inner = untag_ptr(orig);
24742 orig_conv.is_owned = ptr_is_owned(orig);
24743 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
24744 orig_conv.is_owned = false;
24745 LDKChannelCounterparty ret_var = ChannelCounterparty_clone(&orig_conv);
24746 uint64_t ret_ref = 0;
24747 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24748 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24752 void __attribute__((export_name("TS_ChannelDetails_free"))) TS_ChannelDetails_free(uint64_t this_obj) {
24753 LDKChannelDetails this_obj_conv;
24754 this_obj_conv.inner = untag_ptr(this_obj);
24755 this_obj_conv.is_owned = ptr_is_owned(this_obj);
24756 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
24757 ChannelDetails_free(this_obj_conv);
24760 int8_tArray __attribute__((export_name("TS_ChannelDetails_get_channel_id"))) TS_ChannelDetails_get_channel_id(uint64_t this_ptr) {
24761 LDKChannelDetails this_ptr_conv;
24762 this_ptr_conv.inner = untag_ptr(this_ptr);
24763 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24764 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24765 this_ptr_conv.is_owned = false;
24766 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
24767 memcpy(ret_arr->elems, *ChannelDetails_get_channel_id(&this_ptr_conv), 32);
24771 void __attribute__((export_name("TS_ChannelDetails_set_channel_id"))) TS_ChannelDetails_set_channel_id(uint64_t this_ptr, int8_tArray val) {
24772 LDKChannelDetails 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 LDKThirtyTwoBytes val_ref;
24778 CHECK(val->arr_len == 32);
24779 memcpy(val_ref.data, val->elems, 32); FREE(val);
24780 ChannelDetails_set_channel_id(&this_ptr_conv, val_ref);
24783 uint64_t __attribute__((export_name("TS_ChannelDetails_get_counterparty"))) TS_ChannelDetails_get_counterparty(uint64_t this_ptr) {
24784 LDKChannelDetails this_ptr_conv;
24785 this_ptr_conv.inner = untag_ptr(this_ptr);
24786 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24787 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24788 this_ptr_conv.is_owned = false;
24789 LDKChannelCounterparty ret_var = ChannelDetails_get_counterparty(&this_ptr_conv);
24790 uint64_t ret_ref = 0;
24791 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24792 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24796 void __attribute__((export_name("TS_ChannelDetails_set_counterparty"))) TS_ChannelDetails_set_counterparty(uint64_t this_ptr, uint64_t val) {
24797 LDKChannelDetails this_ptr_conv;
24798 this_ptr_conv.inner = untag_ptr(this_ptr);
24799 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24800 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24801 this_ptr_conv.is_owned = false;
24802 LDKChannelCounterparty val_conv;
24803 val_conv.inner = untag_ptr(val);
24804 val_conv.is_owned = ptr_is_owned(val);
24805 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
24806 val_conv = ChannelCounterparty_clone(&val_conv);
24807 ChannelDetails_set_counterparty(&this_ptr_conv, val_conv);
24810 uint64_t __attribute__((export_name("TS_ChannelDetails_get_funding_txo"))) TS_ChannelDetails_get_funding_txo(uint64_t this_ptr) {
24811 LDKChannelDetails this_ptr_conv;
24812 this_ptr_conv.inner = untag_ptr(this_ptr);
24813 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24814 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24815 this_ptr_conv.is_owned = false;
24816 LDKOutPoint ret_var = ChannelDetails_get_funding_txo(&this_ptr_conv);
24817 uint64_t ret_ref = 0;
24818 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24819 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24823 void __attribute__((export_name("TS_ChannelDetails_set_funding_txo"))) TS_ChannelDetails_set_funding_txo(uint64_t this_ptr, uint64_t val) {
24824 LDKChannelDetails this_ptr_conv;
24825 this_ptr_conv.inner = untag_ptr(this_ptr);
24826 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24827 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24828 this_ptr_conv.is_owned = false;
24829 LDKOutPoint val_conv;
24830 val_conv.inner = untag_ptr(val);
24831 val_conv.is_owned = ptr_is_owned(val);
24832 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
24833 val_conv = OutPoint_clone(&val_conv);
24834 ChannelDetails_set_funding_txo(&this_ptr_conv, val_conv);
24837 uint64_t __attribute__((export_name("TS_ChannelDetails_get_channel_type"))) TS_ChannelDetails_get_channel_type(uint64_t this_ptr) {
24838 LDKChannelDetails this_ptr_conv;
24839 this_ptr_conv.inner = untag_ptr(this_ptr);
24840 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24841 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24842 this_ptr_conv.is_owned = false;
24843 LDKChannelTypeFeatures ret_var = ChannelDetails_get_channel_type(&this_ptr_conv);
24844 uint64_t ret_ref = 0;
24845 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
24846 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
24850 void __attribute__((export_name("TS_ChannelDetails_set_channel_type"))) TS_ChannelDetails_set_channel_type(uint64_t this_ptr, uint64_t val) {
24851 LDKChannelDetails this_ptr_conv;
24852 this_ptr_conv.inner = untag_ptr(this_ptr);
24853 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24854 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24855 this_ptr_conv.is_owned = false;
24856 LDKChannelTypeFeatures val_conv;
24857 val_conv.inner = untag_ptr(val);
24858 val_conv.is_owned = ptr_is_owned(val);
24859 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
24860 val_conv = ChannelTypeFeatures_clone(&val_conv);
24861 ChannelDetails_set_channel_type(&this_ptr_conv, val_conv);
24864 uint64_t __attribute__((export_name("TS_ChannelDetails_get_short_channel_id"))) TS_ChannelDetails_get_short_channel_id(uint64_t this_ptr) {
24865 LDKChannelDetails this_ptr_conv;
24866 this_ptr_conv.inner = untag_ptr(this_ptr);
24867 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24868 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24869 this_ptr_conv.is_owned = false;
24870 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
24871 *ret_copy = ChannelDetails_get_short_channel_id(&this_ptr_conv);
24872 uint64_t ret_ref = tag_ptr(ret_copy, true);
24876 void __attribute__((export_name("TS_ChannelDetails_set_short_channel_id"))) TS_ChannelDetails_set_short_channel_id(uint64_t this_ptr, uint64_t val) {
24877 LDKChannelDetails this_ptr_conv;
24878 this_ptr_conv.inner = untag_ptr(this_ptr);
24879 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24880 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24881 this_ptr_conv.is_owned = false;
24882 void* val_ptr = untag_ptr(val);
24883 CHECK_ACCESS(val_ptr);
24884 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
24885 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
24886 ChannelDetails_set_short_channel_id(&this_ptr_conv, val_conv);
24889 uint64_t __attribute__((export_name("TS_ChannelDetails_get_outbound_scid_alias"))) TS_ChannelDetails_get_outbound_scid_alias(uint64_t this_ptr) {
24890 LDKChannelDetails this_ptr_conv;
24891 this_ptr_conv.inner = untag_ptr(this_ptr);
24892 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24893 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24894 this_ptr_conv.is_owned = false;
24895 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
24896 *ret_copy = ChannelDetails_get_outbound_scid_alias(&this_ptr_conv);
24897 uint64_t ret_ref = tag_ptr(ret_copy, true);
24901 void __attribute__((export_name("TS_ChannelDetails_set_outbound_scid_alias"))) TS_ChannelDetails_set_outbound_scid_alias(uint64_t this_ptr, uint64_t val) {
24902 LDKChannelDetails this_ptr_conv;
24903 this_ptr_conv.inner = untag_ptr(this_ptr);
24904 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24905 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24906 this_ptr_conv.is_owned = false;
24907 void* val_ptr = untag_ptr(val);
24908 CHECK_ACCESS(val_ptr);
24909 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
24910 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
24911 ChannelDetails_set_outbound_scid_alias(&this_ptr_conv, val_conv);
24914 uint64_t __attribute__((export_name("TS_ChannelDetails_get_inbound_scid_alias"))) TS_ChannelDetails_get_inbound_scid_alias(uint64_t this_ptr) {
24915 LDKChannelDetails this_ptr_conv;
24916 this_ptr_conv.inner = untag_ptr(this_ptr);
24917 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24918 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24919 this_ptr_conv.is_owned = false;
24920 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
24921 *ret_copy = ChannelDetails_get_inbound_scid_alias(&this_ptr_conv);
24922 uint64_t ret_ref = tag_ptr(ret_copy, true);
24926 void __attribute__((export_name("TS_ChannelDetails_set_inbound_scid_alias"))) TS_ChannelDetails_set_inbound_scid_alias(uint64_t this_ptr, uint64_t val) {
24927 LDKChannelDetails this_ptr_conv;
24928 this_ptr_conv.inner = untag_ptr(this_ptr);
24929 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24930 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24931 this_ptr_conv.is_owned = false;
24932 void* val_ptr = untag_ptr(val);
24933 CHECK_ACCESS(val_ptr);
24934 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
24935 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
24936 ChannelDetails_set_inbound_scid_alias(&this_ptr_conv, val_conv);
24939 int64_t __attribute__((export_name("TS_ChannelDetails_get_channel_value_satoshis"))) TS_ChannelDetails_get_channel_value_satoshis(uint64_t this_ptr) {
24940 LDKChannelDetails this_ptr_conv;
24941 this_ptr_conv.inner = untag_ptr(this_ptr);
24942 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24943 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24944 this_ptr_conv.is_owned = false;
24945 int64_t ret_conv = ChannelDetails_get_channel_value_satoshis(&this_ptr_conv);
24949 void __attribute__((export_name("TS_ChannelDetails_set_channel_value_satoshis"))) TS_ChannelDetails_set_channel_value_satoshis(uint64_t this_ptr, int64_t val) {
24950 LDKChannelDetails this_ptr_conv;
24951 this_ptr_conv.inner = untag_ptr(this_ptr);
24952 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24953 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24954 this_ptr_conv.is_owned = false;
24955 ChannelDetails_set_channel_value_satoshis(&this_ptr_conv, val);
24958 uint64_t __attribute__((export_name("TS_ChannelDetails_get_unspendable_punishment_reserve"))) TS_ChannelDetails_get_unspendable_punishment_reserve(uint64_t this_ptr) {
24959 LDKChannelDetails this_ptr_conv;
24960 this_ptr_conv.inner = untag_ptr(this_ptr);
24961 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24962 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24963 this_ptr_conv.is_owned = false;
24964 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
24965 *ret_copy = ChannelDetails_get_unspendable_punishment_reserve(&this_ptr_conv);
24966 uint64_t ret_ref = tag_ptr(ret_copy, true);
24970 void __attribute__((export_name("TS_ChannelDetails_set_unspendable_punishment_reserve"))) TS_ChannelDetails_set_unspendable_punishment_reserve(uint64_t this_ptr, uint64_t val) {
24971 LDKChannelDetails this_ptr_conv;
24972 this_ptr_conv.inner = untag_ptr(this_ptr);
24973 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24974 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24975 this_ptr_conv.is_owned = false;
24976 void* val_ptr = untag_ptr(val);
24977 CHECK_ACCESS(val_ptr);
24978 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
24979 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
24980 ChannelDetails_set_unspendable_punishment_reserve(&this_ptr_conv, val_conv);
24983 int64_t __attribute__((export_name("TS_ChannelDetails_get_user_channel_id"))) TS_ChannelDetails_get_user_channel_id(uint64_t this_ptr) {
24984 LDKChannelDetails this_ptr_conv;
24985 this_ptr_conv.inner = untag_ptr(this_ptr);
24986 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24987 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24988 this_ptr_conv.is_owned = false;
24989 int64_t ret_conv = ChannelDetails_get_user_channel_id(&this_ptr_conv);
24993 void __attribute__((export_name("TS_ChannelDetails_set_user_channel_id"))) TS_ChannelDetails_set_user_channel_id(uint64_t this_ptr, int64_t val) {
24994 LDKChannelDetails this_ptr_conv;
24995 this_ptr_conv.inner = untag_ptr(this_ptr);
24996 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
24997 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
24998 this_ptr_conv.is_owned = false;
24999 ChannelDetails_set_user_channel_id(&this_ptr_conv, val);
25002 int64_t __attribute__((export_name("TS_ChannelDetails_get_balance_msat"))) TS_ChannelDetails_get_balance_msat(uint64_t this_ptr) {
25003 LDKChannelDetails this_ptr_conv;
25004 this_ptr_conv.inner = untag_ptr(this_ptr);
25005 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25006 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25007 this_ptr_conv.is_owned = false;
25008 int64_t ret_conv = ChannelDetails_get_balance_msat(&this_ptr_conv);
25012 void __attribute__((export_name("TS_ChannelDetails_set_balance_msat"))) TS_ChannelDetails_set_balance_msat(uint64_t this_ptr, int64_t val) {
25013 LDKChannelDetails this_ptr_conv;
25014 this_ptr_conv.inner = untag_ptr(this_ptr);
25015 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25016 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25017 this_ptr_conv.is_owned = false;
25018 ChannelDetails_set_balance_msat(&this_ptr_conv, val);
25021 int64_t __attribute__((export_name("TS_ChannelDetails_get_outbound_capacity_msat"))) TS_ChannelDetails_get_outbound_capacity_msat(uint64_t this_ptr) {
25022 LDKChannelDetails this_ptr_conv;
25023 this_ptr_conv.inner = untag_ptr(this_ptr);
25024 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25025 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25026 this_ptr_conv.is_owned = false;
25027 int64_t ret_conv = ChannelDetails_get_outbound_capacity_msat(&this_ptr_conv);
25031 void __attribute__((export_name("TS_ChannelDetails_set_outbound_capacity_msat"))) TS_ChannelDetails_set_outbound_capacity_msat(uint64_t this_ptr, int64_t val) {
25032 LDKChannelDetails this_ptr_conv;
25033 this_ptr_conv.inner = untag_ptr(this_ptr);
25034 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25035 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25036 this_ptr_conv.is_owned = false;
25037 ChannelDetails_set_outbound_capacity_msat(&this_ptr_conv, val);
25040 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) {
25041 LDKChannelDetails this_ptr_conv;
25042 this_ptr_conv.inner = untag_ptr(this_ptr);
25043 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25044 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25045 this_ptr_conv.is_owned = false;
25046 int64_t ret_conv = ChannelDetails_get_next_outbound_htlc_limit_msat(&this_ptr_conv);
25050 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) {
25051 LDKChannelDetails this_ptr_conv;
25052 this_ptr_conv.inner = untag_ptr(this_ptr);
25053 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25054 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25055 this_ptr_conv.is_owned = false;
25056 ChannelDetails_set_next_outbound_htlc_limit_msat(&this_ptr_conv, val);
25059 int64_t __attribute__((export_name("TS_ChannelDetails_get_inbound_capacity_msat"))) TS_ChannelDetails_get_inbound_capacity_msat(uint64_t this_ptr) {
25060 LDKChannelDetails this_ptr_conv;
25061 this_ptr_conv.inner = untag_ptr(this_ptr);
25062 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25063 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25064 this_ptr_conv.is_owned = false;
25065 int64_t ret_conv = ChannelDetails_get_inbound_capacity_msat(&this_ptr_conv);
25069 void __attribute__((export_name("TS_ChannelDetails_set_inbound_capacity_msat"))) TS_ChannelDetails_set_inbound_capacity_msat(uint64_t this_ptr, int64_t val) {
25070 LDKChannelDetails this_ptr_conv;
25071 this_ptr_conv.inner = untag_ptr(this_ptr);
25072 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25073 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25074 this_ptr_conv.is_owned = false;
25075 ChannelDetails_set_inbound_capacity_msat(&this_ptr_conv, val);
25078 uint64_t __attribute__((export_name("TS_ChannelDetails_get_confirmations_required"))) TS_ChannelDetails_get_confirmations_required(uint64_t this_ptr) {
25079 LDKChannelDetails this_ptr_conv;
25080 this_ptr_conv.inner = untag_ptr(this_ptr);
25081 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25082 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25083 this_ptr_conv.is_owned = false;
25084 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
25085 *ret_copy = ChannelDetails_get_confirmations_required(&this_ptr_conv);
25086 uint64_t ret_ref = tag_ptr(ret_copy, true);
25090 void __attribute__((export_name("TS_ChannelDetails_set_confirmations_required"))) TS_ChannelDetails_set_confirmations_required(uint64_t this_ptr, uint64_t val) {
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 void* val_ptr = untag_ptr(val);
25097 CHECK_ACCESS(val_ptr);
25098 LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr);
25099 val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val));
25100 ChannelDetails_set_confirmations_required(&this_ptr_conv, val_conv);
25103 uint64_t __attribute__((export_name("TS_ChannelDetails_get_force_close_spend_delay"))) TS_ChannelDetails_get_force_close_spend_delay(uint64_t this_ptr) {
25104 LDKChannelDetails this_ptr_conv;
25105 this_ptr_conv.inner = untag_ptr(this_ptr);
25106 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25107 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25108 this_ptr_conv.is_owned = false;
25109 LDKCOption_u16Z *ret_copy = MALLOC(sizeof(LDKCOption_u16Z), "LDKCOption_u16Z");
25110 *ret_copy = ChannelDetails_get_force_close_spend_delay(&this_ptr_conv);
25111 uint64_t ret_ref = tag_ptr(ret_copy, true);
25115 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) {
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 void* val_ptr = untag_ptr(val);
25122 CHECK_ACCESS(val_ptr);
25123 LDKCOption_u16Z val_conv = *(LDKCOption_u16Z*)(val_ptr);
25124 val_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(val));
25125 ChannelDetails_set_force_close_spend_delay(&this_ptr_conv, val_conv);
25128 jboolean __attribute__((export_name("TS_ChannelDetails_get_is_outbound"))) TS_ChannelDetails_get_is_outbound(uint64_t this_ptr) {
25129 LDKChannelDetails this_ptr_conv;
25130 this_ptr_conv.inner = untag_ptr(this_ptr);
25131 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25132 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25133 this_ptr_conv.is_owned = false;
25134 jboolean ret_conv = ChannelDetails_get_is_outbound(&this_ptr_conv);
25138 void __attribute__((export_name("TS_ChannelDetails_set_is_outbound"))) TS_ChannelDetails_set_is_outbound(uint64_t this_ptr, jboolean val) {
25139 LDKChannelDetails this_ptr_conv;
25140 this_ptr_conv.inner = untag_ptr(this_ptr);
25141 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25142 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25143 this_ptr_conv.is_owned = false;
25144 ChannelDetails_set_is_outbound(&this_ptr_conv, val);
25147 jboolean __attribute__((export_name("TS_ChannelDetails_get_is_channel_ready"))) TS_ChannelDetails_get_is_channel_ready(uint64_t this_ptr) {
25148 LDKChannelDetails this_ptr_conv;
25149 this_ptr_conv.inner = untag_ptr(this_ptr);
25150 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25151 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25152 this_ptr_conv.is_owned = false;
25153 jboolean ret_conv = ChannelDetails_get_is_channel_ready(&this_ptr_conv);
25157 void __attribute__((export_name("TS_ChannelDetails_set_is_channel_ready"))) TS_ChannelDetails_set_is_channel_ready(uint64_t this_ptr, jboolean val) {
25158 LDKChannelDetails this_ptr_conv;
25159 this_ptr_conv.inner = untag_ptr(this_ptr);
25160 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25161 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25162 this_ptr_conv.is_owned = false;
25163 ChannelDetails_set_is_channel_ready(&this_ptr_conv, val);
25166 jboolean __attribute__((export_name("TS_ChannelDetails_get_is_usable"))) TS_ChannelDetails_get_is_usable(uint64_t this_ptr) {
25167 LDKChannelDetails this_ptr_conv;
25168 this_ptr_conv.inner = untag_ptr(this_ptr);
25169 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25170 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25171 this_ptr_conv.is_owned = false;
25172 jboolean ret_conv = ChannelDetails_get_is_usable(&this_ptr_conv);
25176 void __attribute__((export_name("TS_ChannelDetails_set_is_usable"))) TS_ChannelDetails_set_is_usable(uint64_t this_ptr, jboolean val) {
25177 LDKChannelDetails this_ptr_conv;
25178 this_ptr_conv.inner = untag_ptr(this_ptr);
25179 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25180 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25181 this_ptr_conv.is_owned = false;
25182 ChannelDetails_set_is_usable(&this_ptr_conv, val);
25185 jboolean __attribute__((export_name("TS_ChannelDetails_get_is_public"))) TS_ChannelDetails_get_is_public(uint64_t this_ptr) {
25186 LDKChannelDetails this_ptr_conv;
25187 this_ptr_conv.inner = untag_ptr(this_ptr);
25188 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25189 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25190 this_ptr_conv.is_owned = false;
25191 jboolean ret_conv = ChannelDetails_get_is_public(&this_ptr_conv);
25195 void __attribute__((export_name("TS_ChannelDetails_set_is_public"))) TS_ChannelDetails_set_is_public(uint64_t this_ptr, jboolean val) {
25196 LDKChannelDetails this_ptr_conv;
25197 this_ptr_conv.inner = untag_ptr(this_ptr);
25198 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25199 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25200 this_ptr_conv.is_owned = false;
25201 ChannelDetails_set_is_public(&this_ptr_conv, val);
25204 uint64_t __attribute__((export_name("TS_ChannelDetails_get_inbound_htlc_minimum_msat"))) TS_ChannelDetails_get_inbound_htlc_minimum_msat(uint64_t this_ptr) {
25205 LDKChannelDetails this_ptr_conv;
25206 this_ptr_conv.inner = untag_ptr(this_ptr);
25207 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25208 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25209 this_ptr_conv.is_owned = false;
25210 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
25211 *ret_copy = ChannelDetails_get_inbound_htlc_minimum_msat(&this_ptr_conv);
25212 uint64_t ret_ref = tag_ptr(ret_copy, true);
25216 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) {
25217 LDKChannelDetails this_ptr_conv;
25218 this_ptr_conv.inner = untag_ptr(this_ptr);
25219 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25220 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25221 this_ptr_conv.is_owned = false;
25222 void* val_ptr = untag_ptr(val);
25223 CHECK_ACCESS(val_ptr);
25224 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
25225 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
25226 ChannelDetails_set_inbound_htlc_minimum_msat(&this_ptr_conv, val_conv);
25229 uint64_t __attribute__((export_name("TS_ChannelDetails_get_inbound_htlc_maximum_msat"))) TS_ChannelDetails_get_inbound_htlc_maximum_msat(uint64_t this_ptr) {
25230 LDKChannelDetails this_ptr_conv;
25231 this_ptr_conv.inner = untag_ptr(this_ptr);
25232 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25233 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25234 this_ptr_conv.is_owned = false;
25235 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
25236 *ret_copy = ChannelDetails_get_inbound_htlc_maximum_msat(&this_ptr_conv);
25237 uint64_t ret_ref = tag_ptr(ret_copy, true);
25241 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) {
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 void* val_ptr = untag_ptr(val);
25248 CHECK_ACCESS(val_ptr);
25249 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
25250 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
25251 ChannelDetails_set_inbound_htlc_maximum_msat(&this_ptr_conv, val_conv);
25254 uint64_t __attribute__((export_name("TS_ChannelDetails_get_config"))) TS_ChannelDetails_get_config(uint64_t this_ptr) {
25255 LDKChannelDetails this_ptr_conv;
25256 this_ptr_conv.inner = untag_ptr(this_ptr);
25257 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25258 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25259 this_ptr_conv.is_owned = false;
25260 LDKChannelConfig ret_var = ChannelDetails_get_config(&this_ptr_conv);
25261 uint64_t ret_ref = 0;
25262 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25263 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25267 void __attribute__((export_name("TS_ChannelDetails_set_config"))) TS_ChannelDetails_set_config(uint64_t this_ptr, uint64_t val) {
25268 LDKChannelDetails this_ptr_conv;
25269 this_ptr_conv.inner = untag_ptr(this_ptr);
25270 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25271 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25272 this_ptr_conv.is_owned = false;
25273 LDKChannelConfig val_conv;
25274 val_conv.inner = untag_ptr(val);
25275 val_conv.is_owned = ptr_is_owned(val);
25276 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
25277 val_conv = ChannelConfig_clone(&val_conv);
25278 ChannelDetails_set_config(&this_ptr_conv, val_conv);
25281 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) {
25282 LDKThirtyTwoBytes channel_id_arg_ref;
25283 CHECK(channel_id_arg->arr_len == 32);
25284 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
25285 LDKChannelCounterparty counterparty_arg_conv;
25286 counterparty_arg_conv.inner = untag_ptr(counterparty_arg);
25287 counterparty_arg_conv.is_owned = ptr_is_owned(counterparty_arg);
25288 CHECK_INNER_FIELD_ACCESS_OR_NULL(counterparty_arg_conv);
25289 counterparty_arg_conv = ChannelCounterparty_clone(&counterparty_arg_conv);
25290 LDKOutPoint funding_txo_arg_conv;
25291 funding_txo_arg_conv.inner = untag_ptr(funding_txo_arg);
25292 funding_txo_arg_conv.is_owned = ptr_is_owned(funding_txo_arg);
25293 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_txo_arg_conv);
25294 funding_txo_arg_conv = OutPoint_clone(&funding_txo_arg_conv);
25295 LDKChannelTypeFeatures channel_type_arg_conv;
25296 channel_type_arg_conv.inner = untag_ptr(channel_type_arg);
25297 channel_type_arg_conv.is_owned = ptr_is_owned(channel_type_arg);
25298 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_type_arg_conv);
25299 channel_type_arg_conv = ChannelTypeFeatures_clone(&channel_type_arg_conv);
25300 void* short_channel_id_arg_ptr = untag_ptr(short_channel_id_arg);
25301 CHECK_ACCESS(short_channel_id_arg_ptr);
25302 LDKCOption_u64Z short_channel_id_arg_conv = *(LDKCOption_u64Z*)(short_channel_id_arg_ptr);
25303 short_channel_id_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id_arg));
25304 void* outbound_scid_alias_arg_ptr = untag_ptr(outbound_scid_alias_arg);
25305 CHECK_ACCESS(outbound_scid_alias_arg_ptr);
25306 LDKCOption_u64Z outbound_scid_alias_arg_conv = *(LDKCOption_u64Z*)(outbound_scid_alias_arg_ptr);
25307 outbound_scid_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(outbound_scid_alias_arg));
25308 void* inbound_scid_alias_arg_ptr = untag_ptr(inbound_scid_alias_arg);
25309 CHECK_ACCESS(inbound_scid_alias_arg_ptr);
25310 LDKCOption_u64Z inbound_scid_alias_arg_conv = *(LDKCOption_u64Z*)(inbound_scid_alias_arg_ptr);
25311 inbound_scid_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(inbound_scid_alias_arg));
25312 void* unspendable_punishment_reserve_arg_ptr = untag_ptr(unspendable_punishment_reserve_arg);
25313 CHECK_ACCESS(unspendable_punishment_reserve_arg_ptr);
25314 LDKCOption_u64Z unspendable_punishment_reserve_arg_conv = *(LDKCOption_u64Z*)(unspendable_punishment_reserve_arg_ptr);
25315 void* confirmations_required_arg_ptr = untag_ptr(confirmations_required_arg);
25316 CHECK_ACCESS(confirmations_required_arg_ptr);
25317 LDKCOption_u32Z confirmations_required_arg_conv = *(LDKCOption_u32Z*)(confirmations_required_arg_ptr);
25318 confirmations_required_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(confirmations_required_arg));
25319 void* force_close_spend_delay_arg_ptr = untag_ptr(force_close_spend_delay_arg);
25320 CHECK_ACCESS(force_close_spend_delay_arg_ptr);
25321 LDKCOption_u16Z force_close_spend_delay_arg_conv = *(LDKCOption_u16Z*)(force_close_spend_delay_arg_ptr);
25322 force_close_spend_delay_arg_conv = COption_u16Z_clone((LDKCOption_u16Z*)untag_ptr(force_close_spend_delay_arg));
25323 void* inbound_htlc_minimum_msat_arg_ptr = untag_ptr(inbound_htlc_minimum_msat_arg);
25324 CHECK_ACCESS(inbound_htlc_minimum_msat_arg_ptr);
25325 LDKCOption_u64Z inbound_htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(inbound_htlc_minimum_msat_arg_ptr);
25326 inbound_htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(inbound_htlc_minimum_msat_arg));
25327 void* inbound_htlc_maximum_msat_arg_ptr = untag_ptr(inbound_htlc_maximum_msat_arg);
25328 CHECK_ACCESS(inbound_htlc_maximum_msat_arg_ptr);
25329 LDKCOption_u64Z inbound_htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(inbound_htlc_maximum_msat_arg_ptr);
25330 inbound_htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(inbound_htlc_maximum_msat_arg));
25331 LDKChannelConfig config_arg_conv;
25332 config_arg_conv.inner = untag_ptr(config_arg);
25333 config_arg_conv.is_owned = ptr_is_owned(config_arg);
25334 CHECK_INNER_FIELD_ACCESS_OR_NULL(config_arg_conv);
25335 config_arg_conv = ChannelConfig_clone(&config_arg_conv);
25336 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);
25337 uint64_t ret_ref = 0;
25338 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25339 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25343 static inline uint64_t ChannelDetails_clone_ptr(LDKChannelDetails *NONNULL_PTR arg) {
25344 LDKChannelDetails ret_var = ChannelDetails_clone(arg);
25345 uint64_t ret_ref = 0;
25346 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25347 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25350 int64_t __attribute__((export_name("TS_ChannelDetails_clone_ptr"))) TS_ChannelDetails_clone_ptr(uint64_t arg) {
25351 LDKChannelDetails arg_conv;
25352 arg_conv.inner = untag_ptr(arg);
25353 arg_conv.is_owned = ptr_is_owned(arg);
25354 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
25355 arg_conv.is_owned = false;
25356 int64_t ret_conv = ChannelDetails_clone_ptr(&arg_conv);
25360 uint64_t __attribute__((export_name("TS_ChannelDetails_clone"))) TS_ChannelDetails_clone(uint64_t orig) {
25361 LDKChannelDetails orig_conv;
25362 orig_conv.inner = untag_ptr(orig);
25363 orig_conv.is_owned = ptr_is_owned(orig);
25364 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
25365 orig_conv.is_owned = false;
25366 LDKChannelDetails ret_var = ChannelDetails_clone(&orig_conv);
25367 uint64_t ret_ref = 0;
25368 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25369 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25373 uint64_t __attribute__((export_name("TS_ChannelDetails_get_inbound_payment_scid"))) TS_ChannelDetails_get_inbound_payment_scid(uint64_t this_arg) {
25374 LDKChannelDetails this_arg_conv;
25375 this_arg_conv.inner = untag_ptr(this_arg);
25376 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25377 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25378 this_arg_conv.is_owned = false;
25379 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
25380 *ret_copy = ChannelDetails_get_inbound_payment_scid(&this_arg_conv);
25381 uint64_t ret_ref = tag_ptr(ret_copy, true);
25385 uint64_t __attribute__((export_name("TS_ChannelDetails_get_outbound_payment_scid"))) TS_ChannelDetails_get_outbound_payment_scid(uint64_t this_arg) {
25386 LDKChannelDetails this_arg_conv;
25387 this_arg_conv.inner = untag_ptr(this_arg);
25388 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25389 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25390 this_arg_conv.is_owned = false;
25391 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
25392 *ret_copy = ChannelDetails_get_outbound_payment_scid(&this_arg_conv);
25393 uint64_t ret_ref = tag_ptr(ret_copy, true);
25397 void __attribute__((export_name("TS_PaymentSendFailure_free"))) TS_PaymentSendFailure_free(uint64_t this_ptr) {
25398 if (!ptr_is_owned(this_ptr)) return;
25399 void* this_ptr_ptr = untag_ptr(this_ptr);
25400 CHECK_ACCESS(this_ptr_ptr);
25401 LDKPaymentSendFailure this_ptr_conv = *(LDKPaymentSendFailure*)(this_ptr_ptr);
25402 FREE(untag_ptr(this_ptr));
25403 PaymentSendFailure_free(this_ptr_conv);
25406 static inline uint64_t PaymentSendFailure_clone_ptr(LDKPaymentSendFailure *NONNULL_PTR arg) {
25407 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
25408 *ret_copy = PaymentSendFailure_clone(arg);
25409 uint64_t ret_ref = tag_ptr(ret_copy, true);
25412 int64_t __attribute__((export_name("TS_PaymentSendFailure_clone_ptr"))) TS_PaymentSendFailure_clone_ptr(uint64_t arg) {
25413 LDKPaymentSendFailure* arg_conv = (LDKPaymentSendFailure*)untag_ptr(arg);
25414 int64_t ret_conv = PaymentSendFailure_clone_ptr(arg_conv);
25418 uint64_t __attribute__((export_name("TS_PaymentSendFailure_clone"))) TS_PaymentSendFailure_clone(uint64_t orig) {
25419 LDKPaymentSendFailure* orig_conv = (LDKPaymentSendFailure*)untag_ptr(orig);
25420 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
25421 *ret_copy = PaymentSendFailure_clone(orig_conv);
25422 uint64_t ret_ref = tag_ptr(ret_copy, true);
25426 uint64_t __attribute__((export_name("TS_PaymentSendFailure_parameter_error"))) TS_PaymentSendFailure_parameter_error(uint64_t a) {
25427 void* a_ptr = untag_ptr(a);
25428 CHECK_ACCESS(a_ptr);
25429 LDKAPIError a_conv = *(LDKAPIError*)(a_ptr);
25430 a_conv = APIError_clone((LDKAPIError*)untag_ptr(a));
25431 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
25432 *ret_copy = PaymentSendFailure_parameter_error(a_conv);
25433 uint64_t ret_ref = tag_ptr(ret_copy, true);
25437 uint64_t __attribute__((export_name("TS_PaymentSendFailure_path_parameter_error"))) TS_PaymentSendFailure_path_parameter_error(uint64_tArray a) {
25438 LDKCVec_CResult_NoneAPIErrorZZ a_constr;
25439 a_constr.datalen = a->arr_len;
25440 if (a_constr.datalen > 0)
25441 a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
25443 a_constr.data = NULL;
25444 uint64_t* a_vals = a->elems;
25445 for (size_t w = 0; w < a_constr.datalen; w++) {
25446 uint64_t a_conv_22 = a_vals[w];
25447 void* a_conv_22_ptr = untag_ptr(a_conv_22);
25448 CHECK_ACCESS(a_conv_22_ptr);
25449 LDKCResult_NoneAPIErrorZ a_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(a_conv_22_ptr);
25450 a_conv_22_conv = CResult_NoneAPIErrorZ_clone((LDKCResult_NoneAPIErrorZ*)untag_ptr(a_conv_22));
25451 a_constr.data[w] = a_conv_22_conv;
25454 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
25455 *ret_copy = PaymentSendFailure_path_parameter_error(a_constr);
25456 uint64_t ret_ref = tag_ptr(ret_copy, true);
25460 uint64_t __attribute__((export_name("TS_PaymentSendFailure_all_failed_retry_safe"))) TS_PaymentSendFailure_all_failed_retry_safe(uint64_tArray a) {
25461 LDKCVec_APIErrorZ a_constr;
25462 a_constr.datalen = a->arr_len;
25463 if (a_constr.datalen > 0)
25464 a_constr.data = MALLOC(a_constr.datalen * sizeof(LDKAPIError), "LDKCVec_APIErrorZ Elements");
25466 a_constr.data = NULL;
25467 uint64_t* a_vals = a->elems;
25468 for (size_t k = 0; k < a_constr.datalen; k++) {
25469 uint64_t a_conv_10 = a_vals[k];
25470 void* a_conv_10_ptr = untag_ptr(a_conv_10);
25471 CHECK_ACCESS(a_conv_10_ptr);
25472 LDKAPIError a_conv_10_conv = *(LDKAPIError*)(a_conv_10_ptr);
25473 a_conv_10_conv = APIError_clone((LDKAPIError*)untag_ptr(a_conv_10));
25474 a_constr.data[k] = a_conv_10_conv;
25477 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
25478 *ret_copy = PaymentSendFailure_all_failed_retry_safe(a_constr);
25479 uint64_t ret_ref = tag_ptr(ret_copy, true);
25483 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) {
25484 LDKCVec_CResult_NoneAPIErrorZZ results_constr;
25485 results_constr.datalen = results->arr_len;
25486 if (results_constr.datalen > 0)
25487 results_constr.data = MALLOC(results_constr.datalen * sizeof(LDKCResult_NoneAPIErrorZ), "LDKCVec_CResult_NoneAPIErrorZZ Elements");
25489 results_constr.data = NULL;
25490 uint64_t* results_vals = results->elems;
25491 for (size_t w = 0; w < results_constr.datalen; w++) {
25492 uint64_t results_conv_22 = results_vals[w];
25493 void* results_conv_22_ptr = untag_ptr(results_conv_22);
25494 CHECK_ACCESS(results_conv_22_ptr);
25495 LDKCResult_NoneAPIErrorZ results_conv_22_conv = *(LDKCResult_NoneAPIErrorZ*)(results_conv_22_ptr);
25496 results_constr.data[w] = results_conv_22_conv;
25499 LDKRouteParameters failed_paths_retry_conv;
25500 failed_paths_retry_conv.inner = untag_ptr(failed_paths_retry);
25501 failed_paths_retry_conv.is_owned = ptr_is_owned(failed_paths_retry);
25502 CHECK_INNER_FIELD_ACCESS_OR_NULL(failed_paths_retry_conv);
25503 failed_paths_retry_conv = RouteParameters_clone(&failed_paths_retry_conv);
25504 LDKThirtyTwoBytes payment_id_ref;
25505 CHECK(payment_id->arr_len == 32);
25506 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
25507 LDKPaymentSendFailure *ret_copy = MALLOC(sizeof(LDKPaymentSendFailure), "LDKPaymentSendFailure");
25508 *ret_copy = PaymentSendFailure_partial_failure(results_constr, failed_paths_retry_conv, payment_id_ref);
25509 uint64_t ret_ref = tag_ptr(ret_copy, true);
25513 void __attribute__((export_name("TS_PhantomRouteHints_free"))) TS_PhantomRouteHints_free(uint64_t this_obj) {
25514 LDKPhantomRouteHints this_obj_conv;
25515 this_obj_conv.inner = untag_ptr(this_obj);
25516 this_obj_conv.is_owned = ptr_is_owned(this_obj);
25517 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
25518 PhantomRouteHints_free(this_obj_conv);
25521 uint64_tArray __attribute__((export_name("TS_PhantomRouteHints_get_channels"))) TS_PhantomRouteHints_get_channels(uint64_t this_ptr) {
25522 LDKPhantomRouteHints this_ptr_conv;
25523 this_ptr_conv.inner = untag_ptr(this_ptr);
25524 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25525 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25526 this_ptr_conv.is_owned = false;
25527 LDKCVec_ChannelDetailsZ ret_var = PhantomRouteHints_get_channels(&this_ptr_conv);
25528 uint64_tArray ret_arr = NULL;
25529 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
25530 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
25531 for (size_t q = 0; q < ret_var.datalen; q++) {
25532 LDKChannelDetails ret_conv_16_var = ret_var.data[q];
25533 uint64_t ret_conv_16_ref = 0;
25534 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
25535 ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned);
25536 ret_arr_ptr[q] = ret_conv_16_ref;
25539 FREE(ret_var.data);
25543 void __attribute__((export_name("TS_PhantomRouteHints_set_channels"))) TS_PhantomRouteHints_set_channels(uint64_t this_ptr, uint64_tArray val) {
25544 LDKPhantomRouteHints this_ptr_conv;
25545 this_ptr_conv.inner = untag_ptr(this_ptr);
25546 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25547 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25548 this_ptr_conv.is_owned = false;
25549 LDKCVec_ChannelDetailsZ val_constr;
25550 val_constr.datalen = val->arr_len;
25551 if (val_constr.datalen > 0)
25552 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
25554 val_constr.data = NULL;
25555 uint64_t* val_vals = val->elems;
25556 for (size_t q = 0; q < val_constr.datalen; q++) {
25557 uint64_t val_conv_16 = val_vals[q];
25558 LDKChannelDetails val_conv_16_conv;
25559 val_conv_16_conv.inner = untag_ptr(val_conv_16);
25560 val_conv_16_conv.is_owned = ptr_is_owned(val_conv_16);
25561 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_16_conv);
25562 val_conv_16_conv = ChannelDetails_clone(&val_conv_16_conv);
25563 val_constr.data[q] = val_conv_16_conv;
25566 PhantomRouteHints_set_channels(&this_ptr_conv, val_constr);
25569 int64_t __attribute__((export_name("TS_PhantomRouteHints_get_phantom_scid"))) TS_PhantomRouteHints_get_phantom_scid(uint64_t this_ptr) {
25570 LDKPhantomRouteHints this_ptr_conv;
25571 this_ptr_conv.inner = untag_ptr(this_ptr);
25572 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25573 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25574 this_ptr_conv.is_owned = false;
25575 int64_t ret_conv = PhantomRouteHints_get_phantom_scid(&this_ptr_conv);
25579 void __attribute__((export_name("TS_PhantomRouteHints_set_phantom_scid"))) TS_PhantomRouteHints_set_phantom_scid(uint64_t this_ptr, int64_t val) {
25580 LDKPhantomRouteHints this_ptr_conv;
25581 this_ptr_conv.inner = untag_ptr(this_ptr);
25582 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25583 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25584 this_ptr_conv.is_owned = false;
25585 PhantomRouteHints_set_phantom_scid(&this_ptr_conv, val);
25588 int8_tArray __attribute__((export_name("TS_PhantomRouteHints_get_real_node_pubkey"))) TS_PhantomRouteHints_get_real_node_pubkey(uint64_t this_ptr) {
25589 LDKPhantomRouteHints this_ptr_conv;
25590 this_ptr_conv.inner = untag_ptr(this_ptr);
25591 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25592 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25593 this_ptr_conv.is_owned = false;
25594 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
25595 memcpy(ret_arr->elems, PhantomRouteHints_get_real_node_pubkey(&this_ptr_conv).compressed_form, 33);
25599 void __attribute__((export_name("TS_PhantomRouteHints_set_real_node_pubkey"))) TS_PhantomRouteHints_set_real_node_pubkey(uint64_t this_ptr, int8_tArray val) {
25600 LDKPhantomRouteHints this_ptr_conv;
25601 this_ptr_conv.inner = untag_ptr(this_ptr);
25602 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
25603 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
25604 this_ptr_conv.is_owned = false;
25605 LDKPublicKey val_ref;
25606 CHECK(val->arr_len == 33);
25607 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
25608 PhantomRouteHints_set_real_node_pubkey(&this_ptr_conv, val_ref);
25611 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) {
25612 LDKCVec_ChannelDetailsZ channels_arg_constr;
25613 channels_arg_constr.datalen = channels_arg->arr_len;
25614 if (channels_arg_constr.datalen > 0)
25615 channels_arg_constr.data = MALLOC(channels_arg_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
25617 channels_arg_constr.data = NULL;
25618 uint64_t* channels_arg_vals = channels_arg->elems;
25619 for (size_t q = 0; q < channels_arg_constr.datalen; q++) {
25620 uint64_t channels_arg_conv_16 = channels_arg_vals[q];
25621 LDKChannelDetails channels_arg_conv_16_conv;
25622 channels_arg_conv_16_conv.inner = untag_ptr(channels_arg_conv_16);
25623 channels_arg_conv_16_conv.is_owned = ptr_is_owned(channels_arg_conv_16);
25624 CHECK_INNER_FIELD_ACCESS_OR_NULL(channels_arg_conv_16_conv);
25625 channels_arg_conv_16_conv = ChannelDetails_clone(&channels_arg_conv_16_conv);
25626 channels_arg_constr.data[q] = channels_arg_conv_16_conv;
25628 FREE(channels_arg);
25629 LDKPublicKey real_node_pubkey_arg_ref;
25630 CHECK(real_node_pubkey_arg->arr_len == 33);
25631 memcpy(real_node_pubkey_arg_ref.compressed_form, real_node_pubkey_arg->elems, 33); FREE(real_node_pubkey_arg);
25632 LDKPhantomRouteHints ret_var = PhantomRouteHints_new(channels_arg_constr, phantom_scid_arg, real_node_pubkey_arg_ref);
25633 uint64_t ret_ref = 0;
25634 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25635 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25639 static inline uint64_t PhantomRouteHints_clone_ptr(LDKPhantomRouteHints *NONNULL_PTR arg) {
25640 LDKPhantomRouteHints ret_var = PhantomRouteHints_clone(arg);
25641 uint64_t ret_ref = 0;
25642 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25643 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25646 int64_t __attribute__((export_name("TS_PhantomRouteHints_clone_ptr"))) TS_PhantomRouteHints_clone_ptr(uint64_t arg) {
25647 LDKPhantomRouteHints arg_conv;
25648 arg_conv.inner = untag_ptr(arg);
25649 arg_conv.is_owned = ptr_is_owned(arg);
25650 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
25651 arg_conv.is_owned = false;
25652 int64_t ret_conv = PhantomRouteHints_clone_ptr(&arg_conv);
25656 uint64_t __attribute__((export_name("TS_PhantomRouteHints_clone"))) TS_PhantomRouteHints_clone(uint64_t orig) {
25657 LDKPhantomRouteHints orig_conv;
25658 orig_conv.inner = untag_ptr(orig);
25659 orig_conv.is_owned = ptr_is_owned(orig);
25660 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
25661 orig_conv.is_owned = false;
25662 LDKPhantomRouteHints ret_var = PhantomRouteHints_clone(&orig_conv);
25663 uint64_t ret_ref = 0;
25664 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25665 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25669 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) {
25670 void* fee_est_ptr = untag_ptr(fee_est);
25671 CHECK_ACCESS(fee_est_ptr);
25672 LDKFeeEstimator fee_est_conv = *(LDKFeeEstimator*)(fee_est_ptr);
25673 if (fee_est_conv.free == LDKFeeEstimator_JCalls_free) {
25674 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
25675 LDKFeeEstimator_JCalls_cloned(&fee_est_conv);
25677 void* chain_monitor_ptr = untag_ptr(chain_monitor);
25678 CHECK_ACCESS(chain_monitor_ptr);
25679 LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr);
25680 if (chain_monitor_conv.free == LDKWatch_JCalls_free) {
25681 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
25682 LDKWatch_JCalls_cloned(&chain_monitor_conv);
25684 void* tx_broadcaster_ptr = untag_ptr(tx_broadcaster);
25685 CHECK_ACCESS(tx_broadcaster_ptr);
25686 LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr);
25687 if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
25688 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
25689 LDKBroadcasterInterface_JCalls_cloned(&tx_broadcaster_conv);
25691 void* logger_ptr = untag_ptr(logger);
25692 CHECK_ACCESS(logger_ptr);
25693 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
25694 if (logger_conv.free == LDKLogger_JCalls_free) {
25695 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
25696 LDKLogger_JCalls_cloned(&logger_conv);
25698 void* keys_manager_ptr = untag_ptr(keys_manager);
25699 CHECK_ACCESS(keys_manager_ptr);
25700 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
25701 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
25702 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
25703 LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
25705 LDKUserConfig config_conv;
25706 config_conv.inner = untag_ptr(config);
25707 config_conv.is_owned = ptr_is_owned(config);
25708 CHECK_INNER_FIELD_ACCESS_OR_NULL(config_conv);
25709 config_conv = UserConfig_clone(&config_conv);
25710 LDKChainParameters params_conv;
25711 params_conv.inner = untag_ptr(params);
25712 params_conv.is_owned = ptr_is_owned(params);
25713 CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv);
25714 params_conv = ChainParameters_clone(¶ms_conv);
25715 LDKChannelManager ret_var = ChannelManager_new(fee_est_conv, chain_monitor_conv, tx_broadcaster_conv, logger_conv, keys_manager_conv, config_conv, params_conv);
25716 uint64_t ret_ref = 0;
25717 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25718 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25722 uint64_t __attribute__((export_name("TS_ChannelManager_get_current_default_configuration"))) TS_ChannelManager_get_current_default_configuration(uint64_t this_arg) {
25723 LDKChannelManager this_arg_conv;
25724 this_arg_conv.inner = untag_ptr(this_arg);
25725 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25726 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25727 this_arg_conv.is_owned = false;
25728 LDKUserConfig ret_var = ChannelManager_get_current_default_configuration(&this_arg_conv);
25729 uint64_t ret_ref = 0;
25730 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
25731 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
25735 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) {
25736 LDKChannelManager this_arg_conv;
25737 this_arg_conv.inner = untag_ptr(this_arg);
25738 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25739 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25740 this_arg_conv.is_owned = false;
25741 LDKPublicKey their_network_key_ref;
25742 CHECK(their_network_key->arr_len == 33);
25743 memcpy(their_network_key_ref.compressed_form, their_network_key->elems, 33); FREE(their_network_key);
25744 LDKUserConfig override_config_conv;
25745 override_config_conv.inner = untag_ptr(override_config);
25746 override_config_conv.is_owned = ptr_is_owned(override_config);
25747 CHECK_INNER_FIELD_ACCESS_OR_NULL(override_config_conv);
25748 override_config_conv = UserConfig_clone(&override_config_conv);
25749 LDKCResult__u832APIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult__u832APIErrorZ), "LDKCResult__u832APIErrorZ");
25750 *ret_conv = ChannelManager_create_channel(&this_arg_conv, their_network_key_ref, channel_value_satoshis, push_msat, user_channel_id, override_config_conv);
25751 return tag_ptr(ret_conv, true);
25754 uint64_tArray __attribute__((export_name("TS_ChannelManager_list_channels"))) TS_ChannelManager_list_channels(uint64_t this_arg) {
25755 LDKChannelManager this_arg_conv;
25756 this_arg_conv.inner = untag_ptr(this_arg);
25757 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25758 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25759 this_arg_conv.is_owned = false;
25760 LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_channels(&this_arg_conv);
25761 uint64_tArray ret_arr = NULL;
25762 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
25763 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
25764 for (size_t q = 0; q < ret_var.datalen; q++) {
25765 LDKChannelDetails ret_conv_16_var = ret_var.data[q];
25766 uint64_t ret_conv_16_ref = 0;
25767 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
25768 ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned);
25769 ret_arr_ptr[q] = ret_conv_16_ref;
25772 FREE(ret_var.data);
25776 uint64_tArray __attribute__((export_name("TS_ChannelManager_list_usable_channels"))) TS_ChannelManager_list_usable_channels(uint64_t this_arg) {
25777 LDKChannelManager this_arg_conv;
25778 this_arg_conv.inner = untag_ptr(this_arg);
25779 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25780 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25781 this_arg_conv.is_owned = false;
25782 LDKCVec_ChannelDetailsZ ret_var = ChannelManager_list_usable_channels(&this_arg_conv);
25783 uint64_tArray ret_arr = NULL;
25784 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
25785 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
25786 for (size_t q = 0; q < ret_var.datalen; q++) {
25787 LDKChannelDetails ret_conv_16_var = ret_var.data[q];
25788 uint64_t ret_conv_16_ref = 0;
25789 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
25790 ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned);
25791 ret_arr_ptr[q] = ret_conv_16_ref;
25794 FREE(ret_var.data);
25798 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) {
25799 LDKChannelManager this_arg_conv;
25800 this_arg_conv.inner = untag_ptr(this_arg);
25801 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25802 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25803 this_arg_conv.is_owned = false;
25804 unsigned char channel_id_arr[32];
25805 CHECK(channel_id->arr_len == 32);
25806 memcpy(channel_id_arr, channel_id->elems, 32); FREE(channel_id);
25807 unsigned char (*channel_id_ref)[32] = &channel_id_arr;
25808 LDKPublicKey counterparty_node_id_ref;
25809 CHECK(counterparty_node_id->arr_len == 33);
25810 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
25811 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
25812 *ret_conv = ChannelManager_close_channel(&this_arg_conv, channel_id_ref, counterparty_node_id_ref);
25813 return tag_ptr(ret_conv, true);
25816 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) {
25817 LDKChannelManager this_arg_conv;
25818 this_arg_conv.inner = untag_ptr(this_arg);
25819 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25820 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25821 this_arg_conv.is_owned = false;
25822 unsigned char channel_id_arr[32];
25823 CHECK(channel_id->arr_len == 32);
25824 memcpy(channel_id_arr, channel_id->elems, 32); FREE(channel_id);
25825 unsigned char (*channel_id_ref)[32] = &channel_id_arr;
25826 LDKPublicKey counterparty_node_id_ref;
25827 CHECK(counterparty_node_id->arr_len == 33);
25828 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
25829 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
25830 *ret_conv = ChannelManager_close_channel_with_target_feerate(&this_arg_conv, channel_id_ref, counterparty_node_id_ref, target_feerate_sats_per_1000_weight);
25831 return tag_ptr(ret_conv, true);
25834 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) {
25835 LDKChannelManager this_arg_conv;
25836 this_arg_conv.inner = untag_ptr(this_arg);
25837 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25838 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25839 this_arg_conv.is_owned = false;
25840 unsigned char channel_id_arr[32];
25841 CHECK(channel_id->arr_len == 32);
25842 memcpy(channel_id_arr, channel_id->elems, 32); FREE(channel_id);
25843 unsigned char (*channel_id_ref)[32] = &channel_id_arr;
25844 LDKPublicKey counterparty_node_id_ref;
25845 CHECK(counterparty_node_id->arr_len == 33);
25846 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
25847 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
25848 *ret_conv = ChannelManager_force_close_broadcasting_latest_txn(&this_arg_conv, channel_id_ref, counterparty_node_id_ref);
25849 return tag_ptr(ret_conv, true);
25852 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) {
25853 LDKChannelManager this_arg_conv;
25854 this_arg_conv.inner = untag_ptr(this_arg);
25855 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25856 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25857 this_arg_conv.is_owned = false;
25858 unsigned char channel_id_arr[32];
25859 CHECK(channel_id->arr_len == 32);
25860 memcpy(channel_id_arr, channel_id->elems, 32); FREE(channel_id);
25861 unsigned char (*channel_id_ref)[32] = &channel_id_arr;
25862 LDKPublicKey counterparty_node_id_ref;
25863 CHECK(counterparty_node_id->arr_len == 33);
25864 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
25865 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
25866 *ret_conv = ChannelManager_force_close_without_broadcasting_txn(&this_arg_conv, channel_id_ref, counterparty_node_id_ref);
25867 return tag_ptr(ret_conv, true);
25870 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) {
25871 LDKChannelManager this_arg_conv;
25872 this_arg_conv.inner = untag_ptr(this_arg);
25873 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25874 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25875 this_arg_conv.is_owned = false;
25876 ChannelManager_force_close_all_channels_broadcasting_latest_txn(&this_arg_conv);
25879 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) {
25880 LDKChannelManager this_arg_conv;
25881 this_arg_conv.inner = untag_ptr(this_arg);
25882 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25883 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25884 this_arg_conv.is_owned = false;
25885 ChannelManager_force_close_all_channels_without_broadcasting_txn(&this_arg_conv);
25888 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) {
25889 LDKChannelManager this_arg_conv;
25890 this_arg_conv.inner = untag_ptr(this_arg);
25891 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25892 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25893 this_arg_conv.is_owned = false;
25894 LDKRoute route_conv;
25895 route_conv.inner = untag_ptr(route);
25896 route_conv.is_owned = ptr_is_owned(route);
25897 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
25898 route_conv.is_owned = false;
25899 LDKThirtyTwoBytes payment_hash_ref;
25900 CHECK(payment_hash->arr_len == 32);
25901 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
25902 LDKThirtyTwoBytes payment_secret_ref;
25903 CHECK(payment_secret->arr_len == 32);
25904 memcpy(payment_secret_ref.data, payment_secret->elems, 32); FREE(payment_secret);
25905 LDKCResult_PaymentIdPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentSendFailureZ), "LDKCResult_PaymentIdPaymentSendFailureZ");
25906 *ret_conv = ChannelManager_send_payment(&this_arg_conv, &route_conv, payment_hash_ref, payment_secret_ref);
25907 return tag_ptr(ret_conv, true);
25910 uint64_t __attribute__((export_name("TS_ChannelManager_retry_payment"))) TS_ChannelManager_retry_payment(uint64_t this_arg, uint64_t route, int8_tArray payment_id) {
25911 LDKChannelManager this_arg_conv;
25912 this_arg_conv.inner = untag_ptr(this_arg);
25913 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25914 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25915 this_arg_conv.is_owned = false;
25916 LDKRoute route_conv;
25917 route_conv.inner = untag_ptr(route);
25918 route_conv.is_owned = ptr_is_owned(route);
25919 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
25920 route_conv.is_owned = false;
25921 LDKThirtyTwoBytes payment_id_ref;
25922 CHECK(payment_id->arr_len == 32);
25923 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
25924 LDKCResult_NonePaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePaymentSendFailureZ), "LDKCResult_NonePaymentSendFailureZ");
25925 *ret_conv = ChannelManager_retry_payment(&this_arg_conv, &route_conv, payment_id_ref);
25926 return tag_ptr(ret_conv, true);
25929 void __attribute__((export_name("TS_ChannelManager_abandon_payment"))) TS_ChannelManager_abandon_payment(uint64_t this_arg, int8_tArray payment_id) {
25930 LDKChannelManager this_arg_conv;
25931 this_arg_conv.inner = untag_ptr(this_arg);
25932 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25933 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25934 this_arg_conv.is_owned = false;
25935 LDKThirtyTwoBytes payment_id_ref;
25936 CHECK(payment_id->arr_len == 32);
25937 memcpy(payment_id_ref.data, payment_id->elems, 32); FREE(payment_id);
25938 ChannelManager_abandon_payment(&this_arg_conv, payment_id_ref);
25941 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) {
25942 LDKChannelManager this_arg_conv;
25943 this_arg_conv.inner = untag_ptr(this_arg);
25944 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25945 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25946 this_arg_conv.is_owned = false;
25947 LDKRoute route_conv;
25948 route_conv.inner = untag_ptr(route);
25949 route_conv.is_owned = ptr_is_owned(route);
25950 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_conv);
25951 route_conv.is_owned = false;
25952 LDKThirtyTwoBytes payment_preimage_ref;
25953 CHECK(payment_preimage->arr_len == 32);
25954 memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage);
25955 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
25956 *ret_conv = ChannelManager_send_spontaneous_payment(&this_arg_conv, &route_conv, payment_preimage_ref);
25957 return tag_ptr(ret_conv, true);
25960 uint64_t __attribute__((export_name("TS_ChannelManager_send_probe"))) TS_ChannelManager_send_probe(uint64_t this_arg, uint64_tArray hops) {
25961 LDKChannelManager this_arg_conv;
25962 this_arg_conv.inner = untag_ptr(this_arg);
25963 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25964 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25965 this_arg_conv.is_owned = false;
25966 LDKCVec_RouteHopZ hops_constr;
25967 hops_constr.datalen = hops->arr_len;
25968 if (hops_constr.datalen > 0)
25969 hops_constr.data = MALLOC(hops_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
25971 hops_constr.data = NULL;
25972 uint64_t* hops_vals = hops->elems;
25973 for (size_t k = 0; k < hops_constr.datalen; k++) {
25974 uint64_t hops_conv_10 = hops_vals[k];
25975 LDKRouteHop hops_conv_10_conv;
25976 hops_conv_10_conv.inner = untag_ptr(hops_conv_10);
25977 hops_conv_10_conv.is_owned = ptr_is_owned(hops_conv_10);
25978 CHECK_INNER_FIELD_ACCESS_OR_NULL(hops_conv_10_conv);
25979 hops_conv_10_conv = RouteHop_clone(&hops_conv_10_conv);
25980 hops_constr.data[k] = hops_conv_10_conv;
25983 LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ), "LDKCResult_C2Tuple_PaymentHashPaymentIdZPaymentSendFailureZ");
25984 *ret_conv = ChannelManager_send_probe(&this_arg_conv, hops_constr);
25985 return tag_ptr(ret_conv, true);
25988 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) {
25989 LDKChannelManager this_arg_conv;
25990 this_arg_conv.inner = untag_ptr(this_arg);
25991 this_arg_conv.is_owned = ptr_is_owned(this_arg);
25992 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
25993 this_arg_conv.is_owned = false;
25994 unsigned char temporary_channel_id_arr[32];
25995 CHECK(temporary_channel_id->arr_len == 32);
25996 memcpy(temporary_channel_id_arr, temporary_channel_id->elems, 32); FREE(temporary_channel_id);
25997 unsigned char (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr;
25998 LDKPublicKey counterparty_node_id_ref;
25999 CHECK(counterparty_node_id->arr_len == 33);
26000 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
26001 LDKTransaction funding_transaction_ref;
26002 funding_transaction_ref.datalen = funding_transaction->arr_len;
26003 funding_transaction_ref.data = MALLOC(funding_transaction_ref.datalen, "LDKTransaction Bytes");
26004 memcpy(funding_transaction_ref.data, funding_transaction->elems, funding_transaction_ref.datalen); FREE(funding_transaction);
26005 funding_transaction_ref.data_is_owned = true;
26006 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
26007 *ret_conv = ChannelManager_funding_transaction_generated(&this_arg_conv, temporary_channel_id_ref, counterparty_node_id_ref, funding_transaction_ref);
26008 return tag_ptr(ret_conv, true);
26011 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) {
26012 LDKChannelManager this_arg_conv;
26013 this_arg_conv.inner = untag_ptr(this_arg);
26014 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26015 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26016 this_arg_conv.is_owned = false;
26017 LDKThreeBytes rgb_ref;
26018 CHECK(rgb->arr_len == 3);
26019 memcpy(rgb_ref.data, rgb->elems, 3); FREE(rgb);
26020 LDKThirtyTwoBytes alias_ref;
26021 CHECK(alias->arr_len == 32);
26022 memcpy(alias_ref.data, alias->elems, 32); FREE(alias);
26023 LDKCVec_NetAddressZ addresses_constr;
26024 addresses_constr.datalen = addresses->arr_len;
26025 if (addresses_constr.datalen > 0)
26026 addresses_constr.data = MALLOC(addresses_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
26028 addresses_constr.data = NULL;
26029 uint64_t* addresses_vals = addresses->elems;
26030 for (size_t m = 0; m < addresses_constr.datalen; m++) {
26031 uint64_t addresses_conv_12 = addresses_vals[m];
26032 void* addresses_conv_12_ptr = untag_ptr(addresses_conv_12);
26033 CHECK_ACCESS(addresses_conv_12_ptr);
26034 LDKNetAddress addresses_conv_12_conv = *(LDKNetAddress*)(addresses_conv_12_ptr);
26035 addresses_constr.data[m] = addresses_conv_12_conv;
26038 ChannelManager_broadcast_node_announcement(&this_arg_conv, rgb_ref, alias_ref, addresses_constr);
26041 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) {
26042 LDKChannelManager this_arg_conv;
26043 this_arg_conv.inner = untag_ptr(this_arg);
26044 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26045 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26046 this_arg_conv.is_owned = false;
26047 LDKPublicKey counterparty_node_id_ref;
26048 CHECK(counterparty_node_id->arr_len == 33);
26049 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
26050 LDKCVec_ThirtyTwoBytesZ channel_ids_constr;
26051 channel_ids_constr.datalen = channel_ids->arr_len;
26052 if (channel_ids_constr.datalen > 0)
26053 channel_ids_constr.data = MALLOC(channel_ids_constr.datalen * sizeof(LDKThirtyTwoBytes), "LDKCVec_ThirtyTwoBytesZ Elements");
26055 channel_ids_constr.data = NULL;
26056 int8_tArray* channel_ids_vals = (void*) channel_ids->elems;
26057 for (size_t m = 0; m < channel_ids_constr.datalen; m++) {
26058 int8_tArray channel_ids_conv_12 = channel_ids_vals[m];
26059 LDKThirtyTwoBytes channel_ids_conv_12_ref;
26060 CHECK(channel_ids_conv_12->arr_len == 32);
26061 memcpy(channel_ids_conv_12_ref.data, channel_ids_conv_12->elems, 32); FREE(channel_ids_conv_12);
26062 channel_ids_constr.data[m] = channel_ids_conv_12_ref;
26065 LDKChannelConfig config_conv;
26066 config_conv.inner = untag_ptr(config);
26067 config_conv.is_owned = ptr_is_owned(config);
26068 CHECK_INNER_FIELD_ACCESS_OR_NULL(config_conv);
26069 config_conv.is_owned = false;
26070 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
26071 *ret_conv = ChannelManager_update_channel_config(&this_arg_conv, counterparty_node_id_ref, channel_ids_constr, &config_conv);
26072 return tag_ptr(ret_conv, true);
26075 void __attribute__((export_name("TS_ChannelManager_process_pending_htlc_forwards"))) TS_ChannelManager_process_pending_htlc_forwards(uint64_t this_arg) {
26076 LDKChannelManager this_arg_conv;
26077 this_arg_conv.inner = untag_ptr(this_arg);
26078 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26079 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26080 this_arg_conv.is_owned = false;
26081 ChannelManager_process_pending_htlc_forwards(&this_arg_conv);
26084 void __attribute__((export_name("TS_ChannelManager_timer_tick_occurred"))) TS_ChannelManager_timer_tick_occurred(uint64_t this_arg) {
26085 LDKChannelManager this_arg_conv;
26086 this_arg_conv.inner = untag_ptr(this_arg);
26087 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26088 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26089 this_arg_conv.is_owned = false;
26090 ChannelManager_timer_tick_occurred(&this_arg_conv);
26093 void __attribute__((export_name("TS_ChannelManager_fail_htlc_backwards"))) TS_ChannelManager_fail_htlc_backwards(uint64_t this_arg, int8_tArray payment_hash) {
26094 LDKChannelManager this_arg_conv;
26095 this_arg_conv.inner = untag_ptr(this_arg);
26096 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26097 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26098 this_arg_conv.is_owned = false;
26099 unsigned char payment_hash_arr[32];
26100 CHECK(payment_hash->arr_len == 32);
26101 memcpy(payment_hash_arr, payment_hash->elems, 32); FREE(payment_hash);
26102 unsigned char (*payment_hash_ref)[32] = &payment_hash_arr;
26103 ChannelManager_fail_htlc_backwards(&this_arg_conv, payment_hash_ref);
26106 void __attribute__((export_name("TS_ChannelManager_claim_funds"))) TS_ChannelManager_claim_funds(uint64_t this_arg, int8_tArray payment_preimage) {
26107 LDKChannelManager this_arg_conv;
26108 this_arg_conv.inner = untag_ptr(this_arg);
26109 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26110 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26111 this_arg_conv.is_owned = false;
26112 LDKThirtyTwoBytes payment_preimage_ref;
26113 CHECK(payment_preimage->arr_len == 32);
26114 memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage);
26115 ChannelManager_claim_funds(&this_arg_conv, payment_preimage_ref);
26118 int8_tArray __attribute__((export_name("TS_ChannelManager_get_our_node_id"))) TS_ChannelManager_get_our_node_id(uint64_t this_arg) {
26119 LDKChannelManager this_arg_conv;
26120 this_arg_conv.inner = untag_ptr(this_arg);
26121 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26122 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26123 this_arg_conv.is_owned = false;
26124 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
26125 memcpy(ret_arr->elems, ChannelManager_get_our_node_id(&this_arg_conv).compressed_form, 33);
26129 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) {
26130 LDKChannelManager this_arg_conv;
26131 this_arg_conv.inner = untag_ptr(this_arg);
26132 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26133 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26134 this_arg_conv.is_owned = false;
26135 unsigned char temporary_channel_id_arr[32];
26136 CHECK(temporary_channel_id->arr_len == 32);
26137 memcpy(temporary_channel_id_arr, temporary_channel_id->elems, 32); FREE(temporary_channel_id);
26138 unsigned char (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr;
26139 LDKPublicKey counterparty_node_id_ref;
26140 CHECK(counterparty_node_id->arr_len == 33);
26141 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
26142 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
26143 *ret_conv = ChannelManager_accept_inbound_channel(&this_arg_conv, temporary_channel_id_ref, counterparty_node_id_ref, user_channel_id);
26144 return tag_ptr(ret_conv, true);
26147 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) {
26148 LDKChannelManager this_arg_conv;
26149 this_arg_conv.inner = untag_ptr(this_arg);
26150 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26151 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26152 this_arg_conv.is_owned = false;
26153 unsigned char temporary_channel_id_arr[32];
26154 CHECK(temporary_channel_id->arr_len == 32);
26155 memcpy(temporary_channel_id_arr, temporary_channel_id->elems, 32); FREE(temporary_channel_id);
26156 unsigned char (*temporary_channel_id_ref)[32] = &temporary_channel_id_arr;
26157 LDKPublicKey counterparty_node_id_ref;
26158 CHECK(counterparty_node_id->arr_len == 33);
26159 memcpy(counterparty_node_id_ref.compressed_form, counterparty_node_id->elems, 33); FREE(counterparty_node_id);
26160 LDKCResult_NoneAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneAPIErrorZ), "LDKCResult_NoneAPIErrorZ");
26161 *ret_conv = ChannelManager_accept_inbound_channel_from_trusted_peer_0conf(&this_arg_conv, temporary_channel_id_ref, counterparty_node_id_ref, user_channel_id);
26162 return tag_ptr(ret_conv, true);
26165 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) {
26166 LDKChannelManager this_arg_conv;
26167 this_arg_conv.inner = untag_ptr(this_arg);
26168 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26169 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26170 this_arg_conv.is_owned = false;
26171 void* min_value_msat_ptr = untag_ptr(min_value_msat);
26172 CHECK_ACCESS(min_value_msat_ptr);
26173 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
26174 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
26175 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
26176 *ret_conv = ChannelManager_create_inbound_payment(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs);
26177 return tag_ptr(ret_conv, true);
26180 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) {
26181 LDKChannelManager this_arg_conv;
26182 this_arg_conv.inner = untag_ptr(this_arg);
26183 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26184 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26185 this_arg_conv.is_owned = false;
26186 void* min_value_msat_ptr = untag_ptr(min_value_msat);
26187 CHECK_ACCESS(min_value_msat_ptr);
26188 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
26189 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
26190 LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZAPIErrorZ");
26191 *ret_conv = ChannelManager_create_inbound_payment_legacy(&this_arg_conv, min_value_msat_conv, invoice_expiry_delta_secs);
26192 return tag_ptr(ret_conv, true);
26195 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) {
26196 LDKChannelManager this_arg_conv;
26197 this_arg_conv.inner = untag_ptr(this_arg);
26198 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26199 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26200 this_arg_conv.is_owned = false;
26201 LDKThirtyTwoBytes payment_hash_ref;
26202 CHECK(payment_hash->arr_len == 32);
26203 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
26204 void* min_value_msat_ptr = untag_ptr(min_value_msat);
26205 CHECK_ACCESS(min_value_msat_ptr);
26206 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
26207 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
26208 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
26209 *ret_conv = ChannelManager_create_inbound_payment_for_hash(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs);
26210 return tag_ptr(ret_conv, true);
26213 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) {
26214 LDKChannelManager this_arg_conv;
26215 this_arg_conv.inner = untag_ptr(this_arg);
26216 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26217 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26218 this_arg_conv.is_owned = false;
26219 LDKThirtyTwoBytes payment_hash_ref;
26220 CHECK(payment_hash->arr_len == 32);
26221 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
26222 void* min_value_msat_ptr = untag_ptr(min_value_msat);
26223 CHECK_ACCESS(min_value_msat_ptr);
26224 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
26225 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
26226 LDKCResult_PaymentSecretAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretAPIErrorZ), "LDKCResult_PaymentSecretAPIErrorZ");
26227 *ret_conv = ChannelManager_create_inbound_payment_for_hash_legacy(&this_arg_conv, payment_hash_ref, min_value_msat_conv, invoice_expiry_delta_secs);
26228 return tag_ptr(ret_conv, true);
26231 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) {
26232 LDKChannelManager this_arg_conv;
26233 this_arg_conv.inner = untag_ptr(this_arg);
26234 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26235 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26236 this_arg_conv.is_owned = false;
26237 LDKThirtyTwoBytes payment_hash_ref;
26238 CHECK(payment_hash->arr_len == 32);
26239 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
26240 LDKThirtyTwoBytes payment_secret_ref;
26241 CHECK(payment_secret->arr_len == 32);
26242 memcpy(payment_secret_ref.data, payment_secret->elems, 32); FREE(payment_secret);
26243 LDKCResult_PaymentPreimageAPIErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentPreimageAPIErrorZ), "LDKCResult_PaymentPreimageAPIErrorZ");
26244 *ret_conv = ChannelManager_get_payment_preimage(&this_arg_conv, payment_hash_ref, payment_secret_ref);
26245 return tag_ptr(ret_conv, true);
26248 int64_t __attribute__((export_name("TS_ChannelManager_get_phantom_scid"))) TS_ChannelManager_get_phantom_scid(uint64_t this_arg) {
26249 LDKChannelManager this_arg_conv;
26250 this_arg_conv.inner = untag_ptr(this_arg);
26251 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26252 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26253 this_arg_conv.is_owned = false;
26254 int64_t ret_conv = ChannelManager_get_phantom_scid(&this_arg_conv);
26258 uint64_t __attribute__((export_name("TS_ChannelManager_get_phantom_route_hints"))) TS_ChannelManager_get_phantom_route_hints(uint64_t this_arg) {
26259 LDKChannelManager this_arg_conv;
26260 this_arg_conv.inner = untag_ptr(this_arg);
26261 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26262 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26263 this_arg_conv.is_owned = false;
26264 LDKPhantomRouteHints ret_var = ChannelManager_get_phantom_route_hints(&this_arg_conv);
26265 uint64_t ret_ref = 0;
26266 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26267 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26271 uint64_t __attribute__((export_name("TS_ChannelManager_as_MessageSendEventsProvider"))) TS_ChannelManager_as_MessageSendEventsProvider(uint64_t this_arg) {
26272 LDKChannelManager this_arg_conv;
26273 this_arg_conv.inner = untag_ptr(this_arg);
26274 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26275 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26276 this_arg_conv.is_owned = false;
26277 LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
26278 *ret_ret = ChannelManager_as_MessageSendEventsProvider(&this_arg_conv);
26279 return tag_ptr(ret_ret, true);
26282 uint64_t __attribute__((export_name("TS_ChannelManager_as_EventsProvider"))) TS_ChannelManager_as_EventsProvider(uint64_t this_arg) {
26283 LDKChannelManager this_arg_conv;
26284 this_arg_conv.inner = untag_ptr(this_arg);
26285 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26286 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26287 this_arg_conv.is_owned = false;
26288 LDKEventsProvider* ret_ret = MALLOC(sizeof(LDKEventsProvider), "LDKEventsProvider");
26289 *ret_ret = ChannelManager_as_EventsProvider(&this_arg_conv);
26290 return tag_ptr(ret_ret, true);
26293 uint64_t __attribute__((export_name("TS_ChannelManager_as_Listen"))) TS_ChannelManager_as_Listen(uint64_t this_arg) {
26294 LDKChannelManager this_arg_conv;
26295 this_arg_conv.inner = untag_ptr(this_arg);
26296 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26297 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26298 this_arg_conv.is_owned = false;
26299 LDKListen* ret_ret = MALLOC(sizeof(LDKListen), "LDKListen");
26300 *ret_ret = ChannelManager_as_Listen(&this_arg_conv);
26301 return tag_ptr(ret_ret, true);
26304 uint64_t __attribute__((export_name("TS_ChannelManager_as_Confirm"))) TS_ChannelManager_as_Confirm(uint64_t this_arg) {
26305 LDKChannelManager this_arg_conv;
26306 this_arg_conv.inner = untag_ptr(this_arg);
26307 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26308 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26309 this_arg_conv.is_owned = false;
26310 LDKConfirm* ret_ret = MALLOC(sizeof(LDKConfirm), "LDKConfirm");
26311 *ret_ret = ChannelManager_as_Confirm(&this_arg_conv);
26312 return tag_ptr(ret_ret, true);
26315 void __attribute__((export_name("TS_ChannelManager_await_persistable_update"))) TS_ChannelManager_await_persistable_update(uint64_t this_arg) {
26316 LDKChannelManager this_arg_conv;
26317 this_arg_conv.inner = untag_ptr(this_arg);
26318 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26319 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26320 this_arg_conv.is_owned = false;
26321 ChannelManager_await_persistable_update(&this_arg_conv);
26324 uint64_t __attribute__((export_name("TS_ChannelManager_current_best_block"))) TS_ChannelManager_current_best_block(uint64_t this_arg) {
26325 LDKChannelManager this_arg_conv;
26326 this_arg_conv.inner = untag_ptr(this_arg);
26327 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26328 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26329 this_arg_conv.is_owned = false;
26330 LDKBestBlock ret_var = ChannelManager_current_best_block(&this_arg_conv);
26331 uint64_t ret_ref = 0;
26332 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26333 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26337 uint64_t __attribute__((export_name("TS_ChannelManager_as_ChannelMessageHandler"))) TS_ChannelManager_as_ChannelMessageHandler(uint64_t this_arg) {
26338 LDKChannelManager this_arg_conv;
26339 this_arg_conv.inner = untag_ptr(this_arg);
26340 this_arg_conv.is_owned = ptr_is_owned(this_arg);
26341 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
26342 this_arg_conv.is_owned = false;
26343 LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
26344 *ret_ret = ChannelManager_as_ChannelMessageHandler(&this_arg_conv);
26345 return tag_ptr(ret_ret, true);
26348 int8_tArray __attribute__((export_name("TS_CounterpartyForwardingInfo_write"))) TS_CounterpartyForwardingInfo_write(uint64_t obj) {
26349 LDKCounterpartyForwardingInfo obj_conv;
26350 obj_conv.inner = untag_ptr(obj);
26351 obj_conv.is_owned = ptr_is_owned(obj);
26352 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
26353 obj_conv.is_owned = false;
26354 LDKCVec_u8Z ret_var = CounterpartyForwardingInfo_write(&obj_conv);
26355 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
26356 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
26357 CVec_u8Z_free(ret_var);
26361 uint64_t __attribute__((export_name("TS_CounterpartyForwardingInfo_read"))) TS_CounterpartyForwardingInfo_read(int8_tArray ser) {
26362 LDKu8slice ser_ref;
26363 ser_ref.datalen = ser->arr_len;
26364 ser_ref.data = ser->elems;
26365 LDKCResult_CounterpartyForwardingInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyForwardingInfoDecodeErrorZ), "LDKCResult_CounterpartyForwardingInfoDecodeErrorZ");
26366 *ret_conv = CounterpartyForwardingInfo_read(ser_ref);
26368 return tag_ptr(ret_conv, true);
26371 int8_tArray __attribute__((export_name("TS_ChannelCounterparty_write"))) TS_ChannelCounterparty_write(uint64_t obj) {
26372 LDKChannelCounterparty obj_conv;
26373 obj_conv.inner = untag_ptr(obj);
26374 obj_conv.is_owned = ptr_is_owned(obj);
26375 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
26376 obj_conv.is_owned = false;
26377 LDKCVec_u8Z ret_var = ChannelCounterparty_write(&obj_conv);
26378 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
26379 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
26380 CVec_u8Z_free(ret_var);
26384 uint64_t __attribute__((export_name("TS_ChannelCounterparty_read"))) TS_ChannelCounterparty_read(int8_tArray ser) {
26385 LDKu8slice ser_ref;
26386 ser_ref.datalen = ser->arr_len;
26387 ser_ref.data = ser->elems;
26388 LDKCResult_ChannelCounterpartyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelCounterpartyDecodeErrorZ), "LDKCResult_ChannelCounterpartyDecodeErrorZ");
26389 *ret_conv = ChannelCounterparty_read(ser_ref);
26391 return tag_ptr(ret_conv, true);
26394 int8_tArray __attribute__((export_name("TS_ChannelDetails_write"))) TS_ChannelDetails_write(uint64_t obj) {
26395 LDKChannelDetails obj_conv;
26396 obj_conv.inner = untag_ptr(obj);
26397 obj_conv.is_owned = ptr_is_owned(obj);
26398 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
26399 obj_conv.is_owned = false;
26400 LDKCVec_u8Z ret_var = ChannelDetails_write(&obj_conv);
26401 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
26402 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
26403 CVec_u8Z_free(ret_var);
26407 uint64_t __attribute__((export_name("TS_ChannelDetails_read"))) TS_ChannelDetails_read(int8_tArray ser) {
26408 LDKu8slice ser_ref;
26409 ser_ref.datalen = ser->arr_len;
26410 ser_ref.data = ser->elems;
26411 LDKCResult_ChannelDetailsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelDetailsDecodeErrorZ), "LDKCResult_ChannelDetailsDecodeErrorZ");
26412 *ret_conv = ChannelDetails_read(ser_ref);
26414 return tag_ptr(ret_conv, true);
26417 int8_tArray __attribute__((export_name("TS_PhantomRouteHints_write"))) TS_PhantomRouteHints_write(uint64_t obj) {
26418 LDKPhantomRouteHints obj_conv;
26419 obj_conv.inner = untag_ptr(obj);
26420 obj_conv.is_owned = ptr_is_owned(obj);
26421 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
26422 obj_conv.is_owned = false;
26423 LDKCVec_u8Z ret_var = PhantomRouteHints_write(&obj_conv);
26424 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
26425 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
26426 CVec_u8Z_free(ret_var);
26430 uint64_t __attribute__((export_name("TS_PhantomRouteHints_read"))) TS_PhantomRouteHints_read(int8_tArray ser) {
26431 LDKu8slice ser_ref;
26432 ser_ref.datalen = ser->arr_len;
26433 ser_ref.data = ser->elems;
26434 LDKCResult_PhantomRouteHintsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PhantomRouteHintsDecodeErrorZ), "LDKCResult_PhantomRouteHintsDecodeErrorZ");
26435 *ret_conv = PhantomRouteHints_read(ser_ref);
26437 return tag_ptr(ret_conv, true);
26440 int8_tArray __attribute__((export_name("TS_ChannelManager_write"))) TS_ChannelManager_write(uint64_t obj) {
26441 LDKChannelManager obj_conv;
26442 obj_conv.inner = untag_ptr(obj);
26443 obj_conv.is_owned = ptr_is_owned(obj);
26444 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
26445 obj_conv.is_owned = false;
26446 LDKCVec_u8Z ret_var = ChannelManager_write(&obj_conv);
26447 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
26448 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
26449 CVec_u8Z_free(ret_var);
26453 void __attribute__((export_name("TS_ChannelManagerReadArgs_free"))) TS_ChannelManagerReadArgs_free(uint64_t this_obj) {
26454 LDKChannelManagerReadArgs this_obj_conv;
26455 this_obj_conv.inner = untag_ptr(this_obj);
26456 this_obj_conv.is_owned = ptr_is_owned(this_obj);
26457 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
26458 ChannelManagerReadArgs_free(this_obj_conv);
26461 uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_keys_manager"))) TS_ChannelManagerReadArgs_get_keys_manager(uint64_t this_ptr) {
26462 LDKChannelManagerReadArgs this_ptr_conv;
26463 this_ptr_conv.inner = untag_ptr(this_ptr);
26464 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26465 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26466 this_ptr_conv.is_owned = false;
26467 // WARNING: This object doesn't live past this scope, needs clone!
26468 uint64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_keys_manager(&this_ptr_conv), false);
26472 void __attribute__((export_name("TS_ChannelManagerReadArgs_set_keys_manager"))) TS_ChannelManagerReadArgs_set_keys_manager(uint64_t this_ptr, uint64_t val) {
26473 LDKChannelManagerReadArgs this_ptr_conv;
26474 this_ptr_conv.inner = untag_ptr(this_ptr);
26475 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26476 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26477 this_ptr_conv.is_owned = false;
26478 void* val_ptr = untag_ptr(val);
26479 CHECK_ACCESS(val_ptr);
26480 LDKKeysInterface val_conv = *(LDKKeysInterface*)(val_ptr);
26481 if (val_conv.free == LDKKeysInterface_JCalls_free) {
26482 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26483 LDKKeysInterface_JCalls_cloned(&val_conv);
26485 ChannelManagerReadArgs_set_keys_manager(&this_ptr_conv, val_conv);
26488 uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_fee_estimator"))) TS_ChannelManagerReadArgs_get_fee_estimator(uint64_t this_ptr) {
26489 LDKChannelManagerReadArgs this_ptr_conv;
26490 this_ptr_conv.inner = untag_ptr(this_ptr);
26491 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26492 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26493 this_ptr_conv.is_owned = false;
26494 // WARNING: This object doesn't live past this scope, needs clone!
26495 uint64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_fee_estimator(&this_ptr_conv), false);
26499 void __attribute__((export_name("TS_ChannelManagerReadArgs_set_fee_estimator"))) TS_ChannelManagerReadArgs_set_fee_estimator(uint64_t this_ptr, uint64_t val) {
26500 LDKChannelManagerReadArgs this_ptr_conv;
26501 this_ptr_conv.inner = untag_ptr(this_ptr);
26502 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26503 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26504 this_ptr_conv.is_owned = false;
26505 void* val_ptr = untag_ptr(val);
26506 CHECK_ACCESS(val_ptr);
26507 LDKFeeEstimator val_conv = *(LDKFeeEstimator*)(val_ptr);
26508 if (val_conv.free == LDKFeeEstimator_JCalls_free) {
26509 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26510 LDKFeeEstimator_JCalls_cloned(&val_conv);
26512 ChannelManagerReadArgs_set_fee_estimator(&this_ptr_conv, val_conv);
26515 uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_chain_monitor"))) TS_ChannelManagerReadArgs_get_chain_monitor(uint64_t this_ptr) {
26516 LDKChannelManagerReadArgs this_ptr_conv;
26517 this_ptr_conv.inner = untag_ptr(this_ptr);
26518 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26519 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26520 this_ptr_conv.is_owned = false;
26521 // WARNING: This object doesn't live past this scope, needs clone!
26522 uint64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_chain_monitor(&this_ptr_conv), false);
26526 void __attribute__((export_name("TS_ChannelManagerReadArgs_set_chain_monitor"))) TS_ChannelManagerReadArgs_set_chain_monitor(uint64_t this_ptr, uint64_t val) {
26527 LDKChannelManagerReadArgs this_ptr_conv;
26528 this_ptr_conv.inner = untag_ptr(this_ptr);
26529 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26530 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26531 this_ptr_conv.is_owned = false;
26532 void* val_ptr = untag_ptr(val);
26533 CHECK_ACCESS(val_ptr);
26534 LDKWatch val_conv = *(LDKWatch*)(val_ptr);
26535 if (val_conv.free == LDKWatch_JCalls_free) {
26536 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26537 LDKWatch_JCalls_cloned(&val_conv);
26539 ChannelManagerReadArgs_set_chain_monitor(&this_ptr_conv, val_conv);
26542 uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_tx_broadcaster"))) TS_ChannelManagerReadArgs_get_tx_broadcaster(uint64_t this_ptr) {
26543 LDKChannelManagerReadArgs this_ptr_conv;
26544 this_ptr_conv.inner = untag_ptr(this_ptr);
26545 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26546 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26547 this_ptr_conv.is_owned = false;
26548 // WARNING: This object doesn't live past this scope, needs clone!
26549 uint64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_tx_broadcaster(&this_ptr_conv), false);
26553 void __attribute__((export_name("TS_ChannelManagerReadArgs_set_tx_broadcaster"))) TS_ChannelManagerReadArgs_set_tx_broadcaster(uint64_t this_ptr, uint64_t val) {
26554 LDKChannelManagerReadArgs this_ptr_conv;
26555 this_ptr_conv.inner = untag_ptr(this_ptr);
26556 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26557 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26558 this_ptr_conv.is_owned = false;
26559 void* val_ptr = untag_ptr(val);
26560 CHECK_ACCESS(val_ptr);
26561 LDKBroadcasterInterface val_conv = *(LDKBroadcasterInterface*)(val_ptr);
26562 if (val_conv.free == LDKBroadcasterInterface_JCalls_free) {
26563 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26564 LDKBroadcasterInterface_JCalls_cloned(&val_conv);
26566 ChannelManagerReadArgs_set_tx_broadcaster(&this_ptr_conv, val_conv);
26569 uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_logger"))) TS_ChannelManagerReadArgs_get_logger(uint64_t this_ptr) {
26570 LDKChannelManagerReadArgs this_ptr_conv;
26571 this_ptr_conv.inner = untag_ptr(this_ptr);
26572 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26573 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26574 this_ptr_conv.is_owned = false;
26575 // WARNING: This object doesn't live past this scope, needs clone!
26576 uint64_t ret_ret = tag_ptr(ChannelManagerReadArgs_get_logger(&this_ptr_conv), false);
26580 void __attribute__((export_name("TS_ChannelManagerReadArgs_set_logger"))) TS_ChannelManagerReadArgs_set_logger(uint64_t this_ptr, uint64_t val) {
26581 LDKChannelManagerReadArgs this_ptr_conv;
26582 this_ptr_conv.inner = untag_ptr(this_ptr);
26583 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26584 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26585 this_ptr_conv.is_owned = false;
26586 void* val_ptr = untag_ptr(val);
26587 CHECK_ACCESS(val_ptr);
26588 LDKLogger val_conv = *(LDKLogger*)(val_ptr);
26589 if (val_conv.free == LDKLogger_JCalls_free) {
26590 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26591 LDKLogger_JCalls_cloned(&val_conv);
26593 ChannelManagerReadArgs_set_logger(&this_ptr_conv, val_conv);
26596 uint64_t __attribute__((export_name("TS_ChannelManagerReadArgs_get_default_config"))) TS_ChannelManagerReadArgs_get_default_config(uint64_t this_ptr) {
26597 LDKChannelManagerReadArgs this_ptr_conv;
26598 this_ptr_conv.inner = untag_ptr(this_ptr);
26599 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26600 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26601 this_ptr_conv.is_owned = false;
26602 LDKUserConfig ret_var = ChannelManagerReadArgs_get_default_config(&this_ptr_conv);
26603 uint64_t ret_ref = 0;
26604 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26605 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26609 void __attribute__((export_name("TS_ChannelManagerReadArgs_set_default_config"))) TS_ChannelManagerReadArgs_set_default_config(uint64_t this_ptr, uint64_t val) {
26610 LDKChannelManagerReadArgs this_ptr_conv;
26611 this_ptr_conv.inner = untag_ptr(this_ptr);
26612 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26613 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26614 this_ptr_conv.is_owned = false;
26615 LDKUserConfig val_conv;
26616 val_conv.inner = untag_ptr(val);
26617 val_conv.is_owned = ptr_is_owned(val);
26618 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
26619 val_conv = UserConfig_clone(&val_conv);
26620 ChannelManagerReadArgs_set_default_config(&this_ptr_conv, val_conv);
26623 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) {
26624 void* keys_manager_ptr = untag_ptr(keys_manager);
26625 CHECK_ACCESS(keys_manager_ptr);
26626 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
26627 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
26628 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26629 LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
26631 void* fee_estimator_ptr = untag_ptr(fee_estimator);
26632 CHECK_ACCESS(fee_estimator_ptr);
26633 LDKFeeEstimator fee_estimator_conv = *(LDKFeeEstimator*)(fee_estimator_ptr);
26634 if (fee_estimator_conv.free == LDKFeeEstimator_JCalls_free) {
26635 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26636 LDKFeeEstimator_JCalls_cloned(&fee_estimator_conv);
26638 void* chain_monitor_ptr = untag_ptr(chain_monitor);
26639 CHECK_ACCESS(chain_monitor_ptr);
26640 LDKWatch chain_monitor_conv = *(LDKWatch*)(chain_monitor_ptr);
26641 if (chain_monitor_conv.free == LDKWatch_JCalls_free) {
26642 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26643 LDKWatch_JCalls_cloned(&chain_monitor_conv);
26645 void* tx_broadcaster_ptr = untag_ptr(tx_broadcaster);
26646 CHECK_ACCESS(tx_broadcaster_ptr);
26647 LDKBroadcasterInterface tx_broadcaster_conv = *(LDKBroadcasterInterface*)(tx_broadcaster_ptr);
26648 if (tx_broadcaster_conv.free == LDKBroadcasterInterface_JCalls_free) {
26649 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26650 LDKBroadcasterInterface_JCalls_cloned(&tx_broadcaster_conv);
26652 void* logger_ptr = untag_ptr(logger);
26653 CHECK_ACCESS(logger_ptr);
26654 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
26655 if (logger_conv.free == LDKLogger_JCalls_free) {
26656 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
26657 LDKLogger_JCalls_cloned(&logger_conv);
26659 LDKUserConfig default_config_conv;
26660 default_config_conv.inner = untag_ptr(default_config);
26661 default_config_conv.is_owned = ptr_is_owned(default_config);
26662 CHECK_INNER_FIELD_ACCESS_OR_NULL(default_config_conv);
26663 default_config_conv = UserConfig_clone(&default_config_conv);
26664 LDKCVec_ChannelMonitorZ channel_monitors_constr;
26665 channel_monitors_constr.datalen = channel_monitors->arr_len;
26666 if (channel_monitors_constr.datalen > 0)
26667 channel_monitors_constr.data = MALLOC(channel_monitors_constr.datalen * sizeof(LDKChannelMonitor), "LDKCVec_ChannelMonitorZ Elements");
26669 channel_monitors_constr.data = NULL;
26670 uint64_t* channel_monitors_vals = channel_monitors->elems;
26671 for (size_t q = 0; q < channel_monitors_constr.datalen; q++) {
26672 uint64_t channel_monitors_conv_16 = channel_monitors_vals[q];
26673 LDKChannelMonitor channel_monitors_conv_16_conv;
26674 channel_monitors_conv_16_conv.inner = untag_ptr(channel_monitors_conv_16);
26675 channel_monitors_conv_16_conv.is_owned = ptr_is_owned(channel_monitors_conv_16);
26676 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_monitors_conv_16_conv);
26677 channel_monitors_conv_16_conv.is_owned = false;
26678 channel_monitors_constr.data[q] = channel_monitors_conv_16_conv;
26680 FREE(channel_monitors);
26681 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);
26682 uint64_t ret_ref = 0;
26683 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26684 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26688 uint64_t __attribute__((export_name("TS_C2Tuple_BlockHashChannelManagerZ_read"))) TS_C2Tuple_BlockHashChannelManagerZ_read(int8_tArray ser, uint64_t arg) {
26689 LDKu8slice ser_ref;
26690 ser_ref.datalen = ser->arr_len;
26691 ser_ref.data = ser->elems;
26692 LDKChannelManagerReadArgs arg_conv;
26693 arg_conv.inner = untag_ptr(arg);
26694 arg_conv.is_owned = ptr_is_owned(arg);
26695 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
26696 // WARNING: we need a move here but no clone is available for LDKChannelManagerReadArgs
26698 LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ), "LDKCResult_C2Tuple_BlockHashChannelManagerZDecodeErrorZ");
26699 *ret_conv = C2Tuple_BlockHashChannelManagerZ_read(ser_ref, arg_conv);
26701 return tag_ptr(ret_conv, true);
26704 void __attribute__((export_name("TS_ExpandedKey_free"))) TS_ExpandedKey_free(uint64_t this_obj) {
26705 LDKExpandedKey this_obj_conv;
26706 this_obj_conv.inner = untag_ptr(this_obj);
26707 this_obj_conv.is_owned = ptr_is_owned(this_obj);
26708 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
26709 ExpandedKey_free(this_obj_conv);
26712 uint64_t __attribute__((export_name("TS_ExpandedKey_new"))) TS_ExpandedKey_new(int8_tArray key_material) {
26713 unsigned char key_material_arr[32];
26714 CHECK(key_material->arr_len == 32);
26715 memcpy(key_material_arr, key_material->elems, 32); FREE(key_material);
26716 unsigned char (*key_material_ref)[32] = &key_material_arr;
26717 LDKExpandedKey ret_var = ExpandedKey_new(key_material_ref);
26718 uint64_t ret_ref = 0;
26719 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26720 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26724 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) {
26725 LDKExpandedKey keys_conv;
26726 keys_conv.inner = untag_ptr(keys);
26727 keys_conv.is_owned = ptr_is_owned(keys);
26728 CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv);
26729 keys_conv.is_owned = false;
26730 void* min_value_msat_ptr = untag_ptr(min_value_msat);
26731 CHECK_ACCESS(min_value_msat_ptr);
26732 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
26733 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
26734 void* keys_manager_ptr = untag_ptr(keys_manager);
26735 if (ptr_is_owned(keys_manager)) { CHECK_ACCESS(keys_manager_ptr); }
26736 LDKKeysInterface* keys_manager_conv = (LDKKeysInterface*)keys_manager_ptr;
26737 LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ), "LDKCResult_C2Tuple_PaymentHashPaymentSecretZNoneZ");
26738 *ret_conv = create(&keys_conv, min_value_msat_conv, invoice_expiry_delta_secs, keys_manager_conv, current_time);
26739 return tag_ptr(ret_conv, true);
26742 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) {
26743 LDKExpandedKey keys_conv;
26744 keys_conv.inner = untag_ptr(keys);
26745 keys_conv.is_owned = ptr_is_owned(keys);
26746 CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv);
26747 keys_conv.is_owned = false;
26748 void* min_value_msat_ptr = untag_ptr(min_value_msat);
26749 CHECK_ACCESS(min_value_msat_ptr);
26750 LDKCOption_u64Z min_value_msat_conv = *(LDKCOption_u64Z*)(min_value_msat_ptr);
26751 min_value_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(min_value_msat));
26752 LDKThirtyTwoBytes payment_hash_ref;
26753 CHECK(payment_hash->arr_len == 32);
26754 memcpy(payment_hash_ref.data, payment_hash->elems, 32); FREE(payment_hash);
26755 LDKCResult_PaymentSecretNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentSecretNoneZ), "LDKCResult_PaymentSecretNoneZ");
26756 *ret_conv = create_from_hash(&keys_conv, min_value_msat_conv, payment_hash_ref, invoice_expiry_delta_secs, current_time);
26757 return tag_ptr(ret_conv, true);
26760 void __attribute__((export_name("TS_DecodeError_free"))) TS_DecodeError_free(uint64_t this_obj) {
26761 LDKDecodeError this_obj_conv;
26762 this_obj_conv.inner = untag_ptr(this_obj);
26763 this_obj_conv.is_owned = ptr_is_owned(this_obj);
26764 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
26765 DecodeError_free(this_obj_conv);
26768 static inline uint64_t DecodeError_clone_ptr(LDKDecodeError *NONNULL_PTR arg) {
26769 LDKDecodeError ret_var = DecodeError_clone(arg);
26770 uint64_t ret_ref = 0;
26771 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26772 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26775 int64_t __attribute__((export_name("TS_DecodeError_clone_ptr"))) TS_DecodeError_clone_ptr(uint64_t arg) {
26776 LDKDecodeError arg_conv;
26777 arg_conv.inner = untag_ptr(arg);
26778 arg_conv.is_owned = ptr_is_owned(arg);
26779 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
26780 arg_conv.is_owned = false;
26781 int64_t ret_conv = DecodeError_clone_ptr(&arg_conv);
26785 uint64_t __attribute__((export_name("TS_DecodeError_clone"))) TS_DecodeError_clone(uint64_t orig) {
26786 LDKDecodeError orig_conv;
26787 orig_conv.inner = untag_ptr(orig);
26788 orig_conv.is_owned = ptr_is_owned(orig);
26789 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
26790 orig_conv.is_owned = false;
26791 LDKDecodeError ret_var = DecodeError_clone(&orig_conv);
26792 uint64_t ret_ref = 0;
26793 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26794 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26798 void __attribute__((export_name("TS_Init_free"))) TS_Init_free(uint64_t this_obj) {
26799 LDKInit this_obj_conv;
26800 this_obj_conv.inner = untag_ptr(this_obj);
26801 this_obj_conv.is_owned = ptr_is_owned(this_obj);
26802 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
26803 Init_free(this_obj_conv);
26806 uint64_t __attribute__((export_name("TS_Init_get_features"))) TS_Init_get_features(uint64_t this_ptr) {
26807 LDKInit this_ptr_conv;
26808 this_ptr_conv.inner = untag_ptr(this_ptr);
26809 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26810 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26811 this_ptr_conv.is_owned = false;
26812 LDKInitFeatures ret_var = Init_get_features(&this_ptr_conv);
26813 uint64_t ret_ref = 0;
26814 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26815 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26819 void __attribute__((export_name("TS_Init_set_features"))) TS_Init_set_features(uint64_t this_ptr, uint64_t val) {
26820 LDKInit this_ptr_conv;
26821 this_ptr_conv.inner = untag_ptr(this_ptr);
26822 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26823 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26824 this_ptr_conv.is_owned = false;
26825 LDKInitFeatures val_conv;
26826 val_conv.inner = untag_ptr(val);
26827 val_conv.is_owned = ptr_is_owned(val);
26828 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
26829 val_conv = InitFeatures_clone(&val_conv);
26830 Init_set_features(&this_ptr_conv, val_conv);
26833 uint64_t __attribute__((export_name("TS_Init_get_remote_network_address"))) TS_Init_get_remote_network_address(uint64_t this_ptr) {
26834 LDKInit this_ptr_conv;
26835 this_ptr_conv.inner = untag_ptr(this_ptr);
26836 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26837 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26838 this_ptr_conv.is_owned = false;
26839 LDKCOption_NetAddressZ *ret_copy = MALLOC(sizeof(LDKCOption_NetAddressZ), "LDKCOption_NetAddressZ");
26840 *ret_copy = Init_get_remote_network_address(&this_ptr_conv);
26841 uint64_t ret_ref = tag_ptr(ret_copy, true);
26845 void __attribute__((export_name("TS_Init_set_remote_network_address"))) TS_Init_set_remote_network_address(uint64_t this_ptr, uint64_t val) {
26846 LDKInit this_ptr_conv;
26847 this_ptr_conv.inner = untag_ptr(this_ptr);
26848 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26849 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26850 this_ptr_conv.is_owned = false;
26851 void* val_ptr = untag_ptr(val);
26852 CHECK_ACCESS(val_ptr);
26853 LDKCOption_NetAddressZ val_conv = *(LDKCOption_NetAddressZ*)(val_ptr);
26854 val_conv = COption_NetAddressZ_clone((LDKCOption_NetAddressZ*)untag_ptr(val));
26855 Init_set_remote_network_address(&this_ptr_conv, val_conv);
26858 uint64_t __attribute__((export_name("TS_Init_new"))) TS_Init_new(uint64_t features_arg, uint64_t remote_network_address_arg) {
26859 LDKInitFeatures features_arg_conv;
26860 features_arg_conv.inner = untag_ptr(features_arg);
26861 features_arg_conv.is_owned = ptr_is_owned(features_arg);
26862 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv);
26863 features_arg_conv = InitFeatures_clone(&features_arg_conv);
26864 void* remote_network_address_arg_ptr = untag_ptr(remote_network_address_arg);
26865 CHECK_ACCESS(remote_network_address_arg_ptr);
26866 LDKCOption_NetAddressZ remote_network_address_arg_conv = *(LDKCOption_NetAddressZ*)(remote_network_address_arg_ptr);
26867 LDKInit ret_var = Init_new(features_arg_conv, remote_network_address_arg_conv);
26868 uint64_t ret_ref = 0;
26869 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26870 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26874 static inline uint64_t Init_clone_ptr(LDKInit *NONNULL_PTR arg) {
26875 LDKInit ret_var = Init_clone(arg);
26876 uint64_t ret_ref = 0;
26877 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26878 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26881 int64_t __attribute__((export_name("TS_Init_clone_ptr"))) TS_Init_clone_ptr(uint64_t arg) {
26883 arg_conv.inner = untag_ptr(arg);
26884 arg_conv.is_owned = ptr_is_owned(arg);
26885 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
26886 arg_conv.is_owned = false;
26887 int64_t ret_conv = Init_clone_ptr(&arg_conv);
26891 uint64_t __attribute__((export_name("TS_Init_clone"))) TS_Init_clone(uint64_t orig) {
26893 orig_conv.inner = untag_ptr(orig);
26894 orig_conv.is_owned = ptr_is_owned(orig);
26895 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
26896 orig_conv.is_owned = false;
26897 LDKInit ret_var = Init_clone(&orig_conv);
26898 uint64_t ret_ref = 0;
26899 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26900 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26904 void __attribute__((export_name("TS_ErrorMessage_free"))) TS_ErrorMessage_free(uint64_t this_obj) {
26905 LDKErrorMessage this_obj_conv;
26906 this_obj_conv.inner = untag_ptr(this_obj);
26907 this_obj_conv.is_owned = ptr_is_owned(this_obj);
26908 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
26909 ErrorMessage_free(this_obj_conv);
26912 int8_tArray __attribute__((export_name("TS_ErrorMessage_get_channel_id"))) TS_ErrorMessage_get_channel_id(uint64_t this_ptr) {
26913 LDKErrorMessage this_ptr_conv;
26914 this_ptr_conv.inner = untag_ptr(this_ptr);
26915 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26916 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26917 this_ptr_conv.is_owned = false;
26918 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
26919 memcpy(ret_arr->elems, *ErrorMessage_get_channel_id(&this_ptr_conv), 32);
26923 void __attribute__((export_name("TS_ErrorMessage_set_channel_id"))) TS_ErrorMessage_set_channel_id(uint64_t this_ptr, int8_tArray val) {
26924 LDKErrorMessage this_ptr_conv;
26925 this_ptr_conv.inner = untag_ptr(this_ptr);
26926 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26927 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26928 this_ptr_conv.is_owned = false;
26929 LDKThirtyTwoBytes val_ref;
26930 CHECK(val->arr_len == 32);
26931 memcpy(val_ref.data, val->elems, 32); FREE(val);
26932 ErrorMessage_set_channel_id(&this_ptr_conv, val_ref);
26935 jstring __attribute__((export_name("TS_ErrorMessage_get_data"))) TS_ErrorMessage_get_data(uint64_t this_ptr) {
26936 LDKErrorMessage this_ptr_conv;
26937 this_ptr_conv.inner = untag_ptr(this_ptr);
26938 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26939 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26940 this_ptr_conv.is_owned = false;
26941 LDKStr ret_str = ErrorMessage_get_data(&this_ptr_conv);
26942 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
26947 void __attribute__((export_name("TS_ErrorMessage_set_data"))) TS_ErrorMessage_set_data(uint64_t this_ptr, jstring val) {
26948 LDKErrorMessage this_ptr_conv;
26949 this_ptr_conv.inner = untag_ptr(this_ptr);
26950 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
26951 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
26952 this_ptr_conv.is_owned = false;
26953 LDKStr val_conv = str_ref_to_owned_c(val);
26954 ErrorMessage_set_data(&this_ptr_conv, val_conv);
26957 uint64_t __attribute__((export_name("TS_ErrorMessage_new"))) TS_ErrorMessage_new(int8_tArray channel_id_arg, jstring data_arg) {
26958 LDKThirtyTwoBytes channel_id_arg_ref;
26959 CHECK(channel_id_arg->arr_len == 32);
26960 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
26961 LDKStr data_arg_conv = str_ref_to_owned_c(data_arg);
26962 LDKErrorMessage ret_var = ErrorMessage_new(channel_id_arg_ref, data_arg_conv);
26963 uint64_t ret_ref = 0;
26964 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
26965 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
26969 static inline uint64_t ErrorMessage_clone_ptr(LDKErrorMessage *NONNULL_PTR arg) {
26970 LDKErrorMessage ret_var = ErrorMessage_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_ErrorMessage_clone_ptr"))) TS_ErrorMessage_clone_ptr(uint64_t arg) {
26977 LDKErrorMessage 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 = ErrorMessage_clone_ptr(&arg_conv);
26986 uint64_t __attribute__((export_name("TS_ErrorMessage_clone"))) TS_ErrorMessage_clone(uint64_t orig) {
26987 LDKErrorMessage 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 LDKErrorMessage ret_var = ErrorMessage_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_WarningMessage_free"))) TS_WarningMessage_free(uint64_t this_obj) {
27000 LDKWarningMessage 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 WarningMessage_free(this_obj_conv);
27007 int8_tArray __attribute__((export_name("TS_WarningMessage_get_channel_id"))) TS_WarningMessage_get_channel_id(uint64_t this_ptr) {
27008 LDKWarningMessage 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 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
27014 memcpy(ret_arr->elems, *WarningMessage_get_channel_id(&this_ptr_conv), 32);
27018 void __attribute__((export_name("TS_WarningMessage_set_channel_id"))) TS_WarningMessage_set_channel_id(uint64_t this_ptr, int8_tArray val) {
27019 LDKWarningMessage this_ptr_conv;
27020 this_ptr_conv.inner = untag_ptr(this_ptr);
27021 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27022 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27023 this_ptr_conv.is_owned = false;
27024 LDKThirtyTwoBytes val_ref;
27025 CHECK(val->arr_len == 32);
27026 memcpy(val_ref.data, val->elems, 32); FREE(val);
27027 WarningMessage_set_channel_id(&this_ptr_conv, val_ref);
27030 jstring __attribute__((export_name("TS_WarningMessage_get_data"))) TS_WarningMessage_get_data(uint64_t this_ptr) {
27031 LDKWarningMessage this_ptr_conv;
27032 this_ptr_conv.inner = untag_ptr(this_ptr);
27033 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27034 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27035 this_ptr_conv.is_owned = false;
27036 LDKStr ret_str = WarningMessage_get_data(&this_ptr_conv);
27037 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
27042 void __attribute__((export_name("TS_WarningMessage_set_data"))) TS_WarningMessage_set_data(uint64_t this_ptr, jstring val) {
27043 LDKWarningMessage this_ptr_conv;
27044 this_ptr_conv.inner = untag_ptr(this_ptr);
27045 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27046 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27047 this_ptr_conv.is_owned = false;
27048 LDKStr val_conv = str_ref_to_owned_c(val);
27049 WarningMessage_set_data(&this_ptr_conv, val_conv);
27052 uint64_t __attribute__((export_name("TS_WarningMessage_new"))) TS_WarningMessage_new(int8_tArray channel_id_arg, jstring data_arg) {
27053 LDKThirtyTwoBytes channel_id_arg_ref;
27054 CHECK(channel_id_arg->arr_len == 32);
27055 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
27056 LDKStr data_arg_conv = str_ref_to_owned_c(data_arg);
27057 LDKWarningMessage ret_var = WarningMessage_new(channel_id_arg_ref, data_arg_conv);
27058 uint64_t ret_ref = 0;
27059 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27060 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27064 static inline uint64_t WarningMessage_clone_ptr(LDKWarningMessage *NONNULL_PTR arg) {
27065 LDKWarningMessage ret_var = WarningMessage_clone(arg);
27066 uint64_t ret_ref = 0;
27067 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27068 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27071 int64_t __attribute__((export_name("TS_WarningMessage_clone_ptr"))) TS_WarningMessage_clone_ptr(uint64_t arg) {
27072 LDKWarningMessage arg_conv;
27073 arg_conv.inner = untag_ptr(arg);
27074 arg_conv.is_owned = ptr_is_owned(arg);
27075 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
27076 arg_conv.is_owned = false;
27077 int64_t ret_conv = WarningMessage_clone_ptr(&arg_conv);
27081 uint64_t __attribute__((export_name("TS_WarningMessage_clone"))) TS_WarningMessage_clone(uint64_t orig) {
27082 LDKWarningMessage orig_conv;
27083 orig_conv.inner = untag_ptr(orig);
27084 orig_conv.is_owned = ptr_is_owned(orig);
27085 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
27086 orig_conv.is_owned = false;
27087 LDKWarningMessage ret_var = WarningMessage_clone(&orig_conv);
27088 uint64_t ret_ref = 0;
27089 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27090 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27094 void __attribute__((export_name("TS_Ping_free"))) TS_Ping_free(uint64_t this_obj) {
27095 LDKPing this_obj_conv;
27096 this_obj_conv.inner = untag_ptr(this_obj);
27097 this_obj_conv.is_owned = ptr_is_owned(this_obj);
27098 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
27099 Ping_free(this_obj_conv);
27102 int16_t __attribute__((export_name("TS_Ping_get_ponglen"))) TS_Ping_get_ponglen(uint64_t this_ptr) {
27103 LDKPing this_ptr_conv;
27104 this_ptr_conv.inner = untag_ptr(this_ptr);
27105 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27106 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27107 this_ptr_conv.is_owned = false;
27108 int16_t ret_conv = Ping_get_ponglen(&this_ptr_conv);
27112 void __attribute__((export_name("TS_Ping_set_ponglen"))) TS_Ping_set_ponglen(uint64_t this_ptr, int16_t val) {
27113 LDKPing this_ptr_conv;
27114 this_ptr_conv.inner = untag_ptr(this_ptr);
27115 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27116 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27117 this_ptr_conv.is_owned = false;
27118 Ping_set_ponglen(&this_ptr_conv, val);
27121 int16_t __attribute__((export_name("TS_Ping_get_byteslen"))) TS_Ping_get_byteslen(uint64_t this_ptr) {
27122 LDKPing this_ptr_conv;
27123 this_ptr_conv.inner = untag_ptr(this_ptr);
27124 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27125 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27126 this_ptr_conv.is_owned = false;
27127 int16_t ret_conv = Ping_get_byteslen(&this_ptr_conv);
27131 void __attribute__((export_name("TS_Ping_set_byteslen"))) TS_Ping_set_byteslen(uint64_t this_ptr, int16_t val) {
27132 LDKPing this_ptr_conv;
27133 this_ptr_conv.inner = untag_ptr(this_ptr);
27134 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27135 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27136 this_ptr_conv.is_owned = false;
27137 Ping_set_byteslen(&this_ptr_conv, val);
27140 uint64_t __attribute__((export_name("TS_Ping_new"))) TS_Ping_new(int16_t ponglen_arg, int16_t byteslen_arg) {
27141 LDKPing ret_var = Ping_new(ponglen_arg, byteslen_arg);
27142 uint64_t ret_ref = 0;
27143 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27144 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27148 static inline uint64_t Ping_clone_ptr(LDKPing *NONNULL_PTR arg) {
27149 LDKPing ret_var = Ping_clone(arg);
27150 uint64_t ret_ref = 0;
27151 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27152 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27155 int64_t __attribute__((export_name("TS_Ping_clone_ptr"))) TS_Ping_clone_ptr(uint64_t arg) {
27157 arg_conv.inner = untag_ptr(arg);
27158 arg_conv.is_owned = ptr_is_owned(arg);
27159 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
27160 arg_conv.is_owned = false;
27161 int64_t ret_conv = Ping_clone_ptr(&arg_conv);
27165 uint64_t __attribute__((export_name("TS_Ping_clone"))) TS_Ping_clone(uint64_t orig) {
27167 orig_conv.inner = untag_ptr(orig);
27168 orig_conv.is_owned = ptr_is_owned(orig);
27169 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
27170 orig_conv.is_owned = false;
27171 LDKPing ret_var = Ping_clone(&orig_conv);
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);
27178 void __attribute__((export_name("TS_Pong_free"))) TS_Pong_free(uint64_t this_obj) {
27179 LDKPong this_obj_conv;
27180 this_obj_conv.inner = untag_ptr(this_obj);
27181 this_obj_conv.is_owned = ptr_is_owned(this_obj);
27182 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
27183 Pong_free(this_obj_conv);
27186 int16_t __attribute__((export_name("TS_Pong_get_byteslen"))) TS_Pong_get_byteslen(uint64_t this_ptr) {
27187 LDKPong this_ptr_conv;
27188 this_ptr_conv.inner = untag_ptr(this_ptr);
27189 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27190 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27191 this_ptr_conv.is_owned = false;
27192 int16_t ret_conv = Pong_get_byteslen(&this_ptr_conv);
27196 void __attribute__((export_name("TS_Pong_set_byteslen"))) TS_Pong_set_byteslen(uint64_t this_ptr, int16_t val) {
27197 LDKPong this_ptr_conv;
27198 this_ptr_conv.inner = untag_ptr(this_ptr);
27199 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27200 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27201 this_ptr_conv.is_owned = false;
27202 Pong_set_byteslen(&this_ptr_conv, val);
27205 uint64_t __attribute__((export_name("TS_Pong_new"))) TS_Pong_new(int16_t byteslen_arg) {
27206 LDKPong ret_var = Pong_new(byteslen_arg);
27207 uint64_t ret_ref = 0;
27208 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27209 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27213 static inline uint64_t Pong_clone_ptr(LDKPong *NONNULL_PTR arg) {
27214 LDKPong ret_var = Pong_clone(arg);
27215 uint64_t ret_ref = 0;
27216 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27217 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27220 int64_t __attribute__((export_name("TS_Pong_clone_ptr"))) TS_Pong_clone_ptr(uint64_t arg) {
27222 arg_conv.inner = untag_ptr(arg);
27223 arg_conv.is_owned = ptr_is_owned(arg);
27224 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
27225 arg_conv.is_owned = false;
27226 int64_t ret_conv = Pong_clone_ptr(&arg_conv);
27230 uint64_t __attribute__((export_name("TS_Pong_clone"))) TS_Pong_clone(uint64_t orig) {
27232 orig_conv.inner = untag_ptr(orig);
27233 orig_conv.is_owned = ptr_is_owned(orig);
27234 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
27235 orig_conv.is_owned = false;
27236 LDKPong ret_var = Pong_clone(&orig_conv);
27237 uint64_t ret_ref = 0;
27238 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27239 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27243 void __attribute__((export_name("TS_OpenChannel_free"))) TS_OpenChannel_free(uint64_t this_obj) {
27244 LDKOpenChannel this_obj_conv;
27245 this_obj_conv.inner = untag_ptr(this_obj);
27246 this_obj_conv.is_owned = ptr_is_owned(this_obj);
27247 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
27248 OpenChannel_free(this_obj_conv);
27251 int8_tArray __attribute__((export_name("TS_OpenChannel_get_chain_hash"))) TS_OpenChannel_get_chain_hash(uint64_t this_ptr) {
27252 LDKOpenChannel this_ptr_conv;
27253 this_ptr_conv.inner = untag_ptr(this_ptr);
27254 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27255 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27256 this_ptr_conv.is_owned = false;
27257 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
27258 memcpy(ret_arr->elems, *OpenChannel_get_chain_hash(&this_ptr_conv), 32);
27262 void __attribute__((export_name("TS_OpenChannel_set_chain_hash"))) TS_OpenChannel_set_chain_hash(uint64_t this_ptr, int8_tArray val) {
27263 LDKOpenChannel this_ptr_conv;
27264 this_ptr_conv.inner = untag_ptr(this_ptr);
27265 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27266 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27267 this_ptr_conv.is_owned = false;
27268 LDKThirtyTwoBytes val_ref;
27269 CHECK(val->arr_len == 32);
27270 memcpy(val_ref.data, val->elems, 32); FREE(val);
27271 OpenChannel_set_chain_hash(&this_ptr_conv, val_ref);
27274 int8_tArray __attribute__((export_name("TS_OpenChannel_get_temporary_channel_id"))) TS_OpenChannel_get_temporary_channel_id(uint64_t this_ptr) {
27275 LDKOpenChannel this_ptr_conv;
27276 this_ptr_conv.inner = untag_ptr(this_ptr);
27277 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27278 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27279 this_ptr_conv.is_owned = false;
27280 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
27281 memcpy(ret_arr->elems, *OpenChannel_get_temporary_channel_id(&this_ptr_conv), 32);
27285 void __attribute__((export_name("TS_OpenChannel_set_temporary_channel_id"))) TS_OpenChannel_set_temporary_channel_id(uint64_t this_ptr, int8_tArray val) {
27286 LDKOpenChannel this_ptr_conv;
27287 this_ptr_conv.inner = untag_ptr(this_ptr);
27288 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27289 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27290 this_ptr_conv.is_owned = false;
27291 LDKThirtyTwoBytes val_ref;
27292 CHECK(val->arr_len == 32);
27293 memcpy(val_ref.data, val->elems, 32); FREE(val);
27294 OpenChannel_set_temporary_channel_id(&this_ptr_conv, val_ref);
27297 int64_t __attribute__((export_name("TS_OpenChannel_get_funding_satoshis"))) TS_OpenChannel_get_funding_satoshis(uint64_t this_ptr) {
27298 LDKOpenChannel this_ptr_conv;
27299 this_ptr_conv.inner = untag_ptr(this_ptr);
27300 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27301 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27302 this_ptr_conv.is_owned = false;
27303 int64_t ret_conv = OpenChannel_get_funding_satoshis(&this_ptr_conv);
27307 void __attribute__((export_name("TS_OpenChannel_set_funding_satoshis"))) TS_OpenChannel_set_funding_satoshis(uint64_t this_ptr, int64_t val) {
27308 LDKOpenChannel this_ptr_conv;
27309 this_ptr_conv.inner = untag_ptr(this_ptr);
27310 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27311 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27312 this_ptr_conv.is_owned = false;
27313 OpenChannel_set_funding_satoshis(&this_ptr_conv, val);
27316 int64_t __attribute__((export_name("TS_OpenChannel_get_push_msat"))) TS_OpenChannel_get_push_msat(uint64_t this_ptr) {
27317 LDKOpenChannel this_ptr_conv;
27318 this_ptr_conv.inner = untag_ptr(this_ptr);
27319 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27320 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27321 this_ptr_conv.is_owned = false;
27322 int64_t ret_conv = OpenChannel_get_push_msat(&this_ptr_conv);
27326 void __attribute__((export_name("TS_OpenChannel_set_push_msat"))) TS_OpenChannel_set_push_msat(uint64_t this_ptr, int64_t val) {
27327 LDKOpenChannel this_ptr_conv;
27328 this_ptr_conv.inner = untag_ptr(this_ptr);
27329 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27330 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27331 this_ptr_conv.is_owned = false;
27332 OpenChannel_set_push_msat(&this_ptr_conv, val);
27335 int64_t __attribute__((export_name("TS_OpenChannel_get_dust_limit_satoshis"))) TS_OpenChannel_get_dust_limit_satoshis(uint64_t this_ptr) {
27336 LDKOpenChannel this_ptr_conv;
27337 this_ptr_conv.inner = untag_ptr(this_ptr);
27338 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27339 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27340 this_ptr_conv.is_owned = false;
27341 int64_t ret_conv = OpenChannel_get_dust_limit_satoshis(&this_ptr_conv);
27345 void __attribute__((export_name("TS_OpenChannel_set_dust_limit_satoshis"))) TS_OpenChannel_set_dust_limit_satoshis(uint64_t this_ptr, int64_t val) {
27346 LDKOpenChannel this_ptr_conv;
27347 this_ptr_conv.inner = untag_ptr(this_ptr);
27348 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27349 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27350 this_ptr_conv.is_owned = false;
27351 OpenChannel_set_dust_limit_satoshis(&this_ptr_conv, val);
27354 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) {
27355 LDKOpenChannel this_ptr_conv;
27356 this_ptr_conv.inner = untag_ptr(this_ptr);
27357 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27358 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27359 this_ptr_conv.is_owned = false;
27360 int64_t ret_conv = OpenChannel_get_max_htlc_value_in_flight_msat(&this_ptr_conv);
27364 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) {
27365 LDKOpenChannel this_ptr_conv;
27366 this_ptr_conv.inner = untag_ptr(this_ptr);
27367 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27368 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27369 this_ptr_conv.is_owned = false;
27370 OpenChannel_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val);
27373 int64_t __attribute__((export_name("TS_OpenChannel_get_channel_reserve_satoshis"))) TS_OpenChannel_get_channel_reserve_satoshis(uint64_t this_ptr) {
27374 LDKOpenChannel this_ptr_conv;
27375 this_ptr_conv.inner = untag_ptr(this_ptr);
27376 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27377 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27378 this_ptr_conv.is_owned = false;
27379 int64_t ret_conv = OpenChannel_get_channel_reserve_satoshis(&this_ptr_conv);
27383 void __attribute__((export_name("TS_OpenChannel_set_channel_reserve_satoshis"))) TS_OpenChannel_set_channel_reserve_satoshis(uint64_t this_ptr, int64_t val) {
27384 LDKOpenChannel this_ptr_conv;
27385 this_ptr_conv.inner = untag_ptr(this_ptr);
27386 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27387 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27388 this_ptr_conv.is_owned = false;
27389 OpenChannel_set_channel_reserve_satoshis(&this_ptr_conv, val);
27392 int64_t __attribute__((export_name("TS_OpenChannel_get_htlc_minimum_msat"))) TS_OpenChannel_get_htlc_minimum_msat(uint64_t this_ptr) {
27393 LDKOpenChannel this_ptr_conv;
27394 this_ptr_conv.inner = untag_ptr(this_ptr);
27395 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27396 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27397 this_ptr_conv.is_owned = false;
27398 int64_t ret_conv = OpenChannel_get_htlc_minimum_msat(&this_ptr_conv);
27402 void __attribute__((export_name("TS_OpenChannel_set_htlc_minimum_msat"))) TS_OpenChannel_set_htlc_minimum_msat(uint64_t this_ptr, int64_t val) {
27403 LDKOpenChannel this_ptr_conv;
27404 this_ptr_conv.inner = untag_ptr(this_ptr);
27405 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27406 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27407 this_ptr_conv.is_owned = false;
27408 OpenChannel_set_htlc_minimum_msat(&this_ptr_conv, val);
27411 int32_t __attribute__((export_name("TS_OpenChannel_get_feerate_per_kw"))) TS_OpenChannel_get_feerate_per_kw(uint64_t this_ptr) {
27412 LDKOpenChannel this_ptr_conv;
27413 this_ptr_conv.inner = untag_ptr(this_ptr);
27414 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27415 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27416 this_ptr_conv.is_owned = false;
27417 int32_t ret_conv = OpenChannel_get_feerate_per_kw(&this_ptr_conv);
27421 void __attribute__((export_name("TS_OpenChannel_set_feerate_per_kw"))) TS_OpenChannel_set_feerate_per_kw(uint64_t this_ptr, int32_t val) {
27422 LDKOpenChannel this_ptr_conv;
27423 this_ptr_conv.inner = untag_ptr(this_ptr);
27424 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27425 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27426 this_ptr_conv.is_owned = false;
27427 OpenChannel_set_feerate_per_kw(&this_ptr_conv, val);
27430 int16_t __attribute__((export_name("TS_OpenChannel_get_to_self_delay"))) TS_OpenChannel_get_to_self_delay(uint64_t this_ptr) {
27431 LDKOpenChannel this_ptr_conv;
27432 this_ptr_conv.inner = untag_ptr(this_ptr);
27433 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27434 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27435 this_ptr_conv.is_owned = false;
27436 int16_t ret_conv = OpenChannel_get_to_self_delay(&this_ptr_conv);
27440 void __attribute__((export_name("TS_OpenChannel_set_to_self_delay"))) TS_OpenChannel_set_to_self_delay(uint64_t this_ptr, int16_t val) {
27441 LDKOpenChannel this_ptr_conv;
27442 this_ptr_conv.inner = untag_ptr(this_ptr);
27443 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27444 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27445 this_ptr_conv.is_owned = false;
27446 OpenChannel_set_to_self_delay(&this_ptr_conv, val);
27449 int16_t __attribute__((export_name("TS_OpenChannel_get_max_accepted_htlcs"))) TS_OpenChannel_get_max_accepted_htlcs(uint64_t this_ptr) {
27450 LDKOpenChannel this_ptr_conv;
27451 this_ptr_conv.inner = untag_ptr(this_ptr);
27452 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27453 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27454 this_ptr_conv.is_owned = false;
27455 int16_t ret_conv = OpenChannel_get_max_accepted_htlcs(&this_ptr_conv);
27459 void __attribute__((export_name("TS_OpenChannel_set_max_accepted_htlcs"))) TS_OpenChannel_set_max_accepted_htlcs(uint64_t this_ptr, int16_t val) {
27460 LDKOpenChannel this_ptr_conv;
27461 this_ptr_conv.inner = untag_ptr(this_ptr);
27462 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27463 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27464 this_ptr_conv.is_owned = false;
27465 OpenChannel_set_max_accepted_htlcs(&this_ptr_conv, val);
27468 int8_tArray __attribute__((export_name("TS_OpenChannel_get_funding_pubkey"))) TS_OpenChannel_get_funding_pubkey(uint64_t this_ptr) {
27469 LDKOpenChannel this_ptr_conv;
27470 this_ptr_conv.inner = untag_ptr(this_ptr);
27471 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27472 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27473 this_ptr_conv.is_owned = false;
27474 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
27475 memcpy(ret_arr->elems, OpenChannel_get_funding_pubkey(&this_ptr_conv).compressed_form, 33);
27479 void __attribute__((export_name("TS_OpenChannel_set_funding_pubkey"))) TS_OpenChannel_set_funding_pubkey(uint64_t this_ptr, int8_tArray val) {
27480 LDKOpenChannel this_ptr_conv;
27481 this_ptr_conv.inner = untag_ptr(this_ptr);
27482 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27483 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27484 this_ptr_conv.is_owned = false;
27485 LDKPublicKey val_ref;
27486 CHECK(val->arr_len == 33);
27487 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
27488 OpenChannel_set_funding_pubkey(&this_ptr_conv, val_ref);
27491 int8_tArray __attribute__((export_name("TS_OpenChannel_get_revocation_basepoint"))) TS_OpenChannel_get_revocation_basepoint(uint64_t this_ptr) {
27492 LDKOpenChannel this_ptr_conv;
27493 this_ptr_conv.inner = untag_ptr(this_ptr);
27494 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27495 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27496 this_ptr_conv.is_owned = false;
27497 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
27498 memcpy(ret_arr->elems, OpenChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form, 33);
27502 void __attribute__((export_name("TS_OpenChannel_set_revocation_basepoint"))) TS_OpenChannel_set_revocation_basepoint(uint64_t this_ptr, int8_tArray val) {
27503 LDKOpenChannel this_ptr_conv;
27504 this_ptr_conv.inner = untag_ptr(this_ptr);
27505 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27506 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27507 this_ptr_conv.is_owned = false;
27508 LDKPublicKey val_ref;
27509 CHECK(val->arr_len == 33);
27510 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
27511 OpenChannel_set_revocation_basepoint(&this_ptr_conv, val_ref);
27514 int8_tArray __attribute__((export_name("TS_OpenChannel_get_payment_point"))) TS_OpenChannel_get_payment_point(uint64_t this_ptr) {
27515 LDKOpenChannel this_ptr_conv;
27516 this_ptr_conv.inner = untag_ptr(this_ptr);
27517 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27518 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27519 this_ptr_conv.is_owned = false;
27520 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
27521 memcpy(ret_arr->elems, OpenChannel_get_payment_point(&this_ptr_conv).compressed_form, 33);
27525 void __attribute__((export_name("TS_OpenChannel_set_payment_point"))) TS_OpenChannel_set_payment_point(uint64_t this_ptr, int8_tArray val) {
27526 LDKOpenChannel this_ptr_conv;
27527 this_ptr_conv.inner = untag_ptr(this_ptr);
27528 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27529 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27530 this_ptr_conv.is_owned = false;
27531 LDKPublicKey val_ref;
27532 CHECK(val->arr_len == 33);
27533 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
27534 OpenChannel_set_payment_point(&this_ptr_conv, val_ref);
27537 int8_tArray __attribute__((export_name("TS_OpenChannel_get_delayed_payment_basepoint"))) TS_OpenChannel_get_delayed_payment_basepoint(uint64_t this_ptr) {
27538 LDKOpenChannel this_ptr_conv;
27539 this_ptr_conv.inner = untag_ptr(this_ptr);
27540 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27541 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27542 this_ptr_conv.is_owned = false;
27543 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
27544 memcpy(ret_arr->elems, OpenChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33);
27548 void __attribute__((export_name("TS_OpenChannel_set_delayed_payment_basepoint"))) TS_OpenChannel_set_delayed_payment_basepoint(uint64_t this_ptr, int8_tArray val) {
27549 LDKOpenChannel this_ptr_conv;
27550 this_ptr_conv.inner = untag_ptr(this_ptr);
27551 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27552 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27553 this_ptr_conv.is_owned = false;
27554 LDKPublicKey val_ref;
27555 CHECK(val->arr_len == 33);
27556 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
27557 OpenChannel_set_delayed_payment_basepoint(&this_ptr_conv, val_ref);
27560 int8_tArray __attribute__((export_name("TS_OpenChannel_get_htlc_basepoint"))) TS_OpenChannel_get_htlc_basepoint(uint64_t this_ptr) {
27561 LDKOpenChannel this_ptr_conv;
27562 this_ptr_conv.inner = untag_ptr(this_ptr);
27563 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27564 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27565 this_ptr_conv.is_owned = false;
27566 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
27567 memcpy(ret_arr->elems, OpenChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form, 33);
27571 void __attribute__((export_name("TS_OpenChannel_set_htlc_basepoint"))) TS_OpenChannel_set_htlc_basepoint(uint64_t this_ptr, int8_tArray val) {
27572 LDKOpenChannel this_ptr_conv;
27573 this_ptr_conv.inner = untag_ptr(this_ptr);
27574 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27575 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27576 this_ptr_conv.is_owned = false;
27577 LDKPublicKey val_ref;
27578 CHECK(val->arr_len == 33);
27579 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
27580 OpenChannel_set_htlc_basepoint(&this_ptr_conv, val_ref);
27583 int8_tArray __attribute__((export_name("TS_OpenChannel_get_first_per_commitment_point"))) TS_OpenChannel_get_first_per_commitment_point(uint64_t this_ptr) {
27584 LDKOpenChannel this_ptr_conv;
27585 this_ptr_conv.inner = untag_ptr(this_ptr);
27586 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27587 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27588 this_ptr_conv.is_owned = false;
27589 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
27590 memcpy(ret_arr->elems, OpenChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form, 33);
27594 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) {
27595 LDKOpenChannel this_ptr_conv;
27596 this_ptr_conv.inner = untag_ptr(this_ptr);
27597 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27598 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27599 this_ptr_conv.is_owned = false;
27600 LDKPublicKey val_ref;
27601 CHECK(val->arr_len == 33);
27602 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
27603 OpenChannel_set_first_per_commitment_point(&this_ptr_conv, val_ref);
27606 int8_t __attribute__((export_name("TS_OpenChannel_get_channel_flags"))) TS_OpenChannel_get_channel_flags(uint64_t this_ptr) {
27607 LDKOpenChannel this_ptr_conv;
27608 this_ptr_conv.inner = untag_ptr(this_ptr);
27609 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27610 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27611 this_ptr_conv.is_owned = false;
27612 int8_t ret_conv = OpenChannel_get_channel_flags(&this_ptr_conv);
27616 void __attribute__((export_name("TS_OpenChannel_set_channel_flags"))) TS_OpenChannel_set_channel_flags(uint64_t this_ptr, int8_t val) {
27617 LDKOpenChannel this_ptr_conv;
27618 this_ptr_conv.inner = untag_ptr(this_ptr);
27619 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27620 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27621 this_ptr_conv.is_owned = false;
27622 OpenChannel_set_channel_flags(&this_ptr_conv, val);
27625 uint64_t __attribute__((export_name("TS_OpenChannel_get_channel_type"))) TS_OpenChannel_get_channel_type(uint64_t this_ptr) {
27626 LDKOpenChannel this_ptr_conv;
27627 this_ptr_conv.inner = untag_ptr(this_ptr);
27628 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27629 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27630 this_ptr_conv.is_owned = false;
27631 LDKChannelTypeFeatures ret_var = OpenChannel_get_channel_type(&this_ptr_conv);
27632 uint64_t ret_ref = 0;
27633 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27634 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27638 void __attribute__((export_name("TS_OpenChannel_set_channel_type"))) TS_OpenChannel_set_channel_type(uint64_t this_ptr, uint64_t val) {
27639 LDKOpenChannel this_ptr_conv;
27640 this_ptr_conv.inner = untag_ptr(this_ptr);
27641 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27642 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27643 this_ptr_conv.is_owned = false;
27644 LDKChannelTypeFeatures val_conv;
27645 val_conv.inner = untag_ptr(val);
27646 val_conv.is_owned = ptr_is_owned(val);
27647 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
27648 val_conv = ChannelTypeFeatures_clone(&val_conv);
27649 OpenChannel_set_channel_type(&this_ptr_conv, val_conv);
27652 static inline uint64_t OpenChannel_clone_ptr(LDKOpenChannel *NONNULL_PTR arg) {
27653 LDKOpenChannel ret_var = OpenChannel_clone(arg);
27654 uint64_t ret_ref = 0;
27655 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27656 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27659 int64_t __attribute__((export_name("TS_OpenChannel_clone_ptr"))) TS_OpenChannel_clone_ptr(uint64_t arg) {
27660 LDKOpenChannel arg_conv;
27661 arg_conv.inner = untag_ptr(arg);
27662 arg_conv.is_owned = ptr_is_owned(arg);
27663 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
27664 arg_conv.is_owned = false;
27665 int64_t ret_conv = OpenChannel_clone_ptr(&arg_conv);
27669 uint64_t __attribute__((export_name("TS_OpenChannel_clone"))) TS_OpenChannel_clone(uint64_t orig) {
27670 LDKOpenChannel orig_conv;
27671 orig_conv.inner = untag_ptr(orig);
27672 orig_conv.is_owned = ptr_is_owned(orig);
27673 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
27674 orig_conv.is_owned = false;
27675 LDKOpenChannel ret_var = OpenChannel_clone(&orig_conv);
27676 uint64_t ret_ref = 0;
27677 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27678 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27682 void __attribute__((export_name("TS_AcceptChannel_free"))) TS_AcceptChannel_free(uint64_t this_obj) {
27683 LDKAcceptChannel this_obj_conv;
27684 this_obj_conv.inner = untag_ptr(this_obj);
27685 this_obj_conv.is_owned = ptr_is_owned(this_obj);
27686 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
27687 AcceptChannel_free(this_obj_conv);
27690 int8_tArray __attribute__((export_name("TS_AcceptChannel_get_temporary_channel_id"))) TS_AcceptChannel_get_temporary_channel_id(uint64_t this_ptr) {
27691 LDKAcceptChannel this_ptr_conv;
27692 this_ptr_conv.inner = untag_ptr(this_ptr);
27693 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27694 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27695 this_ptr_conv.is_owned = false;
27696 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
27697 memcpy(ret_arr->elems, *AcceptChannel_get_temporary_channel_id(&this_ptr_conv), 32);
27701 void __attribute__((export_name("TS_AcceptChannel_set_temporary_channel_id"))) TS_AcceptChannel_set_temporary_channel_id(uint64_t this_ptr, int8_tArray val) {
27702 LDKAcceptChannel this_ptr_conv;
27703 this_ptr_conv.inner = untag_ptr(this_ptr);
27704 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27705 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27706 this_ptr_conv.is_owned = false;
27707 LDKThirtyTwoBytes val_ref;
27708 CHECK(val->arr_len == 32);
27709 memcpy(val_ref.data, val->elems, 32); FREE(val);
27710 AcceptChannel_set_temporary_channel_id(&this_ptr_conv, val_ref);
27713 int64_t __attribute__((export_name("TS_AcceptChannel_get_dust_limit_satoshis"))) TS_AcceptChannel_get_dust_limit_satoshis(uint64_t this_ptr) {
27714 LDKAcceptChannel this_ptr_conv;
27715 this_ptr_conv.inner = untag_ptr(this_ptr);
27716 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27717 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27718 this_ptr_conv.is_owned = false;
27719 int64_t ret_conv = AcceptChannel_get_dust_limit_satoshis(&this_ptr_conv);
27723 void __attribute__((export_name("TS_AcceptChannel_set_dust_limit_satoshis"))) TS_AcceptChannel_set_dust_limit_satoshis(uint64_t this_ptr, int64_t val) {
27724 LDKAcceptChannel this_ptr_conv;
27725 this_ptr_conv.inner = untag_ptr(this_ptr);
27726 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27727 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27728 this_ptr_conv.is_owned = false;
27729 AcceptChannel_set_dust_limit_satoshis(&this_ptr_conv, val);
27732 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) {
27733 LDKAcceptChannel this_ptr_conv;
27734 this_ptr_conv.inner = untag_ptr(this_ptr);
27735 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27736 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27737 this_ptr_conv.is_owned = false;
27738 int64_t ret_conv = AcceptChannel_get_max_htlc_value_in_flight_msat(&this_ptr_conv);
27742 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) {
27743 LDKAcceptChannel this_ptr_conv;
27744 this_ptr_conv.inner = untag_ptr(this_ptr);
27745 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27746 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27747 this_ptr_conv.is_owned = false;
27748 AcceptChannel_set_max_htlc_value_in_flight_msat(&this_ptr_conv, val);
27751 int64_t __attribute__((export_name("TS_AcceptChannel_get_channel_reserve_satoshis"))) TS_AcceptChannel_get_channel_reserve_satoshis(uint64_t this_ptr) {
27752 LDKAcceptChannel this_ptr_conv;
27753 this_ptr_conv.inner = untag_ptr(this_ptr);
27754 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27755 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27756 this_ptr_conv.is_owned = false;
27757 int64_t ret_conv = AcceptChannel_get_channel_reserve_satoshis(&this_ptr_conv);
27761 void __attribute__((export_name("TS_AcceptChannel_set_channel_reserve_satoshis"))) TS_AcceptChannel_set_channel_reserve_satoshis(uint64_t this_ptr, int64_t val) {
27762 LDKAcceptChannel 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 AcceptChannel_set_channel_reserve_satoshis(&this_ptr_conv, val);
27770 int64_t __attribute__((export_name("TS_AcceptChannel_get_htlc_minimum_msat"))) TS_AcceptChannel_get_htlc_minimum_msat(uint64_t this_ptr) {
27771 LDKAcceptChannel this_ptr_conv;
27772 this_ptr_conv.inner = untag_ptr(this_ptr);
27773 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27774 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27775 this_ptr_conv.is_owned = false;
27776 int64_t ret_conv = AcceptChannel_get_htlc_minimum_msat(&this_ptr_conv);
27780 void __attribute__((export_name("TS_AcceptChannel_set_htlc_minimum_msat"))) TS_AcceptChannel_set_htlc_minimum_msat(uint64_t this_ptr, int64_t val) {
27781 LDKAcceptChannel this_ptr_conv;
27782 this_ptr_conv.inner = untag_ptr(this_ptr);
27783 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27784 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27785 this_ptr_conv.is_owned = false;
27786 AcceptChannel_set_htlc_minimum_msat(&this_ptr_conv, val);
27789 int32_t __attribute__((export_name("TS_AcceptChannel_get_minimum_depth"))) TS_AcceptChannel_get_minimum_depth(uint64_t this_ptr) {
27790 LDKAcceptChannel this_ptr_conv;
27791 this_ptr_conv.inner = untag_ptr(this_ptr);
27792 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27793 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27794 this_ptr_conv.is_owned = false;
27795 int32_t ret_conv = AcceptChannel_get_minimum_depth(&this_ptr_conv);
27799 void __attribute__((export_name("TS_AcceptChannel_set_minimum_depth"))) TS_AcceptChannel_set_minimum_depth(uint64_t this_ptr, int32_t val) {
27800 LDKAcceptChannel this_ptr_conv;
27801 this_ptr_conv.inner = untag_ptr(this_ptr);
27802 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27803 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27804 this_ptr_conv.is_owned = false;
27805 AcceptChannel_set_minimum_depth(&this_ptr_conv, val);
27808 int16_t __attribute__((export_name("TS_AcceptChannel_get_to_self_delay"))) TS_AcceptChannel_get_to_self_delay(uint64_t this_ptr) {
27809 LDKAcceptChannel this_ptr_conv;
27810 this_ptr_conv.inner = untag_ptr(this_ptr);
27811 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27812 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27813 this_ptr_conv.is_owned = false;
27814 int16_t ret_conv = AcceptChannel_get_to_self_delay(&this_ptr_conv);
27818 void __attribute__((export_name("TS_AcceptChannel_set_to_self_delay"))) TS_AcceptChannel_set_to_self_delay(uint64_t this_ptr, int16_t val) {
27819 LDKAcceptChannel this_ptr_conv;
27820 this_ptr_conv.inner = untag_ptr(this_ptr);
27821 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27822 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27823 this_ptr_conv.is_owned = false;
27824 AcceptChannel_set_to_self_delay(&this_ptr_conv, val);
27827 int16_t __attribute__((export_name("TS_AcceptChannel_get_max_accepted_htlcs"))) TS_AcceptChannel_get_max_accepted_htlcs(uint64_t this_ptr) {
27828 LDKAcceptChannel this_ptr_conv;
27829 this_ptr_conv.inner = untag_ptr(this_ptr);
27830 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27831 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27832 this_ptr_conv.is_owned = false;
27833 int16_t ret_conv = AcceptChannel_get_max_accepted_htlcs(&this_ptr_conv);
27837 void __attribute__((export_name("TS_AcceptChannel_set_max_accepted_htlcs"))) TS_AcceptChannel_set_max_accepted_htlcs(uint64_t this_ptr, int16_t val) {
27838 LDKAcceptChannel this_ptr_conv;
27839 this_ptr_conv.inner = untag_ptr(this_ptr);
27840 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27841 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27842 this_ptr_conv.is_owned = false;
27843 AcceptChannel_set_max_accepted_htlcs(&this_ptr_conv, val);
27846 int8_tArray __attribute__((export_name("TS_AcceptChannel_get_funding_pubkey"))) TS_AcceptChannel_get_funding_pubkey(uint64_t this_ptr) {
27847 LDKAcceptChannel this_ptr_conv;
27848 this_ptr_conv.inner = untag_ptr(this_ptr);
27849 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27850 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27851 this_ptr_conv.is_owned = false;
27852 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
27853 memcpy(ret_arr->elems, AcceptChannel_get_funding_pubkey(&this_ptr_conv).compressed_form, 33);
27857 void __attribute__((export_name("TS_AcceptChannel_set_funding_pubkey"))) TS_AcceptChannel_set_funding_pubkey(uint64_t this_ptr, int8_tArray val) {
27858 LDKAcceptChannel this_ptr_conv;
27859 this_ptr_conv.inner = untag_ptr(this_ptr);
27860 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27861 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27862 this_ptr_conv.is_owned = false;
27863 LDKPublicKey val_ref;
27864 CHECK(val->arr_len == 33);
27865 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
27866 AcceptChannel_set_funding_pubkey(&this_ptr_conv, val_ref);
27869 int8_tArray __attribute__((export_name("TS_AcceptChannel_get_revocation_basepoint"))) TS_AcceptChannel_get_revocation_basepoint(uint64_t this_ptr) {
27870 LDKAcceptChannel this_ptr_conv;
27871 this_ptr_conv.inner = untag_ptr(this_ptr);
27872 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27873 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27874 this_ptr_conv.is_owned = false;
27875 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
27876 memcpy(ret_arr->elems, AcceptChannel_get_revocation_basepoint(&this_ptr_conv).compressed_form, 33);
27880 void __attribute__((export_name("TS_AcceptChannel_set_revocation_basepoint"))) TS_AcceptChannel_set_revocation_basepoint(uint64_t this_ptr, int8_tArray val) {
27881 LDKAcceptChannel this_ptr_conv;
27882 this_ptr_conv.inner = untag_ptr(this_ptr);
27883 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27884 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27885 this_ptr_conv.is_owned = false;
27886 LDKPublicKey val_ref;
27887 CHECK(val->arr_len == 33);
27888 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
27889 AcceptChannel_set_revocation_basepoint(&this_ptr_conv, val_ref);
27892 int8_tArray __attribute__((export_name("TS_AcceptChannel_get_payment_point"))) TS_AcceptChannel_get_payment_point(uint64_t this_ptr) {
27893 LDKAcceptChannel this_ptr_conv;
27894 this_ptr_conv.inner = untag_ptr(this_ptr);
27895 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27896 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27897 this_ptr_conv.is_owned = false;
27898 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
27899 memcpy(ret_arr->elems, AcceptChannel_get_payment_point(&this_ptr_conv).compressed_form, 33);
27903 void __attribute__((export_name("TS_AcceptChannel_set_payment_point"))) TS_AcceptChannel_set_payment_point(uint64_t this_ptr, int8_tArray val) {
27904 LDKAcceptChannel this_ptr_conv;
27905 this_ptr_conv.inner = untag_ptr(this_ptr);
27906 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27907 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27908 this_ptr_conv.is_owned = false;
27909 LDKPublicKey val_ref;
27910 CHECK(val->arr_len == 33);
27911 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
27912 AcceptChannel_set_payment_point(&this_ptr_conv, val_ref);
27915 int8_tArray __attribute__((export_name("TS_AcceptChannel_get_delayed_payment_basepoint"))) TS_AcceptChannel_get_delayed_payment_basepoint(uint64_t this_ptr) {
27916 LDKAcceptChannel this_ptr_conv;
27917 this_ptr_conv.inner = untag_ptr(this_ptr);
27918 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27919 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27920 this_ptr_conv.is_owned = false;
27921 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
27922 memcpy(ret_arr->elems, AcceptChannel_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33);
27926 void __attribute__((export_name("TS_AcceptChannel_set_delayed_payment_basepoint"))) TS_AcceptChannel_set_delayed_payment_basepoint(uint64_t this_ptr, int8_tArray val) {
27927 LDKAcceptChannel this_ptr_conv;
27928 this_ptr_conv.inner = untag_ptr(this_ptr);
27929 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27930 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27931 this_ptr_conv.is_owned = false;
27932 LDKPublicKey val_ref;
27933 CHECK(val->arr_len == 33);
27934 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
27935 AcceptChannel_set_delayed_payment_basepoint(&this_ptr_conv, val_ref);
27938 int8_tArray __attribute__((export_name("TS_AcceptChannel_get_htlc_basepoint"))) TS_AcceptChannel_get_htlc_basepoint(uint64_t this_ptr) {
27939 LDKAcceptChannel this_ptr_conv;
27940 this_ptr_conv.inner = untag_ptr(this_ptr);
27941 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27942 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27943 this_ptr_conv.is_owned = false;
27944 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
27945 memcpy(ret_arr->elems, AcceptChannel_get_htlc_basepoint(&this_ptr_conv).compressed_form, 33);
27949 void __attribute__((export_name("TS_AcceptChannel_set_htlc_basepoint"))) TS_AcceptChannel_set_htlc_basepoint(uint64_t this_ptr, int8_tArray val) {
27950 LDKAcceptChannel this_ptr_conv;
27951 this_ptr_conv.inner = untag_ptr(this_ptr);
27952 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27953 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27954 this_ptr_conv.is_owned = false;
27955 LDKPublicKey val_ref;
27956 CHECK(val->arr_len == 33);
27957 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
27958 AcceptChannel_set_htlc_basepoint(&this_ptr_conv, val_ref);
27961 int8_tArray __attribute__((export_name("TS_AcceptChannel_get_first_per_commitment_point"))) TS_AcceptChannel_get_first_per_commitment_point(uint64_t this_ptr) {
27962 LDKAcceptChannel this_ptr_conv;
27963 this_ptr_conv.inner = untag_ptr(this_ptr);
27964 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27965 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27966 this_ptr_conv.is_owned = false;
27967 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
27968 memcpy(ret_arr->elems, AcceptChannel_get_first_per_commitment_point(&this_ptr_conv).compressed_form, 33);
27972 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) {
27973 LDKAcceptChannel this_ptr_conv;
27974 this_ptr_conv.inner = untag_ptr(this_ptr);
27975 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27976 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27977 this_ptr_conv.is_owned = false;
27978 LDKPublicKey val_ref;
27979 CHECK(val->arr_len == 33);
27980 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
27981 AcceptChannel_set_first_per_commitment_point(&this_ptr_conv, val_ref);
27984 uint64_t __attribute__((export_name("TS_AcceptChannel_get_channel_type"))) TS_AcceptChannel_get_channel_type(uint64_t this_ptr) {
27985 LDKAcceptChannel this_ptr_conv;
27986 this_ptr_conv.inner = untag_ptr(this_ptr);
27987 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
27988 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
27989 this_ptr_conv.is_owned = false;
27990 LDKChannelTypeFeatures ret_var = AcceptChannel_get_channel_type(&this_ptr_conv);
27991 uint64_t ret_ref = 0;
27992 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
27993 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
27997 void __attribute__((export_name("TS_AcceptChannel_set_channel_type"))) TS_AcceptChannel_set_channel_type(uint64_t this_ptr, uint64_t val) {
27998 LDKAcceptChannel this_ptr_conv;
27999 this_ptr_conv.inner = untag_ptr(this_ptr);
28000 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28001 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28002 this_ptr_conv.is_owned = false;
28003 LDKChannelTypeFeatures val_conv;
28004 val_conv.inner = untag_ptr(val);
28005 val_conv.is_owned = ptr_is_owned(val);
28006 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
28007 val_conv = ChannelTypeFeatures_clone(&val_conv);
28008 AcceptChannel_set_channel_type(&this_ptr_conv, val_conv);
28011 static inline uint64_t AcceptChannel_clone_ptr(LDKAcceptChannel *NONNULL_PTR arg) {
28012 LDKAcceptChannel ret_var = AcceptChannel_clone(arg);
28013 uint64_t ret_ref = 0;
28014 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28015 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28018 int64_t __attribute__((export_name("TS_AcceptChannel_clone_ptr"))) TS_AcceptChannel_clone_ptr(uint64_t arg) {
28019 LDKAcceptChannel arg_conv;
28020 arg_conv.inner = untag_ptr(arg);
28021 arg_conv.is_owned = ptr_is_owned(arg);
28022 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28023 arg_conv.is_owned = false;
28024 int64_t ret_conv = AcceptChannel_clone_ptr(&arg_conv);
28028 uint64_t __attribute__((export_name("TS_AcceptChannel_clone"))) TS_AcceptChannel_clone(uint64_t orig) {
28029 LDKAcceptChannel orig_conv;
28030 orig_conv.inner = untag_ptr(orig);
28031 orig_conv.is_owned = ptr_is_owned(orig);
28032 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28033 orig_conv.is_owned = false;
28034 LDKAcceptChannel ret_var = AcceptChannel_clone(&orig_conv);
28035 uint64_t ret_ref = 0;
28036 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28037 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28041 void __attribute__((export_name("TS_FundingCreated_free"))) TS_FundingCreated_free(uint64_t this_obj) {
28042 LDKFundingCreated this_obj_conv;
28043 this_obj_conv.inner = untag_ptr(this_obj);
28044 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28045 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28046 FundingCreated_free(this_obj_conv);
28049 int8_tArray __attribute__((export_name("TS_FundingCreated_get_temporary_channel_id"))) TS_FundingCreated_get_temporary_channel_id(uint64_t this_ptr) {
28050 LDKFundingCreated this_ptr_conv;
28051 this_ptr_conv.inner = untag_ptr(this_ptr);
28052 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28053 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28054 this_ptr_conv.is_owned = false;
28055 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
28056 memcpy(ret_arr->elems, *FundingCreated_get_temporary_channel_id(&this_ptr_conv), 32);
28060 void __attribute__((export_name("TS_FundingCreated_set_temporary_channel_id"))) TS_FundingCreated_set_temporary_channel_id(uint64_t this_ptr, int8_tArray val) {
28061 LDKFundingCreated this_ptr_conv;
28062 this_ptr_conv.inner = untag_ptr(this_ptr);
28063 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28064 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28065 this_ptr_conv.is_owned = false;
28066 LDKThirtyTwoBytes val_ref;
28067 CHECK(val->arr_len == 32);
28068 memcpy(val_ref.data, val->elems, 32); FREE(val);
28069 FundingCreated_set_temporary_channel_id(&this_ptr_conv, val_ref);
28072 int8_tArray __attribute__((export_name("TS_FundingCreated_get_funding_txid"))) TS_FundingCreated_get_funding_txid(uint64_t this_ptr) {
28073 LDKFundingCreated this_ptr_conv;
28074 this_ptr_conv.inner = untag_ptr(this_ptr);
28075 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28076 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28077 this_ptr_conv.is_owned = false;
28078 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
28079 memcpy(ret_arr->elems, *FundingCreated_get_funding_txid(&this_ptr_conv), 32);
28083 void __attribute__((export_name("TS_FundingCreated_set_funding_txid"))) TS_FundingCreated_set_funding_txid(uint64_t this_ptr, int8_tArray val) {
28084 LDKFundingCreated this_ptr_conv;
28085 this_ptr_conv.inner = untag_ptr(this_ptr);
28086 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28087 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28088 this_ptr_conv.is_owned = false;
28089 LDKThirtyTwoBytes val_ref;
28090 CHECK(val->arr_len == 32);
28091 memcpy(val_ref.data, val->elems, 32); FREE(val);
28092 FundingCreated_set_funding_txid(&this_ptr_conv, val_ref);
28095 int16_t __attribute__((export_name("TS_FundingCreated_get_funding_output_index"))) TS_FundingCreated_get_funding_output_index(uint64_t this_ptr) {
28096 LDKFundingCreated this_ptr_conv;
28097 this_ptr_conv.inner = untag_ptr(this_ptr);
28098 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28099 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28100 this_ptr_conv.is_owned = false;
28101 int16_t ret_conv = FundingCreated_get_funding_output_index(&this_ptr_conv);
28105 void __attribute__((export_name("TS_FundingCreated_set_funding_output_index"))) TS_FundingCreated_set_funding_output_index(uint64_t this_ptr, int16_t val) {
28106 LDKFundingCreated this_ptr_conv;
28107 this_ptr_conv.inner = untag_ptr(this_ptr);
28108 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28109 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28110 this_ptr_conv.is_owned = false;
28111 FundingCreated_set_funding_output_index(&this_ptr_conv, val);
28114 int8_tArray __attribute__((export_name("TS_FundingCreated_get_signature"))) TS_FundingCreated_get_signature(uint64_t this_ptr) {
28115 LDKFundingCreated this_ptr_conv;
28116 this_ptr_conv.inner = untag_ptr(this_ptr);
28117 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28118 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28119 this_ptr_conv.is_owned = false;
28120 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
28121 memcpy(ret_arr->elems, FundingCreated_get_signature(&this_ptr_conv).compact_form, 64);
28125 void __attribute__((export_name("TS_FundingCreated_set_signature"))) TS_FundingCreated_set_signature(uint64_t this_ptr, int8_tArray val) {
28126 LDKFundingCreated this_ptr_conv;
28127 this_ptr_conv.inner = untag_ptr(this_ptr);
28128 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28129 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28130 this_ptr_conv.is_owned = false;
28131 LDKSignature val_ref;
28132 CHECK(val->arr_len == 64);
28133 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
28134 FundingCreated_set_signature(&this_ptr_conv, val_ref);
28137 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) {
28138 LDKThirtyTwoBytes temporary_channel_id_arg_ref;
28139 CHECK(temporary_channel_id_arg->arr_len == 32);
28140 memcpy(temporary_channel_id_arg_ref.data, temporary_channel_id_arg->elems, 32); FREE(temporary_channel_id_arg);
28141 LDKThirtyTwoBytes funding_txid_arg_ref;
28142 CHECK(funding_txid_arg->arr_len == 32);
28143 memcpy(funding_txid_arg_ref.data, funding_txid_arg->elems, 32); FREE(funding_txid_arg);
28144 LDKSignature signature_arg_ref;
28145 CHECK(signature_arg->arr_len == 64);
28146 memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg);
28147 LDKFundingCreated ret_var = FundingCreated_new(temporary_channel_id_arg_ref, funding_txid_arg_ref, funding_output_index_arg, signature_arg_ref);
28148 uint64_t ret_ref = 0;
28149 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28150 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28154 static inline uint64_t FundingCreated_clone_ptr(LDKFundingCreated *NONNULL_PTR arg) {
28155 LDKFundingCreated ret_var = FundingCreated_clone(arg);
28156 uint64_t ret_ref = 0;
28157 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28158 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28161 int64_t __attribute__((export_name("TS_FundingCreated_clone_ptr"))) TS_FundingCreated_clone_ptr(uint64_t arg) {
28162 LDKFundingCreated arg_conv;
28163 arg_conv.inner = untag_ptr(arg);
28164 arg_conv.is_owned = ptr_is_owned(arg);
28165 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28166 arg_conv.is_owned = false;
28167 int64_t ret_conv = FundingCreated_clone_ptr(&arg_conv);
28171 uint64_t __attribute__((export_name("TS_FundingCreated_clone"))) TS_FundingCreated_clone(uint64_t orig) {
28172 LDKFundingCreated orig_conv;
28173 orig_conv.inner = untag_ptr(orig);
28174 orig_conv.is_owned = ptr_is_owned(orig);
28175 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28176 orig_conv.is_owned = false;
28177 LDKFundingCreated ret_var = FundingCreated_clone(&orig_conv);
28178 uint64_t ret_ref = 0;
28179 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28180 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28184 void __attribute__((export_name("TS_FundingSigned_free"))) TS_FundingSigned_free(uint64_t this_obj) {
28185 LDKFundingSigned this_obj_conv;
28186 this_obj_conv.inner = untag_ptr(this_obj);
28187 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28188 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28189 FundingSigned_free(this_obj_conv);
28192 int8_tArray __attribute__((export_name("TS_FundingSigned_get_channel_id"))) TS_FundingSigned_get_channel_id(uint64_t this_ptr) {
28193 LDKFundingSigned this_ptr_conv;
28194 this_ptr_conv.inner = untag_ptr(this_ptr);
28195 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28196 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28197 this_ptr_conv.is_owned = false;
28198 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
28199 memcpy(ret_arr->elems, *FundingSigned_get_channel_id(&this_ptr_conv), 32);
28203 void __attribute__((export_name("TS_FundingSigned_set_channel_id"))) TS_FundingSigned_set_channel_id(uint64_t this_ptr, int8_tArray val) {
28204 LDKFundingSigned this_ptr_conv;
28205 this_ptr_conv.inner = untag_ptr(this_ptr);
28206 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28207 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28208 this_ptr_conv.is_owned = false;
28209 LDKThirtyTwoBytes val_ref;
28210 CHECK(val->arr_len == 32);
28211 memcpy(val_ref.data, val->elems, 32); FREE(val);
28212 FundingSigned_set_channel_id(&this_ptr_conv, val_ref);
28215 int8_tArray __attribute__((export_name("TS_FundingSigned_get_signature"))) TS_FundingSigned_get_signature(uint64_t this_ptr) {
28216 LDKFundingSigned this_ptr_conv;
28217 this_ptr_conv.inner = untag_ptr(this_ptr);
28218 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28219 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28220 this_ptr_conv.is_owned = false;
28221 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
28222 memcpy(ret_arr->elems, FundingSigned_get_signature(&this_ptr_conv).compact_form, 64);
28226 void __attribute__((export_name("TS_FundingSigned_set_signature"))) TS_FundingSigned_set_signature(uint64_t this_ptr, int8_tArray val) {
28227 LDKFundingSigned this_ptr_conv;
28228 this_ptr_conv.inner = untag_ptr(this_ptr);
28229 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28230 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28231 this_ptr_conv.is_owned = false;
28232 LDKSignature val_ref;
28233 CHECK(val->arr_len == 64);
28234 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
28235 FundingSigned_set_signature(&this_ptr_conv, val_ref);
28238 uint64_t __attribute__((export_name("TS_FundingSigned_new"))) TS_FundingSigned_new(int8_tArray channel_id_arg, int8_tArray signature_arg) {
28239 LDKThirtyTwoBytes channel_id_arg_ref;
28240 CHECK(channel_id_arg->arr_len == 32);
28241 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
28242 LDKSignature signature_arg_ref;
28243 CHECK(signature_arg->arr_len == 64);
28244 memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg);
28245 LDKFundingSigned ret_var = FundingSigned_new(channel_id_arg_ref, signature_arg_ref);
28246 uint64_t ret_ref = 0;
28247 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28248 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28252 static inline uint64_t FundingSigned_clone_ptr(LDKFundingSigned *NONNULL_PTR arg) {
28253 LDKFundingSigned ret_var = FundingSigned_clone(arg);
28254 uint64_t ret_ref = 0;
28255 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28256 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28259 int64_t __attribute__((export_name("TS_FundingSigned_clone_ptr"))) TS_FundingSigned_clone_ptr(uint64_t arg) {
28260 LDKFundingSigned arg_conv;
28261 arg_conv.inner = untag_ptr(arg);
28262 arg_conv.is_owned = ptr_is_owned(arg);
28263 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28264 arg_conv.is_owned = false;
28265 int64_t ret_conv = FundingSigned_clone_ptr(&arg_conv);
28269 uint64_t __attribute__((export_name("TS_FundingSigned_clone"))) TS_FundingSigned_clone(uint64_t orig) {
28270 LDKFundingSigned orig_conv;
28271 orig_conv.inner = untag_ptr(orig);
28272 orig_conv.is_owned = ptr_is_owned(orig);
28273 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28274 orig_conv.is_owned = false;
28275 LDKFundingSigned ret_var = FundingSigned_clone(&orig_conv);
28276 uint64_t ret_ref = 0;
28277 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28278 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28282 void __attribute__((export_name("TS_ChannelReady_free"))) TS_ChannelReady_free(uint64_t this_obj) {
28283 LDKChannelReady this_obj_conv;
28284 this_obj_conv.inner = untag_ptr(this_obj);
28285 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28286 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28287 ChannelReady_free(this_obj_conv);
28290 int8_tArray __attribute__((export_name("TS_ChannelReady_get_channel_id"))) TS_ChannelReady_get_channel_id(uint64_t this_ptr) {
28291 LDKChannelReady this_ptr_conv;
28292 this_ptr_conv.inner = untag_ptr(this_ptr);
28293 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28294 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28295 this_ptr_conv.is_owned = false;
28296 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
28297 memcpy(ret_arr->elems, *ChannelReady_get_channel_id(&this_ptr_conv), 32);
28301 void __attribute__((export_name("TS_ChannelReady_set_channel_id"))) TS_ChannelReady_set_channel_id(uint64_t this_ptr, int8_tArray val) {
28302 LDKChannelReady this_ptr_conv;
28303 this_ptr_conv.inner = untag_ptr(this_ptr);
28304 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28305 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28306 this_ptr_conv.is_owned = false;
28307 LDKThirtyTwoBytes val_ref;
28308 CHECK(val->arr_len == 32);
28309 memcpy(val_ref.data, val->elems, 32); FREE(val);
28310 ChannelReady_set_channel_id(&this_ptr_conv, val_ref);
28313 int8_tArray __attribute__((export_name("TS_ChannelReady_get_next_per_commitment_point"))) TS_ChannelReady_get_next_per_commitment_point(uint64_t this_ptr) {
28314 LDKChannelReady this_ptr_conv;
28315 this_ptr_conv.inner = untag_ptr(this_ptr);
28316 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28317 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28318 this_ptr_conv.is_owned = false;
28319 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
28320 memcpy(ret_arr->elems, ChannelReady_get_next_per_commitment_point(&this_ptr_conv).compressed_form, 33);
28324 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) {
28325 LDKChannelReady this_ptr_conv;
28326 this_ptr_conv.inner = untag_ptr(this_ptr);
28327 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28328 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28329 this_ptr_conv.is_owned = false;
28330 LDKPublicKey val_ref;
28331 CHECK(val->arr_len == 33);
28332 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
28333 ChannelReady_set_next_per_commitment_point(&this_ptr_conv, val_ref);
28336 uint64_t __attribute__((export_name("TS_ChannelReady_get_short_channel_id_alias"))) TS_ChannelReady_get_short_channel_id_alias(uint64_t this_ptr) {
28337 LDKChannelReady this_ptr_conv;
28338 this_ptr_conv.inner = untag_ptr(this_ptr);
28339 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28340 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28341 this_ptr_conv.is_owned = false;
28342 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
28343 *ret_copy = ChannelReady_get_short_channel_id_alias(&this_ptr_conv);
28344 uint64_t ret_ref = tag_ptr(ret_copy, true);
28348 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) {
28349 LDKChannelReady this_ptr_conv;
28350 this_ptr_conv.inner = untag_ptr(this_ptr);
28351 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28352 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28353 this_ptr_conv.is_owned = false;
28354 void* val_ptr = untag_ptr(val);
28355 CHECK_ACCESS(val_ptr);
28356 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
28357 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
28358 ChannelReady_set_short_channel_id_alias(&this_ptr_conv, val_conv);
28361 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) {
28362 LDKThirtyTwoBytes channel_id_arg_ref;
28363 CHECK(channel_id_arg->arr_len == 32);
28364 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
28365 LDKPublicKey next_per_commitment_point_arg_ref;
28366 CHECK(next_per_commitment_point_arg->arr_len == 33);
28367 memcpy(next_per_commitment_point_arg_ref.compressed_form, next_per_commitment_point_arg->elems, 33); FREE(next_per_commitment_point_arg);
28368 void* short_channel_id_alias_arg_ptr = untag_ptr(short_channel_id_alias_arg);
28369 CHECK_ACCESS(short_channel_id_alias_arg_ptr);
28370 LDKCOption_u64Z short_channel_id_alias_arg_conv = *(LDKCOption_u64Z*)(short_channel_id_alias_arg_ptr);
28371 short_channel_id_alias_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(short_channel_id_alias_arg));
28372 LDKChannelReady ret_var = ChannelReady_new(channel_id_arg_ref, next_per_commitment_point_arg_ref, short_channel_id_alias_arg_conv);
28373 uint64_t ret_ref = 0;
28374 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28375 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28379 static inline uint64_t ChannelReady_clone_ptr(LDKChannelReady *NONNULL_PTR arg) {
28380 LDKChannelReady ret_var = ChannelReady_clone(arg);
28381 uint64_t ret_ref = 0;
28382 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28383 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28386 int64_t __attribute__((export_name("TS_ChannelReady_clone_ptr"))) TS_ChannelReady_clone_ptr(uint64_t arg) {
28387 LDKChannelReady arg_conv;
28388 arg_conv.inner = untag_ptr(arg);
28389 arg_conv.is_owned = ptr_is_owned(arg);
28390 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28391 arg_conv.is_owned = false;
28392 int64_t ret_conv = ChannelReady_clone_ptr(&arg_conv);
28396 uint64_t __attribute__((export_name("TS_ChannelReady_clone"))) TS_ChannelReady_clone(uint64_t orig) {
28397 LDKChannelReady orig_conv;
28398 orig_conv.inner = untag_ptr(orig);
28399 orig_conv.is_owned = ptr_is_owned(orig);
28400 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28401 orig_conv.is_owned = false;
28402 LDKChannelReady ret_var = ChannelReady_clone(&orig_conv);
28403 uint64_t ret_ref = 0;
28404 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28405 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28409 void __attribute__((export_name("TS_Shutdown_free"))) TS_Shutdown_free(uint64_t this_obj) {
28410 LDKShutdown this_obj_conv;
28411 this_obj_conv.inner = untag_ptr(this_obj);
28412 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28413 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28414 Shutdown_free(this_obj_conv);
28417 int8_tArray __attribute__((export_name("TS_Shutdown_get_channel_id"))) TS_Shutdown_get_channel_id(uint64_t this_ptr) {
28418 LDKShutdown this_ptr_conv;
28419 this_ptr_conv.inner = untag_ptr(this_ptr);
28420 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28421 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28422 this_ptr_conv.is_owned = false;
28423 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
28424 memcpy(ret_arr->elems, *Shutdown_get_channel_id(&this_ptr_conv), 32);
28428 void __attribute__((export_name("TS_Shutdown_set_channel_id"))) TS_Shutdown_set_channel_id(uint64_t this_ptr, int8_tArray val) {
28429 LDKShutdown this_ptr_conv;
28430 this_ptr_conv.inner = untag_ptr(this_ptr);
28431 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28432 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28433 this_ptr_conv.is_owned = false;
28434 LDKThirtyTwoBytes val_ref;
28435 CHECK(val->arr_len == 32);
28436 memcpy(val_ref.data, val->elems, 32); FREE(val);
28437 Shutdown_set_channel_id(&this_ptr_conv, val_ref);
28440 int8_tArray __attribute__((export_name("TS_Shutdown_get_scriptpubkey"))) TS_Shutdown_get_scriptpubkey(uint64_t this_ptr) {
28441 LDKShutdown this_ptr_conv;
28442 this_ptr_conv.inner = untag_ptr(this_ptr);
28443 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28444 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28445 this_ptr_conv.is_owned = false;
28446 LDKu8slice ret_var = Shutdown_get_scriptpubkey(&this_ptr_conv);
28447 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
28448 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
28452 void __attribute__((export_name("TS_Shutdown_set_scriptpubkey"))) TS_Shutdown_set_scriptpubkey(uint64_t this_ptr, int8_tArray val) {
28453 LDKShutdown this_ptr_conv;
28454 this_ptr_conv.inner = untag_ptr(this_ptr);
28455 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28456 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28457 this_ptr_conv.is_owned = false;
28458 LDKCVec_u8Z val_ref;
28459 val_ref.datalen = val->arr_len;
28460 val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes");
28461 memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val);
28462 Shutdown_set_scriptpubkey(&this_ptr_conv, val_ref);
28465 uint64_t __attribute__((export_name("TS_Shutdown_new"))) TS_Shutdown_new(int8_tArray channel_id_arg, int8_tArray scriptpubkey_arg) {
28466 LDKThirtyTwoBytes channel_id_arg_ref;
28467 CHECK(channel_id_arg->arr_len == 32);
28468 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
28469 LDKCVec_u8Z scriptpubkey_arg_ref;
28470 scriptpubkey_arg_ref.datalen = scriptpubkey_arg->arr_len;
28471 scriptpubkey_arg_ref.data = MALLOC(scriptpubkey_arg_ref.datalen, "LDKCVec_u8Z Bytes");
28472 memcpy(scriptpubkey_arg_ref.data, scriptpubkey_arg->elems, scriptpubkey_arg_ref.datalen); FREE(scriptpubkey_arg);
28473 LDKShutdown ret_var = Shutdown_new(channel_id_arg_ref, scriptpubkey_arg_ref);
28474 uint64_t ret_ref = 0;
28475 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28476 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28480 static inline uint64_t Shutdown_clone_ptr(LDKShutdown *NONNULL_PTR arg) {
28481 LDKShutdown ret_var = Shutdown_clone(arg);
28482 uint64_t ret_ref = 0;
28483 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28484 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28487 int64_t __attribute__((export_name("TS_Shutdown_clone_ptr"))) TS_Shutdown_clone_ptr(uint64_t arg) {
28488 LDKShutdown arg_conv;
28489 arg_conv.inner = untag_ptr(arg);
28490 arg_conv.is_owned = ptr_is_owned(arg);
28491 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28492 arg_conv.is_owned = false;
28493 int64_t ret_conv = Shutdown_clone_ptr(&arg_conv);
28497 uint64_t __attribute__((export_name("TS_Shutdown_clone"))) TS_Shutdown_clone(uint64_t orig) {
28498 LDKShutdown orig_conv;
28499 orig_conv.inner = untag_ptr(orig);
28500 orig_conv.is_owned = ptr_is_owned(orig);
28501 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28502 orig_conv.is_owned = false;
28503 LDKShutdown ret_var = Shutdown_clone(&orig_conv);
28504 uint64_t ret_ref = 0;
28505 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28506 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28510 void __attribute__((export_name("TS_ClosingSignedFeeRange_free"))) TS_ClosingSignedFeeRange_free(uint64_t this_obj) {
28511 LDKClosingSignedFeeRange this_obj_conv;
28512 this_obj_conv.inner = untag_ptr(this_obj);
28513 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28514 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28515 ClosingSignedFeeRange_free(this_obj_conv);
28518 int64_t __attribute__((export_name("TS_ClosingSignedFeeRange_get_min_fee_satoshis"))) TS_ClosingSignedFeeRange_get_min_fee_satoshis(uint64_t this_ptr) {
28519 LDKClosingSignedFeeRange this_ptr_conv;
28520 this_ptr_conv.inner = untag_ptr(this_ptr);
28521 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28522 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28523 this_ptr_conv.is_owned = false;
28524 int64_t ret_conv = ClosingSignedFeeRange_get_min_fee_satoshis(&this_ptr_conv);
28528 void __attribute__((export_name("TS_ClosingSignedFeeRange_set_min_fee_satoshis"))) TS_ClosingSignedFeeRange_set_min_fee_satoshis(uint64_t this_ptr, int64_t val) {
28529 LDKClosingSignedFeeRange this_ptr_conv;
28530 this_ptr_conv.inner = untag_ptr(this_ptr);
28531 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28532 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28533 this_ptr_conv.is_owned = false;
28534 ClosingSignedFeeRange_set_min_fee_satoshis(&this_ptr_conv, val);
28537 int64_t __attribute__((export_name("TS_ClosingSignedFeeRange_get_max_fee_satoshis"))) TS_ClosingSignedFeeRange_get_max_fee_satoshis(uint64_t this_ptr) {
28538 LDKClosingSignedFeeRange 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 int64_t ret_conv = ClosingSignedFeeRange_get_max_fee_satoshis(&this_ptr_conv);
28547 void __attribute__((export_name("TS_ClosingSignedFeeRange_set_max_fee_satoshis"))) TS_ClosingSignedFeeRange_set_max_fee_satoshis(uint64_t this_ptr, int64_t val) {
28548 LDKClosingSignedFeeRange this_ptr_conv;
28549 this_ptr_conv.inner = untag_ptr(this_ptr);
28550 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28551 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28552 this_ptr_conv.is_owned = false;
28553 ClosingSignedFeeRange_set_max_fee_satoshis(&this_ptr_conv, val);
28556 uint64_t __attribute__((export_name("TS_ClosingSignedFeeRange_new"))) TS_ClosingSignedFeeRange_new(int64_t min_fee_satoshis_arg, int64_t max_fee_satoshis_arg) {
28557 LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_new(min_fee_satoshis_arg, max_fee_satoshis_arg);
28558 uint64_t ret_ref = 0;
28559 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28560 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28564 static inline uint64_t ClosingSignedFeeRange_clone_ptr(LDKClosingSignedFeeRange *NONNULL_PTR arg) {
28565 LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_clone(arg);
28566 uint64_t ret_ref = 0;
28567 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28568 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28571 int64_t __attribute__((export_name("TS_ClosingSignedFeeRange_clone_ptr"))) TS_ClosingSignedFeeRange_clone_ptr(uint64_t arg) {
28572 LDKClosingSignedFeeRange arg_conv;
28573 arg_conv.inner = untag_ptr(arg);
28574 arg_conv.is_owned = ptr_is_owned(arg);
28575 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28576 arg_conv.is_owned = false;
28577 int64_t ret_conv = ClosingSignedFeeRange_clone_ptr(&arg_conv);
28581 uint64_t __attribute__((export_name("TS_ClosingSignedFeeRange_clone"))) TS_ClosingSignedFeeRange_clone(uint64_t orig) {
28582 LDKClosingSignedFeeRange orig_conv;
28583 orig_conv.inner = untag_ptr(orig);
28584 orig_conv.is_owned = ptr_is_owned(orig);
28585 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28586 orig_conv.is_owned = false;
28587 LDKClosingSignedFeeRange ret_var = ClosingSignedFeeRange_clone(&orig_conv);
28588 uint64_t ret_ref = 0;
28589 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28590 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28594 void __attribute__((export_name("TS_ClosingSigned_free"))) TS_ClosingSigned_free(uint64_t this_obj) {
28595 LDKClosingSigned this_obj_conv;
28596 this_obj_conv.inner = untag_ptr(this_obj);
28597 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28598 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28599 ClosingSigned_free(this_obj_conv);
28602 int8_tArray __attribute__((export_name("TS_ClosingSigned_get_channel_id"))) TS_ClosingSigned_get_channel_id(uint64_t this_ptr) {
28603 LDKClosingSigned this_ptr_conv;
28604 this_ptr_conv.inner = untag_ptr(this_ptr);
28605 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28606 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28607 this_ptr_conv.is_owned = false;
28608 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
28609 memcpy(ret_arr->elems, *ClosingSigned_get_channel_id(&this_ptr_conv), 32);
28613 void __attribute__((export_name("TS_ClosingSigned_set_channel_id"))) TS_ClosingSigned_set_channel_id(uint64_t this_ptr, int8_tArray val) {
28614 LDKClosingSigned this_ptr_conv;
28615 this_ptr_conv.inner = untag_ptr(this_ptr);
28616 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28617 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28618 this_ptr_conv.is_owned = false;
28619 LDKThirtyTwoBytes val_ref;
28620 CHECK(val->arr_len == 32);
28621 memcpy(val_ref.data, val->elems, 32); FREE(val);
28622 ClosingSigned_set_channel_id(&this_ptr_conv, val_ref);
28625 int64_t __attribute__((export_name("TS_ClosingSigned_get_fee_satoshis"))) TS_ClosingSigned_get_fee_satoshis(uint64_t this_ptr) {
28626 LDKClosingSigned this_ptr_conv;
28627 this_ptr_conv.inner = untag_ptr(this_ptr);
28628 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28629 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28630 this_ptr_conv.is_owned = false;
28631 int64_t ret_conv = ClosingSigned_get_fee_satoshis(&this_ptr_conv);
28635 void __attribute__((export_name("TS_ClosingSigned_set_fee_satoshis"))) TS_ClosingSigned_set_fee_satoshis(uint64_t this_ptr, int64_t val) {
28636 LDKClosingSigned this_ptr_conv;
28637 this_ptr_conv.inner = untag_ptr(this_ptr);
28638 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28639 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28640 this_ptr_conv.is_owned = false;
28641 ClosingSigned_set_fee_satoshis(&this_ptr_conv, val);
28644 int8_tArray __attribute__((export_name("TS_ClosingSigned_get_signature"))) TS_ClosingSigned_get_signature(uint64_t this_ptr) {
28645 LDKClosingSigned this_ptr_conv;
28646 this_ptr_conv.inner = untag_ptr(this_ptr);
28647 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28648 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28649 this_ptr_conv.is_owned = false;
28650 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
28651 memcpy(ret_arr->elems, ClosingSigned_get_signature(&this_ptr_conv).compact_form, 64);
28655 void __attribute__((export_name("TS_ClosingSigned_set_signature"))) TS_ClosingSigned_set_signature(uint64_t this_ptr, int8_tArray val) {
28656 LDKClosingSigned this_ptr_conv;
28657 this_ptr_conv.inner = untag_ptr(this_ptr);
28658 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28659 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28660 this_ptr_conv.is_owned = false;
28661 LDKSignature val_ref;
28662 CHECK(val->arr_len == 64);
28663 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
28664 ClosingSigned_set_signature(&this_ptr_conv, val_ref);
28667 uint64_t __attribute__((export_name("TS_ClosingSigned_get_fee_range"))) TS_ClosingSigned_get_fee_range(uint64_t this_ptr) {
28668 LDKClosingSigned this_ptr_conv;
28669 this_ptr_conv.inner = untag_ptr(this_ptr);
28670 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28671 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28672 this_ptr_conv.is_owned = false;
28673 LDKClosingSignedFeeRange ret_var = ClosingSigned_get_fee_range(&this_ptr_conv);
28674 uint64_t ret_ref = 0;
28675 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28676 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28680 void __attribute__((export_name("TS_ClosingSigned_set_fee_range"))) TS_ClosingSigned_set_fee_range(uint64_t this_ptr, uint64_t val) {
28681 LDKClosingSigned this_ptr_conv;
28682 this_ptr_conv.inner = untag_ptr(this_ptr);
28683 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28684 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28685 this_ptr_conv.is_owned = false;
28686 LDKClosingSignedFeeRange val_conv;
28687 val_conv.inner = untag_ptr(val);
28688 val_conv.is_owned = ptr_is_owned(val);
28689 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
28690 val_conv = ClosingSignedFeeRange_clone(&val_conv);
28691 ClosingSigned_set_fee_range(&this_ptr_conv, val_conv);
28694 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) {
28695 LDKThirtyTwoBytes channel_id_arg_ref;
28696 CHECK(channel_id_arg->arr_len == 32);
28697 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
28698 LDKSignature signature_arg_ref;
28699 CHECK(signature_arg->arr_len == 64);
28700 memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg);
28701 LDKClosingSignedFeeRange fee_range_arg_conv;
28702 fee_range_arg_conv.inner = untag_ptr(fee_range_arg);
28703 fee_range_arg_conv.is_owned = ptr_is_owned(fee_range_arg);
28704 CHECK_INNER_FIELD_ACCESS_OR_NULL(fee_range_arg_conv);
28705 fee_range_arg_conv = ClosingSignedFeeRange_clone(&fee_range_arg_conv);
28706 LDKClosingSigned ret_var = ClosingSigned_new(channel_id_arg_ref, fee_satoshis_arg, signature_arg_ref, fee_range_arg_conv);
28707 uint64_t ret_ref = 0;
28708 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28709 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28713 static inline uint64_t ClosingSigned_clone_ptr(LDKClosingSigned *NONNULL_PTR arg) {
28714 LDKClosingSigned ret_var = ClosingSigned_clone(arg);
28715 uint64_t ret_ref = 0;
28716 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28717 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28720 int64_t __attribute__((export_name("TS_ClosingSigned_clone_ptr"))) TS_ClosingSigned_clone_ptr(uint64_t arg) {
28721 LDKClosingSigned arg_conv;
28722 arg_conv.inner = untag_ptr(arg);
28723 arg_conv.is_owned = ptr_is_owned(arg);
28724 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28725 arg_conv.is_owned = false;
28726 int64_t ret_conv = ClosingSigned_clone_ptr(&arg_conv);
28730 uint64_t __attribute__((export_name("TS_ClosingSigned_clone"))) TS_ClosingSigned_clone(uint64_t orig) {
28731 LDKClosingSigned orig_conv;
28732 orig_conv.inner = untag_ptr(orig);
28733 orig_conv.is_owned = ptr_is_owned(orig);
28734 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28735 orig_conv.is_owned = false;
28736 LDKClosingSigned ret_var = ClosingSigned_clone(&orig_conv);
28737 uint64_t ret_ref = 0;
28738 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28739 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28743 void __attribute__((export_name("TS_UpdateAddHTLC_free"))) TS_UpdateAddHTLC_free(uint64_t this_obj) {
28744 LDKUpdateAddHTLC this_obj_conv;
28745 this_obj_conv.inner = untag_ptr(this_obj);
28746 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28747 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28748 UpdateAddHTLC_free(this_obj_conv);
28751 int8_tArray __attribute__((export_name("TS_UpdateAddHTLC_get_channel_id"))) TS_UpdateAddHTLC_get_channel_id(uint64_t this_ptr) {
28752 LDKUpdateAddHTLC this_ptr_conv;
28753 this_ptr_conv.inner = untag_ptr(this_ptr);
28754 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28755 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28756 this_ptr_conv.is_owned = false;
28757 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
28758 memcpy(ret_arr->elems, *UpdateAddHTLC_get_channel_id(&this_ptr_conv), 32);
28762 void __attribute__((export_name("TS_UpdateAddHTLC_set_channel_id"))) TS_UpdateAddHTLC_set_channel_id(uint64_t this_ptr, int8_tArray val) {
28763 LDKUpdateAddHTLC this_ptr_conv;
28764 this_ptr_conv.inner = untag_ptr(this_ptr);
28765 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28766 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28767 this_ptr_conv.is_owned = false;
28768 LDKThirtyTwoBytes val_ref;
28769 CHECK(val->arr_len == 32);
28770 memcpy(val_ref.data, val->elems, 32); FREE(val);
28771 UpdateAddHTLC_set_channel_id(&this_ptr_conv, val_ref);
28774 int64_t __attribute__((export_name("TS_UpdateAddHTLC_get_htlc_id"))) TS_UpdateAddHTLC_get_htlc_id(uint64_t this_ptr) {
28775 LDKUpdateAddHTLC this_ptr_conv;
28776 this_ptr_conv.inner = untag_ptr(this_ptr);
28777 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28778 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28779 this_ptr_conv.is_owned = false;
28780 int64_t ret_conv = UpdateAddHTLC_get_htlc_id(&this_ptr_conv);
28784 void __attribute__((export_name("TS_UpdateAddHTLC_set_htlc_id"))) TS_UpdateAddHTLC_set_htlc_id(uint64_t this_ptr, int64_t val) {
28785 LDKUpdateAddHTLC this_ptr_conv;
28786 this_ptr_conv.inner = untag_ptr(this_ptr);
28787 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28788 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28789 this_ptr_conv.is_owned = false;
28790 UpdateAddHTLC_set_htlc_id(&this_ptr_conv, val);
28793 int64_t __attribute__((export_name("TS_UpdateAddHTLC_get_amount_msat"))) TS_UpdateAddHTLC_get_amount_msat(uint64_t this_ptr) {
28794 LDKUpdateAddHTLC this_ptr_conv;
28795 this_ptr_conv.inner = untag_ptr(this_ptr);
28796 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28797 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28798 this_ptr_conv.is_owned = false;
28799 int64_t ret_conv = UpdateAddHTLC_get_amount_msat(&this_ptr_conv);
28803 void __attribute__((export_name("TS_UpdateAddHTLC_set_amount_msat"))) TS_UpdateAddHTLC_set_amount_msat(uint64_t this_ptr, int64_t val) {
28804 LDKUpdateAddHTLC 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 UpdateAddHTLC_set_amount_msat(&this_ptr_conv, val);
28812 int8_tArray __attribute__((export_name("TS_UpdateAddHTLC_get_payment_hash"))) TS_UpdateAddHTLC_get_payment_hash(uint64_t this_ptr) {
28813 LDKUpdateAddHTLC this_ptr_conv;
28814 this_ptr_conv.inner = untag_ptr(this_ptr);
28815 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28816 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28817 this_ptr_conv.is_owned = false;
28818 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
28819 memcpy(ret_arr->elems, *UpdateAddHTLC_get_payment_hash(&this_ptr_conv), 32);
28823 void __attribute__((export_name("TS_UpdateAddHTLC_set_payment_hash"))) TS_UpdateAddHTLC_set_payment_hash(uint64_t this_ptr, int8_tArray val) {
28824 LDKUpdateAddHTLC this_ptr_conv;
28825 this_ptr_conv.inner = untag_ptr(this_ptr);
28826 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28827 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28828 this_ptr_conv.is_owned = false;
28829 LDKThirtyTwoBytes val_ref;
28830 CHECK(val->arr_len == 32);
28831 memcpy(val_ref.data, val->elems, 32); FREE(val);
28832 UpdateAddHTLC_set_payment_hash(&this_ptr_conv, val_ref);
28835 int32_t __attribute__((export_name("TS_UpdateAddHTLC_get_cltv_expiry"))) TS_UpdateAddHTLC_get_cltv_expiry(uint64_t this_ptr) {
28836 LDKUpdateAddHTLC this_ptr_conv;
28837 this_ptr_conv.inner = untag_ptr(this_ptr);
28838 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28839 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28840 this_ptr_conv.is_owned = false;
28841 int32_t ret_conv = UpdateAddHTLC_get_cltv_expiry(&this_ptr_conv);
28845 void __attribute__((export_name("TS_UpdateAddHTLC_set_cltv_expiry"))) TS_UpdateAddHTLC_set_cltv_expiry(uint64_t this_ptr, int32_t val) {
28846 LDKUpdateAddHTLC 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 UpdateAddHTLC_set_cltv_expiry(&this_ptr_conv, val);
28854 static inline uint64_t UpdateAddHTLC_clone_ptr(LDKUpdateAddHTLC *NONNULL_PTR arg) {
28855 LDKUpdateAddHTLC ret_var = UpdateAddHTLC_clone(arg);
28856 uint64_t ret_ref = 0;
28857 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28858 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28861 int64_t __attribute__((export_name("TS_UpdateAddHTLC_clone_ptr"))) TS_UpdateAddHTLC_clone_ptr(uint64_t arg) {
28862 LDKUpdateAddHTLC arg_conv;
28863 arg_conv.inner = untag_ptr(arg);
28864 arg_conv.is_owned = ptr_is_owned(arg);
28865 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28866 arg_conv.is_owned = false;
28867 int64_t ret_conv = UpdateAddHTLC_clone_ptr(&arg_conv);
28871 uint64_t __attribute__((export_name("TS_UpdateAddHTLC_clone"))) TS_UpdateAddHTLC_clone(uint64_t orig) {
28872 LDKUpdateAddHTLC orig_conv;
28873 orig_conv.inner = untag_ptr(orig);
28874 orig_conv.is_owned = ptr_is_owned(orig);
28875 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28876 orig_conv.is_owned = false;
28877 LDKUpdateAddHTLC ret_var = UpdateAddHTLC_clone(&orig_conv);
28878 uint64_t ret_ref = 0;
28879 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28880 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28884 void __attribute__((export_name("TS_UpdateFulfillHTLC_free"))) TS_UpdateFulfillHTLC_free(uint64_t this_obj) {
28885 LDKUpdateFulfillHTLC this_obj_conv;
28886 this_obj_conv.inner = untag_ptr(this_obj);
28887 this_obj_conv.is_owned = ptr_is_owned(this_obj);
28888 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
28889 UpdateFulfillHTLC_free(this_obj_conv);
28892 int8_tArray __attribute__((export_name("TS_UpdateFulfillHTLC_get_channel_id"))) TS_UpdateFulfillHTLC_get_channel_id(uint64_t this_ptr) {
28893 LDKUpdateFulfillHTLC this_ptr_conv;
28894 this_ptr_conv.inner = untag_ptr(this_ptr);
28895 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28896 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28897 this_ptr_conv.is_owned = false;
28898 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
28899 memcpy(ret_arr->elems, *UpdateFulfillHTLC_get_channel_id(&this_ptr_conv), 32);
28903 void __attribute__((export_name("TS_UpdateFulfillHTLC_set_channel_id"))) TS_UpdateFulfillHTLC_set_channel_id(uint64_t this_ptr, int8_tArray val) {
28904 LDKUpdateFulfillHTLC this_ptr_conv;
28905 this_ptr_conv.inner = untag_ptr(this_ptr);
28906 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28907 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28908 this_ptr_conv.is_owned = false;
28909 LDKThirtyTwoBytes val_ref;
28910 CHECK(val->arr_len == 32);
28911 memcpy(val_ref.data, val->elems, 32); FREE(val);
28912 UpdateFulfillHTLC_set_channel_id(&this_ptr_conv, val_ref);
28915 int64_t __attribute__((export_name("TS_UpdateFulfillHTLC_get_htlc_id"))) TS_UpdateFulfillHTLC_get_htlc_id(uint64_t this_ptr) {
28916 LDKUpdateFulfillHTLC this_ptr_conv;
28917 this_ptr_conv.inner = untag_ptr(this_ptr);
28918 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28919 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28920 this_ptr_conv.is_owned = false;
28921 int64_t ret_conv = UpdateFulfillHTLC_get_htlc_id(&this_ptr_conv);
28925 void __attribute__((export_name("TS_UpdateFulfillHTLC_set_htlc_id"))) TS_UpdateFulfillHTLC_set_htlc_id(uint64_t this_ptr, int64_t val) {
28926 LDKUpdateFulfillHTLC this_ptr_conv;
28927 this_ptr_conv.inner = untag_ptr(this_ptr);
28928 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28929 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28930 this_ptr_conv.is_owned = false;
28931 UpdateFulfillHTLC_set_htlc_id(&this_ptr_conv, val);
28934 int8_tArray __attribute__((export_name("TS_UpdateFulfillHTLC_get_payment_preimage"))) TS_UpdateFulfillHTLC_get_payment_preimage(uint64_t this_ptr) {
28935 LDKUpdateFulfillHTLC this_ptr_conv;
28936 this_ptr_conv.inner = untag_ptr(this_ptr);
28937 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28938 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28939 this_ptr_conv.is_owned = false;
28940 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
28941 memcpy(ret_arr->elems, *UpdateFulfillHTLC_get_payment_preimage(&this_ptr_conv), 32);
28945 void __attribute__((export_name("TS_UpdateFulfillHTLC_set_payment_preimage"))) TS_UpdateFulfillHTLC_set_payment_preimage(uint64_t this_ptr, int8_tArray val) {
28946 LDKUpdateFulfillHTLC this_ptr_conv;
28947 this_ptr_conv.inner = untag_ptr(this_ptr);
28948 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
28949 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
28950 this_ptr_conv.is_owned = false;
28951 LDKThirtyTwoBytes val_ref;
28952 CHECK(val->arr_len == 32);
28953 memcpy(val_ref.data, val->elems, 32); FREE(val);
28954 UpdateFulfillHTLC_set_payment_preimage(&this_ptr_conv, val_ref);
28957 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) {
28958 LDKThirtyTwoBytes channel_id_arg_ref;
28959 CHECK(channel_id_arg->arr_len == 32);
28960 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
28961 LDKThirtyTwoBytes payment_preimage_arg_ref;
28962 CHECK(payment_preimage_arg->arr_len == 32);
28963 memcpy(payment_preimage_arg_ref.data, payment_preimage_arg->elems, 32); FREE(payment_preimage_arg);
28964 LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_new(channel_id_arg_ref, htlc_id_arg, payment_preimage_arg_ref);
28965 uint64_t ret_ref = 0;
28966 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28967 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28971 static inline uint64_t UpdateFulfillHTLC_clone_ptr(LDKUpdateFulfillHTLC *NONNULL_PTR arg) {
28972 LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_clone(arg);
28973 uint64_t ret_ref = 0;
28974 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28975 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
28978 int64_t __attribute__((export_name("TS_UpdateFulfillHTLC_clone_ptr"))) TS_UpdateFulfillHTLC_clone_ptr(uint64_t arg) {
28979 LDKUpdateFulfillHTLC arg_conv;
28980 arg_conv.inner = untag_ptr(arg);
28981 arg_conv.is_owned = ptr_is_owned(arg);
28982 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
28983 arg_conv.is_owned = false;
28984 int64_t ret_conv = UpdateFulfillHTLC_clone_ptr(&arg_conv);
28988 uint64_t __attribute__((export_name("TS_UpdateFulfillHTLC_clone"))) TS_UpdateFulfillHTLC_clone(uint64_t orig) {
28989 LDKUpdateFulfillHTLC orig_conv;
28990 orig_conv.inner = untag_ptr(orig);
28991 orig_conv.is_owned = ptr_is_owned(orig);
28992 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
28993 orig_conv.is_owned = false;
28994 LDKUpdateFulfillHTLC ret_var = UpdateFulfillHTLC_clone(&orig_conv);
28995 uint64_t ret_ref = 0;
28996 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
28997 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29001 void __attribute__((export_name("TS_UpdateFailHTLC_free"))) TS_UpdateFailHTLC_free(uint64_t this_obj) {
29002 LDKUpdateFailHTLC this_obj_conv;
29003 this_obj_conv.inner = untag_ptr(this_obj);
29004 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29005 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29006 UpdateFailHTLC_free(this_obj_conv);
29009 int8_tArray __attribute__((export_name("TS_UpdateFailHTLC_get_channel_id"))) TS_UpdateFailHTLC_get_channel_id(uint64_t this_ptr) {
29010 LDKUpdateFailHTLC this_ptr_conv;
29011 this_ptr_conv.inner = untag_ptr(this_ptr);
29012 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29013 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29014 this_ptr_conv.is_owned = false;
29015 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
29016 memcpy(ret_arr->elems, *UpdateFailHTLC_get_channel_id(&this_ptr_conv), 32);
29020 void __attribute__((export_name("TS_UpdateFailHTLC_set_channel_id"))) TS_UpdateFailHTLC_set_channel_id(uint64_t this_ptr, int8_tArray val) {
29021 LDKUpdateFailHTLC this_ptr_conv;
29022 this_ptr_conv.inner = untag_ptr(this_ptr);
29023 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29024 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29025 this_ptr_conv.is_owned = false;
29026 LDKThirtyTwoBytes val_ref;
29027 CHECK(val->arr_len == 32);
29028 memcpy(val_ref.data, val->elems, 32); FREE(val);
29029 UpdateFailHTLC_set_channel_id(&this_ptr_conv, val_ref);
29032 int64_t __attribute__((export_name("TS_UpdateFailHTLC_get_htlc_id"))) TS_UpdateFailHTLC_get_htlc_id(uint64_t this_ptr) {
29033 LDKUpdateFailHTLC this_ptr_conv;
29034 this_ptr_conv.inner = untag_ptr(this_ptr);
29035 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29036 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29037 this_ptr_conv.is_owned = false;
29038 int64_t ret_conv = UpdateFailHTLC_get_htlc_id(&this_ptr_conv);
29042 void __attribute__((export_name("TS_UpdateFailHTLC_set_htlc_id"))) TS_UpdateFailHTLC_set_htlc_id(uint64_t this_ptr, int64_t val) {
29043 LDKUpdateFailHTLC this_ptr_conv;
29044 this_ptr_conv.inner = untag_ptr(this_ptr);
29045 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29046 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29047 this_ptr_conv.is_owned = false;
29048 UpdateFailHTLC_set_htlc_id(&this_ptr_conv, val);
29051 static inline uint64_t UpdateFailHTLC_clone_ptr(LDKUpdateFailHTLC *NONNULL_PTR arg) {
29052 LDKUpdateFailHTLC ret_var = UpdateFailHTLC_clone(arg);
29053 uint64_t ret_ref = 0;
29054 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29055 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29058 int64_t __attribute__((export_name("TS_UpdateFailHTLC_clone_ptr"))) TS_UpdateFailHTLC_clone_ptr(uint64_t arg) {
29059 LDKUpdateFailHTLC arg_conv;
29060 arg_conv.inner = untag_ptr(arg);
29061 arg_conv.is_owned = ptr_is_owned(arg);
29062 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29063 arg_conv.is_owned = false;
29064 int64_t ret_conv = UpdateFailHTLC_clone_ptr(&arg_conv);
29068 uint64_t __attribute__((export_name("TS_UpdateFailHTLC_clone"))) TS_UpdateFailHTLC_clone(uint64_t orig) {
29069 LDKUpdateFailHTLC orig_conv;
29070 orig_conv.inner = untag_ptr(orig);
29071 orig_conv.is_owned = ptr_is_owned(orig);
29072 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29073 orig_conv.is_owned = false;
29074 LDKUpdateFailHTLC ret_var = UpdateFailHTLC_clone(&orig_conv);
29075 uint64_t ret_ref = 0;
29076 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29077 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29081 void __attribute__((export_name("TS_UpdateFailMalformedHTLC_free"))) TS_UpdateFailMalformedHTLC_free(uint64_t this_obj) {
29082 LDKUpdateFailMalformedHTLC this_obj_conv;
29083 this_obj_conv.inner = untag_ptr(this_obj);
29084 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29085 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29086 UpdateFailMalformedHTLC_free(this_obj_conv);
29089 int8_tArray __attribute__((export_name("TS_UpdateFailMalformedHTLC_get_channel_id"))) TS_UpdateFailMalformedHTLC_get_channel_id(uint64_t this_ptr) {
29090 LDKUpdateFailMalformedHTLC this_ptr_conv;
29091 this_ptr_conv.inner = untag_ptr(this_ptr);
29092 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29093 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29094 this_ptr_conv.is_owned = false;
29095 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
29096 memcpy(ret_arr->elems, *UpdateFailMalformedHTLC_get_channel_id(&this_ptr_conv), 32);
29100 void __attribute__((export_name("TS_UpdateFailMalformedHTLC_set_channel_id"))) TS_UpdateFailMalformedHTLC_set_channel_id(uint64_t this_ptr, int8_tArray val) {
29101 LDKUpdateFailMalformedHTLC this_ptr_conv;
29102 this_ptr_conv.inner = untag_ptr(this_ptr);
29103 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29104 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29105 this_ptr_conv.is_owned = false;
29106 LDKThirtyTwoBytes val_ref;
29107 CHECK(val->arr_len == 32);
29108 memcpy(val_ref.data, val->elems, 32); FREE(val);
29109 UpdateFailMalformedHTLC_set_channel_id(&this_ptr_conv, val_ref);
29112 int64_t __attribute__((export_name("TS_UpdateFailMalformedHTLC_get_htlc_id"))) TS_UpdateFailMalformedHTLC_get_htlc_id(uint64_t this_ptr) {
29113 LDKUpdateFailMalformedHTLC this_ptr_conv;
29114 this_ptr_conv.inner = untag_ptr(this_ptr);
29115 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29116 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29117 this_ptr_conv.is_owned = false;
29118 int64_t ret_conv = UpdateFailMalformedHTLC_get_htlc_id(&this_ptr_conv);
29122 void __attribute__((export_name("TS_UpdateFailMalformedHTLC_set_htlc_id"))) TS_UpdateFailMalformedHTLC_set_htlc_id(uint64_t this_ptr, int64_t val) {
29123 LDKUpdateFailMalformedHTLC this_ptr_conv;
29124 this_ptr_conv.inner = untag_ptr(this_ptr);
29125 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29126 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29127 this_ptr_conv.is_owned = false;
29128 UpdateFailMalformedHTLC_set_htlc_id(&this_ptr_conv, val);
29131 int16_t __attribute__((export_name("TS_UpdateFailMalformedHTLC_get_failure_code"))) TS_UpdateFailMalformedHTLC_get_failure_code(uint64_t this_ptr) {
29132 LDKUpdateFailMalformedHTLC this_ptr_conv;
29133 this_ptr_conv.inner = untag_ptr(this_ptr);
29134 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29135 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29136 this_ptr_conv.is_owned = false;
29137 int16_t ret_conv = UpdateFailMalformedHTLC_get_failure_code(&this_ptr_conv);
29141 void __attribute__((export_name("TS_UpdateFailMalformedHTLC_set_failure_code"))) TS_UpdateFailMalformedHTLC_set_failure_code(uint64_t this_ptr, int16_t val) {
29142 LDKUpdateFailMalformedHTLC this_ptr_conv;
29143 this_ptr_conv.inner = untag_ptr(this_ptr);
29144 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29145 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29146 this_ptr_conv.is_owned = false;
29147 UpdateFailMalformedHTLC_set_failure_code(&this_ptr_conv, val);
29150 static inline uint64_t UpdateFailMalformedHTLC_clone_ptr(LDKUpdateFailMalformedHTLC *NONNULL_PTR arg) {
29151 LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_clone(arg);
29152 uint64_t ret_ref = 0;
29153 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29154 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29157 int64_t __attribute__((export_name("TS_UpdateFailMalformedHTLC_clone_ptr"))) TS_UpdateFailMalformedHTLC_clone_ptr(uint64_t arg) {
29158 LDKUpdateFailMalformedHTLC arg_conv;
29159 arg_conv.inner = untag_ptr(arg);
29160 arg_conv.is_owned = ptr_is_owned(arg);
29161 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29162 arg_conv.is_owned = false;
29163 int64_t ret_conv = UpdateFailMalformedHTLC_clone_ptr(&arg_conv);
29167 uint64_t __attribute__((export_name("TS_UpdateFailMalformedHTLC_clone"))) TS_UpdateFailMalformedHTLC_clone(uint64_t orig) {
29168 LDKUpdateFailMalformedHTLC orig_conv;
29169 orig_conv.inner = untag_ptr(orig);
29170 orig_conv.is_owned = ptr_is_owned(orig);
29171 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29172 orig_conv.is_owned = false;
29173 LDKUpdateFailMalformedHTLC ret_var = UpdateFailMalformedHTLC_clone(&orig_conv);
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);
29180 void __attribute__((export_name("TS_CommitmentSigned_free"))) TS_CommitmentSigned_free(uint64_t this_obj) {
29181 LDKCommitmentSigned this_obj_conv;
29182 this_obj_conv.inner = untag_ptr(this_obj);
29183 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29184 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29185 CommitmentSigned_free(this_obj_conv);
29188 int8_tArray __attribute__((export_name("TS_CommitmentSigned_get_channel_id"))) TS_CommitmentSigned_get_channel_id(uint64_t this_ptr) {
29189 LDKCommitmentSigned this_ptr_conv;
29190 this_ptr_conv.inner = untag_ptr(this_ptr);
29191 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29192 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29193 this_ptr_conv.is_owned = false;
29194 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
29195 memcpy(ret_arr->elems, *CommitmentSigned_get_channel_id(&this_ptr_conv), 32);
29199 void __attribute__((export_name("TS_CommitmentSigned_set_channel_id"))) TS_CommitmentSigned_set_channel_id(uint64_t this_ptr, int8_tArray val) {
29200 LDKCommitmentSigned this_ptr_conv;
29201 this_ptr_conv.inner = untag_ptr(this_ptr);
29202 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29203 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29204 this_ptr_conv.is_owned = false;
29205 LDKThirtyTwoBytes val_ref;
29206 CHECK(val->arr_len == 32);
29207 memcpy(val_ref.data, val->elems, 32); FREE(val);
29208 CommitmentSigned_set_channel_id(&this_ptr_conv, val_ref);
29211 int8_tArray __attribute__((export_name("TS_CommitmentSigned_get_signature"))) TS_CommitmentSigned_get_signature(uint64_t this_ptr) {
29212 LDKCommitmentSigned this_ptr_conv;
29213 this_ptr_conv.inner = untag_ptr(this_ptr);
29214 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29215 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29216 this_ptr_conv.is_owned = false;
29217 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
29218 memcpy(ret_arr->elems, CommitmentSigned_get_signature(&this_ptr_conv).compact_form, 64);
29222 void __attribute__((export_name("TS_CommitmentSigned_set_signature"))) TS_CommitmentSigned_set_signature(uint64_t this_ptr, int8_tArray val) {
29223 LDKCommitmentSigned this_ptr_conv;
29224 this_ptr_conv.inner = untag_ptr(this_ptr);
29225 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29226 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29227 this_ptr_conv.is_owned = false;
29228 LDKSignature val_ref;
29229 CHECK(val->arr_len == 64);
29230 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
29231 CommitmentSigned_set_signature(&this_ptr_conv, val_ref);
29234 ptrArray __attribute__((export_name("TS_CommitmentSigned_get_htlc_signatures"))) TS_CommitmentSigned_get_htlc_signatures(uint64_t this_ptr) {
29235 LDKCommitmentSigned this_ptr_conv;
29236 this_ptr_conv.inner = untag_ptr(this_ptr);
29237 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29238 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29239 this_ptr_conv.is_owned = false;
29240 LDKCVec_SignatureZ ret_var = CommitmentSigned_get_htlc_signatures(&this_ptr_conv);
29241 ptrArray ret_arr = NULL;
29242 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
29243 int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8);
29244 for (size_t m = 0; m < ret_var.datalen; m++) {
29245 int8_tArray ret_conv_12_arr = init_int8_tArray(64, __LINE__);
29246 memcpy(ret_conv_12_arr->elems, ret_var.data[m].compact_form, 64);
29247 ret_arr_ptr[m] = ret_conv_12_arr;
29250 FREE(ret_var.data);
29254 void __attribute__((export_name("TS_CommitmentSigned_set_htlc_signatures"))) TS_CommitmentSigned_set_htlc_signatures(uint64_t this_ptr, ptrArray val) {
29255 LDKCommitmentSigned this_ptr_conv;
29256 this_ptr_conv.inner = untag_ptr(this_ptr);
29257 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29258 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29259 this_ptr_conv.is_owned = false;
29260 LDKCVec_SignatureZ val_constr;
29261 val_constr.datalen = val->arr_len;
29262 if (val_constr.datalen > 0)
29263 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
29265 val_constr.data = NULL;
29266 int8_tArray* val_vals = (void*) val->elems;
29267 for (size_t m = 0; m < val_constr.datalen; m++) {
29268 int8_tArray val_conv_12 = val_vals[m];
29269 LDKSignature val_conv_12_ref;
29270 CHECK(val_conv_12->arr_len == 64);
29271 memcpy(val_conv_12_ref.compact_form, val_conv_12->elems, 64); FREE(val_conv_12);
29272 val_constr.data[m] = val_conv_12_ref;
29275 CommitmentSigned_set_htlc_signatures(&this_ptr_conv, val_constr);
29278 uint64_t __attribute__((export_name("TS_CommitmentSigned_new"))) TS_CommitmentSigned_new(int8_tArray channel_id_arg, int8_tArray signature_arg, ptrArray htlc_signatures_arg) {
29279 LDKThirtyTwoBytes channel_id_arg_ref;
29280 CHECK(channel_id_arg->arr_len == 32);
29281 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
29282 LDKSignature signature_arg_ref;
29283 CHECK(signature_arg->arr_len == 64);
29284 memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg);
29285 LDKCVec_SignatureZ htlc_signatures_arg_constr;
29286 htlc_signatures_arg_constr.datalen = htlc_signatures_arg->arr_len;
29287 if (htlc_signatures_arg_constr.datalen > 0)
29288 htlc_signatures_arg_constr.data = MALLOC(htlc_signatures_arg_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
29290 htlc_signatures_arg_constr.data = NULL;
29291 int8_tArray* htlc_signatures_arg_vals = (void*) htlc_signatures_arg->elems;
29292 for (size_t m = 0; m < htlc_signatures_arg_constr.datalen; m++) {
29293 int8_tArray htlc_signatures_arg_conv_12 = htlc_signatures_arg_vals[m];
29294 LDKSignature htlc_signatures_arg_conv_12_ref;
29295 CHECK(htlc_signatures_arg_conv_12->arr_len == 64);
29296 memcpy(htlc_signatures_arg_conv_12_ref.compact_form, htlc_signatures_arg_conv_12->elems, 64); FREE(htlc_signatures_arg_conv_12);
29297 htlc_signatures_arg_constr.data[m] = htlc_signatures_arg_conv_12_ref;
29299 FREE(htlc_signatures_arg);
29300 LDKCommitmentSigned ret_var = CommitmentSigned_new(channel_id_arg_ref, signature_arg_ref, htlc_signatures_arg_constr);
29301 uint64_t ret_ref = 0;
29302 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29303 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29307 static inline uint64_t CommitmentSigned_clone_ptr(LDKCommitmentSigned *NONNULL_PTR arg) {
29308 LDKCommitmentSigned ret_var = CommitmentSigned_clone(arg);
29309 uint64_t ret_ref = 0;
29310 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29311 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29314 int64_t __attribute__((export_name("TS_CommitmentSigned_clone_ptr"))) TS_CommitmentSigned_clone_ptr(uint64_t arg) {
29315 LDKCommitmentSigned arg_conv;
29316 arg_conv.inner = untag_ptr(arg);
29317 arg_conv.is_owned = ptr_is_owned(arg);
29318 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29319 arg_conv.is_owned = false;
29320 int64_t ret_conv = CommitmentSigned_clone_ptr(&arg_conv);
29324 uint64_t __attribute__((export_name("TS_CommitmentSigned_clone"))) TS_CommitmentSigned_clone(uint64_t orig) {
29325 LDKCommitmentSigned orig_conv;
29326 orig_conv.inner = untag_ptr(orig);
29327 orig_conv.is_owned = ptr_is_owned(orig);
29328 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29329 orig_conv.is_owned = false;
29330 LDKCommitmentSigned ret_var = CommitmentSigned_clone(&orig_conv);
29331 uint64_t ret_ref = 0;
29332 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29333 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29337 void __attribute__((export_name("TS_RevokeAndACK_free"))) TS_RevokeAndACK_free(uint64_t this_obj) {
29338 LDKRevokeAndACK this_obj_conv;
29339 this_obj_conv.inner = untag_ptr(this_obj);
29340 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29341 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29342 RevokeAndACK_free(this_obj_conv);
29345 int8_tArray __attribute__((export_name("TS_RevokeAndACK_get_channel_id"))) TS_RevokeAndACK_get_channel_id(uint64_t this_ptr) {
29346 LDKRevokeAndACK this_ptr_conv;
29347 this_ptr_conv.inner = untag_ptr(this_ptr);
29348 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29349 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29350 this_ptr_conv.is_owned = false;
29351 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
29352 memcpy(ret_arr->elems, *RevokeAndACK_get_channel_id(&this_ptr_conv), 32);
29356 void __attribute__((export_name("TS_RevokeAndACK_set_channel_id"))) TS_RevokeAndACK_set_channel_id(uint64_t this_ptr, int8_tArray val) {
29357 LDKRevokeAndACK this_ptr_conv;
29358 this_ptr_conv.inner = untag_ptr(this_ptr);
29359 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29360 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29361 this_ptr_conv.is_owned = false;
29362 LDKThirtyTwoBytes val_ref;
29363 CHECK(val->arr_len == 32);
29364 memcpy(val_ref.data, val->elems, 32); FREE(val);
29365 RevokeAndACK_set_channel_id(&this_ptr_conv, val_ref);
29368 int8_tArray __attribute__((export_name("TS_RevokeAndACK_get_per_commitment_secret"))) TS_RevokeAndACK_get_per_commitment_secret(uint64_t this_ptr) {
29369 LDKRevokeAndACK this_ptr_conv;
29370 this_ptr_conv.inner = untag_ptr(this_ptr);
29371 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29372 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29373 this_ptr_conv.is_owned = false;
29374 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
29375 memcpy(ret_arr->elems, *RevokeAndACK_get_per_commitment_secret(&this_ptr_conv), 32);
29379 void __attribute__((export_name("TS_RevokeAndACK_set_per_commitment_secret"))) TS_RevokeAndACK_set_per_commitment_secret(uint64_t this_ptr, int8_tArray val) {
29380 LDKRevokeAndACK this_ptr_conv;
29381 this_ptr_conv.inner = untag_ptr(this_ptr);
29382 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29383 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29384 this_ptr_conv.is_owned = false;
29385 LDKThirtyTwoBytes val_ref;
29386 CHECK(val->arr_len == 32);
29387 memcpy(val_ref.data, val->elems, 32); FREE(val);
29388 RevokeAndACK_set_per_commitment_secret(&this_ptr_conv, val_ref);
29391 int8_tArray __attribute__((export_name("TS_RevokeAndACK_get_next_per_commitment_point"))) TS_RevokeAndACK_get_next_per_commitment_point(uint64_t this_ptr) {
29392 LDKRevokeAndACK this_ptr_conv;
29393 this_ptr_conv.inner = untag_ptr(this_ptr);
29394 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29395 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29396 this_ptr_conv.is_owned = false;
29397 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
29398 memcpy(ret_arr->elems, RevokeAndACK_get_next_per_commitment_point(&this_ptr_conv).compressed_form, 33);
29402 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) {
29403 LDKRevokeAndACK this_ptr_conv;
29404 this_ptr_conv.inner = untag_ptr(this_ptr);
29405 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29406 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29407 this_ptr_conv.is_owned = false;
29408 LDKPublicKey val_ref;
29409 CHECK(val->arr_len == 33);
29410 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
29411 RevokeAndACK_set_next_per_commitment_point(&this_ptr_conv, val_ref);
29414 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) {
29415 LDKThirtyTwoBytes channel_id_arg_ref;
29416 CHECK(channel_id_arg->arr_len == 32);
29417 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
29418 LDKThirtyTwoBytes per_commitment_secret_arg_ref;
29419 CHECK(per_commitment_secret_arg->arr_len == 32);
29420 memcpy(per_commitment_secret_arg_ref.data, per_commitment_secret_arg->elems, 32); FREE(per_commitment_secret_arg);
29421 LDKPublicKey next_per_commitment_point_arg_ref;
29422 CHECK(next_per_commitment_point_arg->arr_len == 33);
29423 memcpy(next_per_commitment_point_arg_ref.compressed_form, next_per_commitment_point_arg->elems, 33); FREE(next_per_commitment_point_arg);
29424 LDKRevokeAndACK ret_var = RevokeAndACK_new(channel_id_arg_ref, per_commitment_secret_arg_ref, next_per_commitment_point_arg_ref);
29425 uint64_t ret_ref = 0;
29426 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29427 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29431 static inline uint64_t RevokeAndACK_clone_ptr(LDKRevokeAndACK *NONNULL_PTR arg) {
29432 LDKRevokeAndACK ret_var = RevokeAndACK_clone(arg);
29433 uint64_t ret_ref = 0;
29434 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29435 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29438 int64_t __attribute__((export_name("TS_RevokeAndACK_clone_ptr"))) TS_RevokeAndACK_clone_ptr(uint64_t arg) {
29439 LDKRevokeAndACK arg_conv;
29440 arg_conv.inner = untag_ptr(arg);
29441 arg_conv.is_owned = ptr_is_owned(arg);
29442 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29443 arg_conv.is_owned = false;
29444 int64_t ret_conv = RevokeAndACK_clone_ptr(&arg_conv);
29448 uint64_t __attribute__((export_name("TS_RevokeAndACK_clone"))) TS_RevokeAndACK_clone(uint64_t orig) {
29449 LDKRevokeAndACK orig_conv;
29450 orig_conv.inner = untag_ptr(orig);
29451 orig_conv.is_owned = ptr_is_owned(orig);
29452 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29453 orig_conv.is_owned = false;
29454 LDKRevokeAndACK ret_var = RevokeAndACK_clone(&orig_conv);
29455 uint64_t ret_ref = 0;
29456 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29457 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29461 void __attribute__((export_name("TS_UpdateFee_free"))) TS_UpdateFee_free(uint64_t this_obj) {
29462 LDKUpdateFee this_obj_conv;
29463 this_obj_conv.inner = untag_ptr(this_obj);
29464 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29465 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29466 UpdateFee_free(this_obj_conv);
29469 int8_tArray __attribute__((export_name("TS_UpdateFee_get_channel_id"))) TS_UpdateFee_get_channel_id(uint64_t this_ptr) {
29470 LDKUpdateFee this_ptr_conv;
29471 this_ptr_conv.inner = untag_ptr(this_ptr);
29472 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29473 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29474 this_ptr_conv.is_owned = false;
29475 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
29476 memcpy(ret_arr->elems, *UpdateFee_get_channel_id(&this_ptr_conv), 32);
29480 void __attribute__((export_name("TS_UpdateFee_set_channel_id"))) TS_UpdateFee_set_channel_id(uint64_t this_ptr, int8_tArray val) {
29481 LDKUpdateFee this_ptr_conv;
29482 this_ptr_conv.inner = untag_ptr(this_ptr);
29483 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29484 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29485 this_ptr_conv.is_owned = false;
29486 LDKThirtyTwoBytes val_ref;
29487 CHECK(val->arr_len == 32);
29488 memcpy(val_ref.data, val->elems, 32); FREE(val);
29489 UpdateFee_set_channel_id(&this_ptr_conv, val_ref);
29492 int32_t __attribute__((export_name("TS_UpdateFee_get_feerate_per_kw"))) TS_UpdateFee_get_feerate_per_kw(uint64_t this_ptr) {
29493 LDKUpdateFee this_ptr_conv;
29494 this_ptr_conv.inner = untag_ptr(this_ptr);
29495 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29496 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29497 this_ptr_conv.is_owned = false;
29498 int32_t ret_conv = UpdateFee_get_feerate_per_kw(&this_ptr_conv);
29502 void __attribute__((export_name("TS_UpdateFee_set_feerate_per_kw"))) TS_UpdateFee_set_feerate_per_kw(uint64_t this_ptr, int32_t val) {
29503 LDKUpdateFee this_ptr_conv;
29504 this_ptr_conv.inner = untag_ptr(this_ptr);
29505 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29506 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29507 this_ptr_conv.is_owned = false;
29508 UpdateFee_set_feerate_per_kw(&this_ptr_conv, val);
29511 uint64_t __attribute__((export_name("TS_UpdateFee_new"))) TS_UpdateFee_new(int8_tArray channel_id_arg, int32_t feerate_per_kw_arg) {
29512 LDKThirtyTwoBytes channel_id_arg_ref;
29513 CHECK(channel_id_arg->arr_len == 32);
29514 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
29515 LDKUpdateFee ret_var = UpdateFee_new(channel_id_arg_ref, feerate_per_kw_arg);
29516 uint64_t ret_ref = 0;
29517 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29518 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29522 static inline uint64_t UpdateFee_clone_ptr(LDKUpdateFee *NONNULL_PTR arg) {
29523 LDKUpdateFee ret_var = UpdateFee_clone(arg);
29524 uint64_t ret_ref = 0;
29525 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29526 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29529 int64_t __attribute__((export_name("TS_UpdateFee_clone_ptr"))) TS_UpdateFee_clone_ptr(uint64_t arg) {
29530 LDKUpdateFee arg_conv;
29531 arg_conv.inner = untag_ptr(arg);
29532 arg_conv.is_owned = ptr_is_owned(arg);
29533 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29534 arg_conv.is_owned = false;
29535 int64_t ret_conv = UpdateFee_clone_ptr(&arg_conv);
29539 uint64_t __attribute__((export_name("TS_UpdateFee_clone"))) TS_UpdateFee_clone(uint64_t orig) {
29540 LDKUpdateFee orig_conv;
29541 orig_conv.inner = untag_ptr(orig);
29542 orig_conv.is_owned = ptr_is_owned(orig);
29543 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29544 orig_conv.is_owned = false;
29545 LDKUpdateFee ret_var = UpdateFee_clone(&orig_conv);
29546 uint64_t ret_ref = 0;
29547 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29548 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29552 void __attribute__((export_name("TS_DataLossProtect_free"))) TS_DataLossProtect_free(uint64_t this_obj) {
29553 LDKDataLossProtect this_obj_conv;
29554 this_obj_conv.inner = untag_ptr(this_obj);
29555 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29556 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29557 DataLossProtect_free(this_obj_conv);
29560 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) {
29561 LDKDataLossProtect this_ptr_conv;
29562 this_ptr_conv.inner = untag_ptr(this_ptr);
29563 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29564 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29565 this_ptr_conv.is_owned = false;
29566 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
29567 memcpy(ret_arr->elems, *DataLossProtect_get_your_last_per_commitment_secret(&this_ptr_conv), 32);
29571 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) {
29572 LDKDataLossProtect this_ptr_conv;
29573 this_ptr_conv.inner = untag_ptr(this_ptr);
29574 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29575 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29576 this_ptr_conv.is_owned = false;
29577 LDKThirtyTwoBytes val_ref;
29578 CHECK(val->arr_len == 32);
29579 memcpy(val_ref.data, val->elems, 32); FREE(val);
29580 DataLossProtect_set_your_last_per_commitment_secret(&this_ptr_conv, val_ref);
29583 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) {
29584 LDKDataLossProtect this_ptr_conv;
29585 this_ptr_conv.inner = untag_ptr(this_ptr);
29586 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29587 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29588 this_ptr_conv.is_owned = false;
29589 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
29590 memcpy(ret_arr->elems, DataLossProtect_get_my_current_per_commitment_point(&this_ptr_conv).compressed_form, 33);
29594 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) {
29595 LDKDataLossProtect this_ptr_conv;
29596 this_ptr_conv.inner = untag_ptr(this_ptr);
29597 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29598 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29599 this_ptr_conv.is_owned = false;
29600 LDKPublicKey val_ref;
29601 CHECK(val->arr_len == 33);
29602 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
29603 DataLossProtect_set_my_current_per_commitment_point(&this_ptr_conv, val_ref);
29606 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) {
29607 LDKThirtyTwoBytes your_last_per_commitment_secret_arg_ref;
29608 CHECK(your_last_per_commitment_secret_arg->arr_len == 32);
29609 memcpy(your_last_per_commitment_secret_arg_ref.data, your_last_per_commitment_secret_arg->elems, 32); FREE(your_last_per_commitment_secret_arg);
29610 LDKPublicKey my_current_per_commitment_point_arg_ref;
29611 CHECK(my_current_per_commitment_point_arg->arr_len == 33);
29612 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);
29613 LDKDataLossProtect ret_var = DataLossProtect_new(your_last_per_commitment_secret_arg_ref, my_current_per_commitment_point_arg_ref);
29614 uint64_t ret_ref = 0;
29615 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29616 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29620 static inline uint64_t DataLossProtect_clone_ptr(LDKDataLossProtect *NONNULL_PTR arg) {
29621 LDKDataLossProtect ret_var = DataLossProtect_clone(arg);
29622 uint64_t ret_ref = 0;
29623 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29624 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29627 int64_t __attribute__((export_name("TS_DataLossProtect_clone_ptr"))) TS_DataLossProtect_clone_ptr(uint64_t arg) {
29628 LDKDataLossProtect arg_conv;
29629 arg_conv.inner = untag_ptr(arg);
29630 arg_conv.is_owned = ptr_is_owned(arg);
29631 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29632 arg_conv.is_owned = false;
29633 int64_t ret_conv = DataLossProtect_clone_ptr(&arg_conv);
29637 uint64_t __attribute__((export_name("TS_DataLossProtect_clone"))) TS_DataLossProtect_clone(uint64_t orig) {
29638 LDKDataLossProtect orig_conv;
29639 orig_conv.inner = untag_ptr(orig);
29640 orig_conv.is_owned = ptr_is_owned(orig);
29641 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29642 orig_conv.is_owned = false;
29643 LDKDataLossProtect ret_var = DataLossProtect_clone(&orig_conv);
29644 uint64_t ret_ref = 0;
29645 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29646 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29650 void __attribute__((export_name("TS_ChannelReestablish_free"))) TS_ChannelReestablish_free(uint64_t this_obj) {
29651 LDKChannelReestablish this_obj_conv;
29652 this_obj_conv.inner = untag_ptr(this_obj);
29653 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29654 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29655 ChannelReestablish_free(this_obj_conv);
29658 int8_tArray __attribute__((export_name("TS_ChannelReestablish_get_channel_id"))) TS_ChannelReestablish_get_channel_id(uint64_t this_ptr) {
29659 LDKChannelReestablish this_ptr_conv;
29660 this_ptr_conv.inner = untag_ptr(this_ptr);
29661 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29662 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29663 this_ptr_conv.is_owned = false;
29664 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
29665 memcpy(ret_arr->elems, *ChannelReestablish_get_channel_id(&this_ptr_conv), 32);
29669 void __attribute__((export_name("TS_ChannelReestablish_set_channel_id"))) TS_ChannelReestablish_set_channel_id(uint64_t this_ptr, int8_tArray val) {
29670 LDKChannelReestablish this_ptr_conv;
29671 this_ptr_conv.inner = untag_ptr(this_ptr);
29672 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29673 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29674 this_ptr_conv.is_owned = false;
29675 LDKThirtyTwoBytes val_ref;
29676 CHECK(val->arr_len == 32);
29677 memcpy(val_ref.data, val->elems, 32); FREE(val);
29678 ChannelReestablish_set_channel_id(&this_ptr_conv, val_ref);
29681 int64_t __attribute__((export_name("TS_ChannelReestablish_get_next_local_commitment_number"))) TS_ChannelReestablish_get_next_local_commitment_number(uint64_t this_ptr) {
29682 LDKChannelReestablish 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 int64_t ret_conv = ChannelReestablish_get_next_local_commitment_number(&this_ptr_conv);
29691 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) {
29692 LDKChannelReestablish this_ptr_conv;
29693 this_ptr_conv.inner = untag_ptr(this_ptr);
29694 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29695 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29696 this_ptr_conv.is_owned = false;
29697 ChannelReestablish_set_next_local_commitment_number(&this_ptr_conv, val);
29700 int64_t __attribute__((export_name("TS_ChannelReestablish_get_next_remote_commitment_number"))) TS_ChannelReestablish_get_next_remote_commitment_number(uint64_t this_ptr) {
29701 LDKChannelReestablish this_ptr_conv;
29702 this_ptr_conv.inner = untag_ptr(this_ptr);
29703 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29704 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29705 this_ptr_conv.is_owned = false;
29706 int64_t ret_conv = ChannelReestablish_get_next_remote_commitment_number(&this_ptr_conv);
29710 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) {
29711 LDKChannelReestablish this_ptr_conv;
29712 this_ptr_conv.inner = untag_ptr(this_ptr);
29713 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29714 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29715 this_ptr_conv.is_owned = false;
29716 ChannelReestablish_set_next_remote_commitment_number(&this_ptr_conv, val);
29719 static inline uint64_t ChannelReestablish_clone_ptr(LDKChannelReestablish *NONNULL_PTR arg) {
29720 LDKChannelReestablish ret_var = ChannelReestablish_clone(arg);
29721 uint64_t ret_ref = 0;
29722 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29723 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29726 int64_t __attribute__((export_name("TS_ChannelReestablish_clone_ptr"))) TS_ChannelReestablish_clone_ptr(uint64_t arg) {
29727 LDKChannelReestablish arg_conv;
29728 arg_conv.inner = untag_ptr(arg);
29729 arg_conv.is_owned = ptr_is_owned(arg);
29730 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29731 arg_conv.is_owned = false;
29732 int64_t ret_conv = ChannelReestablish_clone_ptr(&arg_conv);
29736 uint64_t __attribute__((export_name("TS_ChannelReestablish_clone"))) TS_ChannelReestablish_clone(uint64_t orig) {
29737 LDKChannelReestablish orig_conv;
29738 orig_conv.inner = untag_ptr(orig);
29739 orig_conv.is_owned = ptr_is_owned(orig);
29740 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29741 orig_conv.is_owned = false;
29742 LDKChannelReestablish ret_var = ChannelReestablish_clone(&orig_conv);
29743 uint64_t ret_ref = 0;
29744 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29745 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29749 void __attribute__((export_name("TS_AnnouncementSignatures_free"))) TS_AnnouncementSignatures_free(uint64_t this_obj) {
29750 LDKAnnouncementSignatures this_obj_conv;
29751 this_obj_conv.inner = untag_ptr(this_obj);
29752 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29753 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29754 AnnouncementSignatures_free(this_obj_conv);
29757 int8_tArray __attribute__((export_name("TS_AnnouncementSignatures_get_channel_id"))) TS_AnnouncementSignatures_get_channel_id(uint64_t this_ptr) {
29758 LDKAnnouncementSignatures this_ptr_conv;
29759 this_ptr_conv.inner = untag_ptr(this_ptr);
29760 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29761 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29762 this_ptr_conv.is_owned = false;
29763 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
29764 memcpy(ret_arr->elems, *AnnouncementSignatures_get_channel_id(&this_ptr_conv), 32);
29768 void __attribute__((export_name("TS_AnnouncementSignatures_set_channel_id"))) TS_AnnouncementSignatures_set_channel_id(uint64_t this_ptr, int8_tArray val) {
29769 LDKAnnouncementSignatures this_ptr_conv;
29770 this_ptr_conv.inner = untag_ptr(this_ptr);
29771 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29772 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29773 this_ptr_conv.is_owned = false;
29774 LDKThirtyTwoBytes val_ref;
29775 CHECK(val->arr_len == 32);
29776 memcpy(val_ref.data, val->elems, 32); FREE(val);
29777 AnnouncementSignatures_set_channel_id(&this_ptr_conv, val_ref);
29780 int64_t __attribute__((export_name("TS_AnnouncementSignatures_get_short_channel_id"))) TS_AnnouncementSignatures_get_short_channel_id(uint64_t this_ptr) {
29781 LDKAnnouncementSignatures this_ptr_conv;
29782 this_ptr_conv.inner = untag_ptr(this_ptr);
29783 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29784 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29785 this_ptr_conv.is_owned = false;
29786 int64_t ret_conv = AnnouncementSignatures_get_short_channel_id(&this_ptr_conv);
29790 void __attribute__((export_name("TS_AnnouncementSignatures_set_short_channel_id"))) TS_AnnouncementSignatures_set_short_channel_id(uint64_t this_ptr, int64_t val) {
29791 LDKAnnouncementSignatures this_ptr_conv;
29792 this_ptr_conv.inner = untag_ptr(this_ptr);
29793 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29794 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29795 this_ptr_conv.is_owned = false;
29796 AnnouncementSignatures_set_short_channel_id(&this_ptr_conv, val);
29799 int8_tArray __attribute__((export_name("TS_AnnouncementSignatures_get_node_signature"))) TS_AnnouncementSignatures_get_node_signature(uint64_t this_ptr) {
29800 LDKAnnouncementSignatures this_ptr_conv;
29801 this_ptr_conv.inner = untag_ptr(this_ptr);
29802 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29803 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29804 this_ptr_conv.is_owned = false;
29805 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
29806 memcpy(ret_arr->elems, AnnouncementSignatures_get_node_signature(&this_ptr_conv).compact_form, 64);
29810 void __attribute__((export_name("TS_AnnouncementSignatures_set_node_signature"))) TS_AnnouncementSignatures_set_node_signature(uint64_t this_ptr, int8_tArray val) {
29811 LDKAnnouncementSignatures this_ptr_conv;
29812 this_ptr_conv.inner = untag_ptr(this_ptr);
29813 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29814 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29815 this_ptr_conv.is_owned = false;
29816 LDKSignature val_ref;
29817 CHECK(val->arr_len == 64);
29818 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
29819 AnnouncementSignatures_set_node_signature(&this_ptr_conv, val_ref);
29822 int8_tArray __attribute__((export_name("TS_AnnouncementSignatures_get_bitcoin_signature"))) TS_AnnouncementSignatures_get_bitcoin_signature(uint64_t this_ptr) {
29823 LDKAnnouncementSignatures this_ptr_conv;
29824 this_ptr_conv.inner = untag_ptr(this_ptr);
29825 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29826 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29827 this_ptr_conv.is_owned = false;
29828 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
29829 memcpy(ret_arr->elems, AnnouncementSignatures_get_bitcoin_signature(&this_ptr_conv).compact_form, 64);
29833 void __attribute__((export_name("TS_AnnouncementSignatures_set_bitcoin_signature"))) TS_AnnouncementSignatures_set_bitcoin_signature(uint64_t this_ptr, int8_tArray val) {
29834 LDKAnnouncementSignatures this_ptr_conv;
29835 this_ptr_conv.inner = untag_ptr(this_ptr);
29836 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
29837 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
29838 this_ptr_conv.is_owned = false;
29839 LDKSignature val_ref;
29840 CHECK(val->arr_len == 64);
29841 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
29842 AnnouncementSignatures_set_bitcoin_signature(&this_ptr_conv, val_ref);
29845 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) {
29846 LDKThirtyTwoBytes channel_id_arg_ref;
29847 CHECK(channel_id_arg->arr_len == 32);
29848 memcpy(channel_id_arg_ref.data, channel_id_arg->elems, 32); FREE(channel_id_arg);
29849 LDKSignature node_signature_arg_ref;
29850 CHECK(node_signature_arg->arr_len == 64);
29851 memcpy(node_signature_arg_ref.compact_form, node_signature_arg->elems, 64); FREE(node_signature_arg);
29852 LDKSignature bitcoin_signature_arg_ref;
29853 CHECK(bitcoin_signature_arg->arr_len == 64);
29854 memcpy(bitcoin_signature_arg_ref.compact_form, bitcoin_signature_arg->elems, 64); FREE(bitcoin_signature_arg);
29855 LDKAnnouncementSignatures ret_var = AnnouncementSignatures_new(channel_id_arg_ref, short_channel_id_arg, node_signature_arg_ref, bitcoin_signature_arg_ref);
29856 uint64_t ret_ref = 0;
29857 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29858 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29862 static inline uint64_t AnnouncementSignatures_clone_ptr(LDKAnnouncementSignatures *NONNULL_PTR arg) {
29863 LDKAnnouncementSignatures ret_var = AnnouncementSignatures_clone(arg);
29864 uint64_t ret_ref = 0;
29865 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29866 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29869 int64_t __attribute__((export_name("TS_AnnouncementSignatures_clone_ptr"))) TS_AnnouncementSignatures_clone_ptr(uint64_t arg) {
29870 LDKAnnouncementSignatures arg_conv;
29871 arg_conv.inner = untag_ptr(arg);
29872 arg_conv.is_owned = ptr_is_owned(arg);
29873 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
29874 arg_conv.is_owned = false;
29875 int64_t ret_conv = AnnouncementSignatures_clone_ptr(&arg_conv);
29879 uint64_t __attribute__((export_name("TS_AnnouncementSignatures_clone"))) TS_AnnouncementSignatures_clone(uint64_t orig) {
29880 LDKAnnouncementSignatures orig_conv;
29881 orig_conv.inner = untag_ptr(orig);
29882 orig_conv.is_owned = ptr_is_owned(orig);
29883 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
29884 orig_conv.is_owned = false;
29885 LDKAnnouncementSignatures ret_var = AnnouncementSignatures_clone(&orig_conv);
29886 uint64_t ret_ref = 0;
29887 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
29888 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
29892 void __attribute__((export_name("TS_NetAddress_free"))) TS_NetAddress_free(uint64_t this_ptr) {
29893 if (!ptr_is_owned(this_ptr)) return;
29894 void* this_ptr_ptr = untag_ptr(this_ptr);
29895 CHECK_ACCESS(this_ptr_ptr);
29896 LDKNetAddress this_ptr_conv = *(LDKNetAddress*)(this_ptr_ptr);
29897 FREE(untag_ptr(this_ptr));
29898 NetAddress_free(this_ptr_conv);
29901 static inline uint64_t NetAddress_clone_ptr(LDKNetAddress *NONNULL_PTR arg) {
29902 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
29903 *ret_copy = NetAddress_clone(arg);
29904 uint64_t ret_ref = tag_ptr(ret_copy, true);
29907 int64_t __attribute__((export_name("TS_NetAddress_clone_ptr"))) TS_NetAddress_clone_ptr(uint64_t arg) {
29908 LDKNetAddress* arg_conv = (LDKNetAddress*)untag_ptr(arg);
29909 int64_t ret_conv = NetAddress_clone_ptr(arg_conv);
29913 uint64_t __attribute__((export_name("TS_NetAddress_clone"))) TS_NetAddress_clone(uint64_t orig) {
29914 LDKNetAddress* orig_conv = (LDKNetAddress*)untag_ptr(orig);
29915 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
29916 *ret_copy = NetAddress_clone(orig_conv);
29917 uint64_t ret_ref = tag_ptr(ret_copy, true);
29921 uint64_t __attribute__((export_name("TS_NetAddress_ipv4"))) TS_NetAddress_ipv4(int8_tArray addr, int16_t port) {
29922 LDKFourBytes addr_ref;
29923 CHECK(addr->arr_len == 4);
29924 memcpy(addr_ref.data, addr->elems, 4); FREE(addr);
29925 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
29926 *ret_copy = NetAddress_ipv4(addr_ref, port);
29927 uint64_t ret_ref = tag_ptr(ret_copy, true);
29931 uint64_t __attribute__((export_name("TS_NetAddress_ipv6"))) TS_NetAddress_ipv6(int8_tArray addr, int16_t port) {
29932 LDKSixteenBytes addr_ref;
29933 CHECK(addr->arr_len == 16);
29934 memcpy(addr_ref.data, addr->elems, 16); FREE(addr);
29935 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
29936 *ret_copy = NetAddress_ipv6(addr_ref, port);
29937 uint64_t ret_ref = tag_ptr(ret_copy, true);
29941 uint64_t __attribute__((export_name("TS_NetAddress_onion_v2"))) TS_NetAddress_onion_v2(int8_tArray a) {
29942 LDKTwelveBytes a_ref;
29943 CHECK(a->arr_len == 12);
29944 memcpy(a_ref.data, a->elems, 12); FREE(a);
29945 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
29946 *ret_copy = NetAddress_onion_v2(a_ref);
29947 uint64_t ret_ref = tag_ptr(ret_copy, true);
29951 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) {
29952 LDKThirtyTwoBytes ed25519_pubkey_ref;
29953 CHECK(ed25519_pubkey->arr_len == 32);
29954 memcpy(ed25519_pubkey_ref.data, ed25519_pubkey->elems, 32); FREE(ed25519_pubkey);
29955 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
29956 *ret_copy = NetAddress_onion_v3(ed25519_pubkey_ref, checksum, version, port);
29957 uint64_t ret_ref = tag_ptr(ret_copy, true);
29961 uint64_t __attribute__((export_name("TS_NetAddress_hostname"))) TS_NetAddress_hostname(uint64_t hostname, int16_t port) {
29962 LDKHostname hostname_conv;
29963 hostname_conv.inner = untag_ptr(hostname);
29964 hostname_conv.is_owned = ptr_is_owned(hostname);
29965 CHECK_INNER_FIELD_ACCESS_OR_NULL(hostname_conv);
29966 hostname_conv = Hostname_clone(&hostname_conv);
29967 LDKNetAddress *ret_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
29968 *ret_copy = NetAddress_hostname(hostname_conv, port);
29969 uint64_t ret_ref = tag_ptr(ret_copy, true);
29973 int8_tArray __attribute__((export_name("TS_NetAddress_write"))) TS_NetAddress_write(uint64_t obj) {
29974 LDKNetAddress* obj_conv = (LDKNetAddress*)untag_ptr(obj);
29975 LDKCVec_u8Z ret_var = NetAddress_write(obj_conv);
29976 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
29977 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
29978 CVec_u8Z_free(ret_var);
29982 uint64_t __attribute__((export_name("TS_NetAddress_read"))) TS_NetAddress_read(int8_tArray ser) {
29983 LDKu8slice ser_ref;
29984 ser_ref.datalen = ser->arr_len;
29985 ser_ref.data = ser->elems;
29986 LDKCResult_NetAddressDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetAddressDecodeErrorZ), "LDKCResult_NetAddressDecodeErrorZ");
29987 *ret_conv = NetAddress_read(ser_ref);
29989 return tag_ptr(ret_conv, true);
29992 void __attribute__((export_name("TS_UnsignedNodeAnnouncement_free"))) TS_UnsignedNodeAnnouncement_free(uint64_t this_obj) {
29993 LDKUnsignedNodeAnnouncement this_obj_conv;
29994 this_obj_conv.inner = untag_ptr(this_obj);
29995 this_obj_conv.is_owned = ptr_is_owned(this_obj);
29996 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
29997 UnsignedNodeAnnouncement_free(this_obj_conv);
30000 uint64_t __attribute__((export_name("TS_UnsignedNodeAnnouncement_get_features"))) TS_UnsignedNodeAnnouncement_get_features(uint64_t this_ptr) {
30001 LDKUnsignedNodeAnnouncement 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 LDKNodeFeatures ret_var = UnsignedNodeAnnouncement_get_features(&this_ptr_conv);
30007 uint64_t ret_ref = 0;
30008 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30009 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30013 void __attribute__((export_name("TS_UnsignedNodeAnnouncement_set_features"))) TS_UnsignedNodeAnnouncement_set_features(uint64_t this_ptr, uint64_t val) {
30014 LDKUnsignedNodeAnnouncement this_ptr_conv;
30015 this_ptr_conv.inner = untag_ptr(this_ptr);
30016 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30017 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30018 this_ptr_conv.is_owned = false;
30019 LDKNodeFeatures val_conv;
30020 val_conv.inner = untag_ptr(val);
30021 val_conv.is_owned = ptr_is_owned(val);
30022 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
30023 val_conv = NodeFeatures_clone(&val_conv);
30024 UnsignedNodeAnnouncement_set_features(&this_ptr_conv, val_conv);
30027 int32_t __attribute__((export_name("TS_UnsignedNodeAnnouncement_get_timestamp"))) TS_UnsignedNodeAnnouncement_get_timestamp(uint64_t this_ptr) {
30028 LDKUnsignedNodeAnnouncement this_ptr_conv;
30029 this_ptr_conv.inner = untag_ptr(this_ptr);
30030 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30031 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30032 this_ptr_conv.is_owned = false;
30033 int32_t ret_conv = UnsignedNodeAnnouncement_get_timestamp(&this_ptr_conv);
30037 void __attribute__((export_name("TS_UnsignedNodeAnnouncement_set_timestamp"))) TS_UnsignedNodeAnnouncement_set_timestamp(uint64_t this_ptr, int32_t val) {
30038 LDKUnsignedNodeAnnouncement this_ptr_conv;
30039 this_ptr_conv.inner = untag_ptr(this_ptr);
30040 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30041 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30042 this_ptr_conv.is_owned = false;
30043 UnsignedNodeAnnouncement_set_timestamp(&this_ptr_conv, val);
30046 int8_tArray __attribute__((export_name("TS_UnsignedNodeAnnouncement_get_node_id"))) TS_UnsignedNodeAnnouncement_get_node_id(uint64_t this_ptr) {
30047 LDKUnsignedNodeAnnouncement this_ptr_conv;
30048 this_ptr_conv.inner = untag_ptr(this_ptr);
30049 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30050 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30051 this_ptr_conv.is_owned = false;
30052 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
30053 memcpy(ret_arr->elems, UnsignedNodeAnnouncement_get_node_id(&this_ptr_conv).compressed_form, 33);
30057 void __attribute__((export_name("TS_UnsignedNodeAnnouncement_set_node_id"))) TS_UnsignedNodeAnnouncement_set_node_id(uint64_t this_ptr, int8_tArray val) {
30058 LDKUnsignedNodeAnnouncement this_ptr_conv;
30059 this_ptr_conv.inner = untag_ptr(this_ptr);
30060 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30061 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30062 this_ptr_conv.is_owned = false;
30063 LDKPublicKey val_ref;
30064 CHECK(val->arr_len == 33);
30065 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
30066 UnsignedNodeAnnouncement_set_node_id(&this_ptr_conv, val_ref);
30069 int8_tArray __attribute__((export_name("TS_UnsignedNodeAnnouncement_get_rgb"))) TS_UnsignedNodeAnnouncement_get_rgb(uint64_t this_ptr) {
30070 LDKUnsignedNodeAnnouncement this_ptr_conv;
30071 this_ptr_conv.inner = untag_ptr(this_ptr);
30072 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30073 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30074 this_ptr_conv.is_owned = false;
30075 int8_tArray ret_arr = init_int8_tArray(3, __LINE__);
30076 memcpy(ret_arr->elems, *UnsignedNodeAnnouncement_get_rgb(&this_ptr_conv), 3);
30080 void __attribute__((export_name("TS_UnsignedNodeAnnouncement_set_rgb"))) TS_UnsignedNodeAnnouncement_set_rgb(uint64_t this_ptr, int8_tArray val) {
30081 LDKUnsignedNodeAnnouncement this_ptr_conv;
30082 this_ptr_conv.inner = untag_ptr(this_ptr);
30083 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30084 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30085 this_ptr_conv.is_owned = false;
30086 LDKThreeBytes val_ref;
30087 CHECK(val->arr_len == 3);
30088 memcpy(val_ref.data, val->elems, 3); FREE(val);
30089 UnsignedNodeAnnouncement_set_rgb(&this_ptr_conv, val_ref);
30092 int8_tArray __attribute__((export_name("TS_UnsignedNodeAnnouncement_get_alias"))) TS_UnsignedNodeAnnouncement_get_alias(uint64_t this_ptr) {
30093 LDKUnsignedNodeAnnouncement this_ptr_conv;
30094 this_ptr_conv.inner = untag_ptr(this_ptr);
30095 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30096 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30097 this_ptr_conv.is_owned = false;
30098 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
30099 memcpy(ret_arr->elems, *UnsignedNodeAnnouncement_get_alias(&this_ptr_conv), 32);
30103 void __attribute__((export_name("TS_UnsignedNodeAnnouncement_set_alias"))) TS_UnsignedNodeAnnouncement_set_alias(uint64_t this_ptr, int8_tArray val) {
30104 LDKUnsignedNodeAnnouncement this_ptr_conv;
30105 this_ptr_conv.inner = untag_ptr(this_ptr);
30106 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30107 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30108 this_ptr_conv.is_owned = false;
30109 LDKThirtyTwoBytes val_ref;
30110 CHECK(val->arr_len == 32);
30111 memcpy(val_ref.data, val->elems, 32); FREE(val);
30112 UnsignedNodeAnnouncement_set_alias(&this_ptr_conv, val_ref);
30115 uint64_tArray __attribute__((export_name("TS_UnsignedNodeAnnouncement_get_addresses"))) TS_UnsignedNodeAnnouncement_get_addresses(uint64_t this_ptr) {
30116 LDKUnsignedNodeAnnouncement this_ptr_conv;
30117 this_ptr_conv.inner = untag_ptr(this_ptr);
30118 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30119 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30120 this_ptr_conv.is_owned = false;
30121 LDKCVec_NetAddressZ ret_var = UnsignedNodeAnnouncement_get_addresses(&this_ptr_conv);
30122 uint64_tArray ret_arr = NULL;
30123 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
30124 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
30125 for (size_t m = 0; m < ret_var.datalen; m++) {
30126 LDKNetAddress *ret_conv_12_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
30127 *ret_conv_12_copy = ret_var.data[m];
30128 uint64_t ret_conv_12_ref = tag_ptr(ret_conv_12_copy, true);
30129 ret_arr_ptr[m] = ret_conv_12_ref;
30132 FREE(ret_var.data);
30136 void __attribute__((export_name("TS_UnsignedNodeAnnouncement_set_addresses"))) TS_UnsignedNodeAnnouncement_set_addresses(uint64_t this_ptr, uint64_tArray val) {
30137 LDKUnsignedNodeAnnouncement this_ptr_conv;
30138 this_ptr_conv.inner = untag_ptr(this_ptr);
30139 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30140 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30141 this_ptr_conv.is_owned = false;
30142 LDKCVec_NetAddressZ val_constr;
30143 val_constr.datalen = val->arr_len;
30144 if (val_constr.datalen > 0)
30145 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
30147 val_constr.data = NULL;
30148 uint64_t* val_vals = val->elems;
30149 for (size_t m = 0; m < val_constr.datalen; m++) {
30150 uint64_t val_conv_12 = val_vals[m];
30151 void* val_conv_12_ptr = untag_ptr(val_conv_12);
30152 CHECK_ACCESS(val_conv_12_ptr);
30153 LDKNetAddress val_conv_12_conv = *(LDKNetAddress*)(val_conv_12_ptr);
30154 val_conv_12_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(val_conv_12));
30155 val_constr.data[m] = val_conv_12_conv;
30158 UnsignedNodeAnnouncement_set_addresses(&this_ptr_conv, val_constr);
30161 static inline uint64_t UnsignedNodeAnnouncement_clone_ptr(LDKUnsignedNodeAnnouncement *NONNULL_PTR arg) {
30162 LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_clone(arg);
30163 uint64_t ret_ref = 0;
30164 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30165 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30168 int64_t __attribute__((export_name("TS_UnsignedNodeAnnouncement_clone_ptr"))) TS_UnsignedNodeAnnouncement_clone_ptr(uint64_t arg) {
30169 LDKUnsignedNodeAnnouncement arg_conv;
30170 arg_conv.inner = untag_ptr(arg);
30171 arg_conv.is_owned = ptr_is_owned(arg);
30172 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
30173 arg_conv.is_owned = false;
30174 int64_t ret_conv = UnsignedNodeAnnouncement_clone_ptr(&arg_conv);
30178 uint64_t __attribute__((export_name("TS_UnsignedNodeAnnouncement_clone"))) TS_UnsignedNodeAnnouncement_clone(uint64_t orig) {
30179 LDKUnsignedNodeAnnouncement orig_conv;
30180 orig_conv.inner = untag_ptr(orig);
30181 orig_conv.is_owned = ptr_is_owned(orig);
30182 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
30183 orig_conv.is_owned = false;
30184 LDKUnsignedNodeAnnouncement ret_var = UnsignedNodeAnnouncement_clone(&orig_conv);
30185 uint64_t ret_ref = 0;
30186 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30187 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30191 void __attribute__((export_name("TS_NodeAnnouncement_free"))) TS_NodeAnnouncement_free(uint64_t this_obj) {
30192 LDKNodeAnnouncement this_obj_conv;
30193 this_obj_conv.inner = untag_ptr(this_obj);
30194 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30195 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30196 NodeAnnouncement_free(this_obj_conv);
30199 int8_tArray __attribute__((export_name("TS_NodeAnnouncement_get_signature"))) TS_NodeAnnouncement_get_signature(uint64_t this_ptr) {
30200 LDKNodeAnnouncement this_ptr_conv;
30201 this_ptr_conv.inner = untag_ptr(this_ptr);
30202 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30203 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30204 this_ptr_conv.is_owned = false;
30205 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
30206 memcpy(ret_arr->elems, NodeAnnouncement_get_signature(&this_ptr_conv).compact_form, 64);
30210 void __attribute__((export_name("TS_NodeAnnouncement_set_signature"))) TS_NodeAnnouncement_set_signature(uint64_t this_ptr, int8_tArray val) {
30211 LDKNodeAnnouncement this_ptr_conv;
30212 this_ptr_conv.inner = untag_ptr(this_ptr);
30213 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30214 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30215 this_ptr_conv.is_owned = false;
30216 LDKSignature val_ref;
30217 CHECK(val->arr_len == 64);
30218 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
30219 NodeAnnouncement_set_signature(&this_ptr_conv, val_ref);
30222 uint64_t __attribute__((export_name("TS_NodeAnnouncement_get_contents"))) TS_NodeAnnouncement_get_contents(uint64_t this_ptr) {
30223 LDKNodeAnnouncement this_ptr_conv;
30224 this_ptr_conv.inner = untag_ptr(this_ptr);
30225 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30226 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30227 this_ptr_conv.is_owned = false;
30228 LDKUnsignedNodeAnnouncement ret_var = NodeAnnouncement_get_contents(&this_ptr_conv);
30229 uint64_t ret_ref = 0;
30230 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30231 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30235 void __attribute__((export_name("TS_NodeAnnouncement_set_contents"))) TS_NodeAnnouncement_set_contents(uint64_t this_ptr, uint64_t val) {
30236 LDKNodeAnnouncement this_ptr_conv;
30237 this_ptr_conv.inner = untag_ptr(this_ptr);
30238 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30239 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30240 this_ptr_conv.is_owned = false;
30241 LDKUnsignedNodeAnnouncement val_conv;
30242 val_conv.inner = untag_ptr(val);
30243 val_conv.is_owned = ptr_is_owned(val);
30244 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
30245 val_conv = UnsignedNodeAnnouncement_clone(&val_conv);
30246 NodeAnnouncement_set_contents(&this_ptr_conv, val_conv);
30249 uint64_t __attribute__((export_name("TS_NodeAnnouncement_new"))) TS_NodeAnnouncement_new(int8_tArray signature_arg, uint64_t contents_arg) {
30250 LDKSignature signature_arg_ref;
30251 CHECK(signature_arg->arr_len == 64);
30252 memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg);
30253 LDKUnsignedNodeAnnouncement contents_arg_conv;
30254 contents_arg_conv.inner = untag_ptr(contents_arg);
30255 contents_arg_conv.is_owned = ptr_is_owned(contents_arg);
30256 CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv);
30257 contents_arg_conv = UnsignedNodeAnnouncement_clone(&contents_arg_conv);
30258 LDKNodeAnnouncement ret_var = NodeAnnouncement_new(signature_arg_ref, contents_arg_conv);
30259 uint64_t ret_ref = 0;
30260 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30261 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30265 static inline uint64_t NodeAnnouncement_clone_ptr(LDKNodeAnnouncement *NONNULL_PTR arg) {
30266 LDKNodeAnnouncement ret_var = NodeAnnouncement_clone(arg);
30267 uint64_t ret_ref = 0;
30268 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30269 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30272 int64_t __attribute__((export_name("TS_NodeAnnouncement_clone_ptr"))) TS_NodeAnnouncement_clone_ptr(uint64_t arg) {
30273 LDKNodeAnnouncement arg_conv;
30274 arg_conv.inner = untag_ptr(arg);
30275 arg_conv.is_owned = ptr_is_owned(arg);
30276 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
30277 arg_conv.is_owned = false;
30278 int64_t ret_conv = NodeAnnouncement_clone_ptr(&arg_conv);
30282 uint64_t __attribute__((export_name("TS_NodeAnnouncement_clone"))) TS_NodeAnnouncement_clone(uint64_t orig) {
30283 LDKNodeAnnouncement orig_conv;
30284 orig_conv.inner = untag_ptr(orig);
30285 orig_conv.is_owned = ptr_is_owned(orig);
30286 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
30287 orig_conv.is_owned = false;
30288 LDKNodeAnnouncement ret_var = NodeAnnouncement_clone(&orig_conv);
30289 uint64_t ret_ref = 0;
30290 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30291 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30295 void __attribute__((export_name("TS_UnsignedChannelAnnouncement_free"))) TS_UnsignedChannelAnnouncement_free(uint64_t this_obj) {
30296 LDKUnsignedChannelAnnouncement this_obj_conv;
30297 this_obj_conv.inner = untag_ptr(this_obj);
30298 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30299 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30300 UnsignedChannelAnnouncement_free(this_obj_conv);
30303 uint64_t __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_features"))) TS_UnsignedChannelAnnouncement_get_features(uint64_t this_ptr) {
30304 LDKUnsignedChannelAnnouncement this_ptr_conv;
30305 this_ptr_conv.inner = untag_ptr(this_ptr);
30306 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30307 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30308 this_ptr_conv.is_owned = false;
30309 LDKChannelFeatures ret_var = UnsignedChannelAnnouncement_get_features(&this_ptr_conv);
30310 uint64_t ret_ref = 0;
30311 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30312 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30316 void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_features"))) TS_UnsignedChannelAnnouncement_set_features(uint64_t this_ptr, uint64_t val) {
30317 LDKUnsignedChannelAnnouncement 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 LDKChannelFeatures val_conv;
30323 val_conv.inner = untag_ptr(val);
30324 val_conv.is_owned = ptr_is_owned(val);
30325 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
30326 val_conv = ChannelFeatures_clone(&val_conv);
30327 UnsignedChannelAnnouncement_set_features(&this_ptr_conv, val_conv);
30330 int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_chain_hash"))) TS_UnsignedChannelAnnouncement_get_chain_hash(uint64_t this_ptr) {
30331 LDKUnsignedChannelAnnouncement this_ptr_conv;
30332 this_ptr_conv.inner = untag_ptr(this_ptr);
30333 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30334 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30335 this_ptr_conv.is_owned = false;
30336 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
30337 memcpy(ret_arr->elems, *UnsignedChannelAnnouncement_get_chain_hash(&this_ptr_conv), 32);
30341 void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_chain_hash"))) TS_UnsignedChannelAnnouncement_set_chain_hash(uint64_t this_ptr, int8_tArray val) {
30342 LDKUnsignedChannelAnnouncement this_ptr_conv;
30343 this_ptr_conv.inner = untag_ptr(this_ptr);
30344 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30345 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30346 this_ptr_conv.is_owned = false;
30347 LDKThirtyTwoBytes val_ref;
30348 CHECK(val->arr_len == 32);
30349 memcpy(val_ref.data, val->elems, 32); FREE(val);
30350 UnsignedChannelAnnouncement_set_chain_hash(&this_ptr_conv, val_ref);
30353 int64_t __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_short_channel_id"))) TS_UnsignedChannelAnnouncement_get_short_channel_id(uint64_t this_ptr) {
30354 LDKUnsignedChannelAnnouncement this_ptr_conv;
30355 this_ptr_conv.inner = untag_ptr(this_ptr);
30356 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30357 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30358 this_ptr_conv.is_owned = false;
30359 int64_t ret_conv = UnsignedChannelAnnouncement_get_short_channel_id(&this_ptr_conv);
30363 void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_short_channel_id"))) TS_UnsignedChannelAnnouncement_set_short_channel_id(uint64_t this_ptr, int64_t val) {
30364 LDKUnsignedChannelAnnouncement this_ptr_conv;
30365 this_ptr_conv.inner = untag_ptr(this_ptr);
30366 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30367 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30368 this_ptr_conv.is_owned = false;
30369 UnsignedChannelAnnouncement_set_short_channel_id(&this_ptr_conv, val);
30372 int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_node_id_1"))) TS_UnsignedChannelAnnouncement_get_node_id_1(uint64_t this_ptr) {
30373 LDKUnsignedChannelAnnouncement this_ptr_conv;
30374 this_ptr_conv.inner = untag_ptr(this_ptr);
30375 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30376 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30377 this_ptr_conv.is_owned = false;
30378 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
30379 memcpy(ret_arr->elems, UnsignedChannelAnnouncement_get_node_id_1(&this_ptr_conv).compressed_form, 33);
30383 void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_node_id_1"))) TS_UnsignedChannelAnnouncement_set_node_id_1(uint64_t this_ptr, int8_tArray val) {
30384 LDKUnsignedChannelAnnouncement this_ptr_conv;
30385 this_ptr_conv.inner = untag_ptr(this_ptr);
30386 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30387 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30388 this_ptr_conv.is_owned = false;
30389 LDKPublicKey val_ref;
30390 CHECK(val->arr_len == 33);
30391 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
30392 UnsignedChannelAnnouncement_set_node_id_1(&this_ptr_conv, val_ref);
30395 int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_node_id_2"))) TS_UnsignedChannelAnnouncement_get_node_id_2(uint64_t this_ptr) {
30396 LDKUnsignedChannelAnnouncement this_ptr_conv;
30397 this_ptr_conv.inner = untag_ptr(this_ptr);
30398 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30399 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30400 this_ptr_conv.is_owned = false;
30401 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
30402 memcpy(ret_arr->elems, UnsignedChannelAnnouncement_get_node_id_2(&this_ptr_conv).compressed_form, 33);
30406 void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_node_id_2"))) TS_UnsignedChannelAnnouncement_set_node_id_2(uint64_t this_ptr, int8_tArray val) {
30407 LDKUnsignedChannelAnnouncement this_ptr_conv;
30408 this_ptr_conv.inner = untag_ptr(this_ptr);
30409 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30410 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30411 this_ptr_conv.is_owned = false;
30412 LDKPublicKey val_ref;
30413 CHECK(val->arr_len == 33);
30414 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
30415 UnsignedChannelAnnouncement_set_node_id_2(&this_ptr_conv, val_ref);
30418 int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_bitcoin_key_1"))) TS_UnsignedChannelAnnouncement_get_bitcoin_key_1(uint64_t this_ptr) {
30419 LDKUnsignedChannelAnnouncement this_ptr_conv;
30420 this_ptr_conv.inner = untag_ptr(this_ptr);
30421 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30422 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30423 this_ptr_conv.is_owned = false;
30424 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
30425 memcpy(ret_arr->elems, UnsignedChannelAnnouncement_get_bitcoin_key_1(&this_ptr_conv).compressed_form, 33);
30429 void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_bitcoin_key_1"))) TS_UnsignedChannelAnnouncement_set_bitcoin_key_1(uint64_t this_ptr, int8_tArray val) {
30430 LDKUnsignedChannelAnnouncement this_ptr_conv;
30431 this_ptr_conv.inner = untag_ptr(this_ptr);
30432 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30433 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30434 this_ptr_conv.is_owned = false;
30435 LDKPublicKey val_ref;
30436 CHECK(val->arr_len == 33);
30437 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
30438 UnsignedChannelAnnouncement_set_bitcoin_key_1(&this_ptr_conv, val_ref);
30441 int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_get_bitcoin_key_2"))) TS_UnsignedChannelAnnouncement_get_bitcoin_key_2(uint64_t this_ptr) {
30442 LDKUnsignedChannelAnnouncement this_ptr_conv;
30443 this_ptr_conv.inner = untag_ptr(this_ptr);
30444 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30445 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30446 this_ptr_conv.is_owned = false;
30447 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
30448 memcpy(ret_arr->elems, UnsignedChannelAnnouncement_get_bitcoin_key_2(&this_ptr_conv).compressed_form, 33);
30452 void __attribute__((export_name("TS_UnsignedChannelAnnouncement_set_bitcoin_key_2"))) TS_UnsignedChannelAnnouncement_set_bitcoin_key_2(uint64_t this_ptr, int8_tArray val) {
30453 LDKUnsignedChannelAnnouncement this_ptr_conv;
30454 this_ptr_conv.inner = untag_ptr(this_ptr);
30455 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30456 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30457 this_ptr_conv.is_owned = false;
30458 LDKPublicKey val_ref;
30459 CHECK(val->arr_len == 33);
30460 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
30461 UnsignedChannelAnnouncement_set_bitcoin_key_2(&this_ptr_conv, val_ref);
30464 static inline uint64_t UnsignedChannelAnnouncement_clone_ptr(LDKUnsignedChannelAnnouncement *NONNULL_PTR arg) {
30465 LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_clone(arg);
30466 uint64_t ret_ref = 0;
30467 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30468 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30471 int64_t __attribute__((export_name("TS_UnsignedChannelAnnouncement_clone_ptr"))) TS_UnsignedChannelAnnouncement_clone_ptr(uint64_t arg) {
30472 LDKUnsignedChannelAnnouncement arg_conv;
30473 arg_conv.inner = untag_ptr(arg);
30474 arg_conv.is_owned = ptr_is_owned(arg);
30475 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
30476 arg_conv.is_owned = false;
30477 int64_t ret_conv = UnsignedChannelAnnouncement_clone_ptr(&arg_conv);
30481 uint64_t __attribute__((export_name("TS_UnsignedChannelAnnouncement_clone"))) TS_UnsignedChannelAnnouncement_clone(uint64_t orig) {
30482 LDKUnsignedChannelAnnouncement orig_conv;
30483 orig_conv.inner = untag_ptr(orig);
30484 orig_conv.is_owned = ptr_is_owned(orig);
30485 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
30486 orig_conv.is_owned = false;
30487 LDKUnsignedChannelAnnouncement ret_var = UnsignedChannelAnnouncement_clone(&orig_conv);
30488 uint64_t ret_ref = 0;
30489 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30490 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30494 void __attribute__((export_name("TS_ChannelAnnouncement_free"))) TS_ChannelAnnouncement_free(uint64_t this_obj) {
30495 LDKChannelAnnouncement this_obj_conv;
30496 this_obj_conv.inner = untag_ptr(this_obj);
30497 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30498 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30499 ChannelAnnouncement_free(this_obj_conv);
30502 int8_tArray __attribute__((export_name("TS_ChannelAnnouncement_get_node_signature_1"))) TS_ChannelAnnouncement_get_node_signature_1(uint64_t this_ptr) {
30503 LDKChannelAnnouncement this_ptr_conv;
30504 this_ptr_conv.inner = untag_ptr(this_ptr);
30505 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30506 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30507 this_ptr_conv.is_owned = false;
30508 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
30509 memcpy(ret_arr->elems, ChannelAnnouncement_get_node_signature_1(&this_ptr_conv).compact_form, 64);
30513 void __attribute__((export_name("TS_ChannelAnnouncement_set_node_signature_1"))) TS_ChannelAnnouncement_set_node_signature_1(uint64_t this_ptr, int8_tArray val) {
30514 LDKChannelAnnouncement this_ptr_conv;
30515 this_ptr_conv.inner = untag_ptr(this_ptr);
30516 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30517 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30518 this_ptr_conv.is_owned = false;
30519 LDKSignature val_ref;
30520 CHECK(val->arr_len == 64);
30521 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
30522 ChannelAnnouncement_set_node_signature_1(&this_ptr_conv, val_ref);
30525 int8_tArray __attribute__((export_name("TS_ChannelAnnouncement_get_node_signature_2"))) TS_ChannelAnnouncement_get_node_signature_2(uint64_t this_ptr) {
30526 LDKChannelAnnouncement this_ptr_conv;
30527 this_ptr_conv.inner = untag_ptr(this_ptr);
30528 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30529 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30530 this_ptr_conv.is_owned = false;
30531 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
30532 memcpy(ret_arr->elems, ChannelAnnouncement_get_node_signature_2(&this_ptr_conv).compact_form, 64);
30536 void __attribute__((export_name("TS_ChannelAnnouncement_set_node_signature_2"))) TS_ChannelAnnouncement_set_node_signature_2(uint64_t this_ptr, int8_tArray val) {
30537 LDKChannelAnnouncement this_ptr_conv;
30538 this_ptr_conv.inner = untag_ptr(this_ptr);
30539 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30540 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30541 this_ptr_conv.is_owned = false;
30542 LDKSignature val_ref;
30543 CHECK(val->arr_len == 64);
30544 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
30545 ChannelAnnouncement_set_node_signature_2(&this_ptr_conv, val_ref);
30548 int8_tArray __attribute__((export_name("TS_ChannelAnnouncement_get_bitcoin_signature_1"))) TS_ChannelAnnouncement_get_bitcoin_signature_1(uint64_t this_ptr) {
30549 LDKChannelAnnouncement this_ptr_conv;
30550 this_ptr_conv.inner = untag_ptr(this_ptr);
30551 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30552 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30553 this_ptr_conv.is_owned = false;
30554 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
30555 memcpy(ret_arr->elems, ChannelAnnouncement_get_bitcoin_signature_1(&this_ptr_conv).compact_form, 64);
30559 void __attribute__((export_name("TS_ChannelAnnouncement_set_bitcoin_signature_1"))) TS_ChannelAnnouncement_set_bitcoin_signature_1(uint64_t this_ptr, int8_tArray val) {
30560 LDKChannelAnnouncement this_ptr_conv;
30561 this_ptr_conv.inner = untag_ptr(this_ptr);
30562 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30563 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30564 this_ptr_conv.is_owned = false;
30565 LDKSignature val_ref;
30566 CHECK(val->arr_len == 64);
30567 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
30568 ChannelAnnouncement_set_bitcoin_signature_1(&this_ptr_conv, val_ref);
30571 int8_tArray __attribute__((export_name("TS_ChannelAnnouncement_get_bitcoin_signature_2"))) TS_ChannelAnnouncement_get_bitcoin_signature_2(uint64_t this_ptr) {
30572 LDKChannelAnnouncement this_ptr_conv;
30573 this_ptr_conv.inner = untag_ptr(this_ptr);
30574 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30575 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30576 this_ptr_conv.is_owned = false;
30577 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
30578 memcpy(ret_arr->elems, ChannelAnnouncement_get_bitcoin_signature_2(&this_ptr_conv).compact_form, 64);
30582 void __attribute__((export_name("TS_ChannelAnnouncement_set_bitcoin_signature_2"))) TS_ChannelAnnouncement_set_bitcoin_signature_2(uint64_t this_ptr, int8_tArray val) {
30583 LDKChannelAnnouncement this_ptr_conv;
30584 this_ptr_conv.inner = untag_ptr(this_ptr);
30585 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30586 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30587 this_ptr_conv.is_owned = false;
30588 LDKSignature val_ref;
30589 CHECK(val->arr_len == 64);
30590 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
30591 ChannelAnnouncement_set_bitcoin_signature_2(&this_ptr_conv, val_ref);
30594 uint64_t __attribute__((export_name("TS_ChannelAnnouncement_get_contents"))) TS_ChannelAnnouncement_get_contents(uint64_t this_ptr) {
30595 LDKChannelAnnouncement this_ptr_conv;
30596 this_ptr_conv.inner = untag_ptr(this_ptr);
30597 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30598 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30599 this_ptr_conv.is_owned = false;
30600 LDKUnsignedChannelAnnouncement ret_var = ChannelAnnouncement_get_contents(&this_ptr_conv);
30601 uint64_t ret_ref = 0;
30602 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30603 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30607 void __attribute__((export_name("TS_ChannelAnnouncement_set_contents"))) TS_ChannelAnnouncement_set_contents(uint64_t this_ptr, uint64_t val) {
30608 LDKChannelAnnouncement 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 LDKUnsignedChannelAnnouncement val_conv;
30614 val_conv.inner = untag_ptr(val);
30615 val_conv.is_owned = ptr_is_owned(val);
30616 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
30617 val_conv = UnsignedChannelAnnouncement_clone(&val_conv);
30618 ChannelAnnouncement_set_contents(&this_ptr_conv, val_conv);
30621 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) {
30622 LDKSignature node_signature_1_arg_ref;
30623 CHECK(node_signature_1_arg->arr_len == 64);
30624 memcpy(node_signature_1_arg_ref.compact_form, node_signature_1_arg->elems, 64); FREE(node_signature_1_arg);
30625 LDKSignature node_signature_2_arg_ref;
30626 CHECK(node_signature_2_arg->arr_len == 64);
30627 memcpy(node_signature_2_arg_ref.compact_form, node_signature_2_arg->elems, 64); FREE(node_signature_2_arg);
30628 LDKSignature bitcoin_signature_1_arg_ref;
30629 CHECK(bitcoin_signature_1_arg->arr_len == 64);
30630 memcpy(bitcoin_signature_1_arg_ref.compact_form, bitcoin_signature_1_arg->elems, 64); FREE(bitcoin_signature_1_arg);
30631 LDKSignature bitcoin_signature_2_arg_ref;
30632 CHECK(bitcoin_signature_2_arg->arr_len == 64);
30633 memcpy(bitcoin_signature_2_arg_ref.compact_form, bitcoin_signature_2_arg->elems, 64); FREE(bitcoin_signature_2_arg);
30634 LDKUnsignedChannelAnnouncement contents_arg_conv;
30635 contents_arg_conv.inner = untag_ptr(contents_arg);
30636 contents_arg_conv.is_owned = ptr_is_owned(contents_arg);
30637 CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv);
30638 contents_arg_conv = UnsignedChannelAnnouncement_clone(&contents_arg_conv);
30639 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);
30640 uint64_t ret_ref = 0;
30641 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30642 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30646 static inline uint64_t ChannelAnnouncement_clone_ptr(LDKChannelAnnouncement *NONNULL_PTR arg) {
30647 LDKChannelAnnouncement ret_var = ChannelAnnouncement_clone(arg);
30648 uint64_t ret_ref = 0;
30649 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30650 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30653 int64_t __attribute__((export_name("TS_ChannelAnnouncement_clone_ptr"))) TS_ChannelAnnouncement_clone_ptr(uint64_t arg) {
30654 LDKChannelAnnouncement arg_conv;
30655 arg_conv.inner = untag_ptr(arg);
30656 arg_conv.is_owned = ptr_is_owned(arg);
30657 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
30658 arg_conv.is_owned = false;
30659 int64_t ret_conv = ChannelAnnouncement_clone_ptr(&arg_conv);
30663 uint64_t __attribute__((export_name("TS_ChannelAnnouncement_clone"))) TS_ChannelAnnouncement_clone(uint64_t orig) {
30664 LDKChannelAnnouncement orig_conv;
30665 orig_conv.inner = untag_ptr(orig);
30666 orig_conv.is_owned = ptr_is_owned(orig);
30667 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
30668 orig_conv.is_owned = false;
30669 LDKChannelAnnouncement ret_var = ChannelAnnouncement_clone(&orig_conv);
30670 uint64_t ret_ref = 0;
30671 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30672 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30676 void __attribute__((export_name("TS_UnsignedChannelUpdate_free"))) TS_UnsignedChannelUpdate_free(uint64_t this_obj) {
30677 LDKUnsignedChannelUpdate this_obj_conv;
30678 this_obj_conv.inner = untag_ptr(this_obj);
30679 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30680 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30681 UnsignedChannelUpdate_free(this_obj_conv);
30684 int8_tArray __attribute__((export_name("TS_UnsignedChannelUpdate_get_chain_hash"))) TS_UnsignedChannelUpdate_get_chain_hash(uint64_t this_ptr) {
30685 LDKUnsignedChannelUpdate this_ptr_conv;
30686 this_ptr_conv.inner = untag_ptr(this_ptr);
30687 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30688 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30689 this_ptr_conv.is_owned = false;
30690 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
30691 memcpy(ret_arr->elems, *UnsignedChannelUpdate_get_chain_hash(&this_ptr_conv), 32);
30695 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_chain_hash"))) TS_UnsignedChannelUpdate_set_chain_hash(uint64_t this_ptr, int8_tArray val) {
30696 LDKUnsignedChannelUpdate this_ptr_conv;
30697 this_ptr_conv.inner = untag_ptr(this_ptr);
30698 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30699 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30700 this_ptr_conv.is_owned = false;
30701 LDKThirtyTwoBytes val_ref;
30702 CHECK(val->arr_len == 32);
30703 memcpy(val_ref.data, val->elems, 32); FREE(val);
30704 UnsignedChannelUpdate_set_chain_hash(&this_ptr_conv, val_ref);
30707 int64_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_short_channel_id"))) TS_UnsignedChannelUpdate_get_short_channel_id(uint64_t this_ptr) {
30708 LDKUnsignedChannelUpdate this_ptr_conv;
30709 this_ptr_conv.inner = untag_ptr(this_ptr);
30710 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30711 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30712 this_ptr_conv.is_owned = false;
30713 int64_t ret_conv = UnsignedChannelUpdate_get_short_channel_id(&this_ptr_conv);
30717 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_short_channel_id"))) TS_UnsignedChannelUpdate_set_short_channel_id(uint64_t this_ptr, int64_t val) {
30718 LDKUnsignedChannelUpdate this_ptr_conv;
30719 this_ptr_conv.inner = untag_ptr(this_ptr);
30720 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30721 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30722 this_ptr_conv.is_owned = false;
30723 UnsignedChannelUpdate_set_short_channel_id(&this_ptr_conv, val);
30726 int32_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_timestamp"))) TS_UnsignedChannelUpdate_get_timestamp(uint64_t this_ptr) {
30727 LDKUnsignedChannelUpdate 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 int32_t ret_conv = UnsignedChannelUpdate_get_timestamp(&this_ptr_conv);
30736 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_timestamp"))) TS_UnsignedChannelUpdate_set_timestamp(uint64_t this_ptr, int32_t val) {
30737 LDKUnsignedChannelUpdate this_ptr_conv;
30738 this_ptr_conv.inner = untag_ptr(this_ptr);
30739 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30740 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30741 this_ptr_conv.is_owned = false;
30742 UnsignedChannelUpdate_set_timestamp(&this_ptr_conv, val);
30745 int8_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_flags"))) TS_UnsignedChannelUpdate_get_flags(uint64_t this_ptr) {
30746 LDKUnsignedChannelUpdate this_ptr_conv;
30747 this_ptr_conv.inner = untag_ptr(this_ptr);
30748 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30749 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30750 this_ptr_conv.is_owned = false;
30751 int8_t ret_conv = UnsignedChannelUpdate_get_flags(&this_ptr_conv);
30755 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_flags"))) TS_UnsignedChannelUpdate_set_flags(uint64_t this_ptr, int8_t val) {
30756 LDKUnsignedChannelUpdate this_ptr_conv;
30757 this_ptr_conv.inner = untag_ptr(this_ptr);
30758 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30759 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30760 this_ptr_conv.is_owned = false;
30761 UnsignedChannelUpdate_set_flags(&this_ptr_conv, val);
30764 int16_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_cltv_expiry_delta"))) TS_UnsignedChannelUpdate_get_cltv_expiry_delta(uint64_t this_ptr) {
30765 LDKUnsignedChannelUpdate this_ptr_conv;
30766 this_ptr_conv.inner = untag_ptr(this_ptr);
30767 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30768 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30769 this_ptr_conv.is_owned = false;
30770 int16_t ret_conv = UnsignedChannelUpdate_get_cltv_expiry_delta(&this_ptr_conv);
30774 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_cltv_expiry_delta"))) TS_UnsignedChannelUpdate_set_cltv_expiry_delta(uint64_t this_ptr, int16_t val) {
30775 LDKUnsignedChannelUpdate this_ptr_conv;
30776 this_ptr_conv.inner = untag_ptr(this_ptr);
30777 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30778 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30779 this_ptr_conv.is_owned = false;
30780 UnsignedChannelUpdate_set_cltv_expiry_delta(&this_ptr_conv, val);
30783 int64_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_htlc_minimum_msat"))) TS_UnsignedChannelUpdate_get_htlc_minimum_msat(uint64_t this_ptr) {
30784 LDKUnsignedChannelUpdate 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 int64_t ret_conv = UnsignedChannelUpdate_get_htlc_minimum_msat(&this_ptr_conv);
30793 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_htlc_minimum_msat"))) TS_UnsignedChannelUpdate_set_htlc_minimum_msat(uint64_t this_ptr, int64_t val) {
30794 LDKUnsignedChannelUpdate this_ptr_conv;
30795 this_ptr_conv.inner = untag_ptr(this_ptr);
30796 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30797 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30798 this_ptr_conv.is_owned = false;
30799 UnsignedChannelUpdate_set_htlc_minimum_msat(&this_ptr_conv, val);
30802 int64_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_htlc_maximum_msat"))) TS_UnsignedChannelUpdate_get_htlc_maximum_msat(uint64_t this_ptr) {
30803 LDKUnsignedChannelUpdate this_ptr_conv;
30804 this_ptr_conv.inner = untag_ptr(this_ptr);
30805 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30806 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30807 this_ptr_conv.is_owned = false;
30808 int64_t ret_conv = UnsignedChannelUpdate_get_htlc_maximum_msat(&this_ptr_conv);
30812 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_htlc_maximum_msat"))) TS_UnsignedChannelUpdate_set_htlc_maximum_msat(uint64_t this_ptr, int64_t val) {
30813 LDKUnsignedChannelUpdate this_ptr_conv;
30814 this_ptr_conv.inner = untag_ptr(this_ptr);
30815 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30816 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30817 this_ptr_conv.is_owned = false;
30818 UnsignedChannelUpdate_set_htlc_maximum_msat(&this_ptr_conv, val);
30821 int32_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_fee_base_msat"))) TS_UnsignedChannelUpdate_get_fee_base_msat(uint64_t this_ptr) {
30822 LDKUnsignedChannelUpdate this_ptr_conv;
30823 this_ptr_conv.inner = untag_ptr(this_ptr);
30824 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30825 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30826 this_ptr_conv.is_owned = false;
30827 int32_t ret_conv = UnsignedChannelUpdate_get_fee_base_msat(&this_ptr_conv);
30831 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_fee_base_msat"))) TS_UnsignedChannelUpdate_set_fee_base_msat(uint64_t this_ptr, int32_t val) {
30832 LDKUnsignedChannelUpdate this_ptr_conv;
30833 this_ptr_conv.inner = untag_ptr(this_ptr);
30834 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30835 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30836 this_ptr_conv.is_owned = false;
30837 UnsignedChannelUpdate_set_fee_base_msat(&this_ptr_conv, val);
30840 int32_t __attribute__((export_name("TS_UnsignedChannelUpdate_get_fee_proportional_millionths"))) TS_UnsignedChannelUpdate_get_fee_proportional_millionths(uint64_t this_ptr) {
30841 LDKUnsignedChannelUpdate this_ptr_conv;
30842 this_ptr_conv.inner = untag_ptr(this_ptr);
30843 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30844 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30845 this_ptr_conv.is_owned = false;
30846 int32_t ret_conv = UnsignedChannelUpdate_get_fee_proportional_millionths(&this_ptr_conv);
30850 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_fee_proportional_millionths"))) TS_UnsignedChannelUpdate_set_fee_proportional_millionths(uint64_t this_ptr, int32_t val) {
30851 LDKUnsignedChannelUpdate this_ptr_conv;
30852 this_ptr_conv.inner = untag_ptr(this_ptr);
30853 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30854 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30855 this_ptr_conv.is_owned = false;
30856 UnsignedChannelUpdate_set_fee_proportional_millionths(&this_ptr_conv, val);
30859 int8_tArray __attribute__((export_name("TS_UnsignedChannelUpdate_get_excess_data"))) TS_UnsignedChannelUpdate_get_excess_data(uint64_t this_ptr) {
30860 LDKUnsignedChannelUpdate this_ptr_conv;
30861 this_ptr_conv.inner = untag_ptr(this_ptr);
30862 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30863 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30864 this_ptr_conv.is_owned = false;
30865 LDKCVec_u8Z ret_var = UnsignedChannelUpdate_get_excess_data(&this_ptr_conv);
30866 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
30867 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
30868 CVec_u8Z_free(ret_var);
30872 void __attribute__((export_name("TS_UnsignedChannelUpdate_set_excess_data"))) TS_UnsignedChannelUpdate_set_excess_data(uint64_t this_ptr, int8_tArray val) {
30873 LDKUnsignedChannelUpdate this_ptr_conv;
30874 this_ptr_conv.inner = untag_ptr(this_ptr);
30875 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30876 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30877 this_ptr_conv.is_owned = false;
30878 LDKCVec_u8Z val_ref;
30879 val_ref.datalen = val->arr_len;
30880 val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes");
30881 memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val);
30882 UnsignedChannelUpdate_set_excess_data(&this_ptr_conv, val_ref);
30885 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) {
30886 LDKThirtyTwoBytes chain_hash_arg_ref;
30887 CHECK(chain_hash_arg->arr_len == 32);
30888 memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg);
30889 LDKCVec_u8Z excess_data_arg_ref;
30890 excess_data_arg_ref.datalen = excess_data_arg->arr_len;
30891 excess_data_arg_ref.data = MALLOC(excess_data_arg_ref.datalen, "LDKCVec_u8Z Bytes");
30892 memcpy(excess_data_arg_ref.data, excess_data_arg->elems, excess_data_arg_ref.datalen); FREE(excess_data_arg);
30893 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);
30894 uint64_t ret_ref = 0;
30895 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30896 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30900 static inline uint64_t UnsignedChannelUpdate_clone_ptr(LDKUnsignedChannelUpdate *NONNULL_PTR arg) {
30901 LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_clone(arg);
30902 uint64_t ret_ref = 0;
30903 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30904 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30907 int64_t __attribute__((export_name("TS_UnsignedChannelUpdate_clone_ptr"))) TS_UnsignedChannelUpdate_clone_ptr(uint64_t arg) {
30908 LDKUnsignedChannelUpdate arg_conv;
30909 arg_conv.inner = untag_ptr(arg);
30910 arg_conv.is_owned = ptr_is_owned(arg);
30911 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
30912 arg_conv.is_owned = false;
30913 int64_t ret_conv = UnsignedChannelUpdate_clone_ptr(&arg_conv);
30917 uint64_t __attribute__((export_name("TS_UnsignedChannelUpdate_clone"))) TS_UnsignedChannelUpdate_clone(uint64_t orig) {
30918 LDKUnsignedChannelUpdate orig_conv;
30919 orig_conv.inner = untag_ptr(orig);
30920 orig_conv.is_owned = ptr_is_owned(orig);
30921 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
30922 orig_conv.is_owned = false;
30923 LDKUnsignedChannelUpdate ret_var = UnsignedChannelUpdate_clone(&orig_conv);
30924 uint64_t ret_ref = 0;
30925 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30926 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30930 void __attribute__((export_name("TS_ChannelUpdate_free"))) TS_ChannelUpdate_free(uint64_t this_obj) {
30931 LDKChannelUpdate this_obj_conv;
30932 this_obj_conv.inner = untag_ptr(this_obj);
30933 this_obj_conv.is_owned = ptr_is_owned(this_obj);
30934 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
30935 ChannelUpdate_free(this_obj_conv);
30938 int8_tArray __attribute__((export_name("TS_ChannelUpdate_get_signature"))) TS_ChannelUpdate_get_signature(uint64_t this_ptr) {
30939 LDKChannelUpdate this_ptr_conv;
30940 this_ptr_conv.inner = untag_ptr(this_ptr);
30941 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30942 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30943 this_ptr_conv.is_owned = false;
30944 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
30945 memcpy(ret_arr->elems, ChannelUpdate_get_signature(&this_ptr_conv).compact_form, 64);
30949 void __attribute__((export_name("TS_ChannelUpdate_set_signature"))) TS_ChannelUpdate_set_signature(uint64_t this_ptr, int8_tArray val) {
30950 LDKChannelUpdate this_ptr_conv;
30951 this_ptr_conv.inner = untag_ptr(this_ptr);
30952 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30953 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30954 this_ptr_conv.is_owned = false;
30955 LDKSignature val_ref;
30956 CHECK(val->arr_len == 64);
30957 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
30958 ChannelUpdate_set_signature(&this_ptr_conv, val_ref);
30961 uint64_t __attribute__((export_name("TS_ChannelUpdate_get_contents"))) TS_ChannelUpdate_get_contents(uint64_t this_ptr) {
30962 LDKChannelUpdate this_ptr_conv;
30963 this_ptr_conv.inner = untag_ptr(this_ptr);
30964 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30965 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30966 this_ptr_conv.is_owned = false;
30967 LDKUnsignedChannelUpdate ret_var = ChannelUpdate_get_contents(&this_ptr_conv);
30968 uint64_t ret_ref = 0;
30969 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
30970 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
30974 void __attribute__((export_name("TS_ChannelUpdate_set_contents"))) TS_ChannelUpdate_set_contents(uint64_t this_ptr, uint64_t val) {
30975 LDKChannelUpdate this_ptr_conv;
30976 this_ptr_conv.inner = untag_ptr(this_ptr);
30977 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
30978 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
30979 this_ptr_conv.is_owned = false;
30980 LDKUnsignedChannelUpdate val_conv;
30981 val_conv.inner = untag_ptr(val);
30982 val_conv.is_owned = ptr_is_owned(val);
30983 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
30984 val_conv = UnsignedChannelUpdate_clone(&val_conv);
30985 ChannelUpdate_set_contents(&this_ptr_conv, val_conv);
30988 uint64_t __attribute__((export_name("TS_ChannelUpdate_new"))) TS_ChannelUpdate_new(int8_tArray signature_arg, uint64_t contents_arg) {
30989 LDKSignature signature_arg_ref;
30990 CHECK(signature_arg->arr_len == 64);
30991 memcpy(signature_arg_ref.compact_form, signature_arg->elems, 64); FREE(signature_arg);
30992 LDKUnsignedChannelUpdate contents_arg_conv;
30993 contents_arg_conv.inner = untag_ptr(contents_arg);
30994 contents_arg_conv.is_owned = ptr_is_owned(contents_arg);
30995 CHECK_INNER_FIELD_ACCESS_OR_NULL(contents_arg_conv);
30996 contents_arg_conv = UnsignedChannelUpdate_clone(&contents_arg_conv);
30997 LDKChannelUpdate ret_var = ChannelUpdate_new(signature_arg_ref, contents_arg_conv);
30998 uint64_t ret_ref = 0;
30999 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31000 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31004 static inline uint64_t ChannelUpdate_clone_ptr(LDKChannelUpdate *NONNULL_PTR arg) {
31005 LDKChannelUpdate ret_var = ChannelUpdate_clone(arg);
31006 uint64_t ret_ref = 0;
31007 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31008 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31011 int64_t __attribute__((export_name("TS_ChannelUpdate_clone_ptr"))) TS_ChannelUpdate_clone_ptr(uint64_t arg) {
31012 LDKChannelUpdate arg_conv;
31013 arg_conv.inner = untag_ptr(arg);
31014 arg_conv.is_owned = ptr_is_owned(arg);
31015 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
31016 arg_conv.is_owned = false;
31017 int64_t ret_conv = ChannelUpdate_clone_ptr(&arg_conv);
31021 uint64_t __attribute__((export_name("TS_ChannelUpdate_clone"))) TS_ChannelUpdate_clone(uint64_t orig) {
31022 LDKChannelUpdate orig_conv;
31023 orig_conv.inner = untag_ptr(orig);
31024 orig_conv.is_owned = ptr_is_owned(orig);
31025 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
31026 orig_conv.is_owned = false;
31027 LDKChannelUpdate ret_var = ChannelUpdate_clone(&orig_conv);
31028 uint64_t ret_ref = 0;
31029 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31030 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31034 void __attribute__((export_name("TS_QueryChannelRange_free"))) TS_QueryChannelRange_free(uint64_t this_obj) {
31035 LDKQueryChannelRange this_obj_conv;
31036 this_obj_conv.inner = untag_ptr(this_obj);
31037 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31038 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31039 QueryChannelRange_free(this_obj_conv);
31042 int8_tArray __attribute__((export_name("TS_QueryChannelRange_get_chain_hash"))) TS_QueryChannelRange_get_chain_hash(uint64_t this_ptr) {
31043 LDKQueryChannelRange this_ptr_conv;
31044 this_ptr_conv.inner = untag_ptr(this_ptr);
31045 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31046 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31047 this_ptr_conv.is_owned = false;
31048 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
31049 memcpy(ret_arr->elems, *QueryChannelRange_get_chain_hash(&this_ptr_conv), 32);
31053 void __attribute__((export_name("TS_QueryChannelRange_set_chain_hash"))) TS_QueryChannelRange_set_chain_hash(uint64_t this_ptr, int8_tArray val) {
31054 LDKQueryChannelRange this_ptr_conv;
31055 this_ptr_conv.inner = untag_ptr(this_ptr);
31056 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31057 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31058 this_ptr_conv.is_owned = false;
31059 LDKThirtyTwoBytes val_ref;
31060 CHECK(val->arr_len == 32);
31061 memcpy(val_ref.data, val->elems, 32); FREE(val);
31062 QueryChannelRange_set_chain_hash(&this_ptr_conv, val_ref);
31065 int32_t __attribute__((export_name("TS_QueryChannelRange_get_first_blocknum"))) TS_QueryChannelRange_get_first_blocknum(uint64_t this_ptr) {
31066 LDKQueryChannelRange this_ptr_conv;
31067 this_ptr_conv.inner = untag_ptr(this_ptr);
31068 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31069 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31070 this_ptr_conv.is_owned = false;
31071 int32_t ret_conv = QueryChannelRange_get_first_blocknum(&this_ptr_conv);
31075 void __attribute__((export_name("TS_QueryChannelRange_set_first_blocknum"))) TS_QueryChannelRange_set_first_blocknum(uint64_t this_ptr, int32_t val) {
31076 LDKQueryChannelRange this_ptr_conv;
31077 this_ptr_conv.inner = untag_ptr(this_ptr);
31078 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31079 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31080 this_ptr_conv.is_owned = false;
31081 QueryChannelRange_set_first_blocknum(&this_ptr_conv, val);
31084 int32_t __attribute__((export_name("TS_QueryChannelRange_get_number_of_blocks"))) TS_QueryChannelRange_get_number_of_blocks(uint64_t this_ptr) {
31085 LDKQueryChannelRange this_ptr_conv;
31086 this_ptr_conv.inner = untag_ptr(this_ptr);
31087 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31088 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31089 this_ptr_conv.is_owned = false;
31090 int32_t ret_conv = QueryChannelRange_get_number_of_blocks(&this_ptr_conv);
31094 void __attribute__((export_name("TS_QueryChannelRange_set_number_of_blocks"))) TS_QueryChannelRange_set_number_of_blocks(uint64_t this_ptr, int32_t val) {
31095 LDKQueryChannelRange this_ptr_conv;
31096 this_ptr_conv.inner = untag_ptr(this_ptr);
31097 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31098 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31099 this_ptr_conv.is_owned = false;
31100 QueryChannelRange_set_number_of_blocks(&this_ptr_conv, val);
31103 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) {
31104 LDKThirtyTwoBytes chain_hash_arg_ref;
31105 CHECK(chain_hash_arg->arr_len == 32);
31106 memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg);
31107 LDKQueryChannelRange ret_var = QueryChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_arg);
31108 uint64_t ret_ref = 0;
31109 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31110 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31114 static inline uint64_t QueryChannelRange_clone_ptr(LDKQueryChannelRange *NONNULL_PTR arg) {
31115 LDKQueryChannelRange ret_var = QueryChannelRange_clone(arg);
31116 uint64_t ret_ref = 0;
31117 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31118 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31121 int64_t __attribute__((export_name("TS_QueryChannelRange_clone_ptr"))) TS_QueryChannelRange_clone_ptr(uint64_t arg) {
31122 LDKQueryChannelRange arg_conv;
31123 arg_conv.inner = untag_ptr(arg);
31124 arg_conv.is_owned = ptr_is_owned(arg);
31125 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
31126 arg_conv.is_owned = false;
31127 int64_t ret_conv = QueryChannelRange_clone_ptr(&arg_conv);
31131 uint64_t __attribute__((export_name("TS_QueryChannelRange_clone"))) TS_QueryChannelRange_clone(uint64_t orig) {
31132 LDKQueryChannelRange orig_conv;
31133 orig_conv.inner = untag_ptr(orig);
31134 orig_conv.is_owned = ptr_is_owned(orig);
31135 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
31136 orig_conv.is_owned = false;
31137 LDKQueryChannelRange ret_var = QueryChannelRange_clone(&orig_conv);
31138 uint64_t ret_ref = 0;
31139 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31140 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31144 void __attribute__((export_name("TS_ReplyChannelRange_free"))) TS_ReplyChannelRange_free(uint64_t this_obj) {
31145 LDKReplyChannelRange this_obj_conv;
31146 this_obj_conv.inner = untag_ptr(this_obj);
31147 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31148 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31149 ReplyChannelRange_free(this_obj_conv);
31152 int8_tArray __attribute__((export_name("TS_ReplyChannelRange_get_chain_hash"))) TS_ReplyChannelRange_get_chain_hash(uint64_t this_ptr) {
31153 LDKReplyChannelRange this_ptr_conv;
31154 this_ptr_conv.inner = untag_ptr(this_ptr);
31155 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31156 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31157 this_ptr_conv.is_owned = false;
31158 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
31159 memcpy(ret_arr->elems, *ReplyChannelRange_get_chain_hash(&this_ptr_conv), 32);
31163 void __attribute__((export_name("TS_ReplyChannelRange_set_chain_hash"))) TS_ReplyChannelRange_set_chain_hash(uint64_t this_ptr, int8_tArray val) {
31164 LDKReplyChannelRange this_ptr_conv;
31165 this_ptr_conv.inner = untag_ptr(this_ptr);
31166 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31167 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31168 this_ptr_conv.is_owned = false;
31169 LDKThirtyTwoBytes val_ref;
31170 CHECK(val->arr_len == 32);
31171 memcpy(val_ref.data, val->elems, 32); FREE(val);
31172 ReplyChannelRange_set_chain_hash(&this_ptr_conv, val_ref);
31175 int32_t __attribute__((export_name("TS_ReplyChannelRange_get_first_blocknum"))) TS_ReplyChannelRange_get_first_blocknum(uint64_t this_ptr) {
31176 LDKReplyChannelRange 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 int32_t ret_conv = ReplyChannelRange_get_first_blocknum(&this_ptr_conv);
31185 void __attribute__((export_name("TS_ReplyChannelRange_set_first_blocknum"))) TS_ReplyChannelRange_set_first_blocknum(uint64_t this_ptr, int32_t val) {
31186 LDKReplyChannelRange this_ptr_conv;
31187 this_ptr_conv.inner = untag_ptr(this_ptr);
31188 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31189 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31190 this_ptr_conv.is_owned = false;
31191 ReplyChannelRange_set_first_blocknum(&this_ptr_conv, val);
31194 int32_t __attribute__((export_name("TS_ReplyChannelRange_get_number_of_blocks"))) TS_ReplyChannelRange_get_number_of_blocks(uint64_t this_ptr) {
31195 LDKReplyChannelRange this_ptr_conv;
31196 this_ptr_conv.inner = untag_ptr(this_ptr);
31197 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31198 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31199 this_ptr_conv.is_owned = false;
31200 int32_t ret_conv = ReplyChannelRange_get_number_of_blocks(&this_ptr_conv);
31204 void __attribute__((export_name("TS_ReplyChannelRange_set_number_of_blocks"))) TS_ReplyChannelRange_set_number_of_blocks(uint64_t this_ptr, int32_t val) {
31205 LDKReplyChannelRange this_ptr_conv;
31206 this_ptr_conv.inner = untag_ptr(this_ptr);
31207 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31208 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31209 this_ptr_conv.is_owned = false;
31210 ReplyChannelRange_set_number_of_blocks(&this_ptr_conv, val);
31213 jboolean __attribute__((export_name("TS_ReplyChannelRange_get_sync_complete"))) TS_ReplyChannelRange_get_sync_complete(uint64_t this_ptr) {
31214 LDKReplyChannelRange this_ptr_conv;
31215 this_ptr_conv.inner = untag_ptr(this_ptr);
31216 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31217 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31218 this_ptr_conv.is_owned = false;
31219 jboolean ret_conv = ReplyChannelRange_get_sync_complete(&this_ptr_conv);
31223 void __attribute__((export_name("TS_ReplyChannelRange_set_sync_complete"))) TS_ReplyChannelRange_set_sync_complete(uint64_t this_ptr, jboolean val) {
31224 LDKReplyChannelRange this_ptr_conv;
31225 this_ptr_conv.inner = untag_ptr(this_ptr);
31226 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31227 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31228 this_ptr_conv.is_owned = false;
31229 ReplyChannelRange_set_sync_complete(&this_ptr_conv, val);
31232 int64_tArray __attribute__((export_name("TS_ReplyChannelRange_get_short_channel_ids"))) TS_ReplyChannelRange_get_short_channel_ids(uint64_t this_ptr) {
31233 LDKReplyChannelRange this_ptr_conv;
31234 this_ptr_conv.inner = untag_ptr(this_ptr);
31235 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31236 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31237 this_ptr_conv.is_owned = false;
31238 LDKCVec_u64Z ret_var = ReplyChannelRange_get_short_channel_ids(&this_ptr_conv);
31239 int64_tArray ret_arr = NULL;
31240 ret_arr = init_int64_tArray(ret_var.datalen, __LINE__);
31241 int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8);
31242 for (size_t i = 0; i < ret_var.datalen; i++) {
31243 int64_t ret_conv_8_conv = ret_var.data[i];
31244 ret_arr_ptr[i] = ret_conv_8_conv;
31247 FREE(ret_var.data);
31251 void __attribute__((export_name("TS_ReplyChannelRange_set_short_channel_ids"))) TS_ReplyChannelRange_set_short_channel_ids(uint64_t this_ptr, int64_tArray val) {
31252 LDKReplyChannelRange this_ptr_conv;
31253 this_ptr_conv.inner = untag_ptr(this_ptr);
31254 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31255 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31256 this_ptr_conv.is_owned = false;
31257 LDKCVec_u64Z val_constr;
31258 val_constr.datalen = val->arr_len;
31259 if (val_constr.datalen > 0)
31260 val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
31262 val_constr.data = NULL;
31263 int64_t* val_vals = val->elems;
31264 for (size_t i = 0; i < val_constr.datalen; i++) {
31265 int64_t val_conv_8 = val_vals[i];
31266 val_constr.data[i] = val_conv_8;
31269 ReplyChannelRange_set_short_channel_ids(&this_ptr_conv, val_constr);
31272 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) {
31273 LDKThirtyTwoBytes chain_hash_arg_ref;
31274 CHECK(chain_hash_arg->arr_len == 32);
31275 memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg);
31276 LDKCVec_u64Z short_channel_ids_arg_constr;
31277 short_channel_ids_arg_constr.datalen = short_channel_ids_arg->arr_len;
31278 if (short_channel_ids_arg_constr.datalen > 0)
31279 short_channel_ids_arg_constr.data = MALLOC(short_channel_ids_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
31281 short_channel_ids_arg_constr.data = NULL;
31282 int64_t* short_channel_ids_arg_vals = short_channel_ids_arg->elems;
31283 for (size_t i = 0; i < short_channel_ids_arg_constr.datalen; i++) {
31284 int64_t short_channel_ids_arg_conv_8 = short_channel_ids_arg_vals[i];
31285 short_channel_ids_arg_constr.data[i] = short_channel_ids_arg_conv_8;
31287 FREE(short_channel_ids_arg);
31288 LDKReplyChannelRange ret_var = ReplyChannelRange_new(chain_hash_arg_ref, first_blocknum_arg, number_of_blocks_arg, sync_complete_arg, short_channel_ids_arg_constr);
31289 uint64_t ret_ref = 0;
31290 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31291 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31295 static inline uint64_t ReplyChannelRange_clone_ptr(LDKReplyChannelRange *NONNULL_PTR arg) {
31296 LDKReplyChannelRange ret_var = ReplyChannelRange_clone(arg);
31297 uint64_t ret_ref = 0;
31298 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31299 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31302 int64_t __attribute__((export_name("TS_ReplyChannelRange_clone_ptr"))) TS_ReplyChannelRange_clone_ptr(uint64_t arg) {
31303 LDKReplyChannelRange arg_conv;
31304 arg_conv.inner = untag_ptr(arg);
31305 arg_conv.is_owned = ptr_is_owned(arg);
31306 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
31307 arg_conv.is_owned = false;
31308 int64_t ret_conv = ReplyChannelRange_clone_ptr(&arg_conv);
31312 uint64_t __attribute__((export_name("TS_ReplyChannelRange_clone"))) TS_ReplyChannelRange_clone(uint64_t orig) {
31313 LDKReplyChannelRange orig_conv;
31314 orig_conv.inner = untag_ptr(orig);
31315 orig_conv.is_owned = ptr_is_owned(orig);
31316 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
31317 orig_conv.is_owned = false;
31318 LDKReplyChannelRange ret_var = ReplyChannelRange_clone(&orig_conv);
31319 uint64_t ret_ref = 0;
31320 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31321 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31325 void __attribute__((export_name("TS_QueryShortChannelIds_free"))) TS_QueryShortChannelIds_free(uint64_t this_obj) {
31326 LDKQueryShortChannelIds this_obj_conv;
31327 this_obj_conv.inner = untag_ptr(this_obj);
31328 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31329 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31330 QueryShortChannelIds_free(this_obj_conv);
31333 int8_tArray __attribute__((export_name("TS_QueryShortChannelIds_get_chain_hash"))) TS_QueryShortChannelIds_get_chain_hash(uint64_t this_ptr) {
31334 LDKQueryShortChannelIds this_ptr_conv;
31335 this_ptr_conv.inner = untag_ptr(this_ptr);
31336 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31337 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31338 this_ptr_conv.is_owned = false;
31339 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
31340 memcpy(ret_arr->elems, *QueryShortChannelIds_get_chain_hash(&this_ptr_conv), 32);
31344 void __attribute__((export_name("TS_QueryShortChannelIds_set_chain_hash"))) TS_QueryShortChannelIds_set_chain_hash(uint64_t this_ptr, int8_tArray val) {
31345 LDKQueryShortChannelIds this_ptr_conv;
31346 this_ptr_conv.inner = untag_ptr(this_ptr);
31347 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31348 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31349 this_ptr_conv.is_owned = false;
31350 LDKThirtyTwoBytes val_ref;
31351 CHECK(val->arr_len == 32);
31352 memcpy(val_ref.data, val->elems, 32); FREE(val);
31353 QueryShortChannelIds_set_chain_hash(&this_ptr_conv, val_ref);
31356 int64_tArray __attribute__((export_name("TS_QueryShortChannelIds_get_short_channel_ids"))) TS_QueryShortChannelIds_get_short_channel_ids(uint64_t this_ptr) {
31357 LDKQueryShortChannelIds this_ptr_conv;
31358 this_ptr_conv.inner = untag_ptr(this_ptr);
31359 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31360 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31361 this_ptr_conv.is_owned = false;
31362 LDKCVec_u64Z ret_var = QueryShortChannelIds_get_short_channel_ids(&this_ptr_conv);
31363 int64_tArray ret_arr = NULL;
31364 ret_arr = init_int64_tArray(ret_var.datalen, __LINE__);
31365 int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8);
31366 for (size_t i = 0; i < ret_var.datalen; i++) {
31367 int64_t ret_conv_8_conv = ret_var.data[i];
31368 ret_arr_ptr[i] = ret_conv_8_conv;
31371 FREE(ret_var.data);
31375 void __attribute__((export_name("TS_QueryShortChannelIds_set_short_channel_ids"))) TS_QueryShortChannelIds_set_short_channel_ids(uint64_t this_ptr, int64_tArray val) {
31376 LDKQueryShortChannelIds this_ptr_conv;
31377 this_ptr_conv.inner = untag_ptr(this_ptr);
31378 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31379 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31380 this_ptr_conv.is_owned = false;
31381 LDKCVec_u64Z val_constr;
31382 val_constr.datalen = val->arr_len;
31383 if (val_constr.datalen > 0)
31384 val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
31386 val_constr.data = NULL;
31387 int64_t* val_vals = val->elems;
31388 for (size_t i = 0; i < val_constr.datalen; i++) {
31389 int64_t val_conv_8 = val_vals[i];
31390 val_constr.data[i] = val_conv_8;
31393 QueryShortChannelIds_set_short_channel_ids(&this_ptr_conv, val_constr);
31396 uint64_t __attribute__((export_name("TS_QueryShortChannelIds_new"))) TS_QueryShortChannelIds_new(int8_tArray chain_hash_arg, int64_tArray short_channel_ids_arg) {
31397 LDKThirtyTwoBytes chain_hash_arg_ref;
31398 CHECK(chain_hash_arg->arr_len == 32);
31399 memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg);
31400 LDKCVec_u64Z short_channel_ids_arg_constr;
31401 short_channel_ids_arg_constr.datalen = short_channel_ids_arg->arr_len;
31402 if (short_channel_ids_arg_constr.datalen > 0)
31403 short_channel_ids_arg_constr.data = MALLOC(short_channel_ids_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
31405 short_channel_ids_arg_constr.data = NULL;
31406 int64_t* short_channel_ids_arg_vals = short_channel_ids_arg->elems;
31407 for (size_t i = 0; i < short_channel_ids_arg_constr.datalen; i++) {
31408 int64_t short_channel_ids_arg_conv_8 = short_channel_ids_arg_vals[i];
31409 short_channel_ids_arg_constr.data[i] = short_channel_ids_arg_conv_8;
31411 FREE(short_channel_ids_arg);
31412 LDKQueryShortChannelIds ret_var = QueryShortChannelIds_new(chain_hash_arg_ref, short_channel_ids_arg_constr);
31413 uint64_t ret_ref = 0;
31414 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31415 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31419 static inline uint64_t QueryShortChannelIds_clone_ptr(LDKQueryShortChannelIds *NONNULL_PTR arg) {
31420 LDKQueryShortChannelIds ret_var = QueryShortChannelIds_clone(arg);
31421 uint64_t ret_ref = 0;
31422 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31423 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31426 int64_t __attribute__((export_name("TS_QueryShortChannelIds_clone_ptr"))) TS_QueryShortChannelIds_clone_ptr(uint64_t arg) {
31427 LDKQueryShortChannelIds arg_conv;
31428 arg_conv.inner = untag_ptr(arg);
31429 arg_conv.is_owned = ptr_is_owned(arg);
31430 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
31431 arg_conv.is_owned = false;
31432 int64_t ret_conv = QueryShortChannelIds_clone_ptr(&arg_conv);
31436 uint64_t __attribute__((export_name("TS_QueryShortChannelIds_clone"))) TS_QueryShortChannelIds_clone(uint64_t orig) {
31437 LDKQueryShortChannelIds orig_conv;
31438 orig_conv.inner = untag_ptr(orig);
31439 orig_conv.is_owned = ptr_is_owned(orig);
31440 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
31441 orig_conv.is_owned = false;
31442 LDKQueryShortChannelIds ret_var = QueryShortChannelIds_clone(&orig_conv);
31443 uint64_t ret_ref = 0;
31444 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31445 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31449 void __attribute__((export_name("TS_ReplyShortChannelIdsEnd_free"))) TS_ReplyShortChannelIdsEnd_free(uint64_t this_obj) {
31450 LDKReplyShortChannelIdsEnd this_obj_conv;
31451 this_obj_conv.inner = untag_ptr(this_obj);
31452 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31453 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31454 ReplyShortChannelIdsEnd_free(this_obj_conv);
31457 int8_tArray __attribute__((export_name("TS_ReplyShortChannelIdsEnd_get_chain_hash"))) TS_ReplyShortChannelIdsEnd_get_chain_hash(uint64_t this_ptr) {
31458 LDKReplyShortChannelIdsEnd this_ptr_conv;
31459 this_ptr_conv.inner = untag_ptr(this_ptr);
31460 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31461 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31462 this_ptr_conv.is_owned = false;
31463 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
31464 memcpy(ret_arr->elems, *ReplyShortChannelIdsEnd_get_chain_hash(&this_ptr_conv), 32);
31468 void __attribute__((export_name("TS_ReplyShortChannelIdsEnd_set_chain_hash"))) TS_ReplyShortChannelIdsEnd_set_chain_hash(uint64_t this_ptr, int8_tArray val) {
31469 LDKReplyShortChannelIdsEnd this_ptr_conv;
31470 this_ptr_conv.inner = untag_ptr(this_ptr);
31471 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31472 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31473 this_ptr_conv.is_owned = false;
31474 LDKThirtyTwoBytes val_ref;
31475 CHECK(val->arr_len == 32);
31476 memcpy(val_ref.data, val->elems, 32); FREE(val);
31477 ReplyShortChannelIdsEnd_set_chain_hash(&this_ptr_conv, val_ref);
31480 jboolean __attribute__((export_name("TS_ReplyShortChannelIdsEnd_get_full_information"))) TS_ReplyShortChannelIdsEnd_get_full_information(uint64_t this_ptr) {
31481 LDKReplyShortChannelIdsEnd this_ptr_conv;
31482 this_ptr_conv.inner = untag_ptr(this_ptr);
31483 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31484 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31485 this_ptr_conv.is_owned = false;
31486 jboolean ret_conv = ReplyShortChannelIdsEnd_get_full_information(&this_ptr_conv);
31490 void __attribute__((export_name("TS_ReplyShortChannelIdsEnd_set_full_information"))) TS_ReplyShortChannelIdsEnd_set_full_information(uint64_t this_ptr, jboolean val) {
31491 LDKReplyShortChannelIdsEnd this_ptr_conv;
31492 this_ptr_conv.inner = untag_ptr(this_ptr);
31493 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31494 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31495 this_ptr_conv.is_owned = false;
31496 ReplyShortChannelIdsEnd_set_full_information(&this_ptr_conv, val);
31499 uint64_t __attribute__((export_name("TS_ReplyShortChannelIdsEnd_new"))) TS_ReplyShortChannelIdsEnd_new(int8_tArray chain_hash_arg, jboolean full_information_arg) {
31500 LDKThirtyTwoBytes chain_hash_arg_ref;
31501 CHECK(chain_hash_arg->arr_len == 32);
31502 memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg);
31503 LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_new(chain_hash_arg_ref, full_information_arg);
31504 uint64_t ret_ref = 0;
31505 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31506 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31510 static inline uint64_t ReplyShortChannelIdsEnd_clone_ptr(LDKReplyShortChannelIdsEnd *NONNULL_PTR arg) {
31511 LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_clone(arg);
31512 uint64_t ret_ref = 0;
31513 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31514 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31517 int64_t __attribute__((export_name("TS_ReplyShortChannelIdsEnd_clone_ptr"))) TS_ReplyShortChannelIdsEnd_clone_ptr(uint64_t arg) {
31518 LDKReplyShortChannelIdsEnd arg_conv;
31519 arg_conv.inner = untag_ptr(arg);
31520 arg_conv.is_owned = ptr_is_owned(arg);
31521 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
31522 arg_conv.is_owned = false;
31523 int64_t ret_conv = ReplyShortChannelIdsEnd_clone_ptr(&arg_conv);
31527 uint64_t __attribute__((export_name("TS_ReplyShortChannelIdsEnd_clone"))) TS_ReplyShortChannelIdsEnd_clone(uint64_t orig) {
31528 LDKReplyShortChannelIdsEnd orig_conv;
31529 orig_conv.inner = untag_ptr(orig);
31530 orig_conv.is_owned = ptr_is_owned(orig);
31531 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
31532 orig_conv.is_owned = false;
31533 LDKReplyShortChannelIdsEnd ret_var = ReplyShortChannelIdsEnd_clone(&orig_conv);
31534 uint64_t ret_ref = 0;
31535 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31536 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31540 void __attribute__((export_name("TS_GossipTimestampFilter_free"))) TS_GossipTimestampFilter_free(uint64_t this_obj) {
31541 LDKGossipTimestampFilter this_obj_conv;
31542 this_obj_conv.inner = untag_ptr(this_obj);
31543 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31544 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31545 GossipTimestampFilter_free(this_obj_conv);
31548 int8_tArray __attribute__((export_name("TS_GossipTimestampFilter_get_chain_hash"))) TS_GossipTimestampFilter_get_chain_hash(uint64_t this_ptr) {
31549 LDKGossipTimestampFilter this_ptr_conv;
31550 this_ptr_conv.inner = untag_ptr(this_ptr);
31551 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31552 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31553 this_ptr_conv.is_owned = false;
31554 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
31555 memcpy(ret_arr->elems, *GossipTimestampFilter_get_chain_hash(&this_ptr_conv), 32);
31559 void __attribute__((export_name("TS_GossipTimestampFilter_set_chain_hash"))) TS_GossipTimestampFilter_set_chain_hash(uint64_t this_ptr, int8_tArray val) {
31560 LDKGossipTimestampFilter this_ptr_conv;
31561 this_ptr_conv.inner = untag_ptr(this_ptr);
31562 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31563 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31564 this_ptr_conv.is_owned = false;
31565 LDKThirtyTwoBytes val_ref;
31566 CHECK(val->arr_len == 32);
31567 memcpy(val_ref.data, val->elems, 32); FREE(val);
31568 GossipTimestampFilter_set_chain_hash(&this_ptr_conv, val_ref);
31571 int32_t __attribute__((export_name("TS_GossipTimestampFilter_get_first_timestamp"))) TS_GossipTimestampFilter_get_first_timestamp(uint64_t this_ptr) {
31572 LDKGossipTimestampFilter this_ptr_conv;
31573 this_ptr_conv.inner = untag_ptr(this_ptr);
31574 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31575 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31576 this_ptr_conv.is_owned = false;
31577 int32_t ret_conv = GossipTimestampFilter_get_first_timestamp(&this_ptr_conv);
31581 void __attribute__((export_name("TS_GossipTimestampFilter_set_first_timestamp"))) TS_GossipTimestampFilter_set_first_timestamp(uint64_t this_ptr, int32_t val) {
31582 LDKGossipTimestampFilter this_ptr_conv;
31583 this_ptr_conv.inner = untag_ptr(this_ptr);
31584 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31585 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31586 this_ptr_conv.is_owned = false;
31587 GossipTimestampFilter_set_first_timestamp(&this_ptr_conv, val);
31590 int32_t __attribute__((export_name("TS_GossipTimestampFilter_get_timestamp_range"))) TS_GossipTimestampFilter_get_timestamp_range(uint64_t this_ptr) {
31591 LDKGossipTimestampFilter this_ptr_conv;
31592 this_ptr_conv.inner = untag_ptr(this_ptr);
31593 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31594 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31595 this_ptr_conv.is_owned = false;
31596 int32_t ret_conv = GossipTimestampFilter_get_timestamp_range(&this_ptr_conv);
31600 void __attribute__((export_name("TS_GossipTimestampFilter_set_timestamp_range"))) TS_GossipTimestampFilter_set_timestamp_range(uint64_t this_ptr, int32_t val) {
31601 LDKGossipTimestampFilter this_ptr_conv;
31602 this_ptr_conv.inner = untag_ptr(this_ptr);
31603 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31604 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31605 this_ptr_conv.is_owned = false;
31606 GossipTimestampFilter_set_timestamp_range(&this_ptr_conv, val);
31609 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) {
31610 LDKThirtyTwoBytes chain_hash_arg_ref;
31611 CHECK(chain_hash_arg->arr_len == 32);
31612 memcpy(chain_hash_arg_ref.data, chain_hash_arg->elems, 32); FREE(chain_hash_arg);
31613 LDKGossipTimestampFilter ret_var = GossipTimestampFilter_new(chain_hash_arg_ref, first_timestamp_arg, timestamp_range_arg);
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 GossipTimestampFilter_clone_ptr(LDKGossipTimestampFilter *NONNULL_PTR arg) {
31621 LDKGossipTimestampFilter ret_var = GossipTimestampFilter_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_GossipTimestampFilter_clone_ptr"))) TS_GossipTimestampFilter_clone_ptr(uint64_t arg) {
31628 LDKGossipTimestampFilter 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 = GossipTimestampFilter_clone_ptr(&arg_conv);
31637 uint64_t __attribute__((export_name("TS_GossipTimestampFilter_clone"))) TS_GossipTimestampFilter_clone(uint64_t orig) {
31638 LDKGossipTimestampFilter 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 LDKGossipTimestampFilter ret_var = GossipTimestampFilter_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_ErrorAction_free"))) TS_ErrorAction_free(uint64_t this_ptr) {
31651 if (!ptr_is_owned(this_ptr)) return;
31652 void* this_ptr_ptr = untag_ptr(this_ptr);
31653 CHECK_ACCESS(this_ptr_ptr);
31654 LDKErrorAction this_ptr_conv = *(LDKErrorAction*)(this_ptr_ptr);
31655 FREE(untag_ptr(this_ptr));
31656 ErrorAction_free(this_ptr_conv);
31659 static inline uint64_t ErrorAction_clone_ptr(LDKErrorAction *NONNULL_PTR arg) {
31660 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
31661 *ret_copy = ErrorAction_clone(arg);
31662 uint64_t ret_ref = tag_ptr(ret_copy, true);
31665 int64_t __attribute__((export_name("TS_ErrorAction_clone_ptr"))) TS_ErrorAction_clone_ptr(uint64_t arg) {
31666 LDKErrorAction* arg_conv = (LDKErrorAction*)untag_ptr(arg);
31667 int64_t ret_conv = ErrorAction_clone_ptr(arg_conv);
31671 uint64_t __attribute__((export_name("TS_ErrorAction_clone"))) TS_ErrorAction_clone(uint64_t orig) {
31672 LDKErrorAction* orig_conv = (LDKErrorAction*)untag_ptr(orig);
31673 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
31674 *ret_copy = ErrorAction_clone(orig_conv);
31675 uint64_t ret_ref = tag_ptr(ret_copy, true);
31679 uint64_t __attribute__((export_name("TS_ErrorAction_disconnect_peer"))) TS_ErrorAction_disconnect_peer(uint64_t msg) {
31680 LDKErrorMessage msg_conv;
31681 msg_conv.inner = untag_ptr(msg);
31682 msg_conv.is_owned = ptr_is_owned(msg);
31683 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
31684 msg_conv = ErrorMessage_clone(&msg_conv);
31685 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
31686 *ret_copy = ErrorAction_disconnect_peer(msg_conv);
31687 uint64_t ret_ref = tag_ptr(ret_copy, true);
31691 uint64_t __attribute__((export_name("TS_ErrorAction_ignore_error"))) TS_ErrorAction_ignore_error() {
31692 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
31693 *ret_copy = ErrorAction_ignore_error();
31694 uint64_t ret_ref = tag_ptr(ret_copy, true);
31698 uint64_t __attribute__((export_name("TS_ErrorAction_ignore_and_log"))) TS_ErrorAction_ignore_and_log(uint32_t a) {
31699 LDKLevel a_conv = LDKLevel_from_js(a);
31700 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
31701 *ret_copy = ErrorAction_ignore_and_log(a_conv);
31702 uint64_t ret_ref = tag_ptr(ret_copy, true);
31706 uint64_t __attribute__((export_name("TS_ErrorAction_ignore_duplicate_gossip"))) TS_ErrorAction_ignore_duplicate_gossip() {
31707 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
31708 *ret_copy = ErrorAction_ignore_duplicate_gossip();
31709 uint64_t ret_ref = tag_ptr(ret_copy, true);
31713 uint64_t __attribute__((export_name("TS_ErrorAction_send_error_message"))) TS_ErrorAction_send_error_message(uint64_t msg) {
31714 LDKErrorMessage msg_conv;
31715 msg_conv.inner = untag_ptr(msg);
31716 msg_conv.is_owned = ptr_is_owned(msg);
31717 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
31718 msg_conv = ErrorMessage_clone(&msg_conv);
31719 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
31720 *ret_copy = ErrorAction_send_error_message(msg_conv);
31721 uint64_t ret_ref = tag_ptr(ret_copy, true);
31725 uint64_t __attribute__((export_name("TS_ErrorAction_send_warning_message"))) TS_ErrorAction_send_warning_message(uint64_t msg, uint32_t log_level) {
31726 LDKWarningMessage msg_conv;
31727 msg_conv.inner = untag_ptr(msg);
31728 msg_conv.is_owned = ptr_is_owned(msg);
31729 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
31730 msg_conv = WarningMessage_clone(&msg_conv);
31731 LDKLevel log_level_conv = LDKLevel_from_js(log_level);
31732 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
31733 *ret_copy = ErrorAction_send_warning_message(msg_conv, log_level_conv);
31734 uint64_t ret_ref = tag_ptr(ret_copy, true);
31738 void __attribute__((export_name("TS_LightningError_free"))) TS_LightningError_free(uint64_t this_obj) {
31739 LDKLightningError this_obj_conv;
31740 this_obj_conv.inner = untag_ptr(this_obj);
31741 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31742 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31743 LightningError_free(this_obj_conv);
31746 jstring __attribute__((export_name("TS_LightningError_get_err"))) TS_LightningError_get_err(uint64_t this_ptr) {
31747 LDKLightningError this_ptr_conv;
31748 this_ptr_conv.inner = untag_ptr(this_ptr);
31749 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31750 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31751 this_ptr_conv.is_owned = false;
31752 LDKStr ret_str = LightningError_get_err(&this_ptr_conv);
31753 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
31758 void __attribute__((export_name("TS_LightningError_set_err"))) TS_LightningError_set_err(uint64_t this_ptr, jstring val) {
31759 LDKLightningError this_ptr_conv;
31760 this_ptr_conv.inner = untag_ptr(this_ptr);
31761 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31762 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31763 this_ptr_conv.is_owned = false;
31764 LDKStr val_conv = str_ref_to_owned_c(val);
31765 LightningError_set_err(&this_ptr_conv, val_conv);
31768 uint64_t __attribute__((export_name("TS_LightningError_get_action"))) TS_LightningError_get_action(uint64_t this_ptr) {
31769 LDKLightningError this_ptr_conv;
31770 this_ptr_conv.inner = untag_ptr(this_ptr);
31771 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31772 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31773 this_ptr_conv.is_owned = false;
31774 LDKErrorAction *ret_copy = MALLOC(sizeof(LDKErrorAction), "LDKErrorAction");
31775 *ret_copy = LightningError_get_action(&this_ptr_conv);
31776 uint64_t ret_ref = tag_ptr(ret_copy, true);
31780 void __attribute__((export_name("TS_LightningError_set_action"))) TS_LightningError_set_action(uint64_t this_ptr, uint64_t val) {
31781 LDKLightningError this_ptr_conv;
31782 this_ptr_conv.inner = untag_ptr(this_ptr);
31783 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31784 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31785 this_ptr_conv.is_owned = false;
31786 void* val_ptr = untag_ptr(val);
31787 CHECK_ACCESS(val_ptr);
31788 LDKErrorAction val_conv = *(LDKErrorAction*)(val_ptr);
31789 val_conv = ErrorAction_clone((LDKErrorAction*)untag_ptr(val));
31790 LightningError_set_action(&this_ptr_conv, val_conv);
31793 uint64_t __attribute__((export_name("TS_LightningError_new"))) TS_LightningError_new(jstring err_arg, uint64_t action_arg) {
31794 LDKStr err_arg_conv = str_ref_to_owned_c(err_arg);
31795 void* action_arg_ptr = untag_ptr(action_arg);
31796 CHECK_ACCESS(action_arg_ptr);
31797 LDKErrorAction action_arg_conv = *(LDKErrorAction*)(action_arg_ptr);
31798 action_arg_conv = ErrorAction_clone((LDKErrorAction*)untag_ptr(action_arg));
31799 LDKLightningError ret_var = LightningError_new(err_arg_conv, action_arg_conv);
31800 uint64_t ret_ref = 0;
31801 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31802 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31806 static inline uint64_t LightningError_clone_ptr(LDKLightningError *NONNULL_PTR arg) {
31807 LDKLightningError ret_var = LightningError_clone(arg);
31808 uint64_t ret_ref = 0;
31809 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31810 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31813 int64_t __attribute__((export_name("TS_LightningError_clone_ptr"))) TS_LightningError_clone_ptr(uint64_t arg) {
31814 LDKLightningError arg_conv;
31815 arg_conv.inner = untag_ptr(arg);
31816 arg_conv.is_owned = ptr_is_owned(arg);
31817 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
31818 arg_conv.is_owned = false;
31819 int64_t ret_conv = LightningError_clone_ptr(&arg_conv);
31823 uint64_t __attribute__((export_name("TS_LightningError_clone"))) TS_LightningError_clone(uint64_t orig) {
31824 LDKLightningError orig_conv;
31825 orig_conv.inner = untag_ptr(orig);
31826 orig_conv.is_owned = ptr_is_owned(orig);
31827 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
31828 orig_conv.is_owned = false;
31829 LDKLightningError ret_var = LightningError_clone(&orig_conv);
31830 uint64_t ret_ref = 0;
31831 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
31832 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
31836 void __attribute__((export_name("TS_CommitmentUpdate_free"))) TS_CommitmentUpdate_free(uint64_t this_obj) {
31837 LDKCommitmentUpdate this_obj_conv;
31838 this_obj_conv.inner = untag_ptr(this_obj);
31839 this_obj_conv.is_owned = ptr_is_owned(this_obj);
31840 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
31841 CommitmentUpdate_free(this_obj_conv);
31844 uint64_tArray __attribute__((export_name("TS_CommitmentUpdate_get_update_add_htlcs"))) TS_CommitmentUpdate_get_update_add_htlcs(uint64_t this_ptr) {
31845 LDKCommitmentUpdate this_ptr_conv;
31846 this_ptr_conv.inner = untag_ptr(this_ptr);
31847 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31848 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31849 this_ptr_conv.is_owned = false;
31850 LDKCVec_UpdateAddHTLCZ ret_var = CommitmentUpdate_get_update_add_htlcs(&this_ptr_conv);
31851 uint64_tArray ret_arr = NULL;
31852 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
31853 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
31854 for (size_t p = 0; p < ret_var.datalen; p++) {
31855 LDKUpdateAddHTLC ret_conv_15_var = ret_var.data[p];
31856 uint64_t ret_conv_15_ref = 0;
31857 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_15_var);
31858 ret_conv_15_ref = tag_ptr(ret_conv_15_var.inner, ret_conv_15_var.is_owned);
31859 ret_arr_ptr[p] = ret_conv_15_ref;
31862 FREE(ret_var.data);
31866 void __attribute__((export_name("TS_CommitmentUpdate_set_update_add_htlcs"))) TS_CommitmentUpdate_set_update_add_htlcs(uint64_t this_ptr, uint64_tArray val) {
31867 LDKCommitmentUpdate this_ptr_conv;
31868 this_ptr_conv.inner = untag_ptr(this_ptr);
31869 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31870 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31871 this_ptr_conv.is_owned = false;
31872 LDKCVec_UpdateAddHTLCZ val_constr;
31873 val_constr.datalen = val->arr_len;
31874 if (val_constr.datalen > 0)
31875 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements");
31877 val_constr.data = NULL;
31878 uint64_t* val_vals = val->elems;
31879 for (size_t p = 0; p < val_constr.datalen; p++) {
31880 uint64_t val_conv_15 = val_vals[p];
31881 LDKUpdateAddHTLC val_conv_15_conv;
31882 val_conv_15_conv.inner = untag_ptr(val_conv_15);
31883 val_conv_15_conv.is_owned = ptr_is_owned(val_conv_15);
31884 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_15_conv);
31885 val_conv_15_conv = UpdateAddHTLC_clone(&val_conv_15_conv);
31886 val_constr.data[p] = val_conv_15_conv;
31889 CommitmentUpdate_set_update_add_htlcs(&this_ptr_conv, val_constr);
31892 uint64_tArray __attribute__((export_name("TS_CommitmentUpdate_get_update_fulfill_htlcs"))) TS_CommitmentUpdate_get_update_fulfill_htlcs(uint64_t this_ptr) {
31893 LDKCommitmentUpdate this_ptr_conv;
31894 this_ptr_conv.inner = untag_ptr(this_ptr);
31895 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31896 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31897 this_ptr_conv.is_owned = false;
31898 LDKCVec_UpdateFulfillHTLCZ ret_var = CommitmentUpdate_get_update_fulfill_htlcs(&this_ptr_conv);
31899 uint64_tArray ret_arr = NULL;
31900 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
31901 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
31902 for (size_t t = 0; t < ret_var.datalen; t++) {
31903 LDKUpdateFulfillHTLC ret_conv_19_var = ret_var.data[t];
31904 uint64_t ret_conv_19_ref = 0;
31905 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_19_var);
31906 ret_conv_19_ref = tag_ptr(ret_conv_19_var.inner, ret_conv_19_var.is_owned);
31907 ret_arr_ptr[t] = ret_conv_19_ref;
31910 FREE(ret_var.data);
31914 void __attribute__((export_name("TS_CommitmentUpdate_set_update_fulfill_htlcs"))) TS_CommitmentUpdate_set_update_fulfill_htlcs(uint64_t this_ptr, uint64_tArray val) {
31915 LDKCommitmentUpdate this_ptr_conv;
31916 this_ptr_conv.inner = untag_ptr(this_ptr);
31917 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31918 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31919 this_ptr_conv.is_owned = false;
31920 LDKCVec_UpdateFulfillHTLCZ val_constr;
31921 val_constr.datalen = val->arr_len;
31922 if (val_constr.datalen > 0)
31923 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements");
31925 val_constr.data = NULL;
31926 uint64_t* val_vals = val->elems;
31927 for (size_t t = 0; t < val_constr.datalen; t++) {
31928 uint64_t val_conv_19 = val_vals[t];
31929 LDKUpdateFulfillHTLC val_conv_19_conv;
31930 val_conv_19_conv.inner = untag_ptr(val_conv_19);
31931 val_conv_19_conv.is_owned = ptr_is_owned(val_conv_19);
31932 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_19_conv);
31933 val_conv_19_conv = UpdateFulfillHTLC_clone(&val_conv_19_conv);
31934 val_constr.data[t] = val_conv_19_conv;
31937 CommitmentUpdate_set_update_fulfill_htlcs(&this_ptr_conv, val_constr);
31940 uint64_tArray __attribute__((export_name("TS_CommitmentUpdate_get_update_fail_htlcs"))) TS_CommitmentUpdate_get_update_fail_htlcs(uint64_t this_ptr) {
31941 LDKCommitmentUpdate this_ptr_conv;
31942 this_ptr_conv.inner = untag_ptr(this_ptr);
31943 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31944 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31945 this_ptr_conv.is_owned = false;
31946 LDKCVec_UpdateFailHTLCZ ret_var = CommitmentUpdate_get_update_fail_htlcs(&this_ptr_conv);
31947 uint64_tArray ret_arr = NULL;
31948 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
31949 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
31950 for (size_t q = 0; q < ret_var.datalen; q++) {
31951 LDKUpdateFailHTLC ret_conv_16_var = ret_var.data[q];
31952 uint64_t ret_conv_16_ref = 0;
31953 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_16_var);
31954 ret_conv_16_ref = tag_ptr(ret_conv_16_var.inner, ret_conv_16_var.is_owned);
31955 ret_arr_ptr[q] = ret_conv_16_ref;
31958 FREE(ret_var.data);
31962 void __attribute__((export_name("TS_CommitmentUpdate_set_update_fail_htlcs"))) TS_CommitmentUpdate_set_update_fail_htlcs(uint64_t this_ptr, uint64_tArray val) {
31963 LDKCommitmentUpdate this_ptr_conv;
31964 this_ptr_conv.inner = untag_ptr(this_ptr);
31965 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31966 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31967 this_ptr_conv.is_owned = false;
31968 LDKCVec_UpdateFailHTLCZ val_constr;
31969 val_constr.datalen = val->arr_len;
31970 if (val_constr.datalen > 0)
31971 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements");
31973 val_constr.data = NULL;
31974 uint64_t* val_vals = val->elems;
31975 for (size_t q = 0; q < val_constr.datalen; q++) {
31976 uint64_t val_conv_16 = val_vals[q];
31977 LDKUpdateFailHTLC val_conv_16_conv;
31978 val_conv_16_conv.inner = untag_ptr(val_conv_16);
31979 val_conv_16_conv.is_owned = ptr_is_owned(val_conv_16);
31980 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_16_conv);
31981 val_conv_16_conv = UpdateFailHTLC_clone(&val_conv_16_conv);
31982 val_constr.data[q] = val_conv_16_conv;
31985 CommitmentUpdate_set_update_fail_htlcs(&this_ptr_conv, val_constr);
31988 uint64_tArray __attribute__((export_name("TS_CommitmentUpdate_get_update_fail_malformed_htlcs"))) TS_CommitmentUpdate_get_update_fail_malformed_htlcs(uint64_t this_ptr) {
31989 LDKCommitmentUpdate this_ptr_conv;
31990 this_ptr_conv.inner = untag_ptr(this_ptr);
31991 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
31992 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
31993 this_ptr_conv.is_owned = false;
31994 LDKCVec_UpdateFailMalformedHTLCZ ret_var = CommitmentUpdate_get_update_fail_malformed_htlcs(&this_ptr_conv);
31995 uint64_tArray ret_arr = NULL;
31996 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
31997 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
31998 for (size_t z = 0; z < ret_var.datalen; z++) {
31999 LDKUpdateFailMalformedHTLC ret_conv_25_var = ret_var.data[z];
32000 uint64_t ret_conv_25_ref = 0;
32001 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_25_var);
32002 ret_conv_25_ref = tag_ptr(ret_conv_25_var.inner, ret_conv_25_var.is_owned);
32003 ret_arr_ptr[z] = ret_conv_25_ref;
32006 FREE(ret_var.data);
32010 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) {
32011 LDKCommitmentUpdate this_ptr_conv;
32012 this_ptr_conv.inner = untag_ptr(this_ptr);
32013 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32014 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32015 this_ptr_conv.is_owned = false;
32016 LDKCVec_UpdateFailMalformedHTLCZ val_constr;
32017 val_constr.datalen = val->arr_len;
32018 if (val_constr.datalen > 0)
32019 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements");
32021 val_constr.data = NULL;
32022 uint64_t* val_vals = val->elems;
32023 for (size_t z = 0; z < val_constr.datalen; z++) {
32024 uint64_t val_conv_25 = val_vals[z];
32025 LDKUpdateFailMalformedHTLC val_conv_25_conv;
32026 val_conv_25_conv.inner = untag_ptr(val_conv_25);
32027 val_conv_25_conv.is_owned = ptr_is_owned(val_conv_25);
32028 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_25_conv);
32029 val_conv_25_conv = UpdateFailMalformedHTLC_clone(&val_conv_25_conv);
32030 val_constr.data[z] = val_conv_25_conv;
32033 CommitmentUpdate_set_update_fail_malformed_htlcs(&this_ptr_conv, val_constr);
32036 uint64_t __attribute__((export_name("TS_CommitmentUpdate_get_update_fee"))) TS_CommitmentUpdate_get_update_fee(uint64_t this_ptr) {
32037 LDKCommitmentUpdate this_ptr_conv;
32038 this_ptr_conv.inner = untag_ptr(this_ptr);
32039 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32040 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32041 this_ptr_conv.is_owned = false;
32042 LDKUpdateFee ret_var = CommitmentUpdate_get_update_fee(&this_ptr_conv);
32043 uint64_t ret_ref = 0;
32044 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32045 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32049 void __attribute__((export_name("TS_CommitmentUpdate_set_update_fee"))) TS_CommitmentUpdate_set_update_fee(uint64_t this_ptr, uint64_t val) {
32050 LDKCommitmentUpdate this_ptr_conv;
32051 this_ptr_conv.inner = untag_ptr(this_ptr);
32052 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32053 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32054 this_ptr_conv.is_owned = false;
32055 LDKUpdateFee val_conv;
32056 val_conv.inner = untag_ptr(val);
32057 val_conv.is_owned = ptr_is_owned(val);
32058 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
32059 val_conv = UpdateFee_clone(&val_conv);
32060 CommitmentUpdate_set_update_fee(&this_ptr_conv, val_conv);
32063 uint64_t __attribute__((export_name("TS_CommitmentUpdate_get_commitment_signed"))) TS_CommitmentUpdate_get_commitment_signed(uint64_t this_ptr) {
32064 LDKCommitmentUpdate this_ptr_conv;
32065 this_ptr_conv.inner = untag_ptr(this_ptr);
32066 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32067 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32068 this_ptr_conv.is_owned = false;
32069 LDKCommitmentSigned ret_var = CommitmentUpdate_get_commitment_signed(&this_ptr_conv);
32070 uint64_t ret_ref = 0;
32071 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32072 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32076 void __attribute__((export_name("TS_CommitmentUpdate_set_commitment_signed"))) TS_CommitmentUpdate_set_commitment_signed(uint64_t this_ptr, uint64_t val) {
32077 LDKCommitmentUpdate this_ptr_conv;
32078 this_ptr_conv.inner = untag_ptr(this_ptr);
32079 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
32080 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
32081 this_ptr_conv.is_owned = false;
32082 LDKCommitmentSigned val_conv;
32083 val_conv.inner = untag_ptr(val);
32084 val_conv.is_owned = ptr_is_owned(val);
32085 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
32086 val_conv = CommitmentSigned_clone(&val_conv);
32087 CommitmentUpdate_set_commitment_signed(&this_ptr_conv, val_conv);
32090 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) {
32091 LDKCVec_UpdateAddHTLCZ update_add_htlcs_arg_constr;
32092 update_add_htlcs_arg_constr.datalen = update_add_htlcs_arg->arr_len;
32093 if (update_add_htlcs_arg_constr.datalen > 0)
32094 update_add_htlcs_arg_constr.data = MALLOC(update_add_htlcs_arg_constr.datalen * sizeof(LDKUpdateAddHTLC), "LDKCVec_UpdateAddHTLCZ Elements");
32096 update_add_htlcs_arg_constr.data = NULL;
32097 uint64_t* update_add_htlcs_arg_vals = update_add_htlcs_arg->elems;
32098 for (size_t p = 0; p < update_add_htlcs_arg_constr.datalen; p++) {
32099 uint64_t update_add_htlcs_arg_conv_15 = update_add_htlcs_arg_vals[p];
32100 LDKUpdateAddHTLC update_add_htlcs_arg_conv_15_conv;
32101 update_add_htlcs_arg_conv_15_conv.inner = untag_ptr(update_add_htlcs_arg_conv_15);
32102 update_add_htlcs_arg_conv_15_conv.is_owned = ptr_is_owned(update_add_htlcs_arg_conv_15);
32103 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_add_htlcs_arg_conv_15_conv);
32104 update_add_htlcs_arg_conv_15_conv = UpdateAddHTLC_clone(&update_add_htlcs_arg_conv_15_conv);
32105 update_add_htlcs_arg_constr.data[p] = update_add_htlcs_arg_conv_15_conv;
32107 FREE(update_add_htlcs_arg);
32108 LDKCVec_UpdateFulfillHTLCZ update_fulfill_htlcs_arg_constr;
32109 update_fulfill_htlcs_arg_constr.datalen = update_fulfill_htlcs_arg->arr_len;
32110 if (update_fulfill_htlcs_arg_constr.datalen > 0)
32111 update_fulfill_htlcs_arg_constr.data = MALLOC(update_fulfill_htlcs_arg_constr.datalen * sizeof(LDKUpdateFulfillHTLC), "LDKCVec_UpdateFulfillHTLCZ Elements");
32113 update_fulfill_htlcs_arg_constr.data = NULL;
32114 uint64_t* update_fulfill_htlcs_arg_vals = update_fulfill_htlcs_arg->elems;
32115 for (size_t t = 0; t < update_fulfill_htlcs_arg_constr.datalen; t++) {
32116 uint64_t update_fulfill_htlcs_arg_conv_19 = update_fulfill_htlcs_arg_vals[t];
32117 LDKUpdateFulfillHTLC update_fulfill_htlcs_arg_conv_19_conv;
32118 update_fulfill_htlcs_arg_conv_19_conv.inner = untag_ptr(update_fulfill_htlcs_arg_conv_19);
32119 update_fulfill_htlcs_arg_conv_19_conv.is_owned = ptr_is_owned(update_fulfill_htlcs_arg_conv_19);
32120 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fulfill_htlcs_arg_conv_19_conv);
32121 update_fulfill_htlcs_arg_conv_19_conv = UpdateFulfillHTLC_clone(&update_fulfill_htlcs_arg_conv_19_conv);
32122 update_fulfill_htlcs_arg_constr.data[t] = update_fulfill_htlcs_arg_conv_19_conv;
32124 FREE(update_fulfill_htlcs_arg);
32125 LDKCVec_UpdateFailHTLCZ update_fail_htlcs_arg_constr;
32126 update_fail_htlcs_arg_constr.datalen = update_fail_htlcs_arg->arr_len;
32127 if (update_fail_htlcs_arg_constr.datalen > 0)
32128 update_fail_htlcs_arg_constr.data = MALLOC(update_fail_htlcs_arg_constr.datalen * sizeof(LDKUpdateFailHTLC), "LDKCVec_UpdateFailHTLCZ Elements");
32130 update_fail_htlcs_arg_constr.data = NULL;
32131 uint64_t* update_fail_htlcs_arg_vals = update_fail_htlcs_arg->elems;
32132 for (size_t q = 0; q < update_fail_htlcs_arg_constr.datalen; q++) {
32133 uint64_t update_fail_htlcs_arg_conv_16 = update_fail_htlcs_arg_vals[q];
32134 LDKUpdateFailHTLC update_fail_htlcs_arg_conv_16_conv;
32135 update_fail_htlcs_arg_conv_16_conv.inner = untag_ptr(update_fail_htlcs_arg_conv_16);
32136 update_fail_htlcs_arg_conv_16_conv.is_owned = ptr_is_owned(update_fail_htlcs_arg_conv_16);
32137 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fail_htlcs_arg_conv_16_conv);
32138 update_fail_htlcs_arg_conv_16_conv = UpdateFailHTLC_clone(&update_fail_htlcs_arg_conv_16_conv);
32139 update_fail_htlcs_arg_constr.data[q] = update_fail_htlcs_arg_conv_16_conv;
32141 FREE(update_fail_htlcs_arg);
32142 LDKCVec_UpdateFailMalformedHTLCZ update_fail_malformed_htlcs_arg_constr;
32143 update_fail_malformed_htlcs_arg_constr.datalen = update_fail_malformed_htlcs_arg->arr_len;
32144 if (update_fail_malformed_htlcs_arg_constr.datalen > 0)
32145 update_fail_malformed_htlcs_arg_constr.data = MALLOC(update_fail_malformed_htlcs_arg_constr.datalen * sizeof(LDKUpdateFailMalformedHTLC), "LDKCVec_UpdateFailMalformedHTLCZ Elements");
32147 update_fail_malformed_htlcs_arg_constr.data = NULL;
32148 uint64_t* update_fail_malformed_htlcs_arg_vals = update_fail_malformed_htlcs_arg->elems;
32149 for (size_t z = 0; z < update_fail_malformed_htlcs_arg_constr.datalen; z++) {
32150 uint64_t update_fail_malformed_htlcs_arg_conv_25 = update_fail_malformed_htlcs_arg_vals[z];
32151 LDKUpdateFailMalformedHTLC update_fail_malformed_htlcs_arg_conv_25_conv;
32152 update_fail_malformed_htlcs_arg_conv_25_conv.inner = untag_ptr(update_fail_malformed_htlcs_arg_conv_25);
32153 update_fail_malformed_htlcs_arg_conv_25_conv.is_owned = ptr_is_owned(update_fail_malformed_htlcs_arg_conv_25);
32154 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fail_malformed_htlcs_arg_conv_25_conv);
32155 update_fail_malformed_htlcs_arg_conv_25_conv = UpdateFailMalformedHTLC_clone(&update_fail_malformed_htlcs_arg_conv_25_conv);
32156 update_fail_malformed_htlcs_arg_constr.data[z] = update_fail_malformed_htlcs_arg_conv_25_conv;
32158 FREE(update_fail_malformed_htlcs_arg);
32159 LDKUpdateFee update_fee_arg_conv;
32160 update_fee_arg_conv.inner = untag_ptr(update_fee_arg);
32161 update_fee_arg_conv.is_owned = ptr_is_owned(update_fee_arg);
32162 CHECK_INNER_FIELD_ACCESS_OR_NULL(update_fee_arg_conv);
32163 update_fee_arg_conv = UpdateFee_clone(&update_fee_arg_conv);
32164 LDKCommitmentSigned commitment_signed_arg_conv;
32165 commitment_signed_arg_conv.inner = untag_ptr(commitment_signed_arg);
32166 commitment_signed_arg_conv.is_owned = ptr_is_owned(commitment_signed_arg);
32167 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_signed_arg_conv);
32168 commitment_signed_arg_conv = CommitmentSigned_clone(&commitment_signed_arg_conv);
32169 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);
32170 uint64_t ret_ref = 0;
32171 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32172 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32176 static inline uint64_t CommitmentUpdate_clone_ptr(LDKCommitmentUpdate *NONNULL_PTR arg) {
32177 LDKCommitmentUpdate ret_var = CommitmentUpdate_clone(arg);
32178 uint64_t ret_ref = 0;
32179 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32180 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32183 int64_t __attribute__((export_name("TS_CommitmentUpdate_clone_ptr"))) TS_CommitmentUpdate_clone_ptr(uint64_t arg) {
32184 LDKCommitmentUpdate arg_conv;
32185 arg_conv.inner = untag_ptr(arg);
32186 arg_conv.is_owned = ptr_is_owned(arg);
32187 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
32188 arg_conv.is_owned = false;
32189 int64_t ret_conv = CommitmentUpdate_clone_ptr(&arg_conv);
32193 uint64_t __attribute__((export_name("TS_CommitmentUpdate_clone"))) TS_CommitmentUpdate_clone(uint64_t orig) {
32194 LDKCommitmentUpdate orig_conv;
32195 orig_conv.inner = untag_ptr(orig);
32196 orig_conv.is_owned = ptr_is_owned(orig);
32197 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
32198 orig_conv.is_owned = false;
32199 LDKCommitmentUpdate ret_var = CommitmentUpdate_clone(&orig_conv);
32200 uint64_t ret_ref = 0;
32201 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
32202 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
32206 void __attribute__((export_name("TS_ChannelMessageHandler_free"))) TS_ChannelMessageHandler_free(uint64_t this_ptr) {
32207 if (!ptr_is_owned(this_ptr)) return;
32208 void* this_ptr_ptr = untag_ptr(this_ptr);
32209 CHECK_ACCESS(this_ptr_ptr);
32210 LDKChannelMessageHandler this_ptr_conv = *(LDKChannelMessageHandler*)(this_ptr_ptr);
32211 FREE(untag_ptr(this_ptr));
32212 ChannelMessageHandler_free(this_ptr_conv);
32215 void __attribute__((export_name("TS_RoutingMessageHandler_free"))) TS_RoutingMessageHandler_free(uint64_t this_ptr) {
32216 if (!ptr_is_owned(this_ptr)) return;
32217 void* this_ptr_ptr = untag_ptr(this_ptr);
32218 CHECK_ACCESS(this_ptr_ptr);
32219 LDKRoutingMessageHandler this_ptr_conv = *(LDKRoutingMessageHandler*)(this_ptr_ptr);
32220 FREE(untag_ptr(this_ptr));
32221 RoutingMessageHandler_free(this_ptr_conv);
32224 int8_tArray __attribute__((export_name("TS_AcceptChannel_write"))) TS_AcceptChannel_write(uint64_t obj) {
32225 LDKAcceptChannel obj_conv;
32226 obj_conv.inner = untag_ptr(obj);
32227 obj_conv.is_owned = ptr_is_owned(obj);
32228 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32229 obj_conv.is_owned = false;
32230 LDKCVec_u8Z ret_var = AcceptChannel_write(&obj_conv);
32231 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32232 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32233 CVec_u8Z_free(ret_var);
32237 uint64_t __attribute__((export_name("TS_AcceptChannel_read"))) TS_AcceptChannel_read(int8_tArray ser) {
32238 LDKu8slice ser_ref;
32239 ser_ref.datalen = ser->arr_len;
32240 ser_ref.data = ser->elems;
32241 LDKCResult_AcceptChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AcceptChannelDecodeErrorZ), "LDKCResult_AcceptChannelDecodeErrorZ");
32242 *ret_conv = AcceptChannel_read(ser_ref);
32244 return tag_ptr(ret_conv, true);
32247 int8_tArray __attribute__((export_name("TS_AnnouncementSignatures_write"))) TS_AnnouncementSignatures_write(uint64_t obj) {
32248 LDKAnnouncementSignatures obj_conv;
32249 obj_conv.inner = untag_ptr(obj);
32250 obj_conv.is_owned = ptr_is_owned(obj);
32251 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32252 obj_conv.is_owned = false;
32253 LDKCVec_u8Z ret_var = AnnouncementSignatures_write(&obj_conv);
32254 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32255 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32256 CVec_u8Z_free(ret_var);
32260 uint64_t __attribute__((export_name("TS_AnnouncementSignatures_read"))) TS_AnnouncementSignatures_read(int8_tArray ser) {
32261 LDKu8slice ser_ref;
32262 ser_ref.datalen = ser->arr_len;
32263 ser_ref.data = ser->elems;
32264 LDKCResult_AnnouncementSignaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_AnnouncementSignaturesDecodeErrorZ), "LDKCResult_AnnouncementSignaturesDecodeErrorZ");
32265 *ret_conv = AnnouncementSignatures_read(ser_ref);
32267 return tag_ptr(ret_conv, true);
32270 int8_tArray __attribute__((export_name("TS_ChannelReestablish_write"))) TS_ChannelReestablish_write(uint64_t obj) {
32271 LDKChannelReestablish obj_conv;
32272 obj_conv.inner = untag_ptr(obj);
32273 obj_conv.is_owned = ptr_is_owned(obj);
32274 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32275 obj_conv.is_owned = false;
32276 LDKCVec_u8Z ret_var = ChannelReestablish_write(&obj_conv);
32277 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32278 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32279 CVec_u8Z_free(ret_var);
32283 uint64_t __attribute__((export_name("TS_ChannelReestablish_read"))) TS_ChannelReestablish_read(int8_tArray ser) {
32284 LDKu8slice ser_ref;
32285 ser_ref.datalen = ser->arr_len;
32286 ser_ref.data = ser->elems;
32287 LDKCResult_ChannelReestablishDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReestablishDecodeErrorZ), "LDKCResult_ChannelReestablishDecodeErrorZ");
32288 *ret_conv = ChannelReestablish_read(ser_ref);
32290 return tag_ptr(ret_conv, true);
32293 int8_tArray __attribute__((export_name("TS_ClosingSigned_write"))) TS_ClosingSigned_write(uint64_t obj) {
32294 LDKClosingSigned obj_conv;
32295 obj_conv.inner = untag_ptr(obj);
32296 obj_conv.is_owned = ptr_is_owned(obj);
32297 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32298 obj_conv.is_owned = false;
32299 LDKCVec_u8Z ret_var = ClosingSigned_write(&obj_conv);
32300 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32301 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32302 CVec_u8Z_free(ret_var);
32306 uint64_t __attribute__((export_name("TS_ClosingSigned_read"))) TS_ClosingSigned_read(int8_tArray ser) {
32307 LDKu8slice ser_ref;
32308 ser_ref.datalen = ser->arr_len;
32309 ser_ref.data = ser->elems;
32310 LDKCResult_ClosingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedDecodeErrorZ), "LDKCResult_ClosingSignedDecodeErrorZ");
32311 *ret_conv = ClosingSigned_read(ser_ref);
32313 return tag_ptr(ret_conv, true);
32316 int8_tArray __attribute__((export_name("TS_ClosingSignedFeeRange_write"))) TS_ClosingSignedFeeRange_write(uint64_t obj) {
32317 LDKClosingSignedFeeRange obj_conv;
32318 obj_conv.inner = untag_ptr(obj);
32319 obj_conv.is_owned = ptr_is_owned(obj);
32320 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32321 obj_conv.is_owned = false;
32322 LDKCVec_u8Z ret_var = ClosingSignedFeeRange_write(&obj_conv);
32323 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32324 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32325 CVec_u8Z_free(ret_var);
32329 uint64_t __attribute__((export_name("TS_ClosingSignedFeeRange_read"))) TS_ClosingSignedFeeRange_read(int8_tArray ser) {
32330 LDKu8slice ser_ref;
32331 ser_ref.datalen = ser->arr_len;
32332 ser_ref.data = ser->elems;
32333 LDKCResult_ClosingSignedFeeRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ClosingSignedFeeRangeDecodeErrorZ), "LDKCResult_ClosingSignedFeeRangeDecodeErrorZ");
32334 *ret_conv = ClosingSignedFeeRange_read(ser_ref);
32336 return tag_ptr(ret_conv, true);
32339 int8_tArray __attribute__((export_name("TS_CommitmentSigned_write"))) TS_CommitmentSigned_write(uint64_t obj) {
32340 LDKCommitmentSigned obj_conv;
32341 obj_conv.inner = untag_ptr(obj);
32342 obj_conv.is_owned = ptr_is_owned(obj);
32343 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32344 obj_conv.is_owned = false;
32345 LDKCVec_u8Z ret_var = CommitmentSigned_write(&obj_conv);
32346 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32347 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32348 CVec_u8Z_free(ret_var);
32352 uint64_t __attribute__((export_name("TS_CommitmentSigned_read"))) TS_CommitmentSigned_read(int8_tArray ser) {
32353 LDKu8slice ser_ref;
32354 ser_ref.datalen = ser->arr_len;
32355 ser_ref.data = ser->elems;
32356 LDKCResult_CommitmentSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentSignedDecodeErrorZ), "LDKCResult_CommitmentSignedDecodeErrorZ");
32357 *ret_conv = CommitmentSigned_read(ser_ref);
32359 return tag_ptr(ret_conv, true);
32362 int8_tArray __attribute__((export_name("TS_FundingCreated_write"))) TS_FundingCreated_write(uint64_t obj) {
32363 LDKFundingCreated obj_conv;
32364 obj_conv.inner = untag_ptr(obj);
32365 obj_conv.is_owned = ptr_is_owned(obj);
32366 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32367 obj_conv.is_owned = false;
32368 LDKCVec_u8Z ret_var = FundingCreated_write(&obj_conv);
32369 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32370 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32371 CVec_u8Z_free(ret_var);
32375 uint64_t __attribute__((export_name("TS_FundingCreated_read"))) TS_FundingCreated_read(int8_tArray ser) {
32376 LDKu8slice ser_ref;
32377 ser_ref.datalen = ser->arr_len;
32378 ser_ref.data = ser->elems;
32379 LDKCResult_FundingCreatedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingCreatedDecodeErrorZ), "LDKCResult_FundingCreatedDecodeErrorZ");
32380 *ret_conv = FundingCreated_read(ser_ref);
32382 return tag_ptr(ret_conv, true);
32385 int8_tArray __attribute__((export_name("TS_FundingSigned_write"))) TS_FundingSigned_write(uint64_t obj) {
32386 LDKFundingSigned obj_conv;
32387 obj_conv.inner = untag_ptr(obj);
32388 obj_conv.is_owned = ptr_is_owned(obj);
32389 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32390 obj_conv.is_owned = false;
32391 LDKCVec_u8Z ret_var = FundingSigned_write(&obj_conv);
32392 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32393 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32394 CVec_u8Z_free(ret_var);
32398 uint64_t __attribute__((export_name("TS_FundingSigned_read"))) TS_FundingSigned_read(int8_tArray ser) {
32399 LDKu8slice ser_ref;
32400 ser_ref.datalen = ser->arr_len;
32401 ser_ref.data = ser->elems;
32402 LDKCResult_FundingSignedDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FundingSignedDecodeErrorZ), "LDKCResult_FundingSignedDecodeErrorZ");
32403 *ret_conv = FundingSigned_read(ser_ref);
32405 return tag_ptr(ret_conv, true);
32408 int8_tArray __attribute__((export_name("TS_ChannelReady_write"))) TS_ChannelReady_write(uint64_t obj) {
32409 LDKChannelReady obj_conv;
32410 obj_conv.inner = untag_ptr(obj);
32411 obj_conv.is_owned = ptr_is_owned(obj);
32412 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32413 obj_conv.is_owned = false;
32414 LDKCVec_u8Z ret_var = ChannelReady_write(&obj_conv);
32415 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32416 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32417 CVec_u8Z_free(ret_var);
32421 uint64_t __attribute__((export_name("TS_ChannelReady_read"))) TS_ChannelReady_read(int8_tArray ser) {
32422 LDKu8slice ser_ref;
32423 ser_ref.datalen = ser->arr_len;
32424 ser_ref.data = ser->elems;
32425 LDKCResult_ChannelReadyDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelReadyDecodeErrorZ), "LDKCResult_ChannelReadyDecodeErrorZ");
32426 *ret_conv = ChannelReady_read(ser_ref);
32428 return tag_ptr(ret_conv, true);
32431 int8_tArray __attribute__((export_name("TS_Init_write"))) TS_Init_write(uint64_t obj) {
32433 obj_conv.inner = untag_ptr(obj);
32434 obj_conv.is_owned = ptr_is_owned(obj);
32435 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32436 obj_conv.is_owned = false;
32437 LDKCVec_u8Z ret_var = Init_write(&obj_conv);
32438 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32439 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32440 CVec_u8Z_free(ret_var);
32444 uint64_t __attribute__((export_name("TS_Init_read"))) TS_Init_read(int8_tArray ser) {
32445 LDKu8slice ser_ref;
32446 ser_ref.datalen = ser->arr_len;
32447 ser_ref.data = ser->elems;
32448 LDKCResult_InitDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitDecodeErrorZ), "LDKCResult_InitDecodeErrorZ");
32449 *ret_conv = Init_read(ser_ref);
32451 return tag_ptr(ret_conv, true);
32454 int8_tArray __attribute__((export_name("TS_OpenChannel_write"))) TS_OpenChannel_write(uint64_t obj) {
32455 LDKOpenChannel obj_conv;
32456 obj_conv.inner = untag_ptr(obj);
32457 obj_conv.is_owned = ptr_is_owned(obj);
32458 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32459 obj_conv.is_owned = false;
32460 LDKCVec_u8Z ret_var = OpenChannel_write(&obj_conv);
32461 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32462 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32463 CVec_u8Z_free(ret_var);
32467 uint64_t __attribute__((export_name("TS_OpenChannel_read"))) TS_OpenChannel_read(int8_tArray ser) {
32468 LDKu8slice ser_ref;
32469 ser_ref.datalen = ser->arr_len;
32470 ser_ref.data = ser->elems;
32471 LDKCResult_OpenChannelDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_OpenChannelDecodeErrorZ), "LDKCResult_OpenChannelDecodeErrorZ");
32472 *ret_conv = OpenChannel_read(ser_ref);
32474 return tag_ptr(ret_conv, true);
32477 int8_tArray __attribute__((export_name("TS_RevokeAndACK_write"))) TS_RevokeAndACK_write(uint64_t obj) {
32478 LDKRevokeAndACK obj_conv;
32479 obj_conv.inner = untag_ptr(obj);
32480 obj_conv.is_owned = ptr_is_owned(obj);
32481 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32482 obj_conv.is_owned = false;
32483 LDKCVec_u8Z ret_var = RevokeAndACK_write(&obj_conv);
32484 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32485 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32486 CVec_u8Z_free(ret_var);
32490 uint64_t __attribute__((export_name("TS_RevokeAndACK_read"))) TS_RevokeAndACK_read(int8_tArray ser) {
32491 LDKu8slice ser_ref;
32492 ser_ref.datalen = ser->arr_len;
32493 ser_ref.data = ser->elems;
32494 LDKCResult_RevokeAndACKDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RevokeAndACKDecodeErrorZ), "LDKCResult_RevokeAndACKDecodeErrorZ");
32495 *ret_conv = RevokeAndACK_read(ser_ref);
32497 return tag_ptr(ret_conv, true);
32500 int8_tArray __attribute__((export_name("TS_Shutdown_write"))) TS_Shutdown_write(uint64_t obj) {
32501 LDKShutdown obj_conv;
32502 obj_conv.inner = untag_ptr(obj);
32503 obj_conv.is_owned = ptr_is_owned(obj);
32504 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32505 obj_conv.is_owned = false;
32506 LDKCVec_u8Z ret_var = Shutdown_write(&obj_conv);
32507 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32508 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32509 CVec_u8Z_free(ret_var);
32513 uint64_t __attribute__((export_name("TS_Shutdown_read"))) TS_Shutdown_read(int8_tArray ser) {
32514 LDKu8slice ser_ref;
32515 ser_ref.datalen = ser->arr_len;
32516 ser_ref.data = ser->elems;
32517 LDKCResult_ShutdownDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownDecodeErrorZ), "LDKCResult_ShutdownDecodeErrorZ");
32518 *ret_conv = Shutdown_read(ser_ref);
32520 return tag_ptr(ret_conv, true);
32523 int8_tArray __attribute__((export_name("TS_UpdateFailHTLC_write"))) TS_UpdateFailHTLC_write(uint64_t obj) {
32524 LDKUpdateFailHTLC obj_conv;
32525 obj_conv.inner = untag_ptr(obj);
32526 obj_conv.is_owned = ptr_is_owned(obj);
32527 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32528 obj_conv.is_owned = false;
32529 LDKCVec_u8Z ret_var = UpdateFailHTLC_write(&obj_conv);
32530 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32531 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32532 CVec_u8Z_free(ret_var);
32536 uint64_t __attribute__((export_name("TS_UpdateFailHTLC_read"))) TS_UpdateFailHTLC_read(int8_tArray ser) {
32537 LDKu8slice ser_ref;
32538 ser_ref.datalen = ser->arr_len;
32539 ser_ref.data = ser->elems;
32540 LDKCResult_UpdateFailHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailHTLCDecodeErrorZ), "LDKCResult_UpdateFailHTLCDecodeErrorZ");
32541 *ret_conv = UpdateFailHTLC_read(ser_ref);
32543 return tag_ptr(ret_conv, true);
32546 int8_tArray __attribute__((export_name("TS_UpdateFailMalformedHTLC_write"))) TS_UpdateFailMalformedHTLC_write(uint64_t obj) {
32547 LDKUpdateFailMalformedHTLC obj_conv;
32548 obj_conv.inner = untag_ptr(obj);
32549 obj_conv.is_owned = ptr_is_owned(obj);
32550 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32551 obj_conv.is_owned = false;
32552 LDKCVec_u8Z ret_var = UpdateFailMalformedHTLC_write(&obj_conv);
32553 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32554 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32555 CVec_u8Z_free(ret_var);
32559 uint64_t __attribute__((export_name("TS_UpdateFailMalformedHTLC_read"))) TS_UpdateFailMalformedHTLC_read(int8_tArray ser) {
32560 LDKu8slice ser_ref;
32561 ser_ref.datalen = ser->arr_len;
32562 ser_ref.data = ser->elems;
32563 LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ), "LDKCResult_UpdateFailMalformedHTLCDecodeErrorZ");
32564 *ret_conv = UpdateFailMalformedHTLC_read(ser_ref);
32566 return tag_ptr(ret_conv, true);
32569 int8_tArray __attribute__((export_name("TS_UpdateFee_write"))) TS_UpdateFee_write(uint64_t obj) {
32570 LDKUpdateFee obj_conv;
32571 obj_conv.inner = untag_ptr(obj);
32572 obj_conv.is_owned = ptr_is_owned(obj);
32573 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32574 obj_conv.is_owned = false;
32575 LDKCVec_u8Z ret_var = UpdateFee_write(&obj_conv);
32576 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32577 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32578 CVec_u8Z_free(ret_var);
32582 uint64_t __attribute__((export_name("TS_UpdateFee_read"))) TS_UpdateFee_read(int8_tArray ser) {
32583 LDKu8slice ser_ref;
32584 ser_ref.datalen = ser->arr_len;
32585 ser_ref.data = ser->elems;
32586 LDKCResult_UpdateFeeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFeeDecodeErrorZ), "LDKCResult_UpdateFeeDecodeErrorZ");
32587 *ret_conv = UpdateFee_read(ser_ref);
32589 return tag_ptr(ret_conv, true);
32592 int8_tArray __attribute__((export_name("TS_UpdateFulfillHTLC_write"))) TS_UpdateFulfillHTLC_write(uint64_t obj) {
32593 LDKUpdateFulfillHTLC obj_conv;
32594 obj_conv.inner = untag_ptr(obj);
32595 obj_conv.is_owned = ptr_is_owned(obj);
32596 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32597 obj_conv.is_owned = false;
32598 LDKCVec_u8Z ret_var = UpdateFulfillHTLC_write(&obj_conv);
32599 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32600 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32601 CVec_u8Z_free(ret_var);
32605 uint64_t __attribute__((export_name("TS_UpdateFulfillHTLC_read"))) TS_UpdateFulfillHTLC_read(int8_tArray ser) {
32606 LDKu8slice ser_ref;
32607 ser_ref.datalen = ser->arr_len;
32608 ser_ref.data = ser->elems;
32609 LDKCResult_UpdateFulfillHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateFulfillHTLCDecodeErrorZ), "LDKCResult_UpdateFulfillHTLCDecodeErrorZ");
32610 *ret_conv = UpdateFulfillHTLC_read(ser_ref);
32612 return tag_ptr(ret_conv, true);
32615 int8_tArray __attribute__((export_name("TS_UpdateAddHTLC_write"))) TS_UpdateAddHTLC_write(uint64_t obj) {
32616 LDKUpdateAddHTLC obj_conv;
32617 obj_conv.inner = untag_ptr(obj);
32618 obj_conv.is_owned = ptr_is_owned(obj);
32619 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32620 obj_conv.is_owned = false;
32621 LDKCVec_u8Z ret_var = UpdateAddHTLC_write(&obj_conv);
32622 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32623 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32624 CVec_u8Z_free(ret_var);
32628 uint64_t __attribute__((export_name("TS_UpdateAddHTLC_read"))) TS_UpdateAddHTLC_read(int8_tArray ser) {
32629 LDKu8slice ser_ref;
32630 ser_ref.datalen = ser->arr_len;
32631 ser_ref.data = ser->elems;
32632 LDKCResult_UpdateAddHTLCDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UpdateAddHTLCDecodeErrorZ), "LDKCResult_UpdateAddHTLCDecodeErrorZ");
32633 *ret_conv = UpdateAddHTLC_read(ser_ref);
32635 return tag_ptr(ret_conv, true);
32638 int8_tArray __attribute__((export_name("TS_Ping_write"))) TS_Ping_write(uint64_t obj) {
32640 obj_conv.inner = untag_ptr(obj);
32641 obj_conv.is_owned = ptr_is_owned(obj);
32642 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32643 obj_conv.is_owned = false;
32644 LDKCVec_u8Z ret_var = Ping_write(&obj_conv);
32645 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32646 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32647 CVec_u8Z_free(ret_var);
32651 uint64_t __attribute__((export_name("TS_Ping_read"))) TS_Ping_read(int8_tArray ser) {
32652 LDKu8slice ser_ref;
32653 ser_ref.datalen = ser->arr_len;
32654 ser_ref.data = ser->elems;
32655 LDKCResult_PingDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PingDecodeErrorZ), "LDKCResult_PingDecodeErrorZ");
32656 *ret_conv = Ping_read(ser_ref);
32658 return tag_ptr(ret_conv, true);
32661 int8_tArray __attribute__((export_name("TS_Pong_write"))) TS_Pong_write(uint64_t obj) {
32663 obj_conv.inner = untag_ptr(obj);
32664 obj_conv.is_owned = ptr_is_owned(obj);
32665 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32666 obj_conv.is_owned = false;
32667 LDKCVec_u8Z ret_var = Pong_write(&obj_conv);
32668 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32669 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32670 CVec_u8Z_free(ret_var);
32674 uint64_t __attribute__((export_name("TS_Pong_read"))) TS_Pong_read(int8_tArray ser) {
32675 LDKu8slice ser_ref;
32676 ser_ref.datalen = ser->arr_len;
32677 ser_ref.data = ser->elems;
32678 LDKCResult_PongDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PongDecodeErrorZ), "LDKCResult_PongDecodeErrorZ");
32679 *ret_conv = Pong_read(ser_ref);
32681 return tag_ptr(ret_conv, true);
32684 int8_tArray __attribute__((export_name("TS_UnsignedChannelAnnouncement_write"))) TS_UnsignedChannelAnnouncement_write(uint64_t obj) {
32685 LDKUnsignedChannelAnnouncement obj_conv;
32686 obj_conv.inner = untag_ptr(obj);
32687 obj_conv.is_owned = ptr_is_owned(obj);
32688 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32689 obj_conv.is_owned = false;
32690 LDKCVec_u8Z ret_var = UnsignedChannelAnnouncement_write(&obj_conv);
32691 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32692 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32693 CVec_u8Z_free(ret_var);
32697 uint64_t __attribute__((export_name("TS_UnsignedChannelAnnouncement_read"))) TS_UnsignedChannelAnnouncement_read(int8_tArray ser) {
32698 LDKu8slice ser_ref;
32699 ser_ref.datalen = ser->arr_len;
32700 ser_ref.data = ser->elems;
32701 LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ), "LDKCResult_UnsignedChannelAnnouncementDecodeErrorZ");
32702 *ret_conv = UnsignedChannelAnnouncement_read(ser_ref);
32704 return tag_ptr(ret_conv, true);
32707 int8_tArray __attribute__((export_name("TS_ChannelAnnouncement_write"))) TS_ChannelAnnouncement_write(uint64_t obj) {
32708 LDKChannelAnnouncement obj_conv;
32709 obj_conv.inner = untag_ptr(obj);
32710 obj_conv.is_owned = ptr_is_owned(obj);
32711 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32712 obj_conv.is_owned = false;
32713 LDKCVec_u8Z ret_var = ChannelAnnouncement_write(&obj_conv);
32714 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32715 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32716 CVec_u8Z_free(ret_var);
32720 uint64_t __attribute__((export_name("TS_ChannelAnnouncement_read"))) TS_ChannelAnnouncement_read(int8_tArray ser) {
32721 LDKu8slice ser_ref;
32722 ser_ref.datalen = ser->arr_len;
32723 ser_ref.data = ser->elems;
32724 LDKCResult_ChannelAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelAnnouncementDecodeErrorZ), "LDKCResult_ChannelAnnouncementDecodeErrorZ");
32725 *ret_conv = ChannelAnnouncement_read(ser_ref);
32727 return tag_ptr(ret_conv, true);
32730 int8_tArray __attribute__((export_name("TS_UnsignedChannelUpdate_write"))) TS_UnsignedChannelUpdate_write(uint64_t obj) {
32731 LDKUnsignedChannelUpdate obj_conv;
32732 obj_conv.inner = untag_ptr(obj);
32733 obj_conv.is_owned = ptr_is_owned(obj);
32734 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32735 obj_conv.is_owned = false;
32736 LDKCVec_u8Z ret_var = UnsignedChannelUpdate_write(&obj_conv);
32737 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32738 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32739 CVec_u8Z_free(ret_var);
32743 uint64_t __attribute__((export_name("TS_UnsignedChannelUpdate_read"))) TS_UnsignedChannelUpdate_read(int8_tArray ser) {
32744 LDKu8slice ser_ref;
32745 ser_ref.datalen = ser->arr_len;
32746 ser_ref.data = ser->elems;
32747 LDKCResult_UnsignedChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedChannelUpdateDecodeErrorZ), "LDKCResult_UnsignedChannelUpdateDecodeErrorZ");
32748 *ret_conv = UnsignedChannelUpdate_read(ser_ref);
32750 return tag_ptr(ret_conv, true);
32753 int8_tArray __attribute__((export_name("TS_ChannelUpdate_write"))) TS_ChannelUpdate_write(uint64_t obj) {
32754 LDKChannelUpdate obj_conv;
32755 obj_conv.inner = untag_ptr(obj);
32756 obj_conv.is_owned = ptr_is_owned(obj);
32757 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32758 obj_conv.is_owned = false;
32759 LDKCVec_u8Z ret_var = ChannelUpdate_write(&obj_conv);
32760 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32761 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32762 CVec_u8Z_free(ret_var);
32766 uint64_t __attribute__((export_name("TS_ChannelUpdate_read"))) TS_ChannelUpdate_read(int8_tArray ser) {
32767 LDKu8slice ser_ref;
32768 ser_ref.datalen = ser->arr_len;
32769 ser_ref.data = ser->elems;
32770 LDKCResult_ChannelUpdateDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateDecodeErrorZ), "LDKCResult_ChannelUpdateDecodeErrorZ");
32771 *ret_conv = ChannelUpdate_read(ser_ref);
32773 return tag_ptr(ret_conv, true);
32776 int8_tArray __attribute__((export_name("TS_ErrorMessage_write"))) TS_ErrorMessage_write(uint64_t obj) {
32777 LDKErrorMessage obj_conv;
32778 obj_conv.inner = untag_ptr(obj);
32779 obj_conv.is_owned = ptr_is_owned(obj);
32780 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32781 obj_conv.is_owned = false;
32782 LDKCVec_u8Z ret_var = ErrorMessage_write(&obj_conv);
32783 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32784 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32785 CVec_u8Z_free(ret_var);
32789 uint64_t __attribute__((export_name("TS_ErrorMessage_read"))) TS_ErrorMessage_read(int8_tArray ser) {
32790 LDKu8slice ser_ref;
32791 ser_ref.datalen = ser->arr_len;
32792 ser_ref.data = ser->elems;
32793 LDKCResult_ErrorMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ErrorMessageDecodeErrorZ), "LDKCResult_ErrorMessageDecodeErrorZ");
32794 *ret_conv = ErrorMessage_read(ser_ref);
32796 return tag_ptr(ret_conv, true);
32799 int8_tArray __attribute__((export_name("TS_WarningMessage_write"))) TS_WarningMessage_write(uint64_t obj) {
32800 LDKWarningMessage obj_conv;
32801 obj_conv.inner = untag_ptr(obj);
32802 obj_conv.is_owned = ptr_is_owned(obj);
32803 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32804 obj_conv.is_owned = false;
32805 LDKCVec_u8Z ret_var = WarningMessage_write(&obj_conv);
32806 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32807 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32808 CVec_u8Z_free(ret_var);
32812 uint64_t __attribute__((export_name("TS_WarningMessage_read"))) TS_WarningMessage_read(int8_tArray ser) {
32813 LDKu8slice ser_ref;
32814 ser_ref.datalen = ser->arr_len;
32815 ser_ref.data = ser->elems;
32816 LDKCResult_WarningMessageDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_WarningMessageDecodeErrorZ), "LDKCResult_WarningMessageDecodeErrorZ");
32817 *ret_conv = WarningMessage_read(ser_ref);
32819 return tag_ptr(ret_conv, true);
32822 int8_tArray __attribute__((export_name("TS_UnsignedNodeAnnouncement_write"))) TS_UnsignedNodeAnnouncement_write(uint64_t obj) {
32823 LDKUnsignedNodeAnnouncement obj_conv;
32824 obj_conv.inner = untag_ptr(obj);
32825 obj_conv.is_owned = ptr_is_owned(obj);
32826 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32827 obj_conv.is_owned = false;
32828 LDKCVec_u8Z ret_var = UnsignedNodeAnnouncement_write(&obj_conv);
32829 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32830 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32831 CVec_u8Z_free(ret_var);
32835 uint64_t __attribute__((export_name("TS_UnsignedNodeAnnouncement_read"))) TS_UnsignedNodeAnnouncement_read(int8_tArray ser) {
32836 LDKu8slice ser_ref;
32837 ser_ref.datalen = ser->arr_len;
32838 ser_ref.data = ser->elems;
32839 LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ), "LDKCResult_UnsignedNodeAnnouncementDecodeErrorZ");
32840 *ret_conv = UnsignedNodeAnnouncement_read(ser_ref);
32842 return tag_ptr(ret_conv, true);
32845 int8_tArray __attribute__((export_name("TS_NodeAnnouncement_write"))) TS_NodeAnnouncement_write(uint64_t obj) {
32846 LDKNodeAnnouncement obj_conv;
32847 obj_conv.inner = untag_ptr(obj);
32848 obj_conv.is_owned = ptr_is_owned(obj);
32849 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32850 obj_conv.is_owned = false;
32851 LDKCVec_u8Z ret_var = NodeAnnouncement_write(&obj_conv);
32852 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32853 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32854 CVec_u8Z_free(ret_var);
32858 uint64_t __attribute__((export_name("TS_NodeAnnouncement_read"))) TS_NodeAnnouncement_read(int8_tArray ser) {
32859 LDKu8slice ser_ref;
32860 ser_ref.datalen = ser->arr_len;
32861 ser_ref.data = ser->elems;
32862 LDKCResult_NodeAnnouncementDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementDecodeErrorZ), "LDKCResult_NodeAnnouncementDecodeErrorZ");
32863 *ret_conv = NodeAnnouncement_read(ser_ref);
32865 return tag_ptr(ret_conv, true);
32868 uint64_t __attribute__((export_name("TS_QueryShortChannelIds_read"))) TS_QueryShortChannelIds_read(int8_tArray ser) {
32869 LDKu8slice ser_ref;
32870 ser_ref.datalen = ser->arr_len;
32871 ser_ref.data = ser->elems;
32872 LDKCResult_QueryShortChannelIdsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryShortChannelIdsDecodeErrorZ), "LDKCResult_QueryShortChannelIdsDecodeErrorZ");
32873 *ret_conv = QueryShortChannelIds_read(ser_ref);
32875 return tag_ptr(ret_conv, true);
32878 int8_tArray __attribute__((export_name("TS_QueryShortChannelIds_write"))) TS_QueryShortChannelIds_write(uint64_t obj) {
32879 LDKQueryShortChannelIds obj_conv;
32880 obj_conv.inner = untag_ptr(obj);
32881 obj_conv.is_owned = ptr_is_owned(obj);
32882 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32883 obj_conv.is_owned = false;
32884 LDKCVec_u8Z ret_var = QueryShortChannelIds_write(&obj_conv);
32885 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32886 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32887 CVec_u8Z_free(ret_var);
32891 int8_tArray __attribute__((export_name("TS_ReplyShortChannelIdsEnd_write"))) TS_ReplyShortChannelIdsEnd_write(uint64_t obj) {
32892 LDKReplyShortChannelIdsEnd obj_conv;
32893 obj_conv.inner = untag_ptr(obj);
32894 obj_conv.is_owned = ptr_is_owned(obj);
32895 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32896 obj_conv.is_owned = false;
32897 LDKCVec_u8Z ret_var = ReplyShortChannelIdsEnd_write(&obj_conv);
32898 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32899 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32900 CVec_u8Z_free(ret_var);
32904 uint64_t __attribute__((export_name("TS_ReplyShortChannelIdsEnd_read"))) TS_ReplyShortChannelIdsEnd_read(int8_tArray ser) {
32905 LDKu8slice ser_ref;
32906 ser_ref.datalen = ser->arr_len;
32907 ser_ref.data = ser->elems;
32908 LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ), "LDKCResult_ReplyShortChannelIdsEndDecodeErrorZ");
32909 *ret_conv = ReplyShortChannelIdsEnd_read(ser_ref);
32911 return tag_ptr(ret_conv, true);
32914 int32_t __attribute__((export_name("TS_QueryChannelRange_end_blocknum"))) TS_QueryChannelRange_end_blocknum(uint64_t this_arg) {
32915 LDKQueryChannelRange this_arg_conv;
32916 this_arg_conv.inner = untag_ptr(this_arg);
32917 this_arg_conv.is_owned = ptr_is_owned(this_arg);
32918 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
32919 this_arg_conv.is_owned = false;
32920 int32_t ret_conv = QueryChannelRange_end_blocknum(&this_arg_conv);
32924 int8_tArray __attribute__((export_name("TS_QueryChannelRange_write"))) TS_QueryChannelRange_write(uint64_t obj) {
32925 LDKQueryChannelRange obj_conv;
32926 obj_conv.inner = untag_ptr(obj);
32927 obj_conv.is_owned = ptr_is_owned(obj);
32928 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32929 obj_conv.is_owned = false;
32930 LDKCVec_u8Z ret_var = QueryChannelRange_write(&obj_conv);
32931 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32932 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32933 CVec_u8Z_free(ret_var);
32937 uint64_t __attribute__((export_name("TS_QueryChannelRange_read"))) TS_QueryChannelRange_read(int8_tArray ser) {
32938 LDKu8slice ser_ref;
32939 ser_ref.datalen = ser->arr_len;
32940 ser_ref.data = ser->elems;
32941 LDKCResult_QueryChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_QueryChannelRangeDecodeErrorZ), "LDKCResult_QueryChannelRangeDecodeErrorZ");
32942 *ret_conv = QueryChannelRange_read(ser_ref);
32944 return tag_ptr(ret_conv, true);
32947 uint64_t __attribute__((export_name("TS_ReplyChannelRange_read"))) TS_ReplyChannelRange_read(int8_tArray ser) {
32948 LDKu8slice ser_ref;
32949 ser_ref.datalen = ser->arr_len;
32950 ser_ref.data = ser->elems;
32951 LDKCResult_ReplyChannelRangeDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ReplyChannelRangeDecodeErrorZ), "LDKCResult_ReplyChannelRangeDecodeErrorZ");
32952 *ret_conv = ReplyChannelRange_read(ser_ref);
32954 return tag_ptr(ret_conv, true);
32957 int8_tArray __attribute__((export_name("TS_ReplyChannelRange_write"))) TS_ReplyChannelRange_write(uint64_t obj) {
32958 LDKReplyChannelRange obj_conv;
32959 obj_conv.inner = untag_ptr(obj);
32960 obj_conv.is_owned = ptr_is_owned(obj);
32961 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32962 obj_conv.is_owned = false;
32963 LDKCVec_u8Z ret_var = ReplyChannelRange_write(&obj_conv);
32964 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32965 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32966 CVec_u8Z_free(ret_var);
32970 int8_tArray __attribute__((export_name("TS_GossipTimestampFilter_write"))) TS_GossipTimestampFilter_write(uint64_t obj) {
32971 LDKGossipTimestampFilter obj_conv;
32972 obj_conv.inner = untag_ptr(obj);
32973 obj_conv.is_owned = ptr_is_owned(obj);
32974 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
32975 obj_conv.is_owned = false;
32976 LDKCVec_u8Z ret_var = GossipTimestampFilter_write(&obj_conv);
32977 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
32978 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
32979 CVec_u8Z_free(ret_var);
32983 uint64_t __attribute__((export_name("TS_GossipTimestampFilter_read"))) TS_GossipTimestampFilter_read(int8_tArray ser) {
32984 LDKu8slice ser_ref;
32985 ser_ref.datalen = ser->arr_len;
32986 ser_ref.data = ser->elems;
32987 LDKCResult_GossipTimestampFilterDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_GossipTimestampFilterDecodeErrorZ), "LDKCResult_GossipTimestampFilterDecodeErrorZ");
32988 *ret_conv = GossipTimestampFilter_read(ser_ref);
32990 return tag_ptr(ret_conv, true);
32993 void __attribute__((export_name("TS_CustomMessageHandler_free"))) TS_CustomMessageHandler_free(uint64_t this_ptr) {
32994 if (!ptr_is_owned(this_ptr)) return;
32995 void* this_ptr_ptr = untag_ptr(this_ptr);
32996 CHECK_ACCESS(this_ptr_ptr);
32997 LDKCustomMessageHandler this_ptr_conv = *(LDKCustomMessageHandler*)(this_ptr_ptr);
32998 FREE(untag_ptr(this_ptr));
32999 CustomMessageHandler_free(this_ptr_conv);
33002 void __attribute__((export_name("TS_IgnoringMessageHandler_free"))) TS_IgnoringMessageHandler_free(uint64_t this_obj) {
33003 LDKIgnoringMessageHandler this_obj_conv;
33004 this_obj_conv.inner = untag_ptr(this_obj);
33005 this_obj_conv.is_owned = ptr_is_owned(this_obj);
33006 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
33007 IgnoringMessageHandler_free(this_obj_conv);
33010 uint64_t __attribute__((export_name("TS_IgnoringMessageHandler_new"))) TS_IgnoringMessageHandler_new() {
33011 LDKIgnoringMessageHandler ret_var = IgnoringMessageHandler_new();
33012 uint64_t ret_ref = 0;
33013 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33014 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33018 uint64_t __attribute__((export_name("TS_IgnoringMessageHandler_as_MessageSendEventsProvider"))) TS_IgnoringMessageHandler_as_MessageSendEventsProvider(uint64_t this_arg) {
33019 LDKIgnoringMessageHandler this_arg_conv;
33020 this_arg_conv.inner = untag_ptr(this_arg);
33021 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33022 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33023 this_arg_conv.is_owned = false;
33024 LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
33025 *ret_ret = IgnoringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv);
33026 return tag_ptr(ret_ret, true);
33029 uint64_t __attribute__((export_name("TS_IgnoringMessageHandler_as_RoutingMessageHandler"))) TS_IgnoringMessageHandler_as_RoutingMessageHandler(uint64_t this_arg) {
33030 LDKIgnoringMessageHandler this_arg_conv;
33031 this_arg_conv.inner = untag_ptr(this_arg);
33032 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33033 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33034 this_arg_conv.is_owned = false;
33035 LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
33036 *ret_ret = IgnoringMessageHandler_as_RoutingMessageHandler(&this_arg_conv);
33037 return tag_ptr(ret_ret, true);
33040 uint64_t __attribute__((export_name("TS_IgnoringMessageHandler_as_CustomMessageReader"))) TS_IgnoringMessageHandler_as_CustomMessageReader(uint64_t this_arg) {
33041 LDKIgnoringMessageHandler this_arg_conv;
33042 this_arg_conv.inner = untag_ptr(this_arg);
33043 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33044 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33045 this_arg_conv.is_owned = false;
33046 LDKCustomMessageReader* ret_ret = MALLOC(sizeof(LDKCustomMessageReader), "LDKCustomMessageReader");
33047 *ret_ret = IgnoringMessageHandler_as_CustomMessageReader(&this_arg_conv);
33048 return tag_ptr(ret_ret, true);
33051 uint64_t __attribute__((export_name("TS_IgnoringMessageHandler_as_CustomMessageHandler"))) TS_IgnoringMessageHandler_as_CustomMessageHandler(uint64_t this_arg) {
33052 LDKIgnoringMessageHandler this_arg_conv;
33053 this_arg_conv.inner = untag_ptr(this_arg);
33054 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33055 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33056 this_arg_conv.is_owned = false;
33057 LDKCustomMessageHandler* ret_ret = MALLOC(sizeof(LDKCustomMessageHandler), "LDKCustomMessageHandler");
33058 *ret_ret = IgnoringMessageHandler_as_CustomMessageHandler(&this_arg_conv);
33059 return tag_ptr(ret_ret, true);
33062 void __attribute__((export_name("TS_ErroringMessageHandler_free"))) TS_ErroringMessageHandler_free(uint64_t this_obj) {
33063 LDKErroringMessageHandler this_obj_conv;
33064 this_obj_conv.inner = untag_ptr(this_obj);
33065 this_obj_conv.is_owned = ptr_is_owned(this_obj);
33066 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
33067 ErroringMessageHandler_free(this_obj_conv);
33070 uint64_t __attribute__((export_name("TS_ErroringMessageHandler_new"))) TS_ErroringMessageHandler_new() {
33071 LDKErroringMessageHandler ret_var = ErroringMessageHandler_new();
33072 uint64_t ret_ref = 0;
33073 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33074 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33078 uint64_t __attribute__((export_name("TS_ErroringMessageHandler_as_MessageSendEventsProvider"))) TS_ErroringMessageHandler_as_MessageSendEventsProvider(uint64_t this_arg) {
33079 LDKErroringMessageHandler this_arg_conv;
33080 this_arg_conv.inner = untag_ptr(this_arg);
33081 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33082 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33083 this_arg_conv.is_owned = false;
33084 LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
33085 *ret_ret = ErroringMessageHandler_as_MessageSendEventsProvider(&this_arg_conv);
33086 return tag_ptr(ret_ret, true);
33089 uint64_t __attribute__((export_name("TS_ErroringMessageHandler_as_ChannelMessageHandler"))) TS_ErroringMessageHandler_as_ChannelMessageHandler(uint64_t this_arg) {
33090 LDKErroringMessageHandler this_arg_conv;
33091 this_arg_conv.inner = untag_ptr(this_arg);
33092 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33093 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33094 this_arg_conv.is_owned = false;
33095 LDKChannelMessageHandler* ret_ret = MALLOC(sizeof(LDKChannelMessageHandler), "LDKChannelMessageHandler");
33096 *ret_ret = ErroringMessageHandler_as_ChannelMessageHandler(&this_arg_conv);
33097 return tag_ptr(ret_ret, true);
33100 void __attribute__((export_name("TS_MessageHandler_free"))) TS_MessageHandler_free(uint64_t this_obj) {
33101 LDKMessageHandler this_obj_conv;
33102 this_obj_conv.inner = untag_ptr(this_obj);
33103 this_obj_conv.is_owned = ptr_is_owned(this_obj);
33104 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
33105 MessageHandler_free(this_obj_conv);
33108 uint64_t __attribute__((export_name("TS_MessageHandler_get_chan_handler"))) TS_MessageHandler_get_chan_handler(uint64_t this_ptr) {
33109 LDKMessageHandler this_ptr_conv;
33110 this_ptr_conv.inner = untag_ptr(this_ptr);
33111 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33112 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33113 this_ptr_conv.is_owned = false;
33114 // WARNING: This object doesn't live past this scope, needs clone!
33115 uint64_t ret_ret = tag_ptr(MessageHandler_get_chan_handler(&this_ptr_conv), false);
33119 void __attribute__((export_name("TS_MessageHandler_set_chan_handler"))) TS_MessageHandler_set_chan_handler(uint64_t this_ptr, uint64_t val) {
33120 LDKMessageHandler this_ptr_conv;
33121 this_ptr_conv.inner = untag_ptr(this_ptr);
33122 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33123 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33124 this_ptr_conv.is_owned = false;
33125 void* val_ptr = untag_ptr(val);
33126 CHECK_ACCESS(val_ptr);
33127 LDKChannelMessageHandler val_conv = *(LDKChannelMessageHandler*)(val_ptr);
33128 if (val_conv.free == LDKChannelMessageHandler_JCalls_free) {
33129 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
33130 LDKChannelMessageHandler_JCalls_cloned(&val_conv);
33132 MessageHandler_set_chan_handler(&this_ptr_conv, val_conv);
33135 uint64_t __attribute__((export_name("TS_MessageHandler_get_route_handler"))) TS_MessageHandler_get_route_handler(uint64_t this_ptr) {
33136 LDKMessageHandler this_ptr_conv;
33137 this_ptr_conv.inner = untag_ptr(this_ptr);
33138 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33139 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33140 this_ptr_conv.is_owned = false;
33141 // WARNING: This object doesn't live past this scope, needs clone!
33142 uint64_t ret_ret = tag_ptr(MessageHandler_get_route_handler(&this_ptr_conv), false);
33146 void __attribute__((export_name("TS_MessageHandler_set_route_handler"))) TS_MessageHandler_set_route_handler(uint64_t this_ptr, uint64_t val) {
33147 LDKMessageHandler this_ptr_conv;
33148 this_ptr_conv.inner = untag_ptr(this_ptr);
33149 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33150 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33151 this_ptr_conv.is_owned = false;
33152 void* val_ptr = untag_ptr(val);
33153 CHECK_ACCESS(val_ptr);
33154 LDKRoutingMessageHandler val_conv = *(LDKRoutingMessageHandler*)(val_ptr);
33155 if (val_conv.free == LDKRoutingMessageHandler_JCalls_free) {
33156 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
33157 LDKRoutingMessageHandler_JCalls_cloned(&val_conv);
33159 MessageHandler_set_route_handler(&this_ptr_conv, val_conv);
33162 uint64_t __attribute__((export_name("TS_MessageHandler_new"))) TS_MessageHandler_new(uint64_t chan_handler_arg, uint64_t route_handler_arg) {
33163 void* chan_handler_arg_ptr = untag_ptr(chan_handler_arg);
33164 CHECK_ACCESS(chan_handler_arg_ptr);
33165 LDKChannelMessageHandler chan_handler_arg_conv = *(LDKChannelMessageHandler*)(chan_handler_arg_ptr);
33166 if (chan_handler_arg_conv.free == LDKChannelMessageHandler_JCalls_free) {
33167 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
33168 LDKChannelMessageHandler_JCalls_cloned(&chan_handler_arg_conv);
33170 void* route_handler_arg_ptr = untag_ptr(route_handler_arg);
33171 CHECK_ACCESS(route_handler_arg_ptr);
33172 LDKRoutingMessageHandler route_handler_arg_conv = *(LDKRoutingMessageHandler*)(route_handler_arg_ptr);
33173 if (route_handler_arg_conv.free == LDKRoutingMessageHandler_JCalls_free) {
33174 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
33175 LDKRoutingMessageHandler_JCalls_cloned(&route_handler_arg_conv);
33177 LDKMessageHandler ret_var = MessageHandler_new(chan_handler_arg_conv, route_handler_arg_conv);
33178 uint64_t ret_ref = 0;
33179 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33180 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33184 static inline uint64_t SocketDescriptor_clone_ptr(LDKSocketDescriptor *NONNULL_PTR arg) {
33185 LDKSocketDescriptor* ret_ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
33186 *ret_ret = SocketDescriptor_clone(arg);
33187 return tag_ptr(ret_ret, true);
33189 int64_t __attribute__((export_name("TS_SocketDescriptor_clone_ptr"))) TS_SocketDescriptor_clone_ptr(uint64_t arg) {
33190 void* arg_ptr = untag_ptr(arg);
33191 if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); }
33192 LDKSocketDescriptor* arg_conv = (LDKSocketDescriptor*)arg_ptr;
33193 int64_t ret_conv = SocketDescriptor_clone_ptr(arg_conv);
33197 uint64_t __attribute__((export_name("TS_SocketDescriptor_clone"))) TS_SocketDescriptor_clone(uint64_t orig) {
33198 void* orig_ptr = untag_ptr(orig);
33199 if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); }
33200 LDKSocketDescriptor* orig_conv = (LDKSocketDescriptor*)orig_ptr;
33201 LDKSocketDescriptor* ret_ret = MALLOC(sizeof(LDKSocketDescriptor), "LDKSocketDescriptor");
33202 *ret_ret = SocketDescriptor_clone(orig_conv);
33203 return tag_ptr(ret_ret, true);
33206 void __attribute__((export_name("TS_SocketDescriptor_free"))) TS_SocketDescriptor_free(uint64_t this_ptr) {
33207 if (!ptr_is_owned(this_ptr)) return;
33208 void* this_ptr_ptr = untag_ptr(this_ptr);
33209 CHECK_ACCESS(this_ptr_ptr);
33210 LDKSocketDescriptor this_ptr_conv = *(LDKSocketDescriptor*)(this_ptr_ptr);
33211 FREE(untag_ptr(this_ptr));
33212 SocketDescriptor_free(this_ptr_conv);
33215 void __attribute__((export_name("TS_PeerHandleError_free"))) TS_PeerHandleError_free(uint64_t this_obj) {
33216 LDKPeerHandleError this_obj_conv;
33217 this_obj_conv.inner = untag_ptr(this_obj);
33218 this_obj_conv.is_owned = ptr_is_owned(this_obj);
33219 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
33220 PeerHandleError_free(this_obj_conv);
33223 jboolean __attribute__((export_name("TS_PeerHandleError_get_no_connection_possible"))) TS_PeerHandleError_get_no_connection_possible(uint64_t this_ptr) {
33224 LDKPeerHandleError this_ptr_conv;
33225 this_ptr_conv.inner = untag_ptr(this_ptr);
33226 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33227 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33228 this_ptr_conv.is_owned = false;
33229 jboolean ret_conv = PeerHandleError_get_no_connection_possible(&this_ptr_conv);
33233 void __attribute__((export_name("TS_PeerHandleError_set_no_connection_possible"))) TS_PeerHandleError_set_no_connection_possible(uint64_t this_ptr, jboolean val) {
33234 LDKPeerHandleError this_ptr_conv;
33235 this_ptr_conv.inner = untag_ptr(this_ptr);
33236 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33237 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33238 this_ptr_conv.is_owned = false;
33239 PeerHandleError_set_no_connection_possible(&this_ptr_conv, val);
33242 uint64_t __attribute__((export_name("TS_PeerHandleError_new"))) TS_PeerHandleError_new(jboolean no_connection_possible_arg) {
33243 LDKPeerHandleError ret_var = PeerHandleError_new(no_connection_possible_arg);
33244 uint64_t ret_ref = 0;
33245 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33246 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33250 static inline uint64_t PeerHandleError_clone_ptr(LDKPeerHandleError *NONNULL_PTR arg) {
33251 LDKPeerHandleError ret_var = PeerHandleError_clone(arg);
33252 uint64_t ret_ref = 0;
33253 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33254 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33257 int64_t __attribute__((export_name("TS_PeerHandleError_clone_ptr"))) TS_PeerHandleError_clone_ptr(uint64_t arg) {
33258 LDKPeerHandleError arg_conv;
33259 arg_conv.inner = untag_ptr(arg);
33260 arg_conv.is_owned = ptr_is_owned(arg);
33261 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
33262 arg_conv.is_owned = false;
33263 int64_t ret_conv = PeerHandleError_clone_ptr(&arg_conv);
33267 uint64_t __attribute__((export_name("TS_PeerHandleError_clone"))) TS_PeerHandleError_clone(uint64_t orig) {
33268 LDKPeerHandleError orig_conv;
33269 orig_conv.inner = untag_ptr(orig);
33270 orig_conv.is_owned = ptr_is_owned(orig);
33271 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
33272 orig_conv.is_owned = false;
33273 LDKPeerHandleError ret_var = PeerHandleError_clone(&orig_conv);
33274 uint64_t ret_ref = 0;
33275 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33276 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33280 void __attribute__((export_name("TS_PeerManager_free"))) TS_PeerManager_free(uint64_t this_obj) {
33281 LDKPeerManager this_obj_conv;
33282 this_obj_conv.inner = untag_ptr(this_obj);
33283 this_obj_conv.is_owned = ptr_is_owned(this_obj);
33284 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
33285 PeerManager_free(this_obj_conv);
33288 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) {
33289 LDKMessageHandler message_handler_conv;
33290 message_handler_conv.inner = untag_ptr(message_handler);
33291 message_handler_conv.is_owned = ptr_is_owned(message_handler);
33292 CHECK_INNER_FIELD_ACCESS_OR_NULL(message_handler_conv);
33293 // WARNING: we need a move here but no clone is available for LDKMessageHandler
33295 LDKSecretKey our_node_secret_ref;
33296 CHECK(our_node_secret->arr_len == 32);
33297 memcpy(our_node_secret_ref.bytes, our_node_secret->elems, 32); FREE(our_node_secret);
33298 unsigned char ephemeral_random_data_arr[32];
33299 CHECK(ephemeral_random_data->arr_len == 32);
33300 memcpy(ephemeral_random_data_arr, ephemeral_random_data->elems, 32); FREE(ephemeral_random_data);
33301 unsigned char (*ephemeral_random_data_ref)[32] = &ephemeral_random_data_arr;
33302 void* logger_ptr = untag_ptr(logger);
33303 CHECK_ACCESS(logger_ptr);
33304 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
33305 if (logger_conv.free == LDKLogger_JCalls_free) {
33306 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
33307 LDKLogger_JCalls_cloned(&logger_conv);
33309 void* custom_message_handler_ptr = untag_ptr(custom_message_handler);
33310 CHECK_ACCESS(custom_message_handler_ptr);
33311 LDKCustomMessageHandler custom_message_handler_conv = *(LDKCustomMessageHandler*)(custom_message_handler_ptr);
33312 if (custom_message_handler_conv.free == LDKCustomMessageHandler_JCalls_free) {
33313 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
33314 LDKCustomMessageHandler_JCalls_cloned(&custom_message_handler_conv);
33316 LDKPeerManager ret_var = PeerManager_new(message_handler_conv, our_node_secret_ref, ephemeral_random_data_ref, logger_conv, custom_message_handler_conv);
33317 uint64_t ret_ref = 0;
33318 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33319 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33323 ptrArray __attribute__((export_name("TS_PeerManager_get_peer_node_ids"))) TS_PeerManager_get_peer_node_ids(uint64_t this_arg) {
33324 LDKPeerManager this_arg_conv;
33325 this_arg_conv.inner = untag_ptr(this_arg);
33326 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33327 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33328 this_arg_conv.is_owned = false;
33329 LDKCVec_PublicKeyZ ret_var = PeerManager_get_peer_node_ids(&this_arg_conv);
33330 ptrArray ret_arr = NULL;
33331 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
33332 int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8);
33333 for (size_t m = 0; m < ret_var.datalen; m++) {
33334 int8_tArray ret_conv_12_arr = init_int8_tArray(33, __LINE__);
33335 memcpy(ret_conv_12_arr->elems, ret_var.data[m].compressed_form, 33);
33336 ret_arr_ptr[m] = ret_conv_12_arr;
33339 FREE(ret_var.data);
33343 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) {
33344 LDKPeerManager this_arg_conv;
33345 this_arg_conv.inner = untag_ptr(this_arg);
33346 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33347 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33348 this_arg_conv.is_owned = false;
33349 LDKPublicKey their_node_id_ref;
33350 CHECK(their_node_id->arr_len == 33);
33351 memcpy(their_node_id_ref.compressed_form, their_node_id->elems, 33); FREE(their_node_id);
33352 void* descriptor_ptr = untag_ptr(descriptor);
33353 CHECK_ACCESS(descriptor_ptr);
33354 LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(descriptor_ptr);
33355 if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) {
33356 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
33357 LDKSocketDescriptor_JCalls_cloned(&descriptor_conv);
33359 void* remote_network_address_ptr = untag_ptr(remote_network_address);
33360 CHECK_ACCESS(remote_network_address_ptr);
33361 LDKCOption_NetAddressZ remote_network_address_conv = *(LDKCOption_NetAddressZ*)(remote_network_address_ptr);
33362 LDKCResult_CVec_u8ZPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_u8ZPeerHandleErrorZ), "LDKCResult_CVec_u8ZPeerHandleErrorZ");
33363 *ret_conv = PeerManager_new_outbound_connection(&this_arg_conv, their_node_id_ref, descriptor_conv, remote_network_address_conv);
33364 return tag_ptr(ret_conv, true);
33367 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) {
33368 LDKPeerManager this_arg_conv;
33369 this_arg_conv.inner = untag_ptr(this_arg);
33370 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33371 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33372 this_arg_conv.is_owned = false;
33373 void* descriptor_ptr = untag_ptr(descriptor);
33374 CHECK_ACCESS(descriptor_ptr);
33375 LDKSocketDescriptor descriptor_conv = *(LDKSocketDescriptor*)(descriptor_ptr);
33376 if (descriptor_conv.free == LDKSocketDescriptor_JCalls_free) {
33377 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
33378 LDKSocketDescriptor_JCalls_cloned(&descriptor_conv);
33380 void* remote_network_address_ptr = untag_ptr(remote_network_address);
33381 CHECK_ACCESS(remote_network_address_ptr);
33382 LDKCOption_NetAddressZ remote_network_address_conv = *(LDKCOption_NetAddressZ*)(remote_network_address_ptr);
33383 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
33384 *ret_conv = PeerManager_new_inbound_connection(&this_arg_conv, descriptor_conv, remote_network_address_conv);
33385 return tag_ptr(ret_conv, true);
33388 uint64_t __attribute__((export_name("TS_PeerManager_write_buffer_space_avail"))) TS_PeerManager_write_buffer_space_avail(uint64_t this_arg, uint64_t descriptor) {
33389 LDKPeerManager this_arg_conv;
33390 this_arg_conv.inner = untag_ptr(this_arg);
33391 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33392 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33393 this_arg_conv.is_owned = false;
33394 void* descriptor_ptr = untag_ptr(descriptor);
33395 if (ptr_is_owned(descriptor)) { CHECK_ACCESS(descriptor_ptr); }
33396 LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr;
33397 LDKCResult_NonePeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NonePeerHandleErrorZ), "LDKCResult_NonePeerHandleErrorZ");
33398 *ret_conv = PeerManager_write_buffer_space_avail(&this_arg_conv, descriptor_conv);
33399 return tag_ptr(ret_conv, true);
33402 uint64_t __attribute__((export_name("TS_PeerManager_read_event"))) TS_PeerManager_read_event(uint64_t this_arg, uint64_t peer_descriptor, int8_tArray data) {
33403 LDKPeerManager this_arg_conv;
33404 this_arg_conv.inner = untag_ptr(this_arg);
33405 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33406 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33407 this_arg_conv.is_owned = false;
33408 void* peer_descriptor_ptr = untag_ptr(peer_descriptor);
33409 if (ptr_is_owned(peer_descriptor)) { CHECK_ACCESS(peer_descriptor_ptr); }
33410 LDKSocketDescriptor* peer_descriptor_conv = (LDKSocketDescriptor*)peer_descriptor_ptr;
33411 LDKu8slice data_ref;
33412 data_ref.datalen = data->arr_len;
33413 data_ref.data = data->elems;
33414 LDKCResult_boolPeerHandleErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_boolPeerHandleErrorZ), "LDKCResult_boolPeerHandleErrorZ");
33415 *ret_conv = PeerManager_read_event(&this_arg_conv, peer_descriptor_conv, data_ref);
33417 return tag_ptr(ret_conv, true);
33420 void __attribute__((export_name("TS_PeerManager_process_events"))) TS_PeerManager_process_events(uint64_t this_arg) {
33421 LDKPeerManager this_arg_conv;
33422 this_arg_conv.inner = untag_ptr(this_arg);
33423 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33424 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33425 this_arg_conv.is_owned = false;
33426 PeerManager_process_events(&this_arg_conv);
33429 void __attribute__((export_name("TS_PeerManager_socket_disconnected"))) TS_PeerManager_socket_disconnected(uint64_t this_arg, uint64_t descriptor) {
33430 LDKPeerManager this_arg_conv;
33431 this_arg_conv.inner = untag_ptr(this_arg);
33432 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33433 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33434 this_arg_conv.is_owned = false;
33435 void* descriptor_ptr = untag_ptr(descriptor);
33436 if (ptr_is_owned(descriptor)) { CHECK_ACCESS(descriptor_ptr); }
33437 LDKSocketDescriptor* descriptor_conv = (LDKSocketDescriptor*)descriptor_ptr;
33438 PeerManager_socket_disconnected(&this_arg_conv, descriptor_conv);
33441 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) {
33442 LDKPeerManager this_arg_conv;
33443 this_arg_conv.inner = untag_ptr(this_arg);
33444 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33445 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33446 this_arg_conv.is_owned = false;
33447 LDKPublicKey node_id_ref;
33448 CHECK(node_id->arr_len == 33);
33449 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
33450 PeerManager_disconnect_by_node_id(&this_arg_conv, node_id_ref, no_connection_possible);
33453 void __attribute__((export_name("TS_PeerManager_disconnect_all_peers"))) TS_PeerManager_disconnect_all_peers(uint64_t this_arg) {
33454 LDKPeerManager this_arg_conv;
33455 this_arg_conv.inner = untag_ptr(this_arg);
33456 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33457 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33458 this_arg_conv.is_owned = false;
33459 PeerManager_disconnect_all_peers(&this_arg_conv);
33462 void __attribute__((export_name("TS_PeerManager_timer_tick_occurred"))) TS_PeerManager_timer_tick_occurred(uint64_t this_arg) {
33463 LDKPeerManager this_arg_conv;
33464 this_arg_conv.inner = untag_ptr(this_arg);
33465 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33466 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33467 this_arg_conv.is_owned = false;
33468 PeerManager_timer_tick_occurred(&this_arg_conv);
33471 int64_t __attribute__((export_name("TS_htlc_success_tx_weight"))) TS_htlc_success_tx_weight(jboolean opt_anchors) {
33472 int64_t ret_conv = htlc_success_tx_weight(opt_anchors);
33476 int64_t __attribute__((export_name("TS_htlc_timeout_tx_weight"))) TS_htlc_timeout_tx_weight(jboolean opt_anchors) {
33477 int64_t ret_conv = htlc_timeout_tx_weight(opt_anchors);
33481 int8_tArray __attribute__((export_name("TS_build_commitment_secret"))) TS_build_commitment_secret(int8_tArray commitment_seed, int64_t idx) {
33482 unsigned char commitment_seed_arr[32];
33483 CHECK(commitment_seed->arr_len == 32);
33484 memcpy(commitment_seed_arr, commitment_seed->elems, 32); FREE(commitment_seed);
33485 unsigned char (*commitment_seed_ref)[32] = &commitment_seed_arr;
33486 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
33487 memcpy(ret_arr->elems, build_commitment_secret(commitment_seed_ref, idx).data, 32);
33491 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) {
33492 LDKCVec_u8Z to_holder_script_ref;
33493 to_holder_script_ref.datalen = to_holder_script->arr_len;
33494 to_holder_script_ref.data = MALLOC(to_holder_script_ref.datalen, "LDKCVec_u8Z Bytes");
33495 memcpy(to_holder_script_ref.data, to_holder_script->elems, to_holder_script_ref.datalen); FREE(to_holder_script);
33496 LDKCVec_u8Z to_counterparty_script_ref;
33497 to_counterparty_script_ref.datalen = to_counterparty_script->arr_len;
33498 to_counterparty_script_ref.data = MALLOC(to_counterparty_script_ref.datalen, "LDKCVec_u8Z Bytes");
33499 memcpy(to_counterparty_script_ref.data, to_counterparty_script->elems, to_counterparty_script_ref.datalen); FREE(to_counterparty_script);
33500 LDKOutPoint funding_outpoint_conv;
33501 funding_outpoint_conv.inner = untag_ptr(funding_outpoint);
33502 funding_outpoint_conv.is_owned = ptr_is_owned(funding_outpoint);
33503 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv);
33504 funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv);
33505 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);
33506 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
33507 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
33508 Transaction_free(ret_var);
33512 void __attribute__((export_name("TS_CounterpartyCommitmentSecrets_free"))) TS_CounterpartyCommitmentSecrets_free(uint64_t this_obj) {
33513 LDKCounterpartyCommitmentSecrets this_obj_conv;
33514 this_obj_conv.inner = untag_ptr(this_obj);
33515 this_obj_conv.is_owned = ptr_is_owned(this_obj);
33516 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
33517 CounterpartyCommitmentSecrets_free(this_obj_conv);
33520 static inline uint64_t CounterpartyCommitmentSecrets_clone_ptr(LDKCounterpartyCommitmentSecrets *NONNULL_PTR arg) {
33521 LDKCounterpartyCommitmentSecrets ret_var = CounterpartyCommitmentSecrets_clone(arg);
33522 uint64_t ret_ref = 0;
33523 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33524 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33527 int64_t __attribute__((export_name("TS_CounterpartyCommitmentSecrets_clone_ptr"))) TS_CounterpartyCommitmentSecrets_clone_ptr(uint64_t arg) {
33528 LDKCounterpartyCommitmentSecrets arg_conv;
33529 arg_conv.inner = untag_ptr(arg);
33530 arg_conv.is_owned = ptr_is_owned(arg);
33531 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
33532 arg_conv.is_owned = false;
33533 int64_t ret_conv = CounterpartyCommitmentSecrets_clone_ptr(&arg_conv);
33537 uint64_t __attribute__((export_name("TS_CounterpartyCommitmentSecrets_clone"))) TS_CounterpartyCommitmentSecrets_clone(uint64_t orig) {
33538 LDKCounterpartyCommitmentSecrets orig_conv;
33539 orig_conv.inner = untag_ptr(orig);
33540 orig_conv.is_owned = ptr_is_owned(orig);
33541 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
33542 orig_conv.is_owned = false;
33543 LDKCounterpartyCommitmentSecrets ret_var = CounterpartyCommitmentSecrets_clone(&orig_conv);
33544 uint64_t ret_ref = 0;
33545 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33546 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33550 uint64_t __attribute__((export_name("TS_CounterpartyCommitmentSecrets_new"))) TS_CounterpartyCommitmentSecrets_new() {
33551 LDKCounterpartyCommitmentSecrets ret_var = CounterpartyCommitmentSecrets_new();
33552 uint64_t ret_ref = 0;
33553 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33554 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33558 int64_t __attribute__((export_name("TS_CounterpartyCommitmentSecrets_get_min_seen_secret"))) TS_CounterpartyCommitmentSecrets_get_min_seen_secret(uint64_t this_arg) {
33559 LDKCounterpartyCommitmentSecrets this_arg_conv;
33560 this_arg_conv.inner = untag_ptr(this_arg);
33561 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33562 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33563 this_arg_conv.is_owned = false;
33564 int64_t ret_conv = CounterpartyCommitmentSecrets_get_min_seen_secret(&this_arg_conv);
33568 uint64_t __attribute__((export_name("TS_CounterpartyCommitmentSecrets_provide_secret"))) TS_CounterpartyCommitmentSecrets_provide_secret(uint64_t this_arg, int64_t idx, int8_tArray secret) {
33569 LDKCounterpartyCommitmentSecrets 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 LDKThirtyTwoBytes secret_ref;
33575 CHECK(secret->arr_len == 32);
33576 memcpy(secret_ref.data, secret->elems, 32); FREE(secret);
33577 LDKCResult_NoneNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneNoneZ), "LDKCResult_NoneNoneZ");
33578 *ret_conv = CounterpartyCommitmentSecrets_provide_secret(&this_arg_conv, idx, secret_ref);
33579 return tag_ptr(ret_conv, true);
33582 int8_tArray __attribute__((export_name("TS_CounterpartyCommitmentSecrets_get_secret"))) TS_CounterpartyCommitmentSecrets_get_secret(uint64_t this_arg, int64_t idx) {
33583 LDKCounterpartyCommitmentSecrets this_arg_conv;
33584 this_arg_conv.inner = untag_ptr(this_arg);
33585 this_arg_conv.is_owned = ptr_is_owned(this_arg);
33586 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
33587 this_arg_conv.is_owned = false;
33588 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
33589 memcpy(ret_arr->elems, CounterpartyCommitmentSecrets_get_secret(&this_arg_conv, idx).data, 32);
33593 int8_tArray __attribute__((export_name("TS_CounterpartyCommitmentSecrets_write"))) TS_CounterpartyCommitmentSecrets_write(uint64_t obj) {
33594 LDKCounterpartyCommitmentSecrets obj_conv;
33595 obj_conv.inner = untag_ptr(obj);
33596 obj_conv.is_owned = ptr_is_owned(obj);
33597 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
33598 obj_conv.is_owned = false;
33599 LDKCVec_u8Z ret_var = CounterpartyCommitmentSecrets_write(&obj_conv);
33600 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
33601 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
33602 CVec_u8Z_free(ret_var);
33606 uint64_t __attribute__((export_name("TS_CounterpartyCommitmentSecrets_read"))) TS_CounterpartyCommitmentSecrets_read(int8_tArray ser) {
33607 LDKu8slice ser_ref;
33608 ser_ref.datalen = ser->arr_len;
33609 ser_ref.data = ser->elems;
33610 LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ), "LDKCResult_CounterpartyCommitmentSecretsDecodeErrorZ");
33611 *ret_conv = CounterpartyCommitmentSecrets_read(ser_ref);
33613 return tag_ptr(ret_conv, true);
33616 uint64_t __attribute__((export_name("TS_derive_private_key"))) TS_derive_private_key(int8_tArray per_commitment_point, int8_tArray base_secret) {
33617 LDKPublicKey per_commitment_point_ref;
33618 CHECK(per_commitment_point->arr_len == 33);
33619 memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point);
33620 unsigned char base_secret_arr[32];
33621 CHECK(base_secret->arr_len == 32);
33622 memcpy(base_secret_arr, base_secret->elems, 32); FREE(base_secret);
33623 unsigned char (*base_secret_ref)[32] = &base_secret_arr;
33624 LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
33625 *ret_conv = derive_private_key(per_commitment_point_ref, base_secret_ref);
33626 return tag_ptr(ret_conv, true);
33629 uint64_t __attribute__((export_name("TS_derive_public_key"))) TS_derive_public_key(int8_tArray per_commitment_point, int8_tArray base_point) {
33630 LDKPublicKey per_commitment_point_ref;
33631 CHECK(per_commitment_point->arr_len == 33);
33632 memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point);
33633 LDKPublicKey base_point_ref;
33634 CHECK(base_point->arr_len == 33);
33635 memcpy(base_point_ref.compressed_form, base_point->elems, 33); FREE(base_point);
33636 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
33637 *ret_conv = derive_public_key(per_commitment_point_ref, base_point_ref);
33638 return tag_ptr(ret_conv, true);
33641 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) {
33642 unsigned char per_commitment_secret_arr[32];
33643 CHECK(per_commitment_secret->arr_len == 32);
33644 memcpy(per_commitment_secret_arr, per_commitment_secret->elems, 32); FREE(per_commitment_secret);
33645 unsigned char (*per_commitment_secret_ref)[32] = &per_commitment_secret_arr;
33646 unsigned char countersignatory_revocation_base_secret_arr[32];
33647 CHECK(countersignatory_revocation_base_secret->arr_len == 32);
33648 memcpy(countersignatory_revocation_base_secret_arr, countersignatory_revocation_base_secret->elems, 32); FREE(countersignatory_revocation_base_secret);
33649 unsigned char (*countersignatory_revocation_base_secret_ref)[32] = &countersignatory_revocation_base_secret_arr;
33650 LDKCResult_SecretKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SecretKeyErrorZ), "LDKCResult_SecretKeyErrorZ");
33651 *ret_conv = derive_private_revocation_key(per_commitment_secret_ref, countersignatory_revocation_base_secret_ref);
33652 return tag_ptr(ret_conv, true);
33655 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) {
33656 LDKPublicKey per_commitment_point_ref;
33657 CHECK(per_commitment_point->arr_len == 33);
33658 memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point);
33659 LDKPublicKey countersignatory_revocation_base_point_ref;
33660 CHECK(countersignatory_revocation_base_point->arr_len == 33);
33661 memcpy(countersignatory_revocation_base_point_ref.compressed_form, countersignatory_revocation_base_point->elems, 33); FREE(countersignatory_revocation_base_point);
33662 LDKCResult_PublicKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PublicKeyErrorZ), "LDKCResult_PublicKeyErrorZ");
33663 *ret_conv = derive_public_revocation_key(per_commitment_point_ref, countersignatory_revocation_base_point_ref);
33664 return tag_ptr(ret_conv, true);
33667 void __attribute__((export_name("TS_TxCreationKeys_free"))) TS_TxCreationKeys_free(uint64_t this_obj) {
33668 LDKTxCreationKeys this_obj_conv;
33669 this_obj_conv.inner = untag_ptr(this_obj);
33670 this_obj_conv.is_owned = ptr_is_owned(this_obj);
33671 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
33672 TxCreationKeys_free(this_obj_conv);
33675 int8_tArray __attribute__((export_name("TS_TxCreationKeys_get_per_commitment_point"))) TS_TxCreationKeys_get_per_commitment_point(uint64_t this_ptr) {
33676 LDKTxCreationKeys this_ptr_conv;
33677 this_ptr_conv.inner = untag_ptr(this_ptr);
33678 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33679 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33680 this_ptr_conv.is_owned = false;
33681 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
33682 memcpy(ret_arr->elems, TxCreationKeys_get_per_commitment_point(&this_ptr_conv).compressed_form, 33);
33686 void __attribute__((export_name("TS_TxCreationKeys_set_per_commitment_point"))) TS_TxCreationKeys_set_per_commitment_point(uint64_t this_ptr, int8_tArray val) {
33687 LDKTxCreationKeys this_ptr_conv;
33688 this_ptr_conv.inner = untag_ptr(this_ptr);
33689 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33690 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33691 this_ptr_conv.is_owned = false;
33692 LDKPublicKey val_ref;
33693 CHECK(val->arr_len == 33);
33694 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
33695 TxCreationKeys_set_per_commitment_point(&this_ptr_conv, val_ref);
33698 int8_tArray __attribute__((export_name("TS_TxCreationKeys_get_revocation_key"))) TS_TxCreationKeys_get_revocation_key(uint64_t this_ptr) {
33699 LDKTxCreationKeys this_ptr_conv;
33700 this_ptr_conv.inner = untag_ptr(this_ptr);
33701 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33702 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33703 this_ptr_conv.is_owned = false;
33704 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
33705 memcpy(ret_arr->elems, TxCreationKeys_get_revocation_key(&this_ptr_conv).compressed_form, 33);
33709 void __attribute__((export_name("TS_TxCreationKeys_set_revocation_key"))) TS_TxCreationKeys_set_revocation_key(uint64_t this_ptr, int8_tArray val) {
33710 LDKTxCreationKeys this_ptr_conv;
33711 this_ptr_conv.inner = untag_ptr(this_ptr);
33712 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33713 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33714 this_ptr_conv.is_owned = false;
33715 LDKPublicKey val_ref;
33716 CHECK(val->arr_len == 33);
33717 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
33718 TxCreationKeys_set_revocation_key(&this_ptr_conv, val_ref);
33721 int8_tArray __attribute__((export_name("TS_TxCreationKeys_get_broadcaster_htlc_key"))) TS_TxCreationKeys_get_broadcaster_htlc_key(uint64_t this_ptr) {
33722 LDKTxCreationKeys this_ptr_conv;
33723 this_ptr_conv.inner = untag_ptr(this_ptr);
33724 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33725 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33726 this_ptr_conv.is_owned = false;
33727 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
33728 memcpy(ret_arr->elems, TxCreationKeys_get_broadcaster_htlc_key(&this_ptr_conv).compressed_form, 33);
33732 void __attribute__((export_name("TS_TxCreationKeys_set_broadcaster_htlc_key"))) TS_TxCreationKeys_set_broadcaster_htlc_key(uint64_t this_ptr, int8_tArray val) {
33733 LDKTxCreationKeys this_ptr_conv;
33734 this_ptr_conv.inner = untag_ptr(this_ptr);
33735 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33736 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33737 this_ptr_conv.is_owned = false;
33738 LDKPublicKey val_ref;
33739 CHECK(val->arr_len == 33);
33740 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
33741 TxCreationKeys_set_broadcaster_htlc_key(&this_ptr_conv, val_ref);
33744 int8_tArray __attribute__((export_name("TS_TxCreationKeys_get_countersignatory_htlc_key"))) TS_TxCreationKeys_get_countersignatory_htlc_key(uint64_t this_ptr) {
33745 LDKTxCreationKeys this_ptr_conv;
33746 this_ptr_conv.inner = untag_ptr(this_ptr);
33747 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33748 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33749 this_ptr_conv.is_owned = false;
33750 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
33751 memcpy(ret_arr->elems, TxCreationKeys_get_countersignatory_htlc_key(&this_ptr_conv).compressed_form, 33);
33755 void __attribute__((export_name("TS_TxCreationKeys_set_countersignatory_htlc_key"))) TS_TxCreationKeys_set_countersignatory_htlc_key(uint64_t this_ptr, int8_tArray val) {
33756 LDKTxCreationKeys this_ptr_conv;
33757 this_ptr_conv.inner = untag_ptr(this_ptr);
33758 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33759 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33760 this_ptr_conv.is_owned = false;
33761 LDKPublicKey val_ref;
33762 CHECK(val->arr_len == 33);
33763 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
33764 TxCreationKeys_set_countersignatory_htlc_key(&this_ptr_conv, val_ref);
33767 int8_tArray __attribute__((export_name("TS_TxCreationKeys_get_broadcaster_delayed_payment_key"))) TS_TxCreationKeys_get_broadcaster_delayed_payment_key(uint64_t this_ptr) {
33768 LDKTxCreationKeys this_ptr_conv;
33769 this_ptr_conv.inner = untag_ptr(this_ptr);
33770 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33771 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33772 this_ptr_conv.is_owned = false;
33773 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
33774 memcpy(ret_arr->elems, TxCreationKeys_get_broadcaster_delayed_payment_key(&this_ptr_conv).compressed_form, 33);
33778 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) {
33779 LDKTxCreationKeys this_ptr_conv;
33780 this_ptr_conv.inner = untag_ptr(this_ptr);
33781 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33782 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33783 this_ptr_conv.is_owned = false;
33784 LDKPublicKey val_ref;
33785 CHECK(val->arr_len == 33);
33786 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
33787 TxCreationKeys_set_broadcaster_delayed_payment_key(&this_ptr_conv, val_ref);
33790 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) {
33791 LDKPublicKey per_commitment_point_arg_ref;
33792 CHECK(per_commitment_point_arg->arr_len == 33);
33793 memcpy(per_commitment_point_arg_ref.compressed_form, per_commitment_point_arg->elems, 33); FREE(per_commitment_point_arg);
33794 LDKPublicKey revocation_key_arg_ref;
33795 CHECK(revocation_key_arg->arr_len == 33);
33796 memcpy(revocation_key_arg_ref.compressed_form, revocation_key_arg->elems, 33); FREE(revocation_key_arg);
33797 LDKPublicKey broadcaster_htlc_key_arg_ref;
33798 CHECK(broadcaster_htlc_key_arg->arr_len == 33);
33799 memcpy(broadcaster_htlc_key_arg_ref.compressed_form, broadcaster_htlc_key_arg->elems, 33); FREE(broadcaster_htlc_key_arg);
33800 LDKPublicKey countersignatory_htlc_key_arg_ref;
33801 CHECK(countersignatory_htlc_key_arg->arr_len == 33);
33802 memcpy(countersignatory_htlc_key_arg_ref.compressed_form, countersignatory_htlc_key_arg->elems, 33); FREE(countersignatory_htlc_key_arg);
33803 LDKPublicKey broadcaster_delayed_payment_key_arg_ref;
33804 CHECK(broadcaster_delayed_payment_key_arg->arr_len == 33);
33805 memcpy(broadcaster_delayed_payment_key_arg_ref.compressed_form, broadcaster_delayed_payment_key_arg->elems, 33); FREE(broadcaster_delayed_payment_key_arg);
33806 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);
33807 uint64_t ret_ref = 0;
33808 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33809 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33813 static inline uint64_t TxCreationKeys_clone_ptr(LDKTxCreationKeys *NONNULL_PTR arg) {
33814 LDKTxCreationKeys ret_var = TxCreationKeys_clone(arg);
33815 uint64_t ret_ref = 0;
33816 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33817 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33820 int64_t __attribute__((export_name("TS_TxCreationKeys_clone_ptr"))) TS_TxCreationKeys_clone_ptr(uint64_t arg) {
33821 LDKTxCreationKeys arg_conv;
33822 arg_conv.inner = untag_ptr(arg);
33823 arg_conv.is_owned = ptr_is_owned(arg);
33824 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
33825 arg_conv.is_owned = false;
33826 int64_t ret_conv = TxCreationKeys_clone_ptr(&arg_conv);
33830 uint64_t __attribute__((export_name("TS_TxCreationKeys_clone"))) TS_TxCreationKeys_clone(uint64_t orig) {
33831 LDKTxCreationKeys orig_conv;
33832 orig_conv.inner = untag_ptr(orig);
33833 orig_conv.is_owned = ptr_is_owned(orig);
33834 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
33835 orig_conv.is_owned = false;
33836 LDKTxCreationKeys ret_var = TxCreationKeys_clone(&orig_conv);
33837 uint64_t ret_ref = 0;
33838 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
33839 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
33843 int8_tArray __attribute__((export_name("TS_TxCreationKeys_write"))) TS_TxCreationKeys_write(uint64_t obj) {
33844 LDKTxCreationKeys obj_conv;
33845 obj_conv.inner = untag_ptr(obj);
33846 obj_conv.is_owned = ptr_is_owned(obj);
33847 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
33848 obj_conv.is_owned = false;
33849 LDKCVec_u8Z ret_var = TxCreationKeys_write(&obj_conv);
33850 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
33851 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
33852 CVec_u8Z_free(ret_var);
33856 uint64_t __attribute__((export_name("TS_TxCreationKeys_read"))) TS_TxCreationKeys_read(int8_tArray ser) {
33857 LDKu8slice ser_ref;
33858 ser_ref.datalen = ser->arr_len;
33859 ser_ref.data = ser->elems;
33860 LDKCResult_TxCreationKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysDecodeErrorZ), "LDKCResult_TxCreationKeysDecodeErrorZ");
33861 *ret_conv = TxCreationKeys_read(ser_ref);
33863 return tag_ptr(ret_conv, true);
33866 void __attribute__((export_name("TS_ChannelPublicKeys_free"))) TS_ChannelPublicKeys_free(uint64_t this_obj) {
33867 LDKChannelPublicKeys this_obj_conv;
33868 this_obj_conv.inner = untag_ptr(this_obj);
33869 this_obj_conv.is_owned = ptr_is_owned(this_obj);
33870 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
33871 ChannelPublicKeys_free(this_obj_conv);
33874 int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_get_funding_pubkey"))) TS_ChannelPublicKeys_get_funding_pubkey(uint64_t this_ptr) {
33875 LDKChannelPublicKeys this_ptr_conv;
33876 this_ptr_conv.inner = untag_ptr(this_ptr);
33877 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33878 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33879 this_ptr_conv.is_owned = false;
33880 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
33881 memcpy(ret_arr->elems, ChannelPublicKeys_get_funding_pubkey(&this_ptr_conv).compressed_form, 33);
33885 void __attribute__((export_name("TS_ChannelPublicKeys_set_funding_pubkey"))) TS_ChannelPublicKeys_set_funding_pubkey(uint64_t this_ptr, int8_tArray val) {
33886 LDKChannelPublicKeys this_ptr_conv;
33887 this_ptr_conv.inner = untag_ptr(this_ptr);
33888 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33889 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33890 this_ptr_conv.is_owned = false;
33891 LDKPublicKey val_ref;
33892 CHECK(val->arr_len == 33);
33893 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
33894 ChannelPublicKeys_set_funding_pubkey(&this_ptr_conv, val_ref);
33897 int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_get_revocation_basepoint"))) TS_ChannelPublicKeys_get_revocation_basepoint(uint64_t this_ptr) {
33898 LDKChannelPublicKeys this_ptr_conv;
33899 this_ptr_conv.inner = untag_ptr(this_ptr);
33900 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33901 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33902 this_ptr_conv.is_owned = false;
33903 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
33904 memcpy(ret_arr->elems, ChannelPublicKeys_get_revocation_basepoint(&this_ptr_conv).compressed_form, 33);
33908 void __attribute__((export_name("TS_ChannelPublicKeys_set_revocation_basepoint"))) TS_ChannelPublicKeys_set_revocation_basepoint(uint64_t this_ptr, int8_tArray val) {
33909 LDKChannelPublicKeys this_ptr_conv;
33910 this_ptr_conv.inner = untag_ptr(this_ptr);
33911 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33912 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33913 this_ptr_conv.is_owned = false;
33914 LDKPublicKey val_ref;
33915 CHECK(val->arr_len == 33);
33916 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
33917 ChannelPublicKeys_set_revocation_basepoint(&this_ptr_conv, val_ref);
33920 int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_get_payment_point"))) TS_ChannelPublicKeys_get_payment_point(uint64_t this_ptr) {
33921 LDKChannelPublicKeys this_ptr_conv;
33922 this_ptr_conv.inner = untag_ptr(this_ptr);
33923 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33924 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33925 this_ptr_conv.is_owned = false;
33926 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
33927 memcpy(ret_arr->elems, ChannelPublicKeys_get_payment_point(&this_ptr_conv).compressed_form, 33);
33931 void __attribute__((export_name("TS_ChannelPublicKeys_set_payment_point"))) TS_ChannelPublicKeys_set_payment_point(uint64_t this_ptr, int8_tArray val) {
33932 LDKChannelPublicKeys this_ptr_conv;
33933 this_ptr_conv.inner = untag_ptr(this_ptr);
33934 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33935 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33936 this_ptr_conv.is_owned = false;
33937 LDKPublicKey val_ref;
33938 CHECK(val->arr_len == 33);
33939 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
33940 ChannelPublicKeys_set_payment_point(&this_ptr_conv, val_ref);
33943 int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_get_delayed_payment_basepoint"))) TS_ChannelPublicKeys_get_delayed_payment_basepoint(uint64_t this_ptr) {
33944 LDKChannelPublicKeys this_ptr_conv;
33945 this_ptr_conv.inner = untag_ptr(this_ptr);
33946 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33947 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33948 this_ptr_conv.is_owned = false;
33949 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
33950 memcpy(ret_arr->elems, ChannelPublicKeys_get_delayed_payment_basepoint(&this_ptr_conv).compressed_form, 33);
33954 void __attribute__((export_name("TS_ChannelPublicKeys_set_delayed_payment_basepoint"))) TS_ChannelPublicKeys_set_delayed_payment_basepoint(uint64_t this_ptr, int8_tArray val) {
33955 LDKChannelPublicKeys this_ptr_conv;
33956 this_ptr_conv.inner = untag_ptr(this_ptr);
33957 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33958 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33959 this_ptr_conv.is_owned = false;
33960 LDKPublicKey val_ref;
33961 CHECK(val->arr_len == 33);
33962 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
33963 ChannelPublicKeys_set_delayed_payment_basepoint(&this_ptr_conv, val_ref);
33966 int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_get_htlc_basepoint"))) TS_ChannelPublicKeys_get_htlc_basepoint(uint64_t this_ptr) {
33967 LDKChannelPublicKeys this_ptr_conv;
33968 this_ptr_conv.inner = untag_ptr(this_ptr);
33969 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33970 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33971 this_ptr_conv.is_owned = false;
33972 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
33973 memcpy(ret_arr->elems, ChannelPublicKeys_get_htlc_basepoint(&this_ptr_conv).compressed_form, 33);
33977 void __attribute__((export_name("TS_ChannelPublicKeys_set_htlc_basepoint"))) TS_ChannelPublicKeys_set_htlc_basepoint(uint64_t this_ptr, int8_tArray val) {
33978 LDKChannelPublicKeys this_ptr_conv;
33979 this_ptr_conv.inner = untag_ptr(this_ptr);
33980 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
33981 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
33982 this_ptr_conv.is_owned = false;
33983 LDKPublicKey val_ref;
33984 CHECK(val->arr_len == 33);
33985 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
33986 ChannelPublicKeys_set_htlc_basepoint(&this_ptr_conv, val_ref);
33989 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) {
33990 LDKPublicKey funding_pubkey_arg_ref;
33991 CHECK(funding_pubkey_arg->arr_len == 33);
33992 memcpy(funding_pubkey_arg_ref.compressed_form, funding_pubkey_arg->elems, 33); FREE(funding_pubkey_arg);
33993 LDKPublicKey revocation_basepoint_arg_ref;
33994 CHECK(revocation_basepoint_arg->arr_len == 33);
33995 memcpy(revocation_basepoint_arg_ref.compressed_form, revocation_basepoint_arg->elems, 33); FREE(revocation_basepoint_arg);
33996 LDKPublicKey payment_point_arg_ref;
33997 CHECK(payment_point_arg->arr_len == 33);
33998 memcpy(payment_point_arg_ref.compressed_form, payment_point_arg->elems, 33); FREE(payment_point_arg);
33999 LDKPublicKey delayed_payment_basepoint_arg_ref;
34000 CHECK(delayed_payment_basepoint_arg->arr_len == 33);
34001 memcpy(delayed_payment_basepoint_arg_ref.compressed_form, delayed_payment_basepoint_arg->elems, 33); FREE(delayed_payment_basepoint_arg);
34002 LDKPublicKey htlc_basepoint_arg_ref;
34003 CHECK(htlc_basepoint_arg->arr_len == 33);
34004 memcpy(htlc_basepoint_arg_ref.compressed_form, htlc_basepoint_arg->elems, 33); FREE(htlc_basepoint_arg);
34005 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);
34006 uint64_t ret_ref = 0;
34007 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34008 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34012 static inline uint64_t ChannelPublicKeys_clone_ptr(LDKChannelPublicKeys *NONNULL_PTR arg) {
34013 LDKChannelPublicKeys ret_var = ChannelPublicKeys_clone(arg);
34014 uint64_t ret_ref = 0;
34015 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34016 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34019 int64_t __attribute__((export_name("TS_ChannelPublicKeys_clone_ptr"))) TS_ChannelPublicKeys_clone_ptr(uint64_t arg) {
34020 LDKChannelPublicKeys arg_conv;
34021 arg_conv.inner = untag_ptr(arg);
34022 arg_conv.is_owned = ptr_is_owned(arg);
34023 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
34024 arg_conv.is_owned = false;
34025 int64_t ret_conv = ChannelPublicKeys_clone_ptr(&arg_conv);
34029 uint64_t __attribute__((export_name("TS_ChannelPublicKeys_clone"))) TS_ChannelPublicKeys_clone(uint64_t orig) {
34030 LDKChannelPublicKeys orig_conv;
34031 orig_conv.inner = untag_ptr(orig);
34032 orig_conv.is_owned = ptr_is_owned(orig);
34033 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
34034 orig_conv.is_owned = false;
34035 LDKChannelPublicKeys ret_var = ChannelPublicKeys_clone(&orig_conv);
34036 uint64_t ret_ref = 0;
34037 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34038 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34042 int8_tArray __attribute__((export_name("TS_ChannelPublicKeys_write"))) TS_ChannelPublicKeys_write(uint64_t obj) {
34043 LDKChannelPublicKeys obj_conv;
34044 obj_conv.inner = untag_ptr(obj);
34045 obj_conv.is_owned = ptr_is_owned(obj);
34046 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34047 obj_conv.is_owned = false;
34048 LDKCVec_u8Z ret_var = ChannelPublicKeys_write(&obj_conv);
34049 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34050 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34051 CVec_u8Z_free(ret_var);
34055 uint64_t __attribute__((export_name("TS_ChannelPublicKeys_read"))) TS_ChannelPublicKeys_read(int8_tArray ser) {
34056 LDKu8slice ser_ref;
34057 ser_ref.datalen = ser->arr_len;
34058 ser_ref.data = ser->elems;
34059 LDKCResult_ChannelPublicKeysDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelPublicKeysDecodeErrorZ), "LDKCResult_ChannelPublicKeysDecodeErrorZ");
34060 *ret_conv = ChannelPublicKeys_read(ser_ref);
34062 return tag_ptr(ret_conv, true);
34065 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) {
34066 LDKPublicKey per_commitment_point_ref;
34067 CHECK(per_commitment_point->arr_len == 33);
34068 memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point);
34069 LDKPublicKey broadcaster_delayed_payment_base_ref;
34070 CHECK(broadcaster_delayed_payment_base->arr_len == 33);
34071 memcpy(broadcaster_delayed_payment_base_ref.compressed_form, broadcaster_delayed_payment_base->elems, 33); FREE(broadcaster_delayed_payment_base);
34072 LDKPublicKey broadcaster_htlc_base_ref;
34073 CHECK(broadcaster_htlc_base->arr_len == 33);
34074 memcpy(broadcaster_htlc_base_ref.compressed_form, broadcaster_htlc_base->elems, 33); FREE(broadcaster_htlc_base);
34075 LDKPublicKey countersignatory_revocation_base_ref;
34076 CHECK(countersignatory_revocation_base->arr_len == 33);
34077 memcpy(countersignatory_revocation_base_ref.compressed_form, countersignatory_revocation_base->elems, 33); FREE(countersignatory_revocation_base);
34078 LDKPublicKey countersignatory_htlc_base_ref;
34079 CHECK(countersignatory_htlc_base->arr_len == 33);
34080 memcpy(countersignatory_htlc_base_ref.compressed_form, countersignatory_htlc_base->elems, 33); FREE(countersignatory_htlc_base);
34081 LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
34082 *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);
34083 return tag_ptr(ret_conv, true);
34086 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) {
34087 LDKPublicKey per_commitment_point_ref;
34088 CHECK(per_commitment_point->arr_len == 33);
34089 memcpy(per_commitment_point_ref.compressed_form, per_commitment_point->elems, 33); FREE(per_commitment_point);
34090 LDKChannelPublicKeys broadcaster_keys_conv;
34091 broadcaster_keys_conv.inner = untag_ptr(broadcaster_keys);
34092 broadcaster_keys_conv.is_owned = ptr_is_owned(broadcaster_keys);
34093 CHECK_INNER_FIELD_ACCESS_OR_NULL(broadcaster_keys_conv);
34094 broadcaster_keys_conv.is_owned = false;
34095 LDKChannelPublicKeys countersignatory_keys_conv;
34096 countersignatory_keys_conv.inner = untag_ptr(countersignatory_keys);
34097 countersignatory_keys_conv.is_owned = ptr_is_owned(countersignatory_keys);
34098 CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_keys_conv);
34099 countersignatory_keys_conv.is_owned = false;
34100 LDKCResult_TxCreationKeysErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_TxCreationKeysErrorZ), "LDKCResult_TxCreationKeysErrorZ");
34101 *ret_conv = TxCreationKeys_from_channel_static_keys(per_commitment_point_ref, &broadcaster_keys_conv, &countersignatory_keys_conv);
34102 return tag_ptr(ret_conv, true);
34105 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) {
34106 LDKPublicKey revocation_key_ref;
34107 CHECK(revocation_key->arr_len == 33);
34108 memcpy(revocation_key_ref.compressed_form, revocation_key->elems, 33); FREE(revocation_key);
34109 LDKPublicKey broadcaster_delayed_payment_key_ref;
34110 CHECK(broadcaster_delayed_payment_key->arr_len == 33);
34111 memcpy(broadcaster_delayed_payment_key_ref.compressed_form, broadcaster_delayed_payment_key->elems, 33); FREE(broadcaster_delayed_payment_key);
34112 LDKCVec_u8Z ret_var = get_revokeable_redeemscript(revocation_key_ref, contest_delay, broadcaster_delayed_payment_key_ref);
34113 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34114 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34115 CVec_u8Z_free(ret_var);
34119 void __attribute__((export_name("TS_HTLCOutputInCommitment_free"))) TS_HTLCOutputInCommitment_free(uint64_t this_obj) {
34120 LDKHTLCOutputInCommitment this_obj_conv;
34121 this_obj_conv.inner = untag_ptr(this_obj);
34122 this_obj_conv.is_owned = ptr_is_owned(this_obj);
34123 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
34124 HTLCOutputInCommitment_free(this_obj_conv);
34127 jboolean __attribute__((export_name("TS_HTLCOutputInCommitment_get_offered"))) TS_HTLCOutputInCommitment_get_offered(uint64_t this_ptr) {
34128 LDKHTLCOutputInCommitment this_ptr_conv;
34129 this_ptr_conv.inner = untag_ptr(this_ptr);
34130 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34131 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34132 this_ptr_conv.is_owned = false;
34133 jboolean ret_conv = HTLCOutputInCommitment_get_offered(&this_ptr_conv);
34137 void __attribute__((export_name("TS_HTLCOutputInCommitment_set_offered"))) TS_HTLCOutputInCommitment_set_offered(uint64_t this_ptr, jboolean val) {
34138 LDKHTLCOutputInCommitment this_ptr_conv;
34139 this_ptr_conv.inner = untag_ptr(this_ptr);
34140 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34141 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34142 this_ptr_conv.is_owned = false;
34143 HTLCOutputInCommitment_set_offered(&this_ptr_conv, val);
34146 int64_t __attribute__((export_name("TS_HTLCOutputInCommitment_get_amount_msat"))) TS_HTLCOutputInCommitment_get_amount_msat(uint64_t this_ptr) {
34147 LDKHTLCOutputInCommitment this_ptr_conv;
34148 this_ptr_conv.inner = untag_ptr(this_ptr);
34149 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34150 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34151 this_ptr_conv.is_owned = false;
34152 int64_t ret_conv = HTLCOutputInCommitment_get_amount_msat(&this_ptr_conv);
34156 void __attribute__((export_name("TS_HTLCOutputInCommitment_set_amount_msat"))) TS_HTLCOutputInCommitment_set_amount_msat(uint64_t this_ptr, int64_t val) {
34157 LDKHTLCOutputInCommitment this_ptr_conv;
34158 this_ptr_conv.inner = untag_ptr(this_ptr);
34159 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34160 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34161 this_ptr_conv.is_owned = false;
34162 HTLCOutputInCommitment_set_amount_msat(&this_ptr_conv, val);
34165 int32_t __attribute__((export_name("TS_HTLCOutputInCommitment_get_cltv_expiry"))) TS_HTLCOutputInCommitment_get_cltv_expiry(uint64_t this_ptr) {
34166 LDKHTLCOutputInCommitment this_ptr_conv;
34167 this_ptr_conv.inner = untag_ptr(this_ptr);
34168 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34169 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34170 this_ptr_conv.is_owned = false;
34171 int32_t ret_conv = HTLCOutputInCommitment_get_cltv_expiry(&this_ptr_conv);
34175 void __attribute__((export_name("TS_HTLCOutputInCommitment_set_cltv_expiry"))) TS_HTLCOutputInCommitment_set_cltv_expiry(uint64_t this_ptr, int32_t val) {
34176 LDKHTLCOutputInCommitment this_ptr_conv;
34177 this_ptr_conv.inner = untag_ptr(this_ptr);
34178 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34179 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34180 this_ptr_conv.is_owned = false;
34181 HTLCOutputInCommitment_set_cltv_expiry(&this_ptr_conv, val);
34184 int8_tArray __attribute__((export_name("TS_HTLCOutputInCommitment_get_payment_hash"))) TS_HTLCOutputInCommitment_get_payment_hash(uint64_t this_ptr) {
34185 LDKHTLCOutputInCommitment this_ptr_conv;
34186 this_ptr_conv.inner = untag_ptr(this_ptr);
34187 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34188 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34189 this_ptr_conv.is_owned = false;
34190 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
34191 memcpy(ret_arr->elems, *HTLCOutputInCommitment_get_payment_hash(&this_ptr_conv), 32);
34195 void __attribute__((export_name("TS_HTLCOutputInCommitment_set_payment_hash"))) TS_HTLCOutputInCommitment_set_payment_hash(uint64_t this_ptr, int8_tArray val) {
34196 LDKHTLCOutputInCommitment this_ptr_conv;
34197 this_ptr_conv.inner = untag_ptr(this_ptr);
34198 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34199 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34200 this_ptr_conv.is_owned = false;
34201 LDKThirtyTwoBytes val_ref;
34202 CHECK(val->arr_len == 32);
34203 memcpy(val_ref.data, val->elems, 32); FREE(val);
34204 HTLCOutputInCommitment_set_payment_hash(&this_ptr_conv, val_ref);
34207 uint64_t __attribute__((export_name("TS_HTLCOutputInCommitment_get_transaction_output_index"))) TS_HTLCOutputInCommitment_get_transaction_output_index(uint64_t this_ptr) {
34208 LDKHTLCOutputInCommitment this_ptr_conv;
34209 this_ptr_conv.inner = untag_ptr(this_ptr);
34210 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34211 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34212 this_ptr_conv.is_owned = false;
34213 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
34214 *ret_copy = HTLCOutputInCommitment_get_transaction_output_index(&this_ptr_conv);
34215 uint64_t ret_ref = tag_ptr(ret_copy, true);
34219 void __attribute__((export_name("TS_HTLCOutputInCommitment_set_transaction_output_index"))) TS_HTLCOutputInCommitment_set_transaction_output_index(uint64_t this_ptr, uint64_t val) {
34220 LDKHTLCOutputInCommitment this_ptr_conv;
34221 this_ptr_conv.inner = untag_ptr(this_ptr);
34222 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34223 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34224 this_ptr_conv.is_owned = false;
34225 void* val_ptr = untag_ptr(val);
34226 CHECK_ACCESS(val_ptr);
34227 LDKCOption_u32Z val_conv = *(LDKCOption_u32Z*)(val_ptr);
34228 val_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(val));
34229 HTLCOutputInCommitment_set_transaction_output_index(&this_ptr_conv, val_conv);
34232 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) {
34233 LDKThirtyTwoBytes payment_hash_arg_ref;
34234 CHECK(payment_hash_arg->arr_len == 32);
34235 memcpy(payment_hash_arg_ref.data, payment_hash_arg->elems, 32); FREE(payment_hash_arg);
34236 void* transaction_output_index_arg_ptr = untag_ptr(transaction_output_index_arg);
34237 CHECK_ACCESS(transaction_output_index_arg_ptr);
34238 LDKCOption_u32Z transaction_output_index_arg_conv = *(LDKCOption_u32Z*)(transaction_output_index_arg_ptr);
34239 transaction_output_index_arg_conv = COption_u32Z_clone((LDKCOption_u32Z*)untag_ptr(transaction_output_index_arg));
34240 LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_new(offered_arg, amount_msat_arg, cltv_expiry_arg, payment_hash_arg_ref, transaction_output_index_arg_conv);
34241 uint64_t ret_ref = 0;
34242 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34243 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34247 static inline uint64_t HTLCOutputInCommitment_clone_ptr(LDKHTLCOutputInCommitment *NONNULL_PTR arg) {
34248 LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_clone(arg);
34249 uint64_t ret_ref = 0;
34250 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34251 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34254 int64_t __attribute__((export_name("TS_HTLCOutputInCommitment_clone_ptr"))) TS_HTLCOutputInCommitment_clone_ptr(uint64_t arg) {
34255 LDKHTLCOutputInCommitment arg_conv;
34256 arg_conv.inner = untag_ptr(arg);
34257 arg_conv.is_owned = ptr_is_owned(arg);
34258 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
34259 arg_conv.is_owned = false;
34260 int64_t ret_conv = HTLCOutputInCommitment_clone_ptr(&arg_conv);
34264 uint64_t __attribute__((export_name("TS_HTLCOutputInCommitment_clone"))) TS_HTLCOutputInCommitment_clone(uint64_t orig) {
34265 LDKHTLCOutputInCommitment orig_conv;
34266 orig_conv.inner = untag_ptr(orig);
34267 orig_conv.is_owned = ptr_is_owned(orig);
34268 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
34269 orig_conv.is_owned = false;
34270 LDKHTLCOutputInCommitment ret_var = HTLCOutputInCommitment_clone(&orig_conv);
34271 uint64_t ret_ref = 0;
34272 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34273 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34277 int8_tArray __attribute__((export_name("TS_HTLCOutputInCommitment_write"))) TS_HTLCOutputInCommitment_write(uint64_t obj) {
34278 LDKHTLCOutputInCommitment obj_conv;
34279 obj_conv.inner = untag_ptr(obj);
34280 obj_conv.is_owned = ptr_is_owned(obj);
34281 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34282 obj_conv.is_owned = false;
34283 LDKCVec_u8Z ret_var = HTLCOutputInCommitment_write(&obj_conv);
34284 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34285 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34286 CVec_u8Z_free(ret_var);
34290 uint64_t __attribute__((export_name("TS_HTLCOutputInCommitment_read"))) TS_HTLCOutputInCommitment_read(int8_tArray ser) {
34291 LDKu8slice ser_ref;
34292 ser_ref.datalen = ser->arr_len;
34293 ser_ref.data = ser->elems;
34294 LDKCResult_HTLCOutputInCommitmentDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HTLCOutputInCommitmentDecodeErrorZ), "LDKCResult_HTLCOutputInCommitmentDecodeErrorZ");
34295 *ret_conv = HTLCOutputInCommitment_read(ser_ref);
34297 return tag_ptr(ret_conv, true);
34300 int8_tArray __attribute__((export_name("TS_get_htlc_redeemscript"))) TS_get_htlc_redeemscript(uint64_t htlc, jboolean opt_anchors, uint64_t keys) {
34301 LDKHTLCOutputInCommitment htlc_conv;
34302 htlc_conv.inner = untag_ptr(htlc);
34303 htlc_conv.is_owned = ptr_is_owned(htlc);
34304 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv);
34305 htlc_conv.is_owned = false;
34306 LDKTxCreationKeys keys_conv;
34307 keys_conv.inner = untag_ptr(keys);
34308 keys_conv.is_owned = ptr_is_owned(keys);
34309 CHECK_INNER_FIELD_ACCESS_OR_NULL(keys_conv);
34310 keys_conv.is_owned = false;
34311 LDKCVec_u8Z ret_var = get_htlc_redeemscript(&htlc_conv, opt_anchors, &keys_conv);
34312 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34313 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34314 CVec_u8Z_free(ret_var);
34318 int8_tArray __attribute__((export_name("TS_make_funding_redeemscript"))) TS_make_funding_redeemscript(int8_tArray broadcaster, int8_tArray countersignatory) {
34319 LDKPublicKey broadcaster_ref;
34320 CHECK(broadcaster->arr_len == 33);
34321 memcpy(broadcaster_ref.compressed_form, broadcaster->elems, 33); FREE(broadcaster);
34322 LDKPublicKey countersignatory_ref;
34323 CHECK(countersignatory->arr_len == 33);
34324 memcpy(countersignatory_ref.compressed_form, countersignatory->elems, 33); FREE(countersignatory);
34325 LDKCVec_u8Z ret_var = make_funding_redeemscript(broadcaster_ref, countersignatory_ref);
34326 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34327 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34328 CVec_u8Z_free(ret_var);
34332 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) {
34333 unsigned char commitment_txid_arr[32];
34334 CHECK(commitment_txid->arr_len == 32);
34335 memcpy(commitment_txid_arr, commitment_txid->elems, 32); FREE(commitment_txid);
34336 unsigned char (*commitment_txid_ref)[32] = &commitment_txid_arr;
34337 LDKHTLCOutputInCommitment htlc_conv;
34338 htlc_conv.inner = untag_ptr(htlc);
34339 htlc_conv.is_owned = ptr_is_owned(htlc);
34340 CHECK_INNER_FIELD_ACCESS_OR_NULL(htlc_conv);
34341 htlc_conv.is_owned = false;
34342 LDKPublicKey broadcaster_delayed_payment_key_ref;
34343 CHECK(broadcaster_delayed_payment_key->arr_len == 33);
34344 memcpy(broadcaster_delayed_payment_key_ref.compressed_form, broadcaster_delayed_payment_key->elems, 33); FREE(broadcaster_delayed_payment_key);
34345 LDKPublicKey revocation_key_ref;
34346 CHECK(revocation_key->arr_len == 33);
34347 memcpy(revocation_key_ref.compressed_form, revocation_key->elems, 33); FREE(revocation_key);
34348 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);
34349 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34350 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34351 Transaction_free(ret_var);
34355 int8_tArray __attribute__((export_name("TS_get_anchor_redeemscript"))) TS_get_anchor_redeemscript(int8_tArray funding_pubkey) {
34356 LDKPublicKey funding_pubkey_ref;
34357 CHECK(funding_pubkey->arr_len == 33);
34358 memcpy(funding_pubkey_ref.compressed_form, funding_pubkey->elems, 33); FREE(funding_pubkey);
34359 LDKCVec_u8Z ret_var = get_anchor_redeemscript(funding_pubkey_ref);
34360 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34361 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34362 CVec_u8Z_free(ret_var);
34366 void __attribute__((export_name("TS_ChannelTransactionParameters_free"))) TS_ChannelTransactionParameters_free(uint64_t this_obj) {
34367 LDKChannelTransactionParameters this_obj_conv;
34368 this_obj_conv.inner = untag_ptr(this_obj);
34369 this_obj_conv.is_owned = ptr_is_owned(this_obj);
34370 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
34371 ChannelTransactionParameters_free(this_obj_conv);
34374 uint64_t __attribute__((export_name("TS_ChannelTransactionParameters_get_holder_pubkeys"))) TS_ChannelTransactionParameters_get_holder_pubkeys(uint64_t this_ptr) {
34375 LDKChannelTransactionParameters this_ptr_conv;
34376 this_ptr_conv.inner = untag_ptr(this_ptr);
34377 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34378 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34379 this_ptr_conv.is_owned = false;
34380 LDKChannelPublicKeys ret_var = ChannelTransactionParameters_get_holder_pubkeys(&this_ptr_conv);
34381 uint64_t ret_ref = 0;
34382 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34383 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34387 void __attribute__((export_name("TS_ChannelTransactionParameters_set_holder_pubkeys"))) TS_ChannelTransactionParameters_set_holder_pubkeys(uint64_t this_ptr, uint64_t val) {
34388 LDKChannelTransactionParameters this_ptr_conv;
34389 this_ptr_conv.inner = untag_ptr(this_ptr);
34390 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34391 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34392 this_ptr_conv.is_owned = false;
34393 LDKChannelPublicKeys val_conv;
34394 val_conv.inner = untag_ptr(val);
34395 val_conv.is_owned = ptr_is_owned(val);
34396 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
34397 val_conv = ChannelPublicKeys_clone(&val_conv);
34398 ChannelTransactionParameters_set_holder_pubkeys(&this_ptr_conv, val_conv);
34401 int16_t __attribute__((export_name("TS_ChannelTransactionParameters_get_holder_selected_contest_delay"))) TS_ChannelTransactionParameters_get_holder_selected_contest_delay(uint64_t this_ptr) {
34402 LDKChannelTransactionParameters this_ptr_conv;
34403 this_ptr_conv.inner = untag_ptr(this_ptr);
34404 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34405 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34406 this_ptr_conv.is_owned = false;
34407 int16_t ret_conv = ChannelTransactionParameters_get_holder_selected_contest_delay(&this_ptr_conv);
34411 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) {
34412 LDKChannelTransactionParameters this_ptr_conv;
34413 this_ptr_conv.inner = untag_ptr(this_ptr);
34414 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34415 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34416 this_ptr_conv.is_owned = false;
34417 ChannelTransactionParameters_set_holder_selected_contest_delay(&this_ptr_conv, val);
34420 jboolean __attribute__((export_name("TS_ChannelTransactionParameters_get_is_outbound_from_holder"))) TS_ChannelTransactionParameters_get_is_outbound_from_holder(uint64_t this_ptr) {
34421 LDKChannelTransactionParameters 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 jboolean ret_conv = ChannelTransactionParameters_get_is_outbound_from_holder(&this_ptr_conv);
34430 void __attribute__((export_name("TS_ChannelTransactionParameters_set_is_outbound_from_holder"))) TS_ChannelTransactionParameters_set_is_outbound_from_holder(uint64_t this_ptr, jboolean val) {
34431 LDKChannelTransactionParameters this_ptr_conv;
34432 this_ptr_conv.inner = untag_ptr(this_ptr);
34433 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34434 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34435 this_ptr_conv.is_owned = false;
34436 ChannelTransactionParameters_set_is_outbound_from_holder(&this_ptr_conv, val);
34439 uint64_t __attribute__((export_name("TS_ChannelTransactionParameters_get_counterparty_parameters"))) TS_ChannelTransactionParameters_get_counterparty_parameters(uint64_t this_ptr) {
34440 LDKChannelTransactionParameters this_ptr_conv;
34441 this_ptr_conv.inner = untag_ptr(this_ptr);
34442 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34443 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34444 this_ptr_conv.is_owned = false;
34445 LDKCounterpartyChannelTransactionParameters ret_var = ChannelTransactionParameters_get_counterparty_parameters(&this_ptr_conv);
34446 uint64_t ret_ref = 0;
34447 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34448 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34452 void __attribute__((export_name("TS_ChannelTransactionParameters_set_counterparty_parameters"))) TS_ChannelTransactionParameters_set_counterparty_parameters(uint64_t this_ptr, uint64_t val) {
34453 LDKChannelTransactionParameters this_ptr_conv;
34454 this_ptr_conv.inner = untag_ptr(this_ptr);
34455 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34456 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34457 this_ptr_conv.is_owned = false;
34458 LDKCounterpartyChannelTransactionParameters val_conv;
34459 val_conv.inner = untag_ptr(val);
34460 val_conv.is_owned = ptr_is_owned(val);
34461 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
34462 val_conv = CounterpartyChannelTransactionParameters_clone(&val_conv);
34463 ChannelTransactionParameters_set_counterparty_parameters(&this_ptr_conv, val_conv);
34466 uint64_t __attribute__((export_name("TS_ChannelTransactionParameters_get_funding_outpoint"))) TS_ChannelTransactionParameters_get_funding_outpoint(uint64_t this_ptr) {
34467 LDKChannelTransactionParameters this_ptr_conv;
34468 this_ptr_conv.inner = untag_ptr(this_ptr);
34469 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34470 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34471 this_ptr_conv.is_owned = false;
34472 LDKOutPoint ret_var = ChannelTransactionParameters_get_funding_outpoint(&this_ptr_conv);
34473 uint64_t ret_ref = 0;
34474 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34475 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34479 void __attribute__((export_name("TS_ChannelTransactionParameters_set_funding_outpoint"))) TS_ChannelTransactionParameters_set_funding_outpoint(uint64_t this_ptr, uint64_t val) {
34480 LDKChannelTransactionParameters this_ptr_conv;
34481 this_ptr_conv.inner = untag_ptr(this_ptr);
34482 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34483 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34484 this_ptr_conv.is_owned = false;
34485 LDKOutPoint val_conv;
34486 val_conv.inner = untag_ptr(val);
34487 val_conv.is_owned = ptr_is_owned(val);
34488 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
34489 val_conv = OutPoint_clone(&val_conv);
34490 ChannelTransactionParameters_set_funding_outpoint(&this_ptr_conv, val_conv);
34493 uint32_t __attribute__((export_name("TS_ChannelTransactionParameters_get_opt_anchors"))) TS_ChannelTransactionParameters_get_opt_anchors(uint64_t this_ptr) {
34494 LDKChannelTransactionParameters this_ptr_conv;
34495 this_ptr_conv.inner = untag_ptr(this_ptr);
34496 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34497 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34498 this_ptr_conv.is_owned = false;
34499 uint32_t ret_conv = LDKCOption_NoneZ_to_js(ChannelTransactionParameters_get_opt_anchors(&this_ptr_conv));
34503 void __attribute__((export_name("TS_ChannelTransactionParameters_set_opt_anchors"))) TS_ChannelTransactionParameters_set_opt_anchors(uint64_t this_ptr, uint32_t val) {
34504 LDKChannelTransactionParameters this_ptr_conv;
34505 this_ptr_conv.inner = untag_ptr(this_ptr);
34506 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34507 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34508 this_ptr_conv.is_owned = false;
34509 LDKCOption_NoneZ val_conv = LDKCOption_NoneZ_from_js(val);
34510 ChannelTransactionParameters_set_opt_anchors(&this_ptr_conv, val_conv);
34513 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) {
34514 LDKChannelPublicKeys holder_pubkeys_arg_conv;
34515 holder_pubkeys_arg_conv.inner = untag_ptr(holder_pubkeys_arg);
34516 holder_pubkeys_arg_conv.is_owned = ptr_is_owned(holder_pubkeys_arg);
34517 CHECK_INNER_FIELD_ACCESS_OR_NULL(holder_pubkeys_arg_conv);
34518 holder_pubkeys_arg_conv = ChannelPublicKeys_clone(&holder_pubkeys_arg_conv);
34519 LDKCounterpartyChannelTransactionParameters counterparty_parameters_arg_conv;
34520 counterparty_parameters_arg_conv.inner = untag_ptr(counterparty_parameters_arg);
34521 counterparty_parameters_arg_conv.is_owned = ptr_is_owned(counterparty_parameters_arg);
34522 CHECK_INNER_FIELD_ACCESS_OR_NULL(counterparty_parameters_arg_conv);
34523 counterparty_parameters_arg_conv = CounterpartyChannelTransactionParameters_clone(&counterparty_parameters_arg_conv);
34524 LDKOutPoint funding_outpoint_arg_conv;
34525 funding_outpoint_arg_conv.inner = untag_ptr(funding_outpoint_arg);
34526 funding_outpoint_arg_conv.is_owned = ptr_is_owned(funding_outpoint_arg);
34527 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_arg_conv);
34528 funding_outpoint_arg_conv = OutPoint_clone(&funding_outpoint_arg_conv);
34529 LDKCOption_NoneZ opt_anchors_arg_conv = LDKCOption_NoneZ_from_js(opt_anchors_arg);
34530 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);
34531 uint64_t ret_ref = 0;
34532 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34533 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34537 static inline uint64_t ChannelTransactionParameters_clone_ptr(LDKChannelTransactionParameters *NONNULL_PTR arg) {
34538 LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_clone(arg);
34539 uint64_t ret_ref = 0;
34540 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34541 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34544 int64_t __attribute__((export_name("TS_ChannelTransactionParameters_clone_ptr"))) TS_ChannelTransactionParameters_clone_ptr(uint64_t arg) {
34545 LDKChannelTransactionParameters arg_conv;
34546 arg_conv.inner = untag_ptr(arg);
34547 arg_conv.is_owned = ptr_is_owned(arg);
34548 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
34549 arg_conv.is_owned = false;
34550 int64_t ret_conv = ChannelTransactionParameters_clone_ptr(&arg_conv);
34554 uint64_t __attribute__((export_name("TS_ChannelTransactionParameters_clone"))) TS_ChannelTransactionParameters_clone(uint64_t orig) {
34555 LDKChannelTransactionParameters orig_conv;
34556 orig_conv.inner = untag_ptr(orig);
34557 orig_conv.is_owned = ptr_is_owned(orig);
34558 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
34559 orig_conv.is_owned = false;
34560 LDKChannelTransactionParameters ret_var = ChannelTransactionParameters_clone(&orig_conv);
34561 uint64_t ret_ref = 0;
34562 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34563 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34567 void __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_free"))) TS_CounterpartyChannelTransactionParameters_free(uint64_t this_obj) {
34568 LDKCounterpartyChannelTransactionParameters 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 CounterpartyChannelTransactionParameters_free(this_obj_conv);
34575 uint64_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_get_pubkeys"))) TS_CounterpartyChannelTransactionParameters_get_pubkeys(uint64_t this_ptr) {
34576 LDKCounterpartyChannelTransactionParameters 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 = CounterpartyChannelTransactionParameters_get_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_CounterpartyChannelTransactionParameters_set_pubkeys"))) TS_CounterpartyChannelTransactionParameters_set_pubkeys(uint64_t this_ptr, uint64_t val) {
34589 LDKCounterpartyChannelTransactionParameters 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 CounterpartyChannelTransactionParameters_set_pubkeys(&this_ptr_conv, val_conv);
34602 int16_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_get_selected_contest_delay"))) TS_CounterpartyChannelTransactionParameters_get_selected_contest_delay(uint64_t this_ptr) {
34603 LDKCounterpartyChannelTransactionParameters 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 = CounterpartyChannelTransactionParameters_get_selected_contest_delay(&this_ptr_conv);
34612 void __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_set_selected_contest_delay"))) TS_CounterpartyChannelTransactionParameters_set_selected_contest_delay(uint64_t this_ptr, int16_t val) {
34613 LDKCounterpartyChannelTransactionParameters 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 CounterpartyChannelTransactionParameters_set_selected_contest_delay(&this_ptr_conv, val);
34621 uint64_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_new"))) TS_CounterpartyChannelTransactionParameters_new(uint64_t pubkeys_arg, int16_t selected_contest_delay_arg) {
34622 LDKChannelPublicKeys pubkeys_arg_conv;
34623 pubkeys_arg_conv.inner = untag_ptr(pubkeys_arg);
34624 pubkeys_arg_conv.is_owned = ptr_is_owned(pubkeys_arg);
34625 CHECK_INNER_FIELD_ACCESS_OR_NULL(pubkeys_arg_conv);
34626 pubkeys_arg_conv = ChannelPublicKeys_clone(&pubkeys_arg_conv);
34627 LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_new(pubkeys_arg_conv, selected_contest_delay_arg);
34628 uint64_t ret_ref = 0;
34629 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34630 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34634 static inline uint64_t CounterpartyChannelTransactionParameters_clone_ptr(LDKCounterpartyChannelTransactionParameters *NONNULL_PTR arg) {
34635 LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_clone(arg);
34636 uint64_t ret_ref = 0;
34637 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34638 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34641 int64_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_clone_ptr"))) TS_CounterpartyChannelTransactionParameters_clone_ptr(uint64_t arg) {
34642 LDKCounterpartyChannelTransactionParameters arg_conv;
34643 arg_conv.inner = untag_ptr(arg);
34644 arg_conv.is_owned = ptr_is_owned(arg);
34645 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
34646 arg_conv.is_owned = false;
34647 int64_t ret_conv = CounterpartyChannelTransactionParameters_clone_ptr(&arg_conv);
34651 uint64_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_clone"))) TS_CounterpartyChannelTransactionParameters_clone(uint64_t orig) {
34652 LDKCounterpartyChannelTransactionParameters orig_conv;
34653 orig_conv.inner = untag_ptr(orig);
34654 orig_conv.is_owned = ptr_is_owned(orig);
34655 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
34656 orig_conv.is_owned = false;
34657 LDKCounterpartyChannelTransactionParameters ret_var = CounterpartyChannelTransactionParameters_clone(&orig_conv);
34658 uint64_t ret_ref = 0;
34659 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34660 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34664 jboolean __attribute__((export_name("TS_ChannelTransactionParameters_is_populated"))) TS_ChannelTransactionParameters_is_populated(uint64_t this_arg) {
34665 LDKChannelTransactionParameters this_arg_conv;
34666 this_arg_conv.inner = untag_ptr(this_arg);
34667 this_arg_conv.is_owned = ptr_is_owned(this_arg);
34668 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
34669 this_arg_conv.is_owned = false;
34670 jboolean ret_conv = ChannelTransactionParameters_is_populated(&this_arg_conv);
34674 uint64_t __attribute__((export_name("TS_ChannelTransactionParameters_as_holder_broadcastable"))) TS_ChannelTransactionParameters_as_holder_broadcastable(uint64_t this_arg) {
34675 LDKChannelTransactionParameters this_arg_conv;
34676 this_arg_conv.inner = untag_ptr(this_arg);
34677 this_arg_conv.is_owned = ptr_is_owned(this_arg);
34678 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
34679 this_arg_conv.is_owned = false;
34680 LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_holder_broadcastable(&this_arg_conv);
34681 uint64_t ret_ref = 0;
34682 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34683 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34687 uint64_t __attribute__((export_name("TS_ChannelTransactionParameters_as_counterparty_broadcastable"))) TS_ChannelTransactionParameters_as_counterparty_broadcastable(uint64_t this_arg) {
34688 LDKChannelTransactionParameters this_arg_conv;
34689 this_arg_conv.inner = untag_ptr(this_arg);
34690 this_arg_conv.is_owned = ptr_is_owned(this_arg);
34691 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
34692 this_arg_conv.is_owned = false;
34693 LDKDirectedChannelTransactionParameters ret_var = ChannelTransactionParameters_as_counterparty_broadcastable(&this_arg_conv);
34694 uint64_t ret_ref = 0;
34695 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34696 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34700 int8_tArray __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_write"))) TS_CounterpartyChannelTransactionParameters_write(uint64_t obj) {
34701 LDKCounterpartyChannelTransactionParameters obj_conv;
34702 obj_conv.inner = untag_ptr(obj);
34703 obj_conv.is_owned = ptr_is_owned(obj);
34704 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34705 obj_conv.is_owned = false;
34706 LDKCVec_u8Z ret_var = CounterpartyChannelTransactionParameters_write(&obj_conv);
34707 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34708 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34709 CVec_u8Z_free(ret_var);
34713 uint64_t __attribute__((export_name("TS_CounterpartyChannelTransactionParameters_read"))) TS_CounterpartyChannelTransactionParameters_read(int8_tArray ser) {
34714 LDKu8slice ser_ref;
34715 ser_ref.datalen = ser->arr_len;
34716 ser_ref.data = ser->elems;
34717 LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ), "LDKCResult_CounterpartyChannelTransactionParametersDecodeErrorZ");
34718 *ret_conv = CounterpartyChannelTransactionParameters_read(ser_ref);
34720 return tag_ptr(ret_conv, true);
34723 int8_tArray __attribute__((export_name("TS_ChannelTransactionParameters_write"))) TS_ChannelTransactionParameters_write(uint64_t obj) {
34724 LDKChannelTransactionParameters obj_conv;
34725 obj_conv.inner = untag_ptr(obj);
34726 obj_conv.is_owned = ptr_is_owned(obj);
34727 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34728 obj_conv.is_owned = false;
34729 LDKCVec_u8Z ret_var = ChannelTransactionParameters_write(&obj_conv);
34730 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34731 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34732 CVec_u8Z_free(ret_var);
34736 uint64_t __attribute__((export_name("TS_ChannelTransactionParameters_read"))) TS_ChannelTransactionParameters_read(int8_tArray ser) {
34737 LDKu8slice ser_ref;
34738 ser_ref.datalen = ser->arr_len;
34739 ser_ref.data = ser->elems;
34740 LDKCResult_ChannelTransactionParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTransactionParametersDecodeErrorZ), "LDKCResult_ChannelTransactionParametersDecodeErrorZ");
34741 *ret_conv = ChannelTransactionParameters_read(ser_ref);
34743 return tag_ptr(ret_conv, true);
34746 void __attribute__((export_name("TS_DirectedChannelTransactionParameters_free"))) TS_DirectedChannelTransactionParameters_free(uint64_t this_obj) {
34747 LDKDirectedChannelTransactionParameters this_obj_conv;
34748 this_obj_conv.inner = untag_ptr(this_obj);
34749 this_obj_conv.is_owned = ptr_is_owned(this_obj);
34750 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
34751 DirectedChannelTransactionParameters_free(this_obj_conv);
34754 uint64_t __attribute__((export_name("TS_DirectedChannelTransactionParameters_broadcaster_pubkeys"))) TS_DirectedChannelTransactionParameters_broadcaster_pubkeys(uint64_t this_arg) {
34755 LDKDirectedChannelTransactionParameters this_arg_conv;
34756 this_arg_conv.inner = untag_ptr(this_arg);
34757 this_arg_conv.is_owned = ptr_is_owned(this_arg);
34758 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
34759 this_arg_conv.is_owned = false;
34760 LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_broadcaster_pubkeys(&this_arg_conv);
34761 uint64_t ret_ref = 0;
34762 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34763 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34767 uint64_t __attribute__((export_name("TS_DirectedChannelTransactionParameters_countersignatory_pubkeys"))) TS_DirectedChannelTransactionParameters_countersignatory_pubkeys(uint64_t this_arg) {
34768 LDKDirectedChannelTransactionParameters this_arg_conv;
34769 this_arg_conv.inner = untag_ptr(this_arg);
34770 this_arg_conv.is_owned = ptr_is_owned(this_arg);
34771 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
34772 this_arg_conv.is_owned = false;
34773 LDKChannelPublicKeys ret_var = DirectedChannelTransactionParameters_countersignatory_pubkeys(&this_arg_conv);
34774 uint64_t ret_ref = 0;
34775 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34776 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34780 int16_t __attribute__((export_name("TS_DirectedChannelTransactionParameters_contest_delay"))) TS_DirectedChannelTransactionParameters_contest_delay(uint64_t this_arg) {
34781 LDKDirectedChannelTransactionParameters this_arg_conv;
34782 this_arg_conv.inner = untag_ptr(this_arg);
34783 this_arg_conv.is_owned = ptr_is_owned(this_arg);
34784 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
34785 this_arg_conv.is_owned = false;
34786 int16_t ret_conv = DirectedChannelTransactionParameters_contest_delay(&this_arg_conv);
34790 jboolean __attribute__((export_name("TS_DirectedChannelTransactionParameters_is_outbound"))) TS_DirectedChannelTransactionParameters_is_outbound(uint64_t this_arg) {
34791 LDKDirectedChannelTransactionParameters this_arg_conv;
34792 this_arg_conv.inner = untag_ptr(this_arg);
34793 this_arg_conv.is_owned = ptr_is_owned(this_arg);
34794 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
34795 this_arg_conv.is_owned = false;
34796 jboolean ret_conv = DirectedChannelTransactionParameters_is_outbound(&this_arg_conv);
34800 uint64_t __attribute__((export_name("TS_DirectedChannelTransactionParameters_funding_outpoint"))) TS_DirectedChannelTransactionParameters_funding_outpoint(uint64_t this_arg) {
34801 LDKDirectedChannelTransactionParameters this_arg_conv;
34802 this_arg_conv.inner = untag_ptr(this_arg);
34803 this_arg_conv.is_owned = ptr_is_owned(this_arg);
34804 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
34805 this_arg_conv.is_owned = false;
34806 LDKOutPoint ret_var = DirectedChannelTransactionParameters_funding_outpoint(&this_arg_conv);
34807 uint64_t ret_ref = 0;
34808 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34809 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34813 jboolean __attribute__((export_name("TS_DirectedChannelTransactionParameters_opt_anchors"))) TS_DirectedChannelTransactionParameters_opt_anchors(uint64_t this_arg) {
34814 LDKDirectedChannelTransactionParameters this_arg_conv;
34815 this_arg_conv.inner = untag_ptr(this_arg);
34816 this_arg_conv.is_owned = ptr_is_owned(this_arg);
34817 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
34818 this_arg_conv.is_owned = false;
34819 jboolean ret_conv = DirectedChannelTransactionParameters_opt_anchors(&this_arg_conv);
34823 void __attribute__((export_name("TS_HolderCommitmentTransaction_free"))) TS_HolderCommitmentTransaction_free(uint64_t this_obj) {
34824 LDKHolderCommitmentTransaction this_obj_conv;
34825 this_obj_conv.inner = untag_ptr(this_obj);
34826 this_obj_conv.is_owned = ptr_is_owned(this_obj);
34827 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
34828 HolderCommitmentTransaction_free(this_obj_conv);
34831 int8_tArray __attribute__((export_name("TS_HolderCommitmentTransaction_get_counterparty_sig"))) TS_HolderCommitmentTransaction_get_counterparty_sig(uint64_t this_ptr) {
34832 LDKHolderCommitmentTransaction this_ptr_conv;
34833 this_ptr_conv.inner = untag_ptr(this_ptr);
34834 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34835 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34836 this_ptr_conv.is_owned = false;
34837 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
34838 memcpy(ret_arr->elems, HolderCommitmentTransaction_get_counterparty_sig(&this_ptr_conv).compact_form, 64);
34842 void __attribute__((export_name("TS_HolderCommitmentTransaction_set_counterparty_sig"))) TS_HolderCommitmentTransaction_set_counterparty_sig(uint64_t this_ptr, int8_tArray val) {
34843 LDKHolderCommitmentTransaction this_ptr_conv;
34844 this_ptr_conv.inner = untag_ptr(this_ptr);
34845 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34846 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34847 this_ptr_conv.is_owned = false;
34848 LDKSignature val_ref;
34849 CHECK(val->arr_len == 64);
34850 memcpy(val_ref.compact_form, val->elems, 64); FREE(val);
34851 HolderCommitmentTransaction_set_counterparty_sig(&this_ptr_conv, val_ref);
34854 ptrArray __attribute__((export_name("TS_HolderCommitmentTransaction_get_counterparty_htlc_sigs"))) TS_HolderCommitmentTransaction_get_counterparty_htlc_sigs(uint64_t this_ptr) {
34855 LDKHolderCommitmentTransaction this_ptr_conv;
34856 this_ptr_conv.inner = untag_ptr(this_ptr);
34857 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34858 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34859 this_ptr_conv.is_owned = false;
34860 LDKCVec_SignatureZ ret_var = HolderCommitmentTransaction_get_counterparty_htlc_sigs(&this_ptr_conv);
34861 ptrArray ret_arr = NULL;
34862 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
34863 int8_tArray *ret_arr_ptr = (int8_tArray*)(((uint8_t*)ret_arr) + 8);
34864 for (size_t m = 0; m < ret_var.datalen; m++) {
34865 int8_tArray ret_conv_12_arr = init_int8_tArray(64, __LINE__);
34866 memcpy(ret_conv_12_arr->elems, ret_var.data[m].compact_form, 64);
34867 ret_arr_ptr[m] = ret_conv_12_arr;
34870 FREE(ret_var.data);
34874 void __attribute__((export_name("TS_HolderCommitmentTransaction_set_counterparty_htlc_sigs"))) TS_HolderCommitmentTransaction_set_counterparty_htlc_sigs(uint64_t this_ptr, ptrArray val) {
34875 LDKHolderCommitmentTransaction this_ptr_conv;
34876 this_ptr_conv.inner = untag_ptr(this_ptr);
34877 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
34878 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
34879 this_ptr_conv.is_owned = false;
34880 LDKCVec_SignatureZ val_constr;
34881 val_constr.datalen = val->arr_len;
34882 if (val_constr.datalen > 0)
34883 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
34885 val_constr.data = NULL;
34886 int8_tArray* val_vals = (void*) val->elems;
34887 for (size_t m = 0; m < val_constr.datalen; m++) {
34888 int8_tArray val_conv_12 = val_vals[m];
34889 LDKSignature val_conv_12_ref;
34890 CHECK(val_conv_12->arr_len == 64);
34891 memcpy(val_conv_12_ref.compact_form, val_conv_12->elems, 64); FREE(val_conv_12);
34892 val_constr.data[m] = val_conv_12_ref;
34895 HolderCommitmentTransaction_set_counterparty_htlc_sigs(&this_ptr_conv, val_constr);
34898 static inline uint64_t HolderCommitmentTransaction_clone_ptr(LDKHolderCommitmentTransaction *NONNULL_PTR arg) {
34899 LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_clone(arg);
34900 uint64_t ret_ref = 0;
34901 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34902 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34905 int64_t __attribute__((export_name("TS_HolderCommitmentTransaction_clone_ptr"))) TS_HolderCommitmentTransaction_clone_ptr(uint64_t arg) {
34906 LDKHolderCommitmentTransaction arg_conv;
34907 arg_conv.inner = untag_ptr(arg);
34908 arg_conv.is_owned = ptr_is_owned(arg);
34909 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
34910 arg_conv.is_owned = false;
34911 int64_t ret_conv = HolderCommitmentTransaction_clone_ptr(&arg_conv);
34915 uint64_t __attribute__((export_name("TS_HolderCommitmentTransaction_clone"))) TS_HolderCommitmentTransaction_clone(uint64_t orig) {
34916 LDKHolderCommitmentTransaction orig_conv;
34917 orig_conv.inner = untag_ptr(orig);
34918 orig_conv.is_owned = ptr_is_owned(orig);
34919 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
34920 orig_conv.is_owned = false;
34921 LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_clone(&orig_conv);
34922 uint64_t ret_ref = 0;
34923 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34924 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34928 int8_tArray __attribute__((export_name("TS_HolderCommitmentTransaction_write"))) TS_HolderCommitmentTransaction_write(uint64_t obj) {
34929 LDKHolderCommitmentTransaction obj_conv;
34930 obj_conv.inner = untag_ptr(obj);
34931 obj_conv.is_owned = ptr_is_owned(obj);
34932 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
34933 obj_conv.is_owned = false;
34934 LDKCVec_u8Z ret_var = HolderCommitmentTransaction_write(&obj_conv);
34935 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
34936 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
34937 CVec_u8Z_free(ret_var);
34941 uint64_t __attribute__((export_name("TS_HolderCommitmentTransaction_read"))) TS_HolderCommitmentTransaction_read(int8_tArray ser) {
34942 LDKu8slice ser_ref;
34943 ser_ref.datalen = ser->arr_len;
34944 ser_ref.data = ser->elems;
34945 LDKCResult_HolderCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_HolderCommitmentTransactionDecodeErrorZ), "LDKCResult_HolderCommitmentTransactionDecodeErrorZ");
34946 *ret_conv = HolderCommitmentTransaction_read(ser_ref);
34948 return tag_ptr(ret_conv, true);
34951 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) {
34952 LDKCommitmentTransaction commitment_tx_conv;
34953 commitment_tx_conv.inner = untag_ptr(commitment_tx);
34954 commitment_tx_conv.is_owned = ptr_is_owned(commitment_tx);
34955 CHECK_INNER_FIELD_ACCESS_OR_NULL(commitment_tx_conv);
34956 commitment_tx_conv = CommitmentTransaction_clone(&commitment_tx_conv);
34957 LDKSignature counterparty_sig_ref;
34958 CHECK(counterparty_sig->arr_len == 64);
34959 memcpy(counterparty_sig_ref.compact_form, counterparty_sig->elems, 64); FREE(counterparty_sig);
34960 LDKCVec_SignatureZ counterparty_htlc_sigs_constr;
34961 counterparty_htlc_sigs_constr.datalen = counterparty_htlc_sigs->arr_len;
34962 if (counterparty_htlc_sigs_constr.datalen > 0)
34963 counterparty_htlc_sigs_constr.data = MALLOC(counterparty_htlc_sigs_constr.datalen * sizeof(LDKSignature), "LDKCVec_SignatureZ Elements");
34965 counterparty_htlc_sigs_constr.data = NULL;
34966 int8_tArray* counterparty_htlc_sigs_vals = (void*) counterparty_htlc_sigs->elems;
34967 for (size_t m = 0; m < counterparty_htlc_sigs_constr.datalen; m++) {
34968 int8_tArray counterparty_htlc_sigs_conv_12 = counterparty_htlc_sigs_vals[m];
34969 LDKSignature counterparty_htlc_sigs_conv_12_ref;
34970 CHECK(counterparty_htlc_sigs_conv_12->arr_len == 64);
34971 memcpy(counterparty_htlc_sigs_conv_12_ref.compact_form, counterparty_htlc_sigs_conv_12->elems, 64); FREE(counterparty_htlc_sigs_conv_12);
34972 counterparty_htlc_sigs_constr.data[m] = counterparty_htlc_sigs_conv_12_ref;
34974 FREE(counterparty_htlc_sigs);
34975 LDKPublicKey holder_funding_key_ref;
34976 CHECK(holder_funding_key->arr_len == 33);
34977 memcpy(holder_funding_key_ref.compressed_form, holder_funding_key->elems, 33); FREE(holder_funding_key);
34978 LDKPublicKey counterparty_funding_key_ref;
34979 CHECK(counterparty_funding_key->arr_len == 33);
34980 memcpy(counterparty_funding_key_ref.compressed_form, counterparty_funding_key->elems, 33); FREE(counterparty_funding_key);
34981 LDKHolderCommitmentTransaction ret_var = HolderCommitmentTransaction_new(commitment_tx_conv, counterparty_sig_ref, counterparty_htlc_sigs_constr, holder_funding_key_ref, counterparty_funding_key_ref);
34982 uint64_t ret_ref = 0;
34983 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
34984 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
34988 void __attribute__((export_name("TS_BuiltCommitmentTransaction_free"))) TS_BuiltCommitmentTransaction_free(uint64_t this_obj) {
34989 LDKBuiltCommitmentTransaction this_obj_conv;
34990 this_obj_conv.inner = untag_ptr(this_obj);
34991 this_obj_conv.is_owned = ptr_is_owned(this_obj);
34992 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
34993 BuiltCommitmentTransaction_free(this_obj_conv);
34996 int8_tArray __attribute__((export_name("TS_BuiltCommitmentTransaction_get_transaction"))) TS_BuiltCommitmentTransaction_get_transaction(uint64_t this_ptr) {
34997 LDKBuiltCommitmentTransaction this_ptr_conv;
34998 this_ptr_conv.inner = untag_ptr(this_ptr);
34999 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35000 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35001 this_ptr_conv.is_owned = false;
35002 LDKTransaction ret_var = BuiltCommitmentTransaction_get_transaction(&this_ptr_conv);
35003 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35004 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35005 Transaction_free(ret_var);
35009 void __attribute__((export_name("TS_BuiltCommitmentTransaction_set_transaction"))) TS_BuiltCommitmentTransaction_set_transaction(uint64_t this_ptr, int8_tArray val) {
35010 LDKBuiltCommitmentTransaction this_ptr_conv;
35011 this_ptr_conv.inner = untag_ptr(this_ptr);
35012 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35013 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35014 this_ptr_conv.is_owned = false;
35015 LDKTransaction val_ref;
35016 val_ref.datalen = val->arr_len;
35017 val_ref.data = MALLOC(val_ref.datalen, "LDKTransaction Bytes");
35018 memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val);
35019 val_ref.data_is_owned = true;
35020 BuiltCommitmentTransaction_set_transaction(&this_ptr_conv, val_ref);
35023 int8_tArray __attribute__((export_name("TS_BuiltCommitmentTransaction_get_txid"))) TS_BuiltCommitmentTransaction_get_txid(uint64_t this_ptr) {
35024 LDKBuiltCommitmentTransaction this_ptr_conv;
35025 this_ptr_conv.inner = untag_ptr(this_ptr);
35026 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35027 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35028 this_ptr_conv.is_owned = false;
35029 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
35030 memcpy(ret_arr->elems, *BuiltCommitmentTransaction_get_txid(&this_ptr_conv), 32);
35034 void __attribute__((export_name("TS_BuiltCommitmentTransaction_set_txid"))) TS_BuiltCommitmentTransaction_set_txid(uint64_t this_ptr, int8_tArray val) {
35035 LDKBuiltCommitmentTransaction this_ptr_conv;
35036 this_ptr_conv.inner = untag_ptr(this_ptr);
35037 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
35038 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
35039 this_ptr_conv.is_owned = false;
35040 LDKThirtyTwoBytes val_ref;
35041 CHECK(val->arr_len == 32);
35042 memcpy(val_ref.data, val->elems, 32); FREE(val);
35043 BuiltCommitmentTransaction_set_txid(&this_ptr_conv, val_ref);
35046 uint64_t __attribute__((export_name("TS_BuiltCommitmentTransaction_new"))) TS_BuiltCommitmentTransaction_new(int8_tArray transaction_arg, int8_tArray txid_arg) {
35047 LDKTransaction transaction_arg_ref;
35048 transaction_arg_ref.datalen = transaction_arg->arr_len;
35049 transaction_arg_ref.data = MALLOC(transaction_arg_ref.datalen, "LDKTransaction Bytes");
35050 memcpy(transaction_arg_ref.data, transaction_arg->elems, transaction_arg_ref.datalen); FREE(transaction_arg);
35051 transaction_arg_ref.data_is_owned = true;
35052 LDKThirtyTwoBytes txid_arg_ref;
35053 CHECK(txid_arg->arr_len == 32);
35054 memcpy(txid_arg_ref.data, txid_arg->elems, 32); FREE(txid_arg);
35055 LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_new(transaction_arg_ref, txid_arg_ref);
35056 uint64_t ret_ref = 0;
35057 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35058 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35062 static inline uint64_t BuiltCommitmentTransaction_clone_ptr(LDKBuiltCommitmentTransaction *NONNULL_PTR arg) {
35063 LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_clone(arg);
35064 uint64_t ret_ref = 0;
35065 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35066 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35069 int64_t __attribute__((export_name("TS_BuiltCommitmentTransaction_clone_ptr"))) TS_BuiltCommitmentTransaction_clone_ptr(uint64_t arg) {
35070 LDKBuiltCommitmentTransaction arg_conv;
35071 arg_conv.inner = untag_ptr(arg);
35072 arg_conv.is_owned = ptr_is_owned(arg);
35073 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35074 arg_conv.is_owned = false;
35075 int64_t ret_conv = BuiltCommitmentTransaction_clone_ptr(&arg_conv);
35079 uint64_t __attribute__((export_name("TS_BuiltCommitmentTransaction_clone"))) TS_BuiltCommitmentTransaction_clone(uint64_t orig) {
35080 LDKBuiltCommitmentTransaction orig_conv;
35081 orig_conv.inner = untag_ptr(orig);
35082 orig_conv.is_owned = ptr_is_owned(orig);
35083 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35084 orig_conv.is_owned = false;
35085 LDKBuiltCommitmentTransaction ret_var = BuiltCommitmentTransaction_clone(&orig_conv);
35086 uint64_t ret_ref = 0;
35087 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35088 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35092 int8_tArray __attribute__((export_name("TS_BuiltCommitmentTransaction_write"))) TS_BuiltCommitmentTransaction_write(uint64_t obj) {
35093 LDKBuiltCommitmentTransaction obj_conv;
35094 obj_conv.inner = untag_ptr(obj);
35095 obj_conv.is_owned = ptr_is_owned(obj);
35096 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
35097 obj_conv.is_owned = false;
35098 LDKCVec_u8Z ret_var = BuiltCommitmentTransaction_write(&obj_conv);
35099 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35100 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35101 CVec_u8Z_free(ret_var);
35105 uint64_t __attribute__((export_name("TS_BuiltCommitmentTransaction_read"))) TS_BuiltCommitmentTransaction_read(int8_tArray ser) {
35106 LDKu8slice ser_ref;
35107 ser_ref.datalen = ser->arr_len;
35108 ser_ref.data = ser->elems;
35109 LDKCResult_BuiltCommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_BuiltCommitmentTransactionDecodeErrorZ), "LDKCResult_BuiltCommitmentTransactionDecodeErrorZ");
35110 *ret_conv = BuiltCommitmentTransaction_read(ser_ref);
35112 return tag_ptr(ret_conv, true);
35115 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) {
35116 LDKBuiltCommitmentTransaction this_arg_conv;
35117 this_arg_conv.inner = untag_ptr(this_arg);
35118 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35119 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35120 this_arg_conv.is_owned = false;
35121 LDKu8slice funding_redeemscript_ref;
35122 funding_redeemscript_ref.datalen = funding_redeemscript->arr_len;
35123 funding_redeemscript_ref.data = funding_redeemscript->elems;
35124 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
35125 memcpy(ret_arr->elems, BuiltCommitmentTransaction_get_sighash_all(&this_arg_conv, funding_redeemscript_ref, channel_value_satoshis).data, 32);
35126 FREE(funding_redeemscript);
35130 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) {
35131 LDKBuiltCommitmentTransaction this_arg_conv;
35132 this_arg_conv.inner = untag_ptr(this_arg);
35133 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35134 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35135 this_arg_conv.is_owned = false;
35136 unsigned char funding_key_arr[32];
35137 CHECK(funding_key->arr_len == 32);
35138 memcpy(funding_key_arr, funding_key->elems, 32); FREE(funding_key);
35139 unsigned char (*funding_key_ref)[32] = &funding_key_arr;
35140 LDKu8slice funding_redeemscript_ref;
35141 funding_redeemscript_ref.datalen = funding_redeemscript->arr_len;
35142 funding_redeemscript_ref.data = funding_redeemscript->elems;
35143 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
35144 memcpy(ret_arr->elems, BuiltCommitmentTransaction_sign(&this_arg_conv, funding_key_ref, funding_redeemscript_ref, channel_value_satoshis).compact_form, 64);
35145 FREE(funding_redeemscript);
35149 void __attribute__((export_name("TS_ClosingTransaction_free"))) TS_ClosingTransaction_free(uint64_t this_obj) {
35150 LDKClosingTransaction this_obj_conv;
35151 this_obj_conv.inner = untag_ptr(this_obj);
35152 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35153 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35154 ClosingTransaction_free(this_obj_conv);
35157 static inline uint64_t ClosingTransaction_clone_ptr(LDKClosingTransaction *NONNULL_PTR arg) {
35158 LDKClosingTransaction ret_var = ClosingTransaction_clone(arg);
35159 uint64_t ret_ref = 0;
35160 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35161 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35164 int64_t __attribute__((export_name("TS_ClosingTransaction_clone_ptr"))) TS_ClosingTransaction_clone_ptr(uint64_t arg) {
35165 LDKClosingTransaction arg_conv;
35166 arg_conv.inner = untag_ptr(arg);
35167 arg_conv.is_owned = ptr_is_owned(arg);
35168 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35169 arg_conv.is_owned = false;
35170 int64_t ret_conv = ClosingTransaction_clone_ptr(&arg_conv);
35174 uint64_t __attribute__((export_name("TS_ClosingTransaction_clone"))) TS_ClosingTransaction_clone(uint64_t orig) {
35175 LDKClosingTransaction orig_conv;
35176 orig_conv.inner = untag_ptr(orig);
35177 orig_conv.is_owned = ptr_is_owned(orig);
35178 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35179 orig_conv.is_owned = false;
35180 LDKClosingTransaction ret_var = ClosingTransaction_clone(&orig_conv);
35181 uint64_t ret_ref = 0;
35182 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35183 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35187 int64_t __attribute__((export_name("TS_ClosingTransaction_hash"))) TS_ClosingTransaction_hash(uint64_t o) {
35188 LDKClosingTransaction o_conv;
35189 o_conv.inner = untag_ptr(o);
35190 o_conv.is_owned = ptr_is_owned(o);
35191 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
35192 o_conv.is_owned = false;
35193 int64_t ret_conv = ClosingTransaction_hash(&o_conv);
35197 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) {
35198 LDKCVec_u8Z to_holder_script_ref;
35199 to_holder_script_ref.datalen = to_holder_script->arr_len;
35200 to_holder_script_ref.data = MALLOC(to_holder_script_ref.datalen, "LDKCVec_u8Z Bytes");
35201 memcpy(to_holder_script_ref.data, to_holder_script->elems, to_holder_script_ref.datalen); FREE(to_holder_script);
35202 LDKCVec_u8Z to_counterparty_script_ref;
35203 to_counterparty_script_ref.datalen = to_counterparty_script->arr_len;
35204 to_counterparty_script_ref.data = MALLOC(to_counterparty_script_ref.datalen, "LDKCVec_u8Z Bytes");
35205 memcpy(to_counterparty_script_ref.data, to_counterparty_script->elems, to_counterparty_script_ref.datalen); FREE(to_counterparty_script);
35206 LDKOutPoint funding_outpoint_conv;
35207 funding_outpoint_conv.inner = untag_ptr(funding_outpoint);
35208 funding_outpoint_conv.is_owned = ptr_is_owned(funding_outpoint);
35209 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv);
35210 funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv);
35211 LDKClosingTransaction ret_var = ClosingTransaction_new(to_holder_value_sat, to_counterparty_value_sat, to_holder_script_ref, to_counterparty_script_ref, funding_outpoint_conv);
35212 uint64_t ret_ref = 0;
35213 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35214 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35218 uint64_t __attribute__((export_name("TS_ClosingTransaction_trust"))) TS_ClosingTransaction_trust(uint64_t this_arg) {
35219 LDKClosingTransaction this_arg_conv;
35220 this_arg_conv.inner = untag_ptr(this_arg);
35221 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35222 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35223 this_arg_conv.is_owned = false;
35224 LDKTrustedClosingTransaction ret_var = ClosingTransaction_trust(&this_arg_conv);
35225 uint64_t ret_ref = 0;
35226 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35227 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35231 uint64_t __attribute__((export_name("TS_ClosingTransaction_verify"))) TS_ClosingTransaction_verify(uint64_t this_arg, uint64_t funding_outpoint) {
35232 LDKClosingTransaction this_arg_conv;
35233 this_arg_conv.inner = untag_ptr(this_arg);
35234 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35235 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35236 this_arg_conv.is_owned = false;
35237 LDKOutPoint funding_outpoint_conv;
35238 funding_outpoint_conv.inner = untag_ptr(funding_outpoint);
35239 funding_outpoint_conv.is_owned = ptr_is_owned(funding_outpoint);
35240 CHECK_INNER_FIELD_ACCESS_OR_NULL(funding_outpoint_conv);
35241 funding_outpoint_conv = OutPoint_clone(&funding_outpoint_conv);
35242 LDKCResult_TrustedClosingTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedClosingTransactionNoneZ), "LDKCResult_TrustedClosingTransactionNoneZ");
35243 *ret_conv = ClosingTransaction_verify(&this_arg_conv, funding_outpoint_conv);
35244 return tag_ptr(ret_conv, true);
35247 int64_t __attribute__((export_name("TS_ClosingTransaction_to_holder_value_sat"))) TS_ClosingTransaction_to_holder_value_sat(uint64_t this_arg) {
35248 LDKClosingTransaction this_arg_conv;
35249 this_arg_conv.inner = untag_ptr(this_arg);
35250 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35251 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35252 this_arg_conv.is_owned = false;
35253 int64_t ret_conv = ClosingTransaction_to_holder_value_sat(&this_arg_conv);
35257 int64_t __attribute__((export_name("TS_ClosingTransaction_to_counterparty_value_sat"))) TS_ClosingTransaction_to_counterparty_value_sat(uint64_t this_arg) {
35258 LDKClosingTransaction this_arg_conv;
35259 this_arg_conv.inner = untag_ptr(this_arg);
35260 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35261 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35262 this_arg_conv.is_owned = false;
35263 int64_t ret_conv = ClosingTransaction_to_counterparty_value_sat(&this_arg_conv);
35267 int8_tArray __attribute__((export_name("TS_ClosingTransaction_to_holder_script"))) TS_ClosingTransaction_to_holder_script(uint64_t this_arg) {
35268 LDKClosingTransaction this_arg_conv;
35269 this_arg_conv.inner = untag_ptr(this_arg);
35270 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35271 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35272 this_arg_conv.is_owned = false;
35273 LDKu8slice ret_var = ClosingTransaction_to_holder_script(&this_arg_conv);
35274 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35275 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35279 int8_tArray __attribute__((export_name("TS_ClosingTransaction_to_counterparty_script"))) TS_ClosingTransaction_to_counterparty_script(uint64_t this_arg) {
35280 LDKClosingTransaction this_arg_conv;
35281 this_arg_conv.inner = untag_ptr(this_arg);
35282 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35283 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35284 this_arg_conv.is_owned = false;
35285 LDKu8slice ret_var = ClosingTransaction_to_counterparty_script(&this_arg_conv);
35286 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35287 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35291 void __attribute__((export_name("TS_TrustedClosingTransaction_free"))) TS_TrustedClosingTransaction_free(uint64_t this_obj) {
35292 LDKTrustedClosingTransaction this_obj_conv;
35293 this_obj_conv.inner = untag_ptr(this_obj);
35294 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35295 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35296 TrustedClosingTransaction_free(this_obj_conv);
35299 int8_tArray __attribute__((export_name("TS_TrustedClosingTransaction_built_transaction"))) TS_TrustedClosingTransaction_built_transaction(uint64_t this_arg) {
35300 LDKTrustedClosingTransaction this_arg_conv;
35301 this_arg_conv.inner = untag_ptr(this_arg);
35302 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35303 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35304 this_arg_conv.is_owned = false;
35305 LDKTransaction ret_var = TrustedClosingTransaction_built_transaction(&this_arg_conv);
35306 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35307 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35308 Transaction_free(ret_var);
35312 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) {
35313 LDKTrustedClosingTransaction this_arg_conv;
35314 this_arg_conv.inner = untag_ptr(this_arg);
35315 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35316 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35317 this_arg_conv.is_owned = false;
35318 LDKu8slice funding_redeemscript_ref;
35319 funding_redeemscript_ref.datalen = funding_redeemscript->arr_len;
35320 funding_redeemscript_ref.data = funding_redeemscript->elems;
35321 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
35322 memcpy(ret_arr->elems, TrustedClosingTransaction_get_sighash_all(&this_arg_conv, funding_redeemscript_ref, channel_value_satoshis).data, 32);
35323 FREE(funding_redeemscript);
35327 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) {
35328 LDKTrustedClosingTransaction this_arg_conv;
35329 this_arg_conv.inner = untag_ptr(this_arg);
35330 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35331 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35332 this_arg_conv.is_owned = false;
35333 unsigned char funding_key_arr[32];
35334 CHECK(funding_key->arr_len == 32);
35335 memcpy(funding_key_arr, funding_key->elems, 32); FREE(funding_key);
35336 unsigned char (*funding_key_ref)[32] = &funding_key_arr;
35337 LDKu8slice funding_redeemscript_ref;
35338 funding_redeemscript_ref.datalen = funding_redeemscript->arr_len;
35339 funding_redeemscript_ref.data = funding_redeemscript->elems;
35340 int8_tArray ret_arr = init_int8_tArray(64, __LINE__);
35341 memcpy(ret_arr->elems, TrustedClosingTransaction_sign(&this_arg_conv, funding_key_ref, funding_redeemscript_ref, channel_value_satoshis).compact_form, 64);
35342 FREE(funding_redeemscript);
35346 void __attribute__((export_name("TS_CommitmentTransaction_free"))) TS_CommitmentTransaction_free(uint64_t this_obj) {
35347 LDKCommitmentTransaction this_obj_conv;
35348 this_obj_conv.inner = untag_ptr(this_obj);
35349 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35350 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35351 CommitmentTransaction_free(this_obj_conv);
35354 static inline uint64_t CommitmentTransaction_clone_ptr(LDKCommitmentTransaction *NONNULL_PTR arg) {
35355 LDKCommitmentTransaction ret_var = CommitmentTransaction_clone(arg);
35356 uint64_t ret_ref = 0;
35357 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35358 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35361 int64_t __attribute__((export_name("TS_CommitmentTransaction_clone_ptr"))) TS_CommitmentTransaction_clone_ptr(uint64_t arg) {
35362 LDKCommitmentTransaction arg_conv;
35363 arg_conv.inner = untag_ptr(arg);
35364 arg_conv.is_owned = ptr_is_owned(arg);
35365 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35366 arg_conv.is_owned = false;
35367 int64_t ret_conv = CommitmentTransaction_clone_ptr(&arg_conv);
35371 uint64_t __attribute__((export_name("TS_CommitmentTransaction_clone"))) TS_CommitmentTransaction_clone(uint64_t orig) {
35372 LDKCommitmentTransaction orig_conv;
35373 orig_conv.inner = untag_ptr(orig);
35374 orig_conv.is_owned = ptr_is_owned(orig);
35375 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35376 orig_conv.is_owned = false;
35377 LDKCommitmentTransaction ret_var = CommitmentTransaction_clone(&orig_conv);
35378 uint64_t ret_ref = 0;
35379 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35380 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35384 int8_tArray __attribute__((export_name("TS_CommitmentTransaction_write"))) TS_CommitmentTransaction_write(uint64_t obj) {
35385 LDKCommitmentTransaction obj_conv;
35386 obj_conv.inner = untag_ptr(obj);
35387 obj_conv.is_owned = ptr_is_owned(obj);
35388 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
35389 obj_conv.is_owned = false;
35390 LDKCVec_u8Z ret_var = CommitmentTransaction_write(&obj_conv);
35391 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35392 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35393 CVec_u8Z_free(ret_var);
35397 uint64_t __attribute__((export_name("TS_CommitmentTransaction_read"))) TS_CommitmentTransaction_read(int8_tArray ser) {
35398 LDKu8slice ser_ref;
35399 ser_ref.datalen = ser->arr_len;
35400 ser_ref.data = ser->elems;
35401 LDKCResult_CommitmentTransactionDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_CommitmentTransactionDecodeErrorZ), "LDKCResult_CommitmentTransactionDecodeErrorZ");
35402 *ret_conv = CommitmentTransaction_read(ser_ref);
35404 return tag_ptr(ret_conv, true);
35407 int64_t __attribute__((export_name("TS_CommitmentTransaction_commitment_number"))) TS_CommitmentTransaction_commitment_number(uint64_t this_arg) {
35408 LDKCommitmentTransaction this_arg_conv;
35409 this_arg_conv.inner = untag_ptr(this_arg);
35410 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35411 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35412 this_arg_conv.is_owned = false;
35413 int64_t ret_conv = CommitmentTransaction_commitment_number(&this_arg_conv);
35417 int64_t __attribute__((export_name("TS_CommitmentTransaction_to_broadcaster_value_sat"))) TS_CommitmentTransaction_to_broadcaster_value_sat(uint64_t this_arg) {
35418 LDKCommitmentTransaction this_arg_conv;
35419 this_arg_conv.inner = untag_ptr(this_arg);
35420 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35421 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35422 this_arg_conv.is_owned = false;
35423 int64_t ret_conv = CommitmentTransaction_to_broadcaster_value_sat(&this_arg_conv);
35427 int64_t __attribute__((export_name("TS_CommitmentTransaction_to_countersignatory_value_sat"))) TS_CommitmentTransaction_to_countersignatory_value_sat(uint64_t this_arg) {
35428 LDKCommitmentTransaction this_arg_conv;
35429 this_arg_conv.inner = untag_ptr(this_arg);
35430 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35431 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35432 this_arg_conv.is_owned = false;
35433 int64_t ret_conv = CommitmentTransaction_to_countersignatory_value_sat(&this_arg_conv);
35437 int32_t __attribute__((export_name("TS_CommitmentTransaction_feerate_per_kw"))) TS_CommitmentTransaction_feerate_per_kw(uint64_t this_arg) {
35438 LDKCommitmentTransaction this_arg_conv;
35439 this_arg_conv.inner = untag_ptr(this_arg);
35440 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35441 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35442 this_arg_conv.is_owned = false;
35443 int32_t ret_conv = CommitmentTransaction_feerate_per_kw(&this_arg_conv);
35447 uint64_t __attribute__((export_name("TS_CommitmentTransaction_trust"))) TS_CommitmentTransaction_trust(uint64_t this_arg) {
35448 LDKCommitmentTransaction this_arg_conv;
35449 this_arg_conv.inner = untag_ptr(this_arg);
35450 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35451 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35452 this_arg_conv.is_owned = false;
35453 LDKTrustedCommitmentTransaction ret_var = CommitmentTransaction_trust(&this_arg_conv);
35454 uint64_t ret_ref = 0;
35455 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35456 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35460 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) {
35461 LDKCommitmentTransaction this_arg_conv;
35462 this_arg_conv.inner = untag_ptr(this_arg);
35463 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35464 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35465 this_arg_conv.is_owned = false;
35466 LDKDirectedChannelTransactionParameters channel_parameters_conv;
35467 channel_parameters_conv.inner = untag_ptr(channel_parameters);
35468 channel_parameters_conv.is_owned = ptr_is_owned(channel_parameters);
35469 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv);
35470 channel_parameters_conv.is_owned = false;
35471 LDKChannelPublicKeys broadcaster_keys_conv;
35472 broadcaster_keys_conv.inner = untag_ptr(broadcaster_keys);
35473 broadcaster_keys_conv.is_owned = ptr_is_owned(broadcaster_keys);
35474 CHECK_INNER_FIELD_ACCESS_OR_NULL(broadcaster_keys_conv);
35475 broadcaster_keys_conv.is_owned = false;
35476 LDKChannelPublicKeys countersignatory_keys_conv;
35477 countersignatory_keys_conv.inner = untag_ptr(countersignatory_keys);
35478 countersignatory_keys_conv.is_owned = ptr_is_owned(countersignatory_keys);
35479 CHECK_INNER_FIELD_ACCESS_OR_NULL(countersignatory_keys_conv);
35480 countersignatory_keys_conv.is_owned = false;
35481 LDKCResult_TrustedCommitmentTransactionNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_TrustedCommitmentTransactionNoneZ), "LDKCResult_TrustedCommitmentTransactionNoneZ");
35482 *ret_conv = CommitmentTransaction_verify(&this_arg_conv, &channel_parameters_conv, &broadcaster_keys_conv, &countersignatory_keys_conv);
35483 return tag_ptr(ret_conv, true);
35486 void __attribute__((export_name("TS_TrustedCommitmentTransaction_free"))) TS_TrustedCommitmentTransaction_free(uint64_t this_obj) {
35487 LDKTrustedCommitmentTransaction this_obj_conv;
35488 this_obj_conv.inner = untag_ptr(this_obj);
35489 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35490 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35491 TrustedCommitmentTransaction_free(this_obj_conv);
35494 int8_tArray __attribute__((export_name("TS_TrustedCommitmentTransaction_txid"))) TS_TrustedCommitmentTransaction_txid(uint64_t this_arg) {
35495 LDKTrustedCommitmentTransaction this_arg_conv;
35496 this_arg_conv.inner = untag_ptr(this_arg);
35497 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35498 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35499 this_arg_conv.is_owned = false;
35500 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
35501 memcpy(ret_arr->elems, TrustedCommitmentTransaction_txid(&this_arg_conv).data, 32);
35505 uint64_t __attribute__((export_name("TS_TrustedCommitmentTransaction_built_transaction"))) TS_TrustedCommitmentTransaction_built_transaction(uint64_t this_arg) {
35506 LDKTrustedCommitmentTransaction this_arg_conv;
35507 this_arg_conv.inner = untag_ptr(this_arg);
35508 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35509 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35510 this_arg_conv.is_owned = false;
35511 LDKBuiltCommitmentTransaction ret_var = TrustedCommitmentTransaction_built_transaction(&this_arg_conv);
35512 uint64_t ret_ref = 0;
35513 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35514 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35518 uint64_t __attribute__((export_name("TS_TrustedCommitmentTransaction_keys"))) TS_TrustedCommitmentTransaction_keys(uint64_t this_arg) {
35519 LDKTrustedCommitmentTransaction this_arg_conv;
35520 this_arg_conv.inner = untag_ptr(this_arg);
35521 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35522 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35523 this_arg_conv.is_owned = false;
35524 LDKTxCreationKeys ret_var = TrustedCommitmentTransaction_keys(&this_arg_conv);
35525 uint64_t ret_ref = 0;
35526 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35527 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35531 jboolean __attribute__((export_name("TS_TrustedCommitmentTransaction_opt_anchors"))) TS_TrustedCommitmentTransaction_opt_anchors(uint64_t this_arg) {
35532 LDKTrustedCommitmentTransaction this_arg_conv;
35533 this_arg_conv.inner = untag_ptr(this_arg);
35534 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35535 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35536 this_arg_conv.is_owned = false;
35537 jboolean ret_conv = TrustedCommitmentTransaction_opt_anchors(&this_arg_conv);
35541 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) {
35542 LDKTrustedCommitmentTransaction this_arg_conv;
35543 this_arg_conv.inner = untag_ptr(this_arg);
35544 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35545 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35546 this_arg_conv.is_owned = false;
35547 unsigned char htlc_base_key_arr[32];
35548 CHECK(htlc_base_key->arr_len == 32);
35549 memcpy(htlc_base_key_arr, htlc_base_key->elems, 32); FREE(htlc_base_key);
35550 unsigned char (*htlc_base_key_ref)[32] = &htlc_base_key_arr;
35551 LDKDirectedChannelTransactionParameters channel_parameters_conv;
35552 channel_parameters_conv.inner = untag_ptr(channel_parameters);
35553 channel_parameters_conv.is_owned = ptr_is_owned(channel_parameters);
35554 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_parameters_conv);
35555 channel_parameters_conv.is_owned = false;
35556 LDKCResult_CVec_SignatureZNoneZ* ret_conv = MALLOC(sizeof(LDKCResult_CVec_SignatureZNoneZ), "LDKCResult_CVec_SignatureZNoneZ");
35557 *ret_conv = TrustedCommitmentTransaction_get_htlc_sigs(&this_arg_conv, htlc_base_key_ref, &channel_parameters_conv);
35558 return tag_ptr(ret_conv, true);
35561 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) {
35562 LDKPublicKey broadcaster_payment_basepoint_ref;
35563 CHECK(broadcaster_payment_basepoint->arr_len == 33);
35564 memcpy(broadcaster_payment_basepoint_ref.compressed_form, broadcaster_payment_basepoint->elems, 33); FREE(broadcaster_payment_basepoint);
35565 LDKPublicKey countersignatory_payment_basepoint_ref;
35566 CHECK(countersignatory_payment_basepoint->arr_len == 33);
35567 memcpy(countersignatory_payment_basepoint_ref.compressed_form, countersignatory_payment_basepoint->elems, 33); FREE(countersignatory_payment_basepoint);
35568 int64_t ret_conv = get_commitment_transaction_number_obscure_factor(broadcaster_payment_basepoint_ref, countersignatory_payment_basepoint_ref, outbound_from_broadcaster);
35572 jboolean __attribute__((export_name("TS_InitFeatures_eq"))) TS_InitFeatures_eq(uint64_t a, uint64_t b) {
35573 LDKInitFeatures a_conv;
35574 a_conv.inner = untag_ptr(a);
35575 a_conv.is_owned = ptr_is_owned(a);
35576 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
35577 a_conv.is_owned = false;
35578 LDKInitFeatures b_conv;
35579 b_conv.inner = untag_ptr(b);
35580 b_conv.is_owned = ptr_is_owned(b);
35581 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
35582 b_conv.is_owned = false;
35583 jboolean ret_conv = InitFeatures_eq(&a_conv, &b_conv);
35587 jboolean __attribute__((export_name("TS_NodeFeatures_eq"))) TS_NodeFeatures_eq(uint64_t a, uint64_t b) {
35588 LDKNodeFeatures a_conv;
35589 a_conv.inner = untag_ptr(a);
35590 a_conv.is_owned = ptr_is_owned(a);
35591 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
35592 a_conv.is_owned = false;
35593 LDKNodeFeatures b_conv;
35594 b_conv.inner = untag_ptr(b);
35595 b_conv.is_owned = ptr_is_owned(b);
35596 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
35597 b_conv.is_owned = false;
35598 jboolean ret_conv = NodeFeatures_eq(&a_conv, &b_conv);
35602 jboolean __attribute__((export_name("TS_ChannelFeatures_eq"))) TS_ChannelFeatures_eq(uint64_t a, uint64_t b) {
35603 LDKChannelFeatures a_conv;
35604 a_conv.inner = untag_ptr(a);
35605 a_conv.is_owned = ptr_is_owned(a);
35606 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
35607 a_conv.is_owned = false;
35608 LDKChannelFeatures b_conv;
35609 b_conv.inner = untag_ptr(b);
35610 b_conv.is_owned = ptr_is_owned(b);
35611 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
35612 b_conv.is_owned = false;
35613 jboolean ret_conv = ChannelFeatures_eq(&a_conv, &b_conv);
35617 jboolean __attribute__((export_name("TS_InvoiceFeatures_eq"))) TS_InvoiceFeatures_eq(uint64_t a, uint64_t b) {
35618 LDKInvoiceFeatures a_conv;
35619 a_conv.inner = untag_ptr(a);
35620 a_conv.is_owned = ptr_is_owned(a);
35621 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
35622 a_conv.is_owned = false;
35623 LDKInvoiceFeatures b_conv;
35624 b_conv.inner = untag_ptr(b);
35625 b_conv.is_owned = ptr_is_owned(b);
35626 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
35627 b_conv.is_owned = false;
35628 jboolean ret_conv = InvoiceFeatures_eq(&a_conv, &b_conv);
35632 jboolean __attribute__((export_name("TS_ChannelTypeFeatures_eq"))) TS_ChannelTypeFeatures_eq(uint64_t a, uint64_t b) {
35633 LDKChannelTypeFeatures a_conv;
35634 a_conv.inner = untag_ptr(a);
35635 a_conv.is_owned = ptr_is_owned(a);
35636 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
35637 a_conv.is_owned = false;
35638 LDKChannelTypeFeatures b_conv;
35639 b_conv.inner = untag_ptr(b);
35640 b_conv.is_owned = ptr_is_owned(b);
35641 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
35642 b_conv.is_owned = false;
35643 jboolean ret_conv = ChannelTypeFeatures_eq(&a_conv, &b_conv);
35647 static inline uint64_t InitFeatures_clone_ptr(LDKInitFeatures *NONNULL_PTR arg) {
35648 LDKInitFeatures ret_var = InitFeatures_clone(arg);
35649 uint64_t ret_ref = 0;
35650 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35651 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35654 int64_t __attribute__((export_name("TS_InitFeatures_clone_ptr"))) TS_InitFeatures_clone_ptr(uint64_t arg) {
35655 LDKInitFeatures arg_conv;
35656 arg_conv.inner = untag_ptr(arg);
35657 arg_conv.is_owned = ptr_is_owned(arg);
35658 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35659 arg_conv.is_owned = false;
35660 int64_t ret_conv = InitFeatures_clone_ptr(&arg_conv);
35664 uint64_t __attribute__((export_name("TS_InitFeatures_clone"))) TS_InitFeatures_clone(uint64_t orig) {
35665 LDKInitFeatures orig_conv;
35666 orig_conv.inner = untag_ptr(orig);
35667 orig_conv.is_owned = ptr_is_owned(orig);
35668 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35669 orig_conv.is_owned = false;
35670 LDKInitFeatures ret_var = InitFeatures_clone(&orig_conv);
35671 uint64_t ret_ref = 0;
35672 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35673 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35677 static inline uint64_t NodeFeatures_clone_ptr(LDKNodeFeatures *NONNULL_PTR arg) {
35678 LDKNodeFeatures ret_var = NodeFeatures_clone(arg);
35679 uint64_t ret_ref = 0;
35680 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35681 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35684 int64_t __attribute__((export_name("TS_NodeFeatures_clone_ptr"))) TS_NodeFeatures_clone_ptr(uint64_t arg) {
35685 LDKNodeFeatures arg_conv;
35686 arg_conv.inner = untag_ptr(arg);
35687 arg_conv.is_owned = ptr_is_owned(arg);
35688 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35689 arg_conv.is_owned = false;
35690 int64_t ret_conv = NodeFeatures_clone_ptr(&arg_conv);
35694 uint64_t __attribute__((export_name("TS_NodeFeatures_clone"))) TS_NodeFeatures_clone(uint64_t orig) {
35695 LDKNodeFeatures orig_conv;
35696 orig_conv.inner = untag_ptr(orig);
35697 orig_conv.is_owned = ptr_is_owned(orig);
35698 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35699 orig_conv.is_owned = false;
35700 LDKNodeFeatures ret_var = NodeFeatures_clone(&orig_conv);
35701 uint64_t ret_ref = 0;
35702 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35703 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35707 static inline uint64_t ChannelFeatures_clone_ptr(LDKChannelFeatures *NONNULL_PTR arg) {
35708 LDKChannelFeatures ret_var = ChannelFeatures_clone(arg);
35709 uint64_t ret_ref = 0;
35710 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35711 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35714 int64_t __attribute__((export_name("TS_ChannelFeatures_clone_ptr"))) TS_ChannelFeatures_clone_ptr(uint64_t arg) {
35715 LDKChannelFeatures arg_conv;
35716 arg_conv.inner = untag_ptr(arg);
35717 arg_conv.is_owned = ptr_is_owned(arg);
35718 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35719 arg_conv.is_owned = false;
35720 int64_t ret_conv = ChannelFeatures_clone_ptr(&arg_conv);
35724 uint64_t __attribute__((export_name("TS_ChannelFeatures_clone"))) TS_ChannelFeatures_clone(uint64_t orig) {
35725 LDKChannelFeatures orig_conv;
35726 orig_conv.inner = untag_ptr(orig);
35727 orig_conv.is_owned = ptr_is_owned(orig);
35728 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35729 orig_conv.is_owned = false;
35730 LDKChannelFeatures ret_var = ChannelFeatures_clone(&orig_conv);
35731 uint64_t ret_ref = 0;
35732 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35733 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35737 static inline uint64_t InvoiceFeatures_clone_ptr(LDKInvoiceFeatures *NONNULL_PTR arg) {
35738 LDKInvoiceFeatures ret_var = InvoiceFeatures_clone(arg);
35739 uint64_t ret_ref = 0;
35740 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35741 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35744 int64_t __attribute__((export_name("TS_InvoiceFeatures_clone_ptr"))) TS_InvoiceFeatures_clone_ptr(uint64_t arg) {
35745 LDKInvoiceFeatures arg_conv;
35746 arg_conv.inner = untag_ptr(arg);
35747 arg_conv.is_owned = ptr_is_owned(arg);
35748 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35749 arg_conv.is_owned = false;
35750 int64_t ret_conv = InvoiceFeatures_clone_ptr(&arg_conv);
35754 uint64_t __attribute__((export_name("TS_InvoiceFeatures_clone"))) TS_InvoiceFeatures_clone(uint64_t orig) {
35755 LDKInvoiceFeatures orig_conv;
35756 orig_conv.inner = untag_ptr(orig);
35757 orig_conv.is_owned = ptr_is_owned(orig);
35758 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35759 orig_conv.is_owned = false;
35760 LDKInvoiceFeatures ret_var = InvoiceFeatures_clone(&orig_conv);
35761 uint64_t ret_ref = 0;
35762 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35763 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35767 static inline uint64_t ChannelTypeFeatures_clone_ptr(LDKChannelTypeFeatures *NONNULL_PTR arg) {
35768 LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(arg);
35769 uint64_t ret_ref = 0;
35770 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35771 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35774 int64_t __attribute__((export_name("TS_ChannelTypeFeatures_clone_ptr"))) TS_ChannelTypeFeatures_clone_ptr(uint64_t arg) {
35775 LDKChannelTypeFeatures arg_conv;
35776 arg_conv.inner = untag_ptr(arg);
35777 arg_conv.is_owned = ptr_is_owned(arg);
35778 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
35779 arg_conv.is_owned = false;
35780 int64_t ret_conv = ChannelTypeFeatures_clone_ptr(&arg_conv);
35784 uint64_t __attribute__((export_name("TS_ChannelTypeFeatures_clone"))) TS_ChannelTypeFeatures_clone(uint64_t orig) {
35785 LDKChannelTypeFeatures orig_conv;
35786 orig_conv.inner = untag_ptr(orig);
35787 orig_conv.is_owned = ptr_is_owned(orig);
35788 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
35789 orig_conv.is_owned = false;
35790 LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_clone(&orig_conv);
35791 uint64_t ret_ref = 0;
35792 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35793 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35797 void __attribute__((export_name("TS_InitFeatures_free"))) TS_InitFeatures_free(uint64_t this_obj) {
35798 LDKInitFeatures this_obj_conv;
35799 this_obj_conv.inner = untag_ptr(this_obj);
35800 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35801 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35802 InitFeatures_free(this_obj_conv);
35805 void __attribute__((export_name("TS_NodeFeatures_free"))) TS_NodeFeatures_free(uint64_t this_obj) {
35806 LDKNodeFeatures this_obj_conv;
35807 this_obj_conv.inner = untag_ptr(this_obj);
35808 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35809 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35810 NodeFeatures_free(this_obj_conv);
35813 void __attribute__((export_name("TS_ChannelFeatures_free"))) TS_ChannelFeatures_free(uint64_t this_obj) {
35814 LDKChannelFeatures this_obj_conv;
35815 this_obj_conv.inner = untag_ptr(this_obj);
35816 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35817 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35818 ChannelFeatures_free(this_obj_conv);
35821 void __attribute__((export_name("TS_InvoiceFeatures_free"))) TS_InvoiceFeatures_free(uint64_t this_obj) {
35822 LDKInvoiceFeatures this_obj_conv;
35823 this_obj_conv.inner = untag_ptr(this_obj);
35824 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35825 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35826 InvoiceFeatures_free(this_obj_conv);
35829 void __attribute__((export_name("TS_ChannelTypeFeatures_free"))) TS_ChannelTypeFeatures_free(uint64_t this_obj) {
35830 LDKChannelTypeFeatures this_obj_conv;
35831 this_obj_conv.inner = untag_ptr(this_obj);
35832 this_obj_conv.is_owned = ptr_is_owned(this_obj);
35833 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
35834 ChannelTypeFeatures_free(this_obj_conv);
35837 uint64_t __attribute__((export_name("TS_InitFeatures_empty"))) TS_InitFeatures_empty() {
35838 LDKInitFeatures ret_var = InitFeatures_empty();
35839 uint64_t ret_ref = 0;
35840 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35841 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35845 uint64_t __attribute__((export_name("TS_InitFeatures_known"))) TS_InitFeatures_known() {
35846 LDKInitFeatures ret_var = InitFeatures_known();
35847 uint64_t ret_ref = 0;
35848 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35849 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35853 jboolean __attribute__((export_name("TS_InitFeatures_requires_unknown_bits"))) TS_InitFeatures_requires_unknown_bits(uint64_t this_arg) {
35854 LDKInitFeatures this_arg_conv;
35855 this_arg_conv.inner = untag_ptr(this_arg);
35856 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35857 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35858 this_arg_conv.is_owned = false;
35859 jboolean ret_conv = InitFeatures_requires_unknown_bits(&this_arg_conv);
35863 uint64_t __attribute__((export_name("TS_NodeFeatures_empty"))) TS_NodeFeatures_empty() {
35864 LDKNodeFeatures ret_var = NodeFeatures_empty();
35865 uint64_t ret_ref = 0;
35866 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35867 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35871 uint64_t __attribute__((export_name("TS_NodeFeatures_known"))) TS_NodeFeatures_known() {
35872 LDKNodeFeatures ret_var = NodeFeatures_known();
35873 uint64_t ret_ref = 0;
35874 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35875 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35879 jboolean __attribute__((export_name("TS_NodeFeatures_requires_unknown_bits"))) TS_NodeFeatures_requires_unknown_bits(uint64_t this_arg) {
35880 LDKNodeFeatures this_arg_conv;
35881 this_arg_conv.inner = untag_ptr(this_arg);
35882 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35883 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35884 this_arg_conv.is_owned = false;
35885 jboolean ret_conv = NodeFeatures_requires_unknown_bits(&this_arg_conv);
35889 uint64_t __attribute__((export_name("TS_ChannelFeatures_empty"))) TS_ChannelFeatures_empty() {
35890 LDKChannelFeatures ret_var = ChannelFeatures_empty();
35891 uint64_t ret_ref = 0;
35892 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35893 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35897 uint64_t __attribute__((export_name("TS_ChannelFeatures_known"))) TS_ChannelFeatures_known() {
35898 LDKChannelFeatures ret_var = ChannelFeatures_known();
35899 uint64_t ret_ref = 0;
35900 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35901 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35905 jboolean __attribute__((export_name("TS_ChannelFeatures_requires_unknown_bits"))) TS_ChannelFeatures_requires_unknown_bits(uint64_t this_arg) {
35906 LDKChannelFeatures this_arg_conv;
35907 this_arg_conv.inner = untag_ptr(this_arg);
35908 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35909 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35910 this_arg_conv.is_owned = false;
35911 jboolean ret_conv = ChannelFeatures_requires_unknown_bits(&this_arg_conv);
35915 uint64_t __attribute__((export_name("TS_InvoiceFeatures_empty"))) TS_InvoiceFeatures_empty() {
35916 LDKInvoiceFeatures ret_var = InvoiceFeatures_empty();
35917 uint64_t ret_ref = 0;
35918 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35919 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35923 uint64_t __attribute__((export_name("TS_InvoiceFeatures_known"))) TS_InvoiceFeatures_known() {
35924 LDKInvoiceFeatures ret_var = InvoiceFeatures_known();
35925 uint64_t ret_ref = 0;
35926 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35927 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35931 jboolean __attribute__((export_name("TS_InvoiceFeatures_requires_unknown_bits"))) TS_InvoiceFeatures_requires_unknown_bits(uint64_t this_arg) {
35932 LDKInvoiceFeatures this_arg_conv;
35933 this_arg_conv.inner = untag_ptr(this_arg);
35934 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35935 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35936 this_arg_conv.is_owned = false;
35937 jboolean ret_conv = InvoiceFeatures_requires_unknown_bits(&this_arg_conv);
35941 uint64_t __attribute__((export_name("TS_ChannelTypeFeatures_empty"))) TS_ChannelTypeFeatures_empty() {
35942 LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_empty();
35943 uint64_t ret_ref = 0;
35944 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35945 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35949 uint64_t __attribute__((export_name("TS_ChannelTypeFeatures_known"))) TS_ChannelTypeFeatures_known() {
35950 LDKChannelTypeFeatures ret_var = ChannelTypeFeatures_known();
35951 uint64_t ret_ref = 0;
35952 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
35953 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
35957 jboolean __attribute__((export_name("TS_ChannelTypeFeatures_requires_unknown_bits"))) TS_ChannelTypeFeatures_requires_unknown_bits(uint64_t this_arg) {
35958 LDKChannelTypeFeatures this_arg_conv;
35959 this_arg_conv.inner = untag_ptr(this_arg);
35960 this_arg_conv.is_owned = ptr_is_owned(this_arg);
35961 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
35962 this_arg_conv.is_owned = false;
35963 jboolean ret_conv = ChannelTypeFeatures_requires_unknown_bits(&this_arg_conv);
35967 int8_tArray __attribute__((export_name("TS_InitFeatures_write"))) TS_InitFeatures_write(uint64_t obj) {
35968 LDKInitFeatures obj_conv;
35969 obj_conv.inner = untag_ptr(obj);
35970 obj_conv.is_owned = ptr_is_owned(obj);
35971 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
35972 obj_conv.is_owned = false;
35973 LDKCVec_u8Z ret_var = InitFeatures_write(&obj_conv);
35974 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35975 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35976 CVec_u8Z_free(ret_var);
35980 uint64_t __attribute__((export_name("TS_InitFeatures_read"))) TS_InitFeatures_read(int8_tArray ser) {
35981 LDKu8slice ser_ref;
35982 ser_ref.datalen = ser->arr_len;
35983 ser_ref.data = ser->elems;
35984 LDKCResult_InitFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InitFeaturesDecodeErrorZ), "LDKCResult_InitFeaturesDecodeErrorZ");
35985 *ret_conv = InitFeatures_read(ser_ref);
35987 return tag_ptr(ret_conv, true);
35990 int8_tArray __attribute__((export_name("TS_ChannelFeatures_write"))) TS_ChannelFeatures_write(uint64_t obj) {
35991 LDKChannelFeatures obj_conv;
35992 obj_conv.inner = untag_ptr(obj);
35993 obj_conv.is_owned = ptr_is_owned(obj);
35994 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
35995 obj_conv.is_owned = false;
35996 LDKCVec_u8Z ret_var = ChannelFeatures_write(&obj_conv);
35997 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
35998 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
35999 CVec_u8Z_free(ret_var);
36003 uint64_t __attribute__((export_name("TS_ChannelFeatures_read"))) TS_ChannelFeatures_read(int8_tArray ser) {
36004 LDKu8slice ser_ref;
36005 ser_ref.datalen = ser->arr_len;
36006 ser_ref.data = ser->elems;
36007 LDKCResult_ChannelFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelFeaturesDecodeErrorZ), "LDKCResult_ChannelFeaturesDecodeErrorZ");
36008 *ret_conv = ChannelFeatures_read(ser_ref);
36010 return tag_ptr(ret_conv, true);
36013 int8_tArray __attribute__((export_name("TS_NodeFeatures_write"))) TS_NodeFeatures_write(uint64_t obj) {
36014 LDKNodeFeatures obj_conv;
36015 obj_conv.inner = untag_ptr(obj);
36016 obj_conv.is_owned = ptr_is_owned(obj);
36017 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
36018 obj_conv.is_owned = false;
36019 LDKCVec_u8Z ret_var = NodeFeatures_write(&obj_conv);
36020 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
36021 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
36022 CVec_u8Z_free(ret_var);
36026 uint64_t __attribute__((export_name("TS_NodeFeatures_read"))) TS_NodeFeatures_read(int8_tArray ser) {
36027 LDKu8slice ser_ref;
36028 ser_ref.datalen = ser->arr_len;
36029 ser_ref.data = ser->elems;
36030 LDKCResult_NodeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeFeaturesDecodeErrorZ), "LDKCResult_NodeFeaturesDecodeErrorZ");
36031 *ret_conv = NodeFeatures_read(ser_ref);
36033 return tag_ptr(ret_conv, true);
36036 int8_tArray __attribute__((export_name("TS_InvoiceFeatures_write"))) TS_InvoiceFeatures_write(uint64_t obj) {
36037 LDKInvoiceFeatures obj_conv;
36038 obj_conv.inner = untag_ptr(obj);
36039 obj_conv.is_owned = ptr_is_owned(obj);
36040 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
36041 obj_conv.is_owned = false;
36042 LDKCVec_u8Z ret_var = InvoiceFeatures_write(&obj_conv);
36043 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
36044 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
36045 CVec_u8Z_free(ret_var);
36049 uint64_t __attribute__((export_name("TS_InvoiceFeatures_read"))) TS_InvoiceFeatures_read(int8_tArray ser) {
36050 LDKu8slice ser_ref;
36051 ser_ref.datalen = ser->arr_len;
36052 ser_ref.data = ser->elems;
36053 LDKCResult_InvoiceFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceFeaturesDecodeErrorZ), "LDKCResult_InvoiceFeaturesDecodeErrorZ");
36054 *ret_conv = InvoiceFeatures_read(ser_ref);
36056 return tag_ptr(ret_conv, true);
36059 int8_tArray __attribute__((export_name("TS_ChannelTypeFeatures_write"))) TS_ChannelTypeFeatures_write(uint64_t obj) {
36060 LDKChannelTypeFeatures obj_conv;
36061 obj_conv.inner = untag_ptr(obj);
36062 obj_conv.is_owned = ptr_is_owned(obj);
36063 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
36064 obj_conv.is_owned = false;
36065 LDKCVec_u8Z ret_var = ChannelTypeFeatures_write(&obj_conv);
36066 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
36067 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
36068 CVec_u8Z_free(ret_var);
36072 uint64_t __attribute__((export_name("TS_ChannelTypeFeatures_read"))) TS_ChannelTypeFeatures_read(int8_tArray ser) {
36073 LDKu8slice ser_ref;
36074 ser_ref.datalen = ser->arr_len;
36075 ser_ref.data = ser->elems;
36076 LDKCResult_ChannelTypeFeaturesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelTypeFeaturesDecodeErrorZ), "LDKCResult_ChannelTypeFeaturesDecodeErrorZ");
36077 *ret_conv = ChannelTypeFeatures_read(ser_ref);
36079 return tag_ptr(ret_conv, true);
36082 void __attribute__((export_name("TS_InitFeatures_set_data_loss_protect_optional"))) TS_InitFeatures_set_data_loss_protect_optional(uint64_t this_arg) {
36083 LDKInitFeatures this_arg_conv;
36084 this_arg_conv.inner = untag_ptr(this_arg);
36085 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36086 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36087 this_arg_conv.is_owned = false;
36088 InitFeatures_set_data_loss_protect_optional(&this_arg_conv);
36091 void __attribute__((export_name("TS_InitFeatures_set_data_loss_protect_required"))) TS_InitFeatures_set_data_loss_protect_required(uint64_t this_arg) {
36092 LDKInitFeatures this_arg_conv;
36093 this_arg_conv.inner = untag_ptr(this_arg);
36094 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36095 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36096 this_arg_conv.is_owned = false;
36097 InitFeatures_set_data_loss_protect_required(&this_arg_conv);
36100 jboolean __attribute__((export_name("TS_InitFeatures_supports_data_loss_protect"))) TS_InitFeatures_supports_data_loss_protect(uint64_t this_arg) {
36101 LDKInitFeatures this_arg_conv;
36102 this_arg_conv.inner = untag_ptr(this_arg);
36103 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36104 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36105 this_arg_conv.is_owned = false;
36106 jboolean ret_conv = InitFeatures_supports_data_loss_protect(&this_arg_conv);
36110 void __attribute__((export_name("TS_NodeFeatures_set_data_loss_protect_optional"))) TS_NodeFeatures_set_data_loss_protect_optional(uint64_t this_arg) {
36111 LDKNodeFeatures this_arg_conv;
36112 this_arg_conv.inner = untag_ptr(this_arg);
36113 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36114 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36115 this_arg_conv.is_owned = false;
36116 NodeFeatures_set_data_loss_protect_optional(&this_arg_conv);
36119 void __attribute__((export_name("TS_NodeFeatures_set_data_loss_protect_required"))) TS_NodeFeatures_set_data_loss_protect_required(uint64_t this_arg) {
36120 LDKNodeFeatures this_arg_conv;
36121 this_arg_conv.inner = untag_ptr(this_arg);
36122 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36123 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36124 this_arg_conv.is_owned = false;
36125 NodeFeatures_set_data_loss_protect_required(&this_arg_conv);
36128 jboolean __attribute__((export_name("TS_NodeFeatures_supports_data_loss_protect"))) TS_NodeFeatures_supports_data_loss_protect(uint64_t this_arg) {
36129 LDKNodeFeatures this_arg_conv;
36130 this_arg_conv.inner = untag_ptr(this_arg);
36131 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36132 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36133 this_arg_conv.is_owned = false;
36134 jboolean ret_conv = NodeFeatures_supports_data_loss_protect(&this_arg_conv);
36138 jboolean __attribute__((export_name("TS_InitFeatures_requires_data_loss_protect"))) TS_InitFeatures_requires_data_loss_protect(uint64_t this_arg) {
36139 LDKInitFeatures this_arg_conv;
36140 this_arg_conv.inner = untag_ptr(this_arg);
36141 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36142 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36143 this_arg_conv.is_owned = false;
36144 jboolean ret_conv = InitFeatures_requires_data_loss_protect(&this_arg_conv);
36148 jboolean __attribute__((export_name("TS_NodeFeatures_requires_data_loss_protect"))) TS_NodeFeatures_requires_data_loss_protect(uint64_t this_arg) {
36149 LDKNodeFeatures this_arg_conv;
36150 this_arg_conv.inner = untag_ptr(this_arg);
36151 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36152 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36153 this_arg_conv.is_owned = false;
36154 jboolean ret_conv = NodeFeatures_requires_data_loss_protect(&this_arg_conv);
36158 void __attribute__((export_name("TS_InitFeatures_set_initial_routing_sync_optional"))) TS_InitFeatures_set_initial_routing_sync_optional(uint64_t this_arg) {
36159 LDKInitFeatures 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 InitFeatures_set_initial_routing_sync_optional(&this_arg_conv);
36167 void __attribute__((export_name("TS_InitFeatures_set_initial_routing_sync_required"))) TS_InitFeatures_set_initial_routing_sync_required(uint64_t this_arg) {
36168 LDKInitFeatures this_arg_conv;
36169 this_arg_conv.inner = untag_ptr(this_arg);
36170 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36171 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36172 this_arg_conv.is_owned = false;
36173 InitFeatures_set_initial_routing_sync_required(&this_arg_conv);
36176 jboolean __attribute__((export_name("TS_InitFeatures_initial_routing_sync"))) TS_InitFeatures_initial_routing_sync(uint64_t this_arg) {
36177 LDKInitFeatures this_arg_conv;
36178 this_arg_conv.inner = untag_ptr(this_arg);
36179 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36180 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36181 this_arg_conv.is_owned = false;
36182 jboolean ret_conv = InitFeatures_initial_routing_sync(&this_arg_conv);
36186 void __attribute__((export_name("TS_InitFeatures_set_upfront_shutdown_script_optional"))) TS_InitFeatures_set_upfront_shutdown_script_optional(uint64_t this_arg) {
36187 LDKInitFeatures this_arg_conv;
36188 this_arg_conv.inner = untag_ptr(this_arg);
36189 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36190 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36191 this_arg_conv.is_owned = false;
36192 InitFeatures_set_upfront_shutdown_script_optional(&this_arg_conv);
36195 void __attribute__((export_name("TS_InitFeatures_set_upfront_shutdown_script_required"))) TS_InitFeatures_set_upfront_shutdown_script_required(uint64_t this_arg) {
36196 LDKInitFeatures this_arg_conv;
36197 this_arg_conv.inner = untag_ptr(this_arg);
36198 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36199 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36200 this_arg_conv.is_owned = false;
36201 InitFeatures_set_upfront_shutdown_script_required(&this_arg_conv);
36204 jboolean __attribute__((export_name("TS_InitFeatures_supports_upfront_shutdown_script"))) TS_InitFeatures_supports_upfront_shutdown_script(uint64_t this_arg) {
36205 LDKInitFeatures this_arg_conv;
36206 this_arg_conv.inner = untag_ptr(this_arg);
36207 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36208 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36209 this_arg_conv.is_owned = false;
36210 jboolean ret_conv = InitFeatures_supports_upfront_shutdown_script(&this_arg_conv);
36214 void __attribute__((export_name("TS_NodeFeatures_set_upfront_shutdown_script_optional"))) TS_NodeFeatures_set_upfront_shutdown_script_optional(uint64_t this_arg) {
36215 LDKNodeFeatures this_arg_conv;
36216 this_arg_conv.inner = untag_ptr(this_arg);
36217 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36218 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36219 this_arg_conv.is_owned = false;
36220 NodeFeatures_set_upfront_shutdown_script_optional(&this_arg_conv);
36223 void __attribute__((export_name("TS_NodeFeatures_set_upfront_shutdown_script_required"))) TS_NodeFeatures_set_upfront_shutdown_script_required(uint64_t this_arg) {
36224 LDKNodeFeatures this_arg_conv;
36225 this_arg_conv.inner = untag_ptr(this_arg);
36226 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36227 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36228 this_arg_conv.is_owned = false;
36229 NodeFeatures_set_upfront_shutdown_script_required(&this_arg_conv);
36232 jboolean __attribute__((export_name("TS_NodeFeatures_supports_upfront_shutdown_script"))) TS_NodeFeatures_supports_upfront_shutdown_script(uint64_t this_arg) {
36233 LDKNodeFeatures this_arg_conv;
36234 this_arg_conv.inner = untag_ptr(this_arg);
36235 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36236 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36237 this_arg_conv.is_owned = false;
36238 jboolean ret_conv = NodeFeatures_supports_upfront_shutdown_script(&this_arg_conv);
36242 jboolean __attribute__((export_name("TS_InitFeatures_requires_upfront_shutdown_script"))) TS_InitFeatures_requires_upfront_shutdown_script(uint64_t this_arg) {
36243 LDKInitFeatures this_arg_conv;
36244 this_arg_conv.inner = untag_ptr(this_arg);
36245 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36246 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36247 this_arg_conv.is_owned = false;
36248 jboolean ret_conv = InitFeatures_requires_upfront_shutdown_script(&this_arg_conv);
36252 jboolean __attribute__((export_name("TS_NodeFeatures_requires_upfront_shutdown_script"))) TS_NodeFeatures_requires_upfront_shutdown_script(uint64_t this_arg) {
36253 LDKNodeFeatures this_arg_conv;
36254 this_arg_conv.inner = untag_ptr(this_arg);
36255 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36256 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36257 this_arg_conv.is_owned = false;
36258 jboolean ret_conv = NodeFeatures_requires_upfront_shutdown_script(&this_arg_conv);
36262 void __attribute__((export_name("TS_InitFeatures_set_gossip_queries_optional"))) TS_InitFeatures_set_gossip_queries_optional(uint64_t this_arg) {
36263 LDKInitFeatures this_arg_conv;
36264 this_arg_conv.inner = untag_ptr(this_arg);
36265 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36266 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36267 this_arg_conv.is_owned = false;
36268 InitFeatures_set_gossip_queries_optional(&this_arg_conv);
36271 void __attribute__((export_name("TS_InitFeatures_set_gossip_queries_required"))) TS_InitFeatures_set_gossip_queries_required(uint64_t this_arg) {
36272 LDKInitFeatures this_arg_conv;
36273 this_arg_conv.inner = untag_ptr(this_arg);
36274 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36275 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36276 this_arg_conv.is_owned = false;
36277 InitFeatures_set_gossip_queries_required(&this_arg_conv);
36280 jboolean __attribute__((export_name("TS_InitFeatures_supports_gossip_queries"))) TS_InitFeatures_supports_gossip_queries(uint64_t this_arg) {
36281 LDKInitFeatures this_arg_conv;
36282 this_arg_conv.inner = untag_ptr(this_arg);
36283 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36284 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36285 this_arg_conv.is_owned = false;
36286 jboolean ret_conv = InitFeatures_supports_gossip_queries(&this_arg_conv);
36290 void __attribute__((export_name("TS_NodeFeatures_set_gossip_queries_optional"))) TS_NodeFeatures_set_gossip_queries_optional(uint64_t this_arg) {
36291 LDKNodeFeatures this_arg_conv;
36292 this_arg_conv.inner = untag_ptr(this_arg);
36293 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36294 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36295 this_arg_conv.is_owned = false;
36296 NodeFeatures_set_gossip_queries_optional(&this_arg_conv);
36299 void __attribute__((export_name("TS_NodeFeatures_set_gossip_queries_required"))) TS_NodeFeatures_set_gossip_queries_required(uint64_t this_arg) {
36300 LDKNodeFeatures this_arg_conv;
36301 this_arg_conv.inner = untag_ptr(this_arg);
36302 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36303 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36304 this_arg_conv.is_owned = false;
36305 NodeFeatures_set_gossip_queries_required(&this_arg_conv);
36308 jboolean __attribute__((export_name("TS_NodeFeatures_supports_gossip_queries"))) TS_NodeFeatures_supports_gossip_queries(uint64_t this_arg) {
36309 LDKNodeFeatures this_arg_conv;
36310 this_arg_conv.inner = untag_ptr(this_arg);
36311 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36312 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36313 this_arg_conv.is_owned = false;
36314 jboolean ret_conv = NodeFeatures_supports_gossip_queries(&this_arg_conv);
36318 jboolean __attribute__((export_name("TS_InitFeatures_requires_gossip_queries"))) TS_InitFeatures_requires_gossip_queries(uint64_t this_arg) {
36319 LDKInitFeatures this_arg_conv;
36320 this_arg_conv.inner = untag_ptr(this_arg);
36321 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36322 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36323 this_arg_conv.is_owned = false;
36324 jboolean ret_conv = InitFeatures_requires_gossip_queries(&this_arg_conv);
36328 jboolean __attribute__((export_name("TS_NodeFeatures_requires_gossip_queries"))) TS_NodeFeatures_requires_gossip_queries(uint64_t this_arg) {
36329 LDKNodeFeatures this_arg_conv;
36330 this_arg_conv.inner = untag_ptr(this_arg);
36331 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36332 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36333 this_arg_conv.is_owned = false;
36334 jboolean ret_conv = NodeFeatures_requires_gossip_queries(&this_arg_conv);
36338 void __attribute__((export_name("TS_InitFeatures_set_variable_length_onion_optional"))) TS_InitFeatures_set_variable_length_onion_optional(uint64_t this_arg) {
36339 LDKInitFeatures this_arg_conv;
36340 this_arg_conv.inner = untag_ptr(this_arg);
36341 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36342 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36343 this_arg_conv.is_owned = false;
36344 InitFeatures_set_variable_length_onion_optional(&this_arg_conv);
36347 void __attribute__((export_name("TS_InitFeatures_set_variable_length_onion_required"))) TS_InitFeatures_set_variable_length_onion_required(uint64_t this_arg) {
36348 LDKInitFeatures this_arg_conv;
36349 this_arg_conv.inner = untag_ptr(this_arg);
36350 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36351 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36352 this_arg_conv.is_owned = false;
36353 InitFeatures_set_variable_length_onion_required(&this_arg_conv);
36356 jboolean __attribute__((export_name("TS_InitFeatures_supports_variable_length_onion"))) TS_InitFeatures_supports_variable_length_onion(uint64_t this_arg) {
36357 LDKInitFeatures this_arg_conv;
36358 this_arg_conv.inner = untag_ptr(this_arg);
36359 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36360 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36361 this_arg_conv.is_owned = false;
36362 jboolean ret_conv = InitFeatures_supports_variable_length_onion(&this_arg_conv);
36366 void __attribute__((export_name("TS_NodeFeatures_set_variable_length_onion_optional"))) TS_NodeFeatures_set_variable_length_onion_optional(uint64_t this_arg) {
36367 LDKNodeFeatures this_arg_conv;
36368 this_arg_conv.inner = untag_ptr(this_arg);
36369 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36370 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36371 this_arg_conv.is_owned = false;
36372 NodeFeatures_set_variable_length_onion_optional(&this_arg_conv);
36375 void __attribute__((export_name("TS_NodeFeatures_set_variable_length_onion_required"))) TS_NodeFeatures_set_variable_length_onion_required(uint64_t this_arg) {
36376 LDKNodeFeatures this_arg_conv;
36377 this_arg_conv.inner = untag_ptr(this_arg);
36378 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36379 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36380 this_arg_conv.is_owned = false;
36381 NodeFeatures_set_variable_length_onion_required(&this_arg_conv);
36384 jboolean __attribute__((export_name("TS_NodeFeatures_supports_variable_length_onion"))) TS_NodeFeatures_supports_variable_length_onion(uint64_t this_arg) {
36385 LDKNodeFeatures this_arg_conv;
36386 this_arg_conv.inner = untag_ptr(this_arg);
36387 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36388 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36389 this_arg_conv.is_owned = false;
36390 jboolean ret_conv = NodeFeatures_supports_variable_length_onion(&this_arg_conv);
36394 void __attribute__((export_name("TS_InvoiceFeatures_set_variable_length_onion_optional"))) TS_InvoiceFeatures_set_variable_length_onion_optional(uint64_t this_arg) {
36395 LDKInvoiceFeatures this_arg_conv;
36396 this_arg_conv.inner = untag_ptr(this_arg);
36397 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36398 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36399 this_arg_conv.is_owned = false;
36400 InvoiceFeatures_set_variable_length_onion_optional(&this_arg_conv);
36403 void __attribute__((export_name("TS_InvoiceFeatures_set_variable_length_onion_required"))) TS_InvoiceFeatures_set_variable_length_onion_required(uint64_t this_arg) {
36404 LDKInvoiceFeatures this_arg_conv;
36405 this_arg_conv.inner = untag_ptr(this_arg);
36406 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36407 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36408 this_arg_conv.is_owned = false;
36409 InvoiceFeatures_set_variable_length_onion_required(&this_arg_conv);
36412 jboolean __attribute__((export_name("TS_InvoiceFeatures_supports_variable_length_onion"))) TS_InvoiceFeatures_supports_variable_length_onion(uint64_t this_arg) {
36413 LDKInvoiceFeatures this_arg_conv;
36414 this_arg_conv.inner = untag_ptr(this_arg);
36415 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36416 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36417 this_arg_conv.is_owned = false;
36418 jboolean ret_conv = InvoiceFeatures_supports_variable_length_onion(&this_arg_conv);
36422 jboolean __attribute__((export_name("TS_InitFeatures_requires_variable_length_onion"))) TS_InitFeatures_requires_variable_length_onion(uint64_t this_arg) {
36423 LDKInitFeatures this_arg_conv;
36424 this_arg_conv.inner = untag_ptr(this_arg);
36425 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36426 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36427 this_arg_conv.is_owned = false;
36428 jboolean ret_conv = InitFeatures_requires_variable_length_onion(&this_arg_conv);
36432 jboolean __attribute__((export_name("TS_NodeFeatures_requires_variable_length_onion"))) TS_NodeFeatures_requires_variable_length_onion(uint64_t this_arg) {
36433 LDKNodeFeatures this_arg_conv;
36434 this_arg_conv.inner = untag_ptr(this_arg);
36435 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36436 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36437 this_arg_conv.is_owned = false;
36438 jboolean ret_conv = NodeFeatures_requires_variable_length_onion(&this_arg_conv);
36442 jboolean __attribute__((export_name("TS_InvoiceFeatures_requires_variable_length_onion"))) TS_InvoiceFeatures_requires_variable_length_onion(uint64_t this_arg) {
36443 LDKInvoiceFeatures this_arg_conv;
36444 this_arg_conv.inner = untag_ptr(this_arg);
36445 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36446 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36447 this_arg_conv.is_owned = false;
36448 jboolean ret_conv = InvoiceFeatures_requires_variable_length_onion(&this_arg_conv);
36452 void __attribute__((export_name("TS_InitFeatures_set_static_remote_key_optional"))) TS_InitFeatures_set_static_remote_key_optional(uint64_t this_arg) {
36453 LDKInitFeatures this_arg_conv;
36454 this_arg_conv.inner = untag_ptr(this_arg);
36455 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36456 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36457 this_arg_conv.is_owned = false;
36458 InitFeatures_set_static_remote_key_optional(&this_arg_conv);
36461 void __attribute__((export_name("TS_InitFeatures_set_static_remote_key_required"))) TS_InitFeatures_set_static_remote_key_required(uint64_t this_arg) {
36462 LDKInitFeatures this_arg_conv;
36463 this_arg_conv.inner = untag_ptr(this_arg);
36464 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36465 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36466 this_arg_conv.is_owned = false;
36467 InitFeatures_set_static_remote_key_required(&this_arg_conv);
36470 jboolean __attribute__((export_name("TS_InitFeatures_supports_static_remote_key"))) TS_InitFeatures_supports_static_remote_key(uint64_t this_arg) {
36471 LDKInitFeatures this_arg_conv;
36472 this_arg_conv.inner = untag_ptr(this_arg);
36473 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36474 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36475 this_arg_conv.is_owned = false;
36476 jboolean ret_conv = InitFeatures_supports_static_remote_key(&this_arg_conv);
36480 void __attribute__((export_name("TS_NodeFeatures_set_static_remote_key_optional"))) TS_NodeFeatures_set_static_remote_key_optional(uint64_t this_arg) {
36481 LDKNodeFeatures this_arg_conv;
36482 this_arg_conv.inner = untag_ptr(this_arg);
36483 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36484 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36485 this_arg_conv.is_owned = false;
36486 NodeFeatures_set_static_remote_key_optional(&this_arg_conv);
36489 void __attribute__((export_name("TS_NodeFeatures_set_static_remote_key_required"))) TS_NodeFeatures_set_static_remote_key_required(uint64_t this_arg) {
36490 LDKNodeFeatures this_arg_conv;
36491 this_arg_conv.inner = untag_ptr(this_arg);
36492 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36493 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36494 this_arg_conv.is_owned = false;
36495 NodeFeatures_set_static_remote_key_required(&this_arg_conv);
36498 jboolean __attribute__((export_name("TS_NodeFeatures_supports_static_remote_key"))) TS_NodeFeatures_supports_static_remote_key(uint64_t this_arg) {
36499 LDKNodeFeatures this_arg_conv;
36500 this_arg_conv.inner = untag_ptr(this_arg);
36501 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36502 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36503 this_arg_conv.is_owned = false;
36504 jboolean ret_conv = NodeFeatures_supports_static_remote_key(&this_arg_conv);
36508 void __attribute__((export_name("TS_ChannelTypeFeatures_set_static_remote_key_optional"))) TS_ChannelTypeFeatures_set_static_remote_key_optional(uint64_t this_arg) {
36509 LDKChannelTypeFeatures this_arg_conv;
36510 this_arg_conv.inner = untag_ptr(this_arg);
36511 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36512 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36513 this_arg_conv.is_owned = false;
36514 ChannelTypeFeatures_set_static_remote_key_optional(&this_arg_conv);
36517 void __attribute__((export_name("TS_ChannelTypeFeatures_set_static_remote_key_required"))) TS_ChannelTypeFeatures_set_static_remote_key_required(uint64_t this_arg) {
36518 LDKChannelTypeFeatures this_arg_conv;
36519 this_arg_conv.inner = untag_ptr(this_arg);
36520 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36521 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36522 this_arg_conv.is_owned = false;
36523 ChannelTypeFeatures_set_static_remote_key_required(&this_arg_conv);
36526 jboolean __attribute__((export_name("TS_ChannelTypeFeatures_supports_static_remote_key"))) TS_ChannelTypeFeatures_supports_static_remote_key(uint64_t this_arg) {
36527 LDKChannelTypeFeatures this_arg_conv;
36528 this_arg_conv.inner = untag_ptr(this_arg);
36529 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36530 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36531 this_arg_conv.is_owned = false;
36532 jboolean ret_conv = ChannelTypeFeatures_supports_static_remote_key(&this_arg_conv);
36536 jboolean __attribute__((export_name("TS_InitFeatures_requires_static_remote_key"))) TS_InitFeatures_requires_static_remote_key(uint64_t this_arg) {
36537 LDKInitFeatures this_arg_conv;
36538 this_arg_conv.inner = untag_ptr(this_arg);
36539 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36540 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36541 this_arg_conv.is_owned = false;
36542 jboolean ret_conv = InitFeatures_requires_static_remote_key(&this_arg_conv);
36546 jboolean __attribute__((export_name("TS_NodeFeatures_requires_static_remote_key"))) TS_NodeFeatures_requires_static_remote_key(uint64_t this_arg) {
36547 LDKNodeFeatures this_arg_conv;
36548 this_arg_conv.inner = untag_ptr(this_arg);
36549 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36550 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36551 this_arg_conv.is_owned = false;
36552 jboolean ret_conv = NodeFeatures_requires_static_remote_key(&this_arg_conv);
36556 jboolean __attribute__((export_name("TS_ChannelTypeFeatures_requires_static_remote_key"))) TS_ChannelTypeFeatures_requires_static_remote_key(uint64_t this_arg) {
36557 LDKChannelTypeFeatures this_arg_conv;
36558 this_arg_conv.inner = untag_ptr(this_arg);
36559 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36560 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36561 this_arg_conv.is_owned = false;
36562 jboolean ret_conv = ChannelTypeFeatures_requires_static_remote_key(&this_arg_conv);
36566 void __attribute__((export_name("TS_InitFeatures_set_payment_secret_optional"))) TS_InitFeatures_set_payment_secret_optional(uint64_t this_arg) {
36567 LDKInitFeatures this_arg_conv;
36568 this_arg_conv.inner = untag_ptr(this_arg);
36569 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36570 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36571 this_arg_conv.is_owned = false;
36572 InitFeatures_set_payment_secret_optional(&this_arg_conv);
36575 void __attribute__((export_name("TS_InitFeatures_set_payment_secret_required"))) TS_InitFeatures_set_payment_secret_required(uint64_t this_arg) {
36576 LDKInitFeatures this_arg_conv;
36577 this_arg_conv.inner = untag_ptr(this_arg);
36578 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36579 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36580 this_arg_conv.is_owned = false;
36581 InitFeatures_set_payment_secret_required(&this_arg_conv);
36584 jboolean __attribute__((export_name("TS_InitFeatures_supports_payment_secret"))) TS_InitFeatures_supports_payment_secret(uint64_t this_arg) {
36585 LDKInitFeatures this_arg_conv;
36586 this_arg_conv.inner = untag_ptr(this_arg);
36587 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36588 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36589 this_arg_conv.is_owned = false;
36590 jboolean ret_conv = InitFeatures_supports_payment_secret(&this_arg_conv);
36594 void __attribute__((export_name("TS_NodeFeatures_set_payment_secret_optional"))) TS_NodeFeatures_set_payment_secret_optional(uint64_t this_arg) {
36595 LDKNodeFeatures this_arg_conv;
36596 this_arg_conv.inner = untag_ptr(this_arg);
36597 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36598 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36599 this_arg_conv.is_owned = false;
36600 NodeFeatures_set_payment_secret_optional(&this_arg_conv);
36603 void __attribute__((export_name("TS_NodeFeatures_set_payment_secret_required"))) TS_NodeFeatures_set_payment_secret_required(uint64_t this_arg) {
36604 LDKNodeFeatures this_arg_conv;
36605 this_arg_conv.inner = untag_ptr(this_arg);
36606 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36607 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36608 this_arg_conv.is_owned = false;
36609 NodeFeatures_set_payment_secret_required(&this_arg_conv);
36612 jboolean __attribute__((export_name("TS_NodeFeatures_supports_payment_secret"))) TS_NodeFeatures_supports_payment_secret(uint64_t this_arg) {
36613 LDKNodeFeatures this_arg_conv;
36614 this_arg_conv.inner = untag_ptr(this_arg);
36615 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36616 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36617 this_arg_conv.is_owned = false;
36618 jboolean ret_conv = NodeFeatures_supports_payment_secret(&this_arg_conv);
36622 void __attribute__((export_name("TS_InvoiceFeatures_set_payment_secret_optional"))) TS_InvoiceFeatures_set_payment_secret_optional(uint64_t this_arg) {
36623 LDKInvoiceFeatures this_arg_conv;
36624 this_arg_conv.inner = untag_ptr(this_arg);
36625 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36626 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36627 this_arg_conv.is_owned = false;
36628 InvoiceFeatures_set_payment_secret_optional(&this_arg_conv);
36631 void __attribute__((export_name("TS_InvoiceFeatures_set_payment_secret_required"))) TS_InvoiceFeatures_set_payment_secret_required(uint64_t this_arg) {
36632 LDKInvoiceFeatures this_arg_conv;
36633 this_arg_conv.inner = untag_ptr(this_arg);
36634 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36635 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36636 this_arg_conv.is_owned = false;
36637 InvoiceFeatures_set_payment_secret_required(&this_arg_conv);
36640 jboolean __attribute__((export_name("TS_InvoiceFeatures_supports_payment_secret"))) TS_InvoiceFeatures_supports_payment_secret(uint64_t this_arg) {
36641 LDKInvoiceFeatures this_arg_conv;
36642 this_arg_conv.inner = untag_ptr(this_arg);
36643 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36644 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36645 this_arg_conv.is_owned = false;
36646 jboolean ret_conv = InvoiceFeatures_supports_payment_secret(&this_arg_conv);
36650 jboolean __attribute__((export_name("TS_InitFeatures_requires_payment_secret"))) TS_InitFeatures_requires_payment_secret(uint64_t this_arg) {
36651 LDKInitFeatures this_arg_conv;
36652 this_arg_conv.inner = untag_ptr(this_arg);
36653 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36654 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36655 this_arg_conv.is_owned = false;
36656 jboolean ret_conv = InitFeatures_requires_payment_secret(&this_arg_conv);
36660 jboolean __attribute__((export_name("TS_NodeFeatures_requires_payment_secret"))) TS_NodeFeatures_requires_payment_secret(uint64_t this_arg) {
36661 LDKNodeFeatures this_arg_conv;
36662 this_arg_conv.inner = untag_ptr(this_arg);
36663 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36664 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36665 this_arg_conv.is_owned = false;
36666 jboolean ret_conv = NodeFeatures_requires_payment_secret(&this_arg_conv);
36670 jboolean __attribute__((export_name("TS_InvoiceFeatures_requires_payment_secret"))) TS_InvoiceFeatures_requires_payment_secret(uint64_t this_arg) {
36671 LDKInvoiceFeatures this_arg_conv;
36672 this_arg_conv.inner = untag_ptr(this_arg);
36673 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36674 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36675 this_arg_conv.is_owned = false;
36676 jboolean ret_conv = InvoiceFeatures_requires_payment_secret(&this_arg_conv);
36680 void __attribute__((export_name("TS_InitFeatures_set_basic_mpp_optional"))) TS_InitFeatures_set_basic_mpp_optional(uint64_t this_arg) {
36681 LDKInitFeatures this_arg_conv;
36682 this_arg_conv.inner = untag_ptr(this_arg);
36683 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36684 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36685 this_arg_conv.is_owned = false;
36686 InitFeatures_set_basic_mpp_optional(&this_arg_conv);
36689 void __attribute__((export_name("TS_InitFeatures_set_basic_mpp_required"))) TS_InitFeatures_set_basic_mpp_required(uint64_t this_arg) {
36690 LDKInitFeatures this_arg_conv;
36691 this_arg_conv.inner = untag_ptr(this_arg);
36692 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36693 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36694 this_arg_conv.is_owned = false;
36695 InitFeatures_set_basic_mpp_required(&this_arg_conv);
36698 jboolean __attribute__((export_name("TS_InitFeatures_supports_basic_mpp"))) TS_InitFeatures_supports_basic_mpp(uint64_t this_arg) {
36699 LDKInitFeatures this_arg_conv;
36700 this_arg_conv.inner = untag_ptr(this_arg);
36701 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36702 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36703 this_arg_conv.is_owned = false;
36704 jboolean ret_conv = InitFeatures_supports_basic_mpp(&this_arg_conv);
36708 void __attribute__((export_name("TS_NodeFeatures_set_basic_mpp_optional"))) TS_NodeFeatures_set_basic_mpp_optional(uint64_t this_arg) {
36709 LDKNodeFeatures this_arg_conv;
36710 this_arg_conv.inner = untag_ptr(this_arg);
36711 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36712 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36713 this_arg_conv.is_owned = false;
36714 NodeFeatures_set_basic_mpp_optional(&this_arg_conv);
36717 void __attribute__((export_name("TS_NodeFeatures_set_basic_mpp_required"))) TS_NodeFeatures_set_basic_mpp_required(uint64_t this_arg) {
36718 LDKNodeFeatures this_arg_conv;
36719 this_arg_conv.inner = untag_ptr(this_arg);
36720 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36721 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36722 this_arg_conv.is_owned = false;
36723 NodeFeatures_set_basic_mpp_required(&this_arg_conv);
36726 jboolean __attribute__((export_name("TS_NodeFeatures_supports_basic_mpp"))) TS_NodeFeatures_supports_basic_mpp(uint64_t this_arg) {
36727 LDKNodeFeatures this_arg_conv;
36728 this_arg_conv.inner = untag_ptr(this_arg);
36729 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36730 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36731 this_arg_conv.is_owned = false;
36732 jboolean ret_conv = NodeFeatures_supports_basic_mpp(&this_arg_conv);
36736 void __attribute__((export_name("TS_InvoiceFeatures_set_basic_mpp_optional"))) TS_InvoiceFeatures_set_basic_mpp_optional(uint64_t this_arg) {
36737 LDKInvoiceFeatures this_arg_conv;
36738 this_arg_conv.inner = untag_ptr(this_arg);
36739 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36740 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36741 this_arg_conv.is_owned = false;
36742 InvoiceFeatures_set_basic_mpp_optional(&this_arg_conv);
36745 void __attribute__((export_name("TS_InvoiceFeatures_set_basic_mpp_required"))) TS_InvoiceFeatures_set_basic_mpp_required(uint64_t this_arg) {
36746 LDKInvoiceFeatures this_arg_conv;
36747 this_arg_conv.inner = untag_ptr(this_arg);
36748 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36749 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36750 this_arg_conv.is_owned = false;
36751 InvoiceFeatures_set_basic_mpp_required(&this_arg_conv);
36754 jboolean __attribute__((export_name("TS_InvoiceFeatures_supports_basic_mpp"))) TS_InvoiceFeatures_supports_basic_mpp(uint64_t this_arg) {
36755 LDKInvoiceFeatures this_arg_conv;
36756 this_arg_conv.inner = untag_ptr(this_arg);
36757 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36758 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36759 this_arg_conv.is_owned = false;
36760 jboolean ret_conv = InvoiceFeatures_supports_basic_mpp(&this_arg_conv);
36764 jboolean __attribute__((export_name("TS_InitFeatures_requires_basic_mpp"))) TS_InitFeatures_requires_basic_mpp(uint64_t this_arg) {
36765 LDKInitFeatures this_arg_conv;
36766 this_arg_conv.inner = untag_ptr(this_arg);
36767 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36768 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36769 this_arg_conv.is_owned = false;
36770 jboolean ret_conv = InitFeatures_requires_basic_mpp(&this_arg_conv);
36774 jboolean __attribute__((export_name("TS_NodeFeatures_requires_basic_mpp"))) TS_NodeFeatures_requires_basic_mpp(uint64_t this_arg) {
36775 LDKNodeFeatures this_arg_conv;
36776 this_arg_conv.inner = untag_ptr(this_arg);
36777 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36778 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36779 this_arg_conv.is_owned = false;
36780 jboolean ret_conv = NodeFeatures_requires_basic_mpp(&this_arg_conv);
36784 jboolean __attribute__((export_name("TS_InvoiceFeatures_requires_basic_mpp"))) TS_InvoiceFeatures_requires_basic_mpp(uint64_t this_arg) {
36785 LDKInvoiceFeatures this_arg_conv;
36786 this_arg_conv.inner = untag_ptr(this_arg);
36787 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36788 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36789 this_arg_conv.is_owned = false;
36790 jboolean ret_conv = InvoiceFeatures_requires_basic_mpp(&this_arg_conv);
36794 void __attribute__((export_name("TS_InitFeatures_set_wumbo_optional"))) TS_InitFeatures_set_wumbo_optional(uint64_t this_arg) {
36795 LDKInitFeatures this_arg_conv;
36796 this_arg_conv.inner = untag_ptr(this_arg);
36797 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36798 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36799 this_arg_conv.is_owned = false;
36800 InitFeatures_set_wumbo_optional(&this_arg_conv);
36803 void __attribute__((export_name("TS_InitFeatures_set_wumbo_required"))) TS_InitFeatures_set_wumbo_required(uint64_t this_arg) {
36804 LDKInitFeatures this_arg_conv;
36805 this_arg_conv.inner = untag_ptr(this_arg);
36806 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36807 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36808 this_arg_conv.is_owned = false;
36809 InitFeatures_set_wumbo_required(&this_arg_conv);
36812 jboolean __attribute__((export_name("TS_InitFeatures_supports_wumbo"))) TS_InitFeatures_supports_wumbo(uint64_t this_arg) {
36813 LDKInitFeatures this_arg_conv;
36814 this_arg_conv.inner = untag_ptr(this_arg);
36815 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36816 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36817 this_arg_conv.is_owned = false;
36818 jboolean ret_conv = InitFeatures_supports_wumbo(&this_arg_conv);
36822 void __attribute__((export_name("TS_NodeFeatures_set_wumbo_optional"))) TS_NodeFeatures_set_wumbo_optional(uint64_t this_arg) {
36823 LDKNodeFeatures this_arg_conv;
36824 this_arg_conv.inner = untag_ptr(this_arg);
36825 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36826 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36827 this_arg_conv.is_owned = false;
36828 NodeFeatures_set_wumbo_optional(&this_arg_conv);
36831 void __attribute__((export_name("TS_NodeFeatures_set_wumbo_required"))) TS_NodeFeatures_set_wumbo_required(uint64_t this_arg) {
36832 LDKNodeFeatures this_arg_conv;
36833 this_arg_conv.inner = untag_ptr(this_arg);
36834 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36835 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36836 this_arg_conv.is_owned = false;
36837 NodeFeatures_set_wumbo_required(&this_arg_conv);
36840 jboolean __attribute__((export_name("TS_NodeFeatures_supports_wumbo"))) TS_NodeFeatures_supports_wumbo(uint64_t this_arg) {
36841 LDKNodeFeatures this_arg_conv;
36842 this_arg_conv.inner = untag_ptr(this_arg);
36843 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36844 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36845 this_arg_conv.is_owned = false;
36846 jboolean ret_conv = NodeFeatures_supports_wumbo(&this_arg_conv);
36850 jboolean __attribute__((export_name("TS_InitFeatures_requires_wumbo"))) TS_InitFeatures_requires_wumbo(uint64_t this_arg) {
36851 LDKInitFeatures this_arg_conv;
36852 this_arg_conv.inner = untag_ptr(this_arg);
36853 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36854 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36855 this_arg_conv.is_owned = false;
36856 jboolean ret_conv = InitFeatures_requires_wumbo(&this_arg_conv);
36860 jboolean __attribute__((export_name("TS_NodeFeatures_requires_wumbo"))) TS_NodeFeatures_requires_wumbo(uint64_t this_arg) {
36861 LDKNodeFeatures this_arg_conv;
36862 this_arg_conv.inner = untag_ptr(this_arg);
36863 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36864 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36865 this_arg_conv.is_owned = false;
36866 jboolean ret_conv = NodeFeatures_requires_wumbo(&this_arg_conv);
36870 void __attribute__((export_name("TS_InitFeatures_set_shutdown_any_segwit_optional"))) TS_InitFeatures_set_shutdown_any_segwit_optional(uint64_t this_arg) {
36871 LDKInitFeatures this_arg_conv;
36872 this_arg_conv.inner = untag_ptr(this_arg);
36873 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36874 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36875 this_arg_conv.is_owned = false;
36876 InitFeatures_set_shutdown_any_segwit_optional(&this_arg_conv);
36879 void __attribute__((export_name("TS_InitFeatures_set_shutdown_any_segwit_required"))) TS_InitFeatures_set_shutdown_any_segwit_required(uint64_t this_arg) {
36880 LDKInitFeatures this_arg_conv;
36881 this_arg_conv.inner = untag_ptr(this_arg);
36882 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36883 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36884 this_arg_conv.is_owned = false;
36885 InitFeatures_set_shutdown_any_segwit_required(&this_arg_conv);
36888 jboolean __attribute__((export_name("TS_InitFeatures_supports_shutdown_anysegwit"))) TS_InitFeatures_supports_shutdown_anysegwit(uint64_t this_arg) {
36889 LDKInitFeatures this_arg_conv;
36890 this_arg_conv.inner = untag_ptr(this_arg);
36891 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36892 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36893 this_arg_conv.is_owned = false;
36894 jboolean ret_conv = InitFeatures_supports_shutdown_anysegwit(&this_arg_conv);
36898 void __attribute__((export_name("TS_NodeFeatures_set_shutdown_any_segwit_optional"))) TS_NodeFeatures_set_shutdown_any_segwit_optional(uint64_t this_arg) {
36899 LDKNodeFeatures this_arg_conv;
36900 this_arg_conv.inner = untag_ptr(this_arg);
36901 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36902 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36903 this_arg_conv.is_owned = false;
36904 NodeFeatures_set_shutdown_any_segwit_optional(&this_arg_conv);
36907 void __attribute__((export_name("TS_NodeFeatures_set_shutdown_any_segwit_required"))) TS_NodeFeatures_set_shutdown_any_segwit_required(uint64_t this_arg) {
36908 LDKNodeFeatures this_arg_conv;
36909 this_arg_conv.inner = untag_ptr(this_arg);
36910 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36911 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36912 this_arg_conv.is_owned = false;
36913 NodeFeatures_set_shutdown_any_segwit_required(&this_arg_conv);
36916 jboolean __attribute__((export_name("TS_NodeFeatures_supports_shutdown_anysegwit"))) TS_NodeFeatures_supports_shutdown_anysegwit(uint64_t this_arg) {
36917 LDKNodeFeatures this_arg_conv;
36918 this_arg_conv.inner = untag_ptr(this_arg);
36919 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36920 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36921 this_arg_conv.is_owned = false;
36922 jboolean ret_conv = NodeFeatures_supports_shutdown_anysegwit(&this_arg_conv);
36926 jboolean __attribute__((export_name("TS_InitFeatures_requires_shutdown_anysegwit"))) TS_InitFeatures_requires_shutdown_anysegwit(uint64_t this_arg) {
36927 LDKInitFeatures this_arg_conv;
36928 this_arg_conv.inner = untag_ptr(this_arg);
36929 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36930 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36931 this_arg_conv.is_owned = false;
36932 jboolean ret_conv = InitFeatures_requires_shutdown_anysegwit(&this_arg_conv);
36936 jboolean __attribute__((export_name("TS_NodeFeatures_requires_shutdown_anysegwit"))) TS_NodeFeatures_requires_shutdown_anysegwit(uint64_t this_arg) {
36937 LDKNodeFeatures this_arg_conv;
36938 this_arg_conv.inner = untag_ptr(this_arg);
36939 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36940 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36941 this_arg_conv.is_owned = false;
36942 jboolean ret_conv = NodeFeatures_requires_shutdown_anysegwit(&this_arg_conv);
36946 void __attribute__((export_name("TS_InitFeatures_set_channel_type_optional"))) TS_InitFeatures_set_channel_type_optional(uint64_t this_arg) {
36947 LDKInitFeatures 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 InitFeatures_set_channel_type_optional(&this_arg_conv);
36955 void __attribute__((export_name("TS_InitFeatures_set_channel_type_required"))) TS_InitFeatures_set_channel_type_required(uint64_t this_arg) {
36956 LDKInitFeatures 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 InitFeatures_set_channel_type_required(&this_arg_conv);
36964 jboolean __attribute__((export_name("TS_InitFeatures_supports_channel_type"))) TS_InitFeatures_supports_channel_type(uint64_t this_arg) {
36965 LDKInitFeatures this_arg_conv;
36966 this_arg_conv.inner = untag_ptr(this_arg);
36967 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36968 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36969 this_arg_conv.is_owned = false;
36970 jboolean ret_conv = InitFeatures_supports_channel_type(&this_arg_conv);
36974 void __attribute__((export_name("TS_NodeFeatures_set_channel_type_optional"))) TS_NodeFeatures_set_channel_type_optional(uint64_t this_arg) {
36975 LDKNodeFeatures this_arg_conv;
36976 this_arg_conv.inner = untag_ptr(this_arg);
36977 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36978 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36979 this_arg_conv.is_owned = false;
36980 NodeFeatures_set_channel_type_optional(&this_arg_conv);
36983 void __attribute__((export_name("TS_NodeFeatures_set_channel_type_required"))) TS_NodeFeatures_set_channel_type_required(uint64_t this_arg) {
36984 LDKNodeFeatures this_arg_conv;
36985 this_arg_conv.inner = untag_ptr(this_arg);
36986 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36987 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36988 this_arg_conv.is_owned = false;
36989 NodeFeatures_set_channel_type_required(&this_arg_conv);
36992 jboolean __attribute__((export_name("TS_NodeFeatures_supports_channel_type"))) TS_NodeFeatures_supports_channel_type(uint64_t this_arg) {
36993 LDKNodeFeatures this_arg_conv;
36994 this_arg_conv.inner = untag_ptr(this_arg);
36995 this_arg_conv.is_owned = ptr_is_owned(this_arg);
36996 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
36997 this_arg_conv.is_owned = false;
36998 jboolean ret_conv = NodeFeatures_supports_channel_type(&this_arg_conv);
37002 jboolean __attribute__((export_name("TS_InitFeatures_requires_channel_type"))) TS_InitFeatures_requires_channel_type(uint64_t this_arg) {
37003 LDKInitFeatures this_arg_conv;
37004 this_arg_conv.inner = untag_ptr(this_arg);
37005 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37006 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37007 this_arg_conv.is_owned = false;
37008 jboolean ret_conv = InitFeatures_requires_channel_type(&this_arg_conv);
37012 jboolean __attribute__((export_name("TS_NodeFeatures_requires_channel_type"))) TS_NodeFeatures_requires_channel_type(uint64_t this_arg) {
37013 LDKNodeFeatures this_arg_conv;
37014 this_arg_conv.inner = untag_ptr(this_arg);
37015 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37016 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37017 this_arg_conv.is_owned = false;
37018 jboolean ret_conv = NodeFeatures_requires_channel_type(&this_arg_conv);
37022 void __attribute__((export_name("TS_InitFeatures_set_scid_privacy_optional"))) TS_InitFeatures_set_scid_privacy_optional(uint64_t this_arg) {
37023 LDKInitFeatures this_arg_conv;
37024 this_arg_conv.inner = untag_ptr(this_arg);
37025 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37026 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37027 this_arg_conv.is_owned = false;
37028 InitFeatures_set_scid_privacy_optional(&this_arg_conv);
37031 void __attribute__((export_name("TS_InitFeatures_set_scid_privacy_required"))) TS_InitFeatures_set_scid_privacy_required(uint64_t this_arg) {
37032 LDKInitFeatures this_arg_conv;
37033 this_arg_conv.inner = untag_ptr(this_arg);
37034 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37035 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37036 this_arg_conv.is_owned = false;
37037 InitFeatures_set_scid_privacy_required(&this_arg_conv);
37040 jboolean __attribute__((export_name("TS_InitFeatures_supports_scid_privacy"))) TS_InitFeatures_supports_scid_privacy(uint64_t this_arg) {
37041 LDKInitFeatures this_arg_conv;
37042 this_arg_conv.inner = untag_ptr(this_arg);
37043 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37044 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37045 this_arg_conv.is_owned = false;
37046 jboolean ret_conv = InitFeatures_supports_scid_privacy(&this_arg_conv);
37050 void __attribute__((export_name("TS_NodeFeatures_set_scid_privacy_optional"))) TS_NodeFeatures_set_scid_privacy_optional(uint64_t this_arg) {
37051 LDKNodeFeatures this_arg_conv;
37052 this_arg_conv.inner = untag_ptr(this_arg);
37053 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37054 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37055 this_arg_conv.is_owned = false;
37056 NodeFeatures_set_scid_privacy_optional(&this_arg_conv);
37059 void __attribute__((export_name("TS_NodeFeatures_set_scid_privacy_required"))) TS_NodeFeatures_set_scid_privacy_required(uint64_t this_arg) {
37060 LDKNodeFeatures this_arg_conv;
37061 this_arg_conv.inner = untag_ptr(this_arg);
37062 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37063 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37064 this_arg_conv.is_owned = false;
37065 NodeFeatures_set_scid_privacy_required(&this_arg_conv);
37068 jboolean __attribute__((export_name("TS_NodeFeatures_supports_scid_privacy"))) TS_NodeFeatures_supports_scid_privacy(uint64_t this_arg) {
37069 LDKNodeFeatures this_arg_conv;
37070 this_arg_conv.inner = untag_ptr(this_arg);
37071 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37072 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37073 this_arg_conv.is_owned = false;
37074 jboolean ret_conv = NodeFeatures_supports_scid_privacy(&this_arg_conv);
37078 void __attribute__((export_name("TS_ChannelTypeFeatures_set_scid_privacy_optional"))) TS_ChannelTypeFeatures_set_scid_privacy_optional(uint64_t this_arg) {
37079 LDKChannelTypeFeatures this_arg_conv;
37080 this_arg_conv.inner = untag_ptr(this_arg);
37081 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37082 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37083 this_arg_conv.is_owned = false;
37084 ChannelTypeFeatures_set_scid_privacy_optional(&this_arg_conv);
37087 void __attribute__((export_name("TS_ChannelTypeFeatures_set_scid_privacy_required"))) TS_ChannelTypeFeatures_set_scid_privacy_required(uint64_t this_arg) {
37088 LDKChannelTypeFeatures this_arg_conv;
37089 this_arg_conv.inner = untag_ptr(this_arg);
37090 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37091 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37092 this_arg_conv.is_owned = false;
37093 ChannelTypeFeatures_set_scid_privacy_required(&this_arg_conv);
37096 jboolean __attribute__((export_name("TS_ChannelTypeFeatures_supports_scid_privacy"))) TS_ChannelTypeFeatures_supports_scid_privacy(uint64_t this_arg) {
37097 LDKChannelTypeFeatures this_arg_conv;
37098 this_arg_conv.inner = untag_ptr(this_arg);
37099 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37100 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37101 this_arg_conv.is_owned = false;
37102 jboolean ret_conv = ChannelTypeFeatures_supports_scid_privacy(&this_arg_conv);
37106 jboolean __attribute__((export_name("TS_InitFeatures_requires_scid_privacy"))) TS_InitFeatures_requires_scid_privacy(uint64_t this_arg) {
37107 LDKInitFeatures this_arg_conv;
37108 this_arg_conv.inner = untag_ptr(this_arg);
37109 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37110 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37111 this_arg_conv.is_owned = false;
37112 jboolean ret_conv = InitFeatures_requires_scid_privacy(&this_arg_conv);
37116 jboolean __attribute__((export_name("TS_NodeFeatures_requires_scid_privacy"))) TS_NodeFeatures_requires_scid_privacy(uint64_t this_arg) {
37117 LDKNodeFeatures this_arg_conv;
37118 this_arg_conv.inner = untag_ptr(this_arg);
37119 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37120 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37121 this_arg_conv.is_owned = false;
37122 jboolean ret_conv = NodeFeatures_requires_scid_privacy(&this_arg_conv);
37126 jboolean __attribute__((export_name("TS_ChannelTypeFeatures_requires_scid_privacy"))) TS_ChannelTypeFeatures_requires_scid_privacy(uint64_t this_arg) {
37127 LDKChannelTypeFeatures this_arg_conv;
37128 this_arg_conv.inner = untag_ptr(this_arg);
37129 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37130 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37131 this_arg_conv.is_owned = false;
37132 jboolean ret_conv = ChannelTypeFeatures_requires_scid_privacy(&this_arg_conv);
37136 void __attribute__((export_name("TS_InitFeatures_set_zero_conf_optional"))) TS_InitFeatures_set_zero_conf_optional(uint64_t this_arg) {
37137 LDKInitFeatures this_arg_conv;
37138 this_arg_conv.inner = untag_ptr(this_arg);
37139 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37140 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37141 this_arg_conv.is_owned = false;
37142 InitFeatures_set_zero_conf_optional(&this_arg_conv);
37145 void __attribute__((export_name("TS_InitFeatures_set_zero_conf_required"))) TS_InitFeatures_set_zero_conf_required(uint64_t this_arg) {
37146 LDKInitFeatures this_arg_conv;
37147 this_arg_conv.inner = untag_ptr(this_arg);
37148 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37149 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37150 this_arg_conv.is_owned = false;
37151 InitFeatures_set_zero_conf_required(&this_arg_conv);
37154 jboolean __attribute__((export_name("TS_InitFeatures_supports_zero_conf"))) TS_InitFeatures_supports_zero_conf(uint64_t this_arg) {
37155 LDKInitFeatures this_arg_conv;
37156 this_arg_conv.inner = untag_ptr(this_arg);
37157 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37158 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37159 this_arg_conv.is_owned = false;
37160 jboolean ret_conv = InitFeatures_supports_zero_conf(&this_arg_conv);
37164 void __attribute__((export_name("TS_NodeFeatures_set_zero_conf_optional"))) TS_NodeFeatures_set_zero_conf_optional(uint64_t this_arg) {
37165 LDKNodeFeatures this_arg_conv;
37166 this_arg_conv.inner = untag_ptr(this_arg);
37167 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37168 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37169 this_arg_conv.is_owned = false;
37170 NodeFeatures_set_zero_conf_optional(&this_arg_conv);
37173 void __attribute__((export_name("TS_NodeFeatures_set_zero_conf_required"))) TS_NodeFeatures_set_zero_conf_required(uint64_t this_arg) {
37174 LDKNodeFeatures this_arg_conv;
37175 this_arg_conv.inner = untag_ptr(this_arg);
37176 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37177 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37178 this_arg_conv.is_owned = false;
37179 NodeFeatures_set_zero_conf_required(&this_arg_conv);
37182 jboolean __attribute__((export_name("TS_NodeFeatures_supports_zero_conf"))) TS_NodeFeatures_supports_zero_conf(uint64_t this_arg) {
37183 LDKNodeFeatures this_arg_conv;
37184 this_arg_conv.inner = untag_ptr(this_arg);
37185 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37186 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37187 this_arg_conv.is_owned = false;
37188 jboolean ret_conv = NodeFeatures_supports_zero_conf(&this_arg_conv);
37192 void __attribute__((export_name("TS_ChannelTypeFeatures_set_zero_conf_optional"))) TS_ChannelTypeFeatures_set_zero_conf_optional(uint64_t this_arg) {
37193 LDKChannelTypeFeatures this_arg_conv;
37194 this_arg_conv.inner = untag_ptr(this_arg);
37195 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37196 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37197 this_arg_conv.is_owned = false;
37198 ChannelTypeFeatures_set_zero_conf_optional(&this_arg_conv);
37201 void __attribute__((export_name("TS_ChannelTypeFeatures_set_zero_conf_required"))) TS_ChannelTypeFeatures_set_zero_conf_required(uint64_t this_arg) {
37202 LDKChannelTypeFeatures this_arg_conv;
37203 this_arg_conv.inner = untag_ptr(this_arg);
37204 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37205 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37206 this_arg_conv.is_owned = false;
37207 ChannelTypeFeatures_set_zero_conf_required(&this_arg_conv);
37210 jboolean __attribute__((export_name("TS_ChannelTypeFeatures_supports_zero_conf"))) TS_ChannelTypeFeatures_supports_zero_conf(uint64_t this_arg) {
37211 LDKChannelTypeFeatures this_arg_conv;
37212 this_arg_conv.inner = untag_ptr(this_arg);
37213 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37214 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37215 this_arg_conv.is_owned = false;
37216 jboolean ret_conv = ChannelTypeFeatures_supports_zero_conf(&this_arg_conv);
37220 jboolean __attribute__((export_name("TS_InitFeatures_requires_zero_conf"))) TS_InitFeatures_requires_zero_conf(uint64_t this_arg) {
37221 LDKInitFeatures this_arg_conv;
37222 this_arg_conv.inner = untag_ptr(this_arg);
37223 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37224 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37225 this_arg_conv.is_owned = false;
37226 jboolean ret_conv = InitFeatures_requires_zero_conf(&this_arg_conv);
37230 jboolean __attribute__((export_name("TS_NodeFeatures_requires_zero_conf"))) TS_NodeFeatures_requires_zero_conf(uint64_t this_arg) {
37231 LDKNodeFeatures this_arg_conv;
37232 this_arg_conv.inner = untag_ptr(this_arg);
37233 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37234 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37235 this_arg_conv.is_owned = false;
37236 jboolean ret_conv = NodeFeatures_requires_zero_conf(&this_arg_conv);
37240 jboolean __attribute__((export_name("TS_ChannelTypeFeatures_requires_zero_conf"))) TS_ChannelTypeFeatures_requires_zero_conf(uint64_t this_arg) {
37241 LDKChannelTypeFeatures this_arg_conv;
37242 this_arg_conv.inner = untag_ptr(this_arg);
37243 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37244 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37245 this_arg_conv.is_owned = false;
37246 jboolean ret_conv = ChannelTypeFeatures_requires_zero_conf(&this_arg_conv);
37250 void __attribute__((export_name("TS_NodeFeatures_set_keysend_optional"))) TS_NodeFeatures_set_keysend_optional(uint64_t this_arg) {
37251 LDKNodeFeatures this_arg_conv;
37252 this_arg_conv.inner = untag_ptr(this_arg);
37253 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37254 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37255 this_arg_conv.is_owned = false;
37256 NodeFeatures_set_keysend_optional(&this_arg_conv);
37259 void __attribute__((export_name("TS_NodeFeatures_set_keysend_required"))) TS_NodeFeatures_set_keysend_required(uint64_t this_arg) {
37260 LDKNodeFeatures this_arg_conv;
37261 this_arg_conv.inner = untag_ptr(this_arg);
37262 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37263 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37264 this_arg_conv.is_owned = false;
37265 NodeFeatures_set_keysend_required(&this_arg_conv);
37268 jboolean __attribute__((export_name("TS_NodeFeatures_supports_keysend"))) TS_NodeFeatures_supports_keysend(uint64_t this_arg) {
37269 LDKNodeFeatures this_arg_conv;
37270 this_arg_conv.inner = untag_ptr(this_arg);
37271 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37272 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37273 this_arg_conv.is_owned = false;
37274 jboolean ret_conv = NodeFeatures_supports_keysend(&this_arg_conv);
37278 jboolean __attribute__((export_name("TS_NodeFeatures_requires_keysend"))) TS_NodeFeatures_requires_keysend(uint64_t this_arg) {
37279 LDKNodeFeatures this_arg_conv;
37280 this_arg_conv.inner = untag_ptr(this_arg);
37281 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37282 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37283 this_arg_conv.is_owned = false;
37284 jboolean ret_conv = NodeFeatures_requires_keysend(&this_arg_conv);
37288 void __attribute__((export_name("TS_ShutdownScript_free"))) TS_ShutdownScript_free(uint64_t this_obj) {
37289 LDKShutdownScript this_obj_conv;
37290 this_obj_conv.inner = untag_ptr(this_obj);
37291 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37292 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37293 ShutdownScript_free(this_obj_conv);
37296 static inline uint64_t ShutdownScript_clone_ptr(LDKShutdownScript *NONNULL_PTR arg) {
37297 LDKShutdownScript ret_var = ShutdownScript_clone(arg);
37298 uint64_t ret_ref = 0;
37299 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37300 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37303 int64_t __attribute__((export_name("TS_ShutdownScript_clone_ptr"))) TS_ShutdownScript_clone_ptr(uint64_t arg) {
37304 LDKShutdownScript arg_conv;
37305 arg_conv.inner = untag_ptr(arg);
37306 arg_conv.is_owned = ptr_is_owned(arg);
37307 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
37308 arg_conv.is_owned = false;
37309 int64_t ret_conv = ShutdownScript_clone_ptr(&arg_conv);
37313 uint64_t __attribute__((export_name("TS_ShutdownScript_clone"))) TS_ShutdownScript_clone(uint64_t orig) {
37314 LDKShutdownScript orig_conv;
37315 orig_conv.inner = untag_ptr(orig);
37316 orig_conv.is_owned = ptr_is_owned(orig);
37317 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
37318 orig_conv.is_owned = false;
37319 LDKShutdownScript ret_var = ShutdownScript_clone(&orig_conv);
37320 uint64_t ret_ref = 0;
37321 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37322 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37326 void __attribute__((export_name("TS_InvalidShutdownScript_free"))) TS_InvalidShutdownScript_free(uint64_t this_obj) {
37327 LDKInvalidShutdownScript this_obj_conv;
37328 this_obj_conv.inner = untag_ptr(this_obj);
37329 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37330 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37331 InvalidShutdownScript_free(this_obj_conv);
37334 int8_tArray __attribute__((export_name("TS_InvalidShutdownScript_get_script"))) TS_InvalidShutdownScript_get_script(uint64_t this_ptr) {
37335 LDKInvalidShutdownScript this_ptr_conv;
37336 this_ptr_conv.inner = untag_ptr(this_ptr);
37337 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37338 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37339 this_ptr_conv.is_owned = false;
37340 LDKu8slice ret_var = InvalidShutdownScript_get_script(&this_ptr_conv);
37341 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
37342 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
37346 void __attribute__((export_name("TS_InvalidShutdownScript_set_script"))) TS_InvalidShutdownScript_set_script(uint64_t this_ptr, int8_tArray val) {
37347 LDKInvalidShutdownScript this_ptr_conv;
37348 this_ptr_conv.inner = untag_ptr(this_ptr);
37349 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37350 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37351 this_ptr_conv.is_owned = false;
37352 LDKCVec_u8Z val_ref;
37353 val_ref.datalen = val->arr_len;
37354 val_ref.data = MALLOC(val_ref.datalen, "LDKCVec_u8Z Bytes");
37355 memcpy(val_ref.data, val->elems, val_ref.datalen); FREE(val);
37356 InvalidShutdownScript_set_script(&this_ptr_conv, val_ref);
37359 uint64_t __attribute__((export_name("TS_InvalidShutdownScript_new"))) TS_InvalidShutdownScript_new(int8_tArray script_arg) {
37360 LDKCVec_u8Z script_arg_ref;
37361 script_arg_ref.datalen = script_arg->arr_len;
37362 script_arg_ref.data = MALLOC(script_arg_ref.datalen, "LDKCVec_u8Z Bytes");
37363 memcpy(script_arg_ref.data, script_arg->elems, script_arg_ref.datalen); FREE(script_arg);
37364 LDKInvalidShutdownScript ret_var = InvalidShutdownScript_new(script_arg_ref);
37365 uint64_t ret_ref = 0;
37366 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37367 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37371 static inline uint64_t InvalidShutdownScript_clone_ptr(LDKInvalidShutdownScript *NONNULL_PTR arg) {
37372 LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(arg);
37373 uint64_t ret_ref = 0;
37374 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37375 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37378 int64_t __attribute__((export_name("TS_InvalidShutdownScript_clone_ptr"))) TS_InvalidShutdownScript_clone_ptr(uint64_t arg) {
37379 LDKInvalidShutdownScript arg_conv;
37380 arg_conv.inner = untag_ptr(arg);
37381 arg_conv.is_owned = ptr_is_owned(arg);
37382 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
37383 arg_conv.is_owned = false;
37384 int64_t ret_conv = InvalidShutdownScript_clone_ptr(&arg_conv);
37388 uint64_t __attribute__((export_name("TS_InvalidShutdownScript_clone"))) TS_InvalidShutdownScript_clone(uint64_t orig) {
37389 LDKInvalidShutdownScript orig_conv;
37390 orig_conv.inner = untag_ptr(orig);
37391 orig_conv.is_owned = ptr_is_owned(orig);
37392 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
37393 orig_conv.is_owned = false;
37394 LDKInvalidShutdownScript ret_var = InvalidShutdownScript_clone(&orig_conv);
37395 uint64_t ret_ref = 0;
37396 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37397 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37401 int8_tArray __attribute__((export_name("TS_ShutdownScript_write"))) TS_ShutdownScript_write(uint64_t obj) {
37402 LDKShutdownScript obj_conv;
37403 obj_conv.inner = untag_ptr(obj);
37404 obj_conv.is_owned = ptr_is_owned(obj);
37405 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
37406 obj_conv.is_owned = false;
37407 LDKCVec_u8Z ret_var = ShutdownScript_write(&obj_conv);
37408 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
37409 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
37410 CVec_u8Z_free(ret_var);
37414 uint64_t __attribute__((export_name("TS_ShutdownScript_read"))) TS_ShutdownScript_read(int8_tArray ser) {
37415 LDKu8slice ser_ref;
37416 ser_ref.datalen = ser->arr_len;
37417 ser_ref.data = ser->elems;
37418 LDKCResult_ShutdownScriptDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptDecodeErrorZ), "LDKCResult_ShutdownScriptDecodeErrorZ");
37419 *ret_conv = ShutdownScript_read(ser_ref);
37421 return tag_ptr(ret_conv, true);
37424 uint64_t __attribute__((export_name("TS_ShutdownScript_new_p2wpkh"))) TS_ShutdownScript_new_p2wpkh(int8_tArray pubkey_hash) {
37425 unsigned char pubkey_hash_arr[20];
37426 CHECK(pubkey_hash->arr_len == 20);
37427 memcpy(pubkey_hash_arr, pubkey_hash->elems, 20); FREE(pubkey_hash);
37428 unsigned char (*pubkey_hash_ref)[20] = &pubkey_hash_arr;
37429 LDKShutdownScript ret_var = ShutdownScript_new_p2wpkh(pubkey_hash_ref);
37430 uint64_t ret_ref = 0;
37431 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37432 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37436 uint64_t __attribute__((export_name("TS_ShutdownScript_new_p2wsh"))) TS_ShutdownScript_new_p2wsh(int8_tArray script_hash) {
37437 unsigned char script_hash_arr[32];
37438 CHECK(script_hash->arr_len == 32);
37439 memcpy(script_hash_arr, script_hash->elems, 32); FREE(script_hash);
37440 unsigned char (*script_hash_ref)[32] = &script_hash_arr;
37441 LDKShutdownScript ret_var = ShutdownScript_new_p2wsh(script_hash_ref);
37442 uint64_t ret_ref = 0;
37443 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37444 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37448 uint64_t __attribute__((export_name("TS_ShutdownScript_new_witness_program"))) TS_ShutdownScript_new_witness_program(int8_t version, int8_tArray program) {
37450 LDKu8slice program_ref;
37451 program_ref.datalen = program->arr_len;
37452 program_ref.data = program->elems;
37453 LDKCResult_ShutdownScriptInvalidShutdownScriptZ* ret_conv = MALLOC(sizeof(LDKCResult_ShutdownScriptInvalidShutdownScriptZ), "LDKCResult_ShutdownScriptInvalidShutdownScriptZ");
37454 *ret_conv = ShutdownScript_new_witness_program((LDKWitnessVersion){ ._0 = version }, program_ref);
37456 return tag_ptr(ret_conv, true);
37459 int8_tArray __attribute__((export_name("TS_ShutdownScript_into_inner"))) TS_ShutdownScript_into_inner(uint64_t this_arg) {
37460 LDKShutdownScript this_arg_conv;
37461 this_arg_conv.inner = untag_ptr(this_arg);
37462 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37463 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37464 this_arg_conv = ShutdownScript_clone(&this_arg_conv);
37465 LDKCVec_u8Z ret_var = ShutdownScript_into_inner(this_arg_conv);
37466 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
37467 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
37468 CVec_u8Z_free(ret_var);
37472 int8_tArray __attribute__((export_name("TS_ShutdownScript_as_legacy_pubkey"))) TS_ShutdownScript_as_legacy_pubkey(uint64_t this_arg) {
37473 LDKShutdownScript this_arg_conv;
37474 this_arg_conv.inner = untag_ptr(this_arg);
37475 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37476 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37477 this_arg_conv.is_owned = false;
37478 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
37479 memcpy(ret_arr->elems, ShutdownScript_as_legacy_pubkey(&this_arg_conv).compressed_form, 33);
37483 jboolean __attribute__((export_name("TS_ShutdownScript_is_compatible"))) TS_ShutdownScript_is_compatible(uint64_t this_arg, uint64_t features) {
37484 LDKShutdownScript this_arg_conv;
37485 this_arg_conv.inner = untag_ptr(this_arg);
37486 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37487 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37488 this_arg_conv.is_owned = false;
37489 LDKInitFeatures features_conv;
37490 features_conv.inner = untag_ptr(features);
37491 features_conv.is_owned = ptr_is_owned(features);
37492 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv);
37493 features_conv.is_owned = false;
37494 jboolean ret_conv = ShutdownScript_is_compatible(&this_arg_conv, &features_conv);
37498 void __attribute__((export_name("TS_CustomMessageReader_free"))) TS_CustomMessageReader_free(uint64_t this_ptr) {
37499 if (!ptr_is_owned(this_ptr)) return;
37500 void* this_ptr_ptr = untag_ptr(this_ptr);
37501 CHECK_ACCESS(this_ptr_ptr);
37502 LDKCustomMessageReader this_ptr_conv = *(LDKCustomMessageReader*)(this_ptr_ptr);
37503 FREE(untag_ptr(this_ptr));
37504 CustomMessageReader_free(this_ptr_conv);
37507 static inline uint64_t Type_clone_ptr(LDKType *NONNULL_PTR arg) {
37508 LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType");
37509 *ret_ret = Type_clone(arg);
37510 return tag_ptr(ret_ret, true);
37512 int64_t __attribute__((export_name("TS_Type_clone_ptr"))) TS_Type_clone_ptr(uint64_t arg) {
37513 void* arg_ptr = untag_ptr(arg);
37514 if (ptr_is_owned(arg)) { CHECK_ACCESS(arg_ptr); }
37515 LDKType* arg_conv = (LDKType*)arg_ptr;
37516 int64_t ret_conv = Type_clone_ptr(arg_conv);
37520 uint64_t __attribute__((export_name("TS_Type_clone"))) TS_Type_clone(uint64_t orig) {
37521 void* orig_ptr = untag_ptr(orig);
37522 if (ptr_is_owned(orig)) { CHECK_ACCESS(orig_ptr); }
37523 LDKType* orig_conv = (LDKType*)orig_ptr;
37524 LDKType* ret_ret = MALLOC(sizeof(LDKType), "LDKType");
37525 *ret_ret = Type_clone(orig_conv);
37526 return tag_ptr(ret_ret, true);
37529 void __attribute__((export_name("TS_Type_free"))) TS_Type_free(uint64_t this_ptr) {
37530 if (!ptr_is_owned(this_ptr)) return;
37531 void* this_ptr_ptr = untag_ptr(this_ptr);
37532 CHECK_ACCESS(this_ptr_ptr);
37533 LDKType this_ptr_conv = *(LDKType*)(this_ptr_ptr);
37534 FREE(untag_ptr(this_ptr));
37535 Type_free(this_ptr_conv);
37538 void __attribute__((export_name("TS_NodeId_free"))) TS_NodeId_free(uint64_t this_obj) {
37539 LDKNodeId this_obj_conv;
37540 this_obj_conv.inner = untag_ptr(this_obj);
37541 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37542 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37543 NodeId_free(this_obj_conv);
37546 static inline uint64_t NodeId_clone_ptr(LDKNodeId *NONNULL_PTR arg) {
37547 LDKNodeId ret_var = NodeId_clone(arg);
37548 uint64_t ret_ref = 0;
37549 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37550 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37553 int64_t __attribute__((export_name("TS_NodeId_clone_ptr"))) TS_NodeId_clone_ptr(uint64_t arg) {
37554 LDKNodeId arg_conv;
37555 arg_conv.inner = untag_ptr(arg);
37556 arg_conv.is_owned = ptr_is_owned(arg);
37557 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
37558 arg_conv.is_owned = false;
37559 int64_t ret_conv = NodeId_clone_ptr(&arg_conv);
37563 uint64_t __attribute__((export_name("TS_NodeId_clone"))) TS_NodeId_clone(uint64_t orig) {
37564 LDKNodeId orig_conv;
37565 orig_conv.inner = untag_ptr(orig);
37566 orig_conv.is_owned = ptr_is_owned(orig);
37567 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
37568 orig_conv.is_owned = false;
37569 LDKNodeId ret_var = NodeId_clone(&orig_conv);
37570 uint64_t ret_ref = 0;
37571 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37572 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37576 uint64_t __attribute__((export_name("TS_NodeId_from_pubkey"))) TS_NodeId_from_pubkey(int8_tArray pubkey) {
37577 LDKPublicKey pubkey_ref;
37578 CHECK(pubkey->arr_len == 33);
37579 memcpy(pubkey_ref.compressed_form, pubkey->elems, 33); FREE(pubkey);
37580 LDKNodeId ret_var = NodeId_from_pubkey(pubkey_ref);
37581 uint64_t ret_ref = 0;
37582 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37583 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37587 int8_tArray __attribute__((export_name("TS_NodeId_as_slice"))) TS_NodeId_as_slice(uint64_t this_arg) {
37588 LDKNodeId this_arg_conv;
37589 this_arg_conv.inner = untag_ptr(this_arg);
37590 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37591 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37592 this_arg_conv.is_owned = false;
37593 LDKu8slice ret_var = NodeId_as_slice(&this_arg_conv);
37594 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
37595 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
37599 int64_t __attribute__((export_name("TS_NodeId_hash"))) TS_NodeId_hash(uint64_t o) {
37601 o_conv.inner = untag_ptr(o);
37602 o_conv.is_owned = ptr_is_owned(o);
37603 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
37604 o_conv.is_owned = false;
37605 int64_t ret_conv = NodeId_hash(&o_conv);
37609 int8_tArray __attribute__((export_name("TS_NodeId_write"))) TS_NodeId_write(uint64_t obj) {
37610 LDKNodeId obj_conv;
37611 obj_conv.inner = untag_ptr(obj);
37612 obj_conv.is_owned = ptr_is_owned(obj);
37613 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
37614 obj_conv.is_owned = false;
37615 LDKCVec_u8Z ret_var = NodeId_write(&obj_conv);
37616 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
37617 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
37618 CVec_u8Z_free(ret_var);
37622 uint64_t __attribute__((export_name("TS_NodeId_read"))) TS_NodeId_read(int8_tArray ser) {
37623 LDKu8slice ser_ref;
37624 ser_ref.datalen = ser->arr_len;
37625 ser_ref.data = ser->elems;
37626 LDKCResult_NodeIdDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeIdDecodeErrorZ), "LDKCResult_NodeIdDecodeErrorZ");
37627 *ret_conv = NodeId_read(ser_ref);
37629 return tag_ptr(ret_conv, true);
37632 void __attribute__((export_name("TS_NetworkGraph_free"))) TS_NetworkGraph_free(uint64_t this_obj) {
37633 LDKNetworkGraph this_obj_conv;
37634 this_obj_conv.inner = untag_ptr(this_obj);
37635 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37636 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37637 NetworkGraph_free(this_obj_conv);
37640 void __attribute__((export_name("TS_ReadOnlyNetworkGraph_free"))) TS_ReadOnlyNetworkGraph_free(uint64_t this_obj) {
37641 LDKReadOnlyNetworkGraph this_obj_conv;
37642 this_obj_conv.inner = untag_ptr(this_obj);
37643 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37644 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37645 ReadOnlyNetworkGraph_free(this_obj_conv);
37648 void __attribute__((export_name("TS_NetworkUpdate_free"))) TS_NetworkUpdate_free(uint64_t this_ptr) {
37649 if (!ptr_is_owned(this_ptr)) return;
37650 void* this_ptr_ptr = untag_ptr(this_ptr);
37651 CHECK_ACCESS(this_ptr_ptr);
37652 LDKNetworkUpdate this_ptr_conv = *(LDKNetworkUpdate*)(this_ptr_ptr);
37653 FREE(untag_ptr(this_ptr));
37654 NetworkUpdate_free(this_ptr_conv);
37657 static inline uint64_t NetworkUpdate_clone_ptr(LDKNetworkUpdate *NONNULL_PTR arg) {
37658 LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate");
37659 *ret_copy = NetworkUpdate_clone(arg);
37660 uint64_t ret_ref = tag_ptr(ret_copy, true);
37663 int64_t __attribute__((export_name("TS_NetworkUpdate_clone_ptr"))) TS_NetworkUpdate_clone_ptr(uint64_t arg) {
37664 LDKNetworkUpdate* arg_conv = (LDKNetworkUpdate*)untag_ptr(arg);
37665 int64_t ret_conv = NetworkUpdate_clone_ptr(arg_conv);
37669 uint64_t __attribute__((export_name("TS_NetworkUpdate_clone"))) TS_NetworkUpdate_clone(uint64_t orig) {
37670 LDKNetworkUpdate* orig_conv = (LDKNetworkUpdate*)untag_ptr(orig);
37671 LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate");
37672 *ret_copy = NetworkUpdate_clone(orig_conv);
37673 uint64_t ret_ref = tag_ptr(ret_copy, true);
37677 uint64_t __attribute__((export_name("TS_NetworkUpdate_channel_update_message"))) TS_NetworkUpdate_channel_update_message(uint64_t msg) {
37678 LDKChannelUpdate msg_conv;
37679 msg_conv.inner = untag_ptr(msg);
37680 msg_conv.is_owned = ptr_is_owned(msg);
37681 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
37682 msg_conv = ChannelUpdate_clone(&msg_conv);
37683 LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate");
37684 *ret_copy = NetworkUpdate_channel_update_message(msg_conv);
37685 uint64_t ret_ref = tag_ptr(ret_copy, true);
37689 uint64_t __attribute__((export_name("TS_NetworkUpdate_channel_failure"))) TS_NetworkUpdate_channel_failure(int64_t short_channel_id, jboolean is_permanent) {
37690 LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate");
37691 *ret_copy = NetworkUpdate_channel_failure(short_channel_id, is_permanent);
37692 uint64_t ret_ref = tag_ptr(ret_copy, true);
37696 uint64_t __attribute__((export_name("TS_NetworkUpdate_node_failure"))) TS_NetworkUpdate_node_failure(int8_tArray node_id, jboolean is_permanent) {
37697 LDKPublicKey node_id_ref;
37698 CHECK(node_id->arr_len == 33);
37699 memcpy(node_id_ref.compressed_form, node_id->elems, 33); FREE(node_id);
37700 LDKNetworkUpdate *ret_copy = MALLOC(sizeof(LDKNetworkUpdate), "LDKNetworkUpdate");
37701 *ret_copy = NetworkUpdate_node_failure(node_id_ref, is_permanent);
37702 uint64_t ret_ref = tag_ptr(ret_copy, true);
37706 int8_tArray __attribute__((export_name("TS_NetworkUpdate_write"))) TS_NetworkUpdate_write(uint64_t obj) {
37707 LDKNetworkUpdate* obj_conv = (LDKNetworkUpdate*)untag_ptr(obj);
37708 LDKCVec_u8Z ret_var = NetworkUpdate_write(obj_conv);
37709 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
37710 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
37711 CVec_u8Z_free(ret_var);
37715 uint64_t __attribute__((export_name("TS_NetworkUpdate_read"))) TS_NetworkUpdate_read(int8_tArray ser) {
37716 LDKu8slice ser_ref;
37717 ser_ref.datalen = ser->arr_len;
37718 ser_ref.data = ser->elems;
37719 LDKCResult_COption_NetworkUpdateZDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_COption_NetworkUpdateZDecodeErrorZ), "LDKCResult_COption_NetworkUpdateZDecodeErrorZ");
37720 *ret_conv = NetworkUpdate_read(ser_ref);
37722 return tag_ptr(ret_conv, true);
37725 void __attribute__((export_name("TS_P2PGossipSync_free"))) TS_P2PGossipSync_free(uint64_t this_obj) {
37726 LDKP2PGossipSync this_obj_conv;
37727 this_obj_conv.inner = untag_ptr(this_obj);
37728 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37729 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37730 P2PGossipSync_free(this_obj_conv);
37733 uint64_t __attribute__((export_name("TS_P2PGossipSync_new"))) TS_P2PGossipSync_new(uint64_t network_graph, uint64_t chain_access, uint64_t logger) {
37734 LDKNetworkGraph network_graph_conv;
37735 network_graph_conv.inner = untag_ptr(network_graph);
37736 network_graph_conv.is_owned = ptr_is_owned(network_graph);
37737 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
37738 network_graph_conv.is_owned = false;
37739 void* chain_access_ptr = untag_ptr(chain_access);
37740 CHECK_ACCESS(chain_access_ptr);
37741 LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
37742 // WARNING: we may need a move here but no clone is available for LDKCOption_AccessZ
37743 if (chain_access_conv.tag == LDKCOption_AccessZ_Some) {
37744 // Manually implement clone for Java trait instances
37745 if (chain_access_conv.some.free == LDKAccess_JCalls_free) {
37746 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
37747 LDKAccess_JCalls_cloned(&chain_access_conv.some);
37750 void* logger_ptr = untag_ptr(logger);
37751 CHECK_ACCESS(logger_ptr);
37752 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
37753 if (logger_conv.free == LDKLogger_JCalls_free) {
37754 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
37755 LDKLogger_JCalls_cloned(&logger_conv);
37757 LDKP2PGossipSync ret_var = P2PGossipSync_new(&network_graph_conv, chain_access_conv, logger_conv);
37758 uint64_t ret_ref = 0;
37759 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37760 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37764 void __attribute__((export_name("TS_P2PGossipSync_add_chain_access"))) TS_P2PGossipSync_add_chain_access(uint64_t this_arg, uint64_t chain_access) {
37765 LDKP2PGossipSync this_arg_conv;
37766 this_arg_conv.inner = untag_ptr(this_arg);
37767 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37768 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37769 this_arg_conv.is_owned = false;
37770 void* chain_access_ptr = untag_ptr(chain_access);
37771 CHECK_ACCESS(chain_access_ptr);
37772 LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
37773 // WARNING: we may need a move here but no clone is available for LDKCOption_AccessZ
37774 if (chain_access_conv.tag == LDKCOption_AccessZ_Some) {
37775 // Manually implement clone for Java trait instances
37776 if (chain_access_conv.some.free == LDKAccess_JCalls_free) {
37777 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
37778 LDKAccess_JCalls_cloned(&chain_access_conv.some);
37781 P2PGossipSync_add_chain_access(&this_arg_conv, chain_access_conv);
37784 uint64_t __attribute__((export_name("TS_NetworkGraph_as_EventHandler"))) TS_NetworkGraph_as_EventHandler(uint64_t this_arg) {
37785 LDKNetworkGraph this_arg_conv;
37786 this_arg_conv.inner = untag_ptr(this_arg);
37787 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37788 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37789 this_arg_conv.is_owned = false;
37790 LDKEventHandler* ret_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
37791 *ret_ret = NetworkGraph_as_EventHandler(&this_arg_conv);
37792 return tag_ptr(ret_ret, true);
37795 uint64_t __attribute__((export_name("TS_P2PGossipSync_as_RoutingMessageHandler"))) TS_P2PGossipSync_as_RoutingMessageHandler(uint64_t this_arg) {
37796 LDKP2PGossipSync this_arg_conv;
37797 this_arg_conv.inner = untag_ptr(this_arg);
37798 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37799 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37800 this_arg_conv.is_owned = false;
37801 LDKRoutingMessageHandler* ret_ret = MALLOC(sizeof(LDKRoutingMessageHandler), "LDKRoutingMessageHandler");
37802 *ret_ret = P2PGossipSync_as_RoutingMessageHandler(&this_arg_conv);
37803 return tag_ptr(ret_ret, true);
37806 uint64_t __attribute__((export_name("TS_P2PGossipSync_as_MessageSendEventsProvider"))) TS_P2PGossipSync_as_MessageSendEventsProvider(uint64_t this_arg) {
37807 LDKP2PGossipSync this_arg_conv;
37808 this_arg_conv.inner = untag_ptr(this_arg);
37809 this_arg_conv.is_owned = ptr_is_owned(this_arg);
37810 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
37811 this_arg_conv.is_owned = false;
37812 LDKMessageSendEventsProvider* ret_ret = MALLOC(sizeof(LDKMessageSendEventsProvider), "LDKMessageSendEventsProvider");
37813 *ret_ret = P2PGossipSync_as_MessageSendEventsProvider(&this_arg_conv);
37814 return tag_ptr(ret_ret, true);
37817 void __attribute__((export_name("TS_ChannelUpdateInfo_free"))) TS_ChannelUpdateInfo_free(uint64_t this_obj) {
37818 LDKChannelUpdateInfo this_obj_conv;
37819 this_obj_conv.inner = untag_ptr(this_obj);
37820 this_obj_conv.is_owned = ptr_is_owned(this_obj);
37821 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
37822 ChannelUpdateInfo_free(this_obj_conv);
37825 int32_t __attribute__((export_name("TS_ChannelUpdateInfo_get_last_update"))) TS_ChannelUpdateInfo_get_last_update(uint64_t this_ptr) {
37826 LDKChannelUpdateInfo this_ptr_conv;
37827 this_ptr_conv.inner = untag_ptr(this_ptr);
37828 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37829 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37830 this_ptr_conv.is_owned = false;
37831 int32_t ret_conv = ChannelUpdateInfo_get_last_update(&this_ptr_conv);
37835 void __attribute__((export_name("TS_ChannelUpdateInfo_set_last_update"))) TS_ChannelUpdateInfo_set_last_update(uint64_t this_ptr, int32_t val) {
37836 LDKChannelUpdateInfo this_ptr_conv;
37837 this_ptr_conv.inner = untag_ptr(this_ptr);
37838 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37839 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37840 this_ptr_conv.is_owned = false;
37841 ChannelUpdateInfo_set_last_update(&this_ptr_conv, val);
37844 jboolean __attribute__((export_name("TS_ChannelUpdateInfo_get_enabled"))) TS_ChannelUpdateInfo_get_enabled(uint64_t this_ptr) {
37845 LDKChannelUpdateInfo this_ptr_conv;
37846 this_ptr_conv.inner = untag_ptr(this_ptr);
37847 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37848 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37849 this_ptr_conv.is_owned = false;
37850 jboolean ret_conv = ChannelUpdateInfo_get_enabled(&this_ptr_conv);
37854 void __attribute__((export_name("TS_ChannelUpdateInfo_set_enabled"))) TS_ChannelUpdateInfo_set_enabled(uint64_t this_ptr, jboolean val) {
37855 LDKChannelUpdateInfo this_ptr_conv;
37856 this_ptr_conv.inner = untag_ptr(this_ptr);
37857 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37858 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37859 this_ptr_conv.is_owned = false;
37860 ChannelUpdateInfo_set_enabled(&this_ptr_conv, val);
37863 int16_t __attribute__((export_name("TS_ChannelUpdateInfo_get_cltv_expiry_delta"))) TS_ChannelUpdateInfo_get_cltv_expiry_delta(uint64_t this_ptr) {
37864 LDKChannelUpdateInfo this_ptr_conv;
37865 this_ptr_conv.inner = untag_ptr(this_ptr);
37866 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37867 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37868 this_ptr_conv.is_owned = false;
37869 int16_t ret_conv = ChannelUpdateInfo_get_cltv_expiry_delta(&this_ptr_conv);
37873 void __attribute__((export_name("TS_ChannelUpdateInfo_set_cltv_expiry_delta"))) TS_ChannelUpdateInfo_set_cltv_expiry_delta(uint64_t this_ptr, int16_t val) {
37874 LDKChannelUpdateInfo this_ptr_conv;
37875 this_ptr_conv.inner = untag_ptr(this_ptr);
37876 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37877 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37878 this_ptr_conv.is_owned = false;
37879 ChannelUpdateInfo_set_cltv_expiry_delta(&this_ptr_conv, val);
37882 int64_t __attribute__((export_name("TS_ChannelUpdateInfo_get_htlc_minimum_msat"))) TS_ChannelUpdateInfo_get_htlc_minimum_msat(uint64_t this_ptr) {
37883 LDKChannelUpdateInfo this_ptr_conv;
37884 this_ptr_conv.inner = untag_ptr(this_ptr);
37885 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37886 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37887 this_ptr_conv.is_owned = false;
37888 int64_t ret_conv = ChannelUpdateInfo_get_htlc_minimum_msat(&this_ptr_conv);
37892 void __attribute__((export_name("TS_ChannelUpdateInfo_set_htlc_minimum_msat"))) TS_ChannelUpdateInfo_set_htlc_minimum_msat(uint64_t this_ptr, int64_t val) {
37893 LDKChannelUpdateInfo this_ptr_conv;
37894 this_ptr_conv.inner = untag_ptr(this_ptr);
37895 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37896 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37897 this_ptr_conv.is_owned = false;
37898 ChannelUpdateInfo_set_htlc_minimum_msat(&this_ptr_conv, val);
37901 int64_t __attribute__((export_name("TS_ChannelUpdateInfo_get_htlc_maximum_msat"))) TS_ChannelUpdateInfo_get_htlc_maximum_msat(uint64_t this_ptr) {
37902 LDKChannelUpdateInfo this_ptr_conv;
37903 this_ptr_conv.inner = untag_ptr(this_ptr);
37904 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37905 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37906 this_ptr_conv.is_owned = false;
37907 int64_t ret_conv = ChannelUpdateInfo_get_htlc_maximum_msat(&this_ptr_conv);
37911 void __attribute__((export_name("TS_ChannelUpdateInfo_set_htlc_maximum_msat"))) TS_ChannelUpdateInfo_set_htlc_maximum_msat(uint64_t this_ptr, int64_t val) {
37912 LDKChannelUpdateInfo this_ptr_conv;
37913 this_ptr_conv.inner = untag_ptr(this_ptr);
37914 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37915 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37916 this_ptr_conv.is_owned = false;
37917 ChannelUpdateInfo_set_htlc_maximum_msat(&this_ptr_conv, val);
37920 uint64_t __attribute__((export_name("TS_ChannelUpdateInfo_get_fees"))) TS_ChannelUpdateInfo_get_fees(uint64_t this_ptr) {
37921 LDKChannelUpdateInfo this_ptr_conv;
37922 this_ptr_conv.inner = untag_ptr(this_ptr);
37923 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37924 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37925 this_ptr_conv.is_owned = false;
37926 LDKRoutingFees ret_var = ChannelUpdateInfo_get_fees(&this_ptr_conv);
37927 uint64_t ret_ref = 0;
37928 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37929 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37933 void __attribute__((export_name("TS_ChannelUpdateInfo_set_fees"))) TS_ChannelUpdateInfo_set_fees(uint64_t this_ptr, uint64_t val) {
37934 LDKChannelUpdateInfo this_ptr_conv;
37935 this_ptr_conv.inner = untag_ptr(this_ptr);
37936 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37937 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37938 this_ptr_conv.is_owned = false;
37939 LDKRoutingFees val_conv;
37940 val_conv.inner = untag_ptr(val);
37941 val_conv.is_owned = ptr_is_owned(val);
37942 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
37943 val_conv = RoutingFees_clone(&val_conv);
37944 ChannelUpdateInfo_set_fees(&this_ptr_conv, val_conv);
37947 uint64_t __attribute__((export_name("TS_ChannelUpdateInfo_get_last_update_message"))) TS_ChannelUpdateInfo_get_last_update_message(uint64_t this_ptr) {
37948 LDKChannelUpdateInfo this_ptr_conv;
37949 this_ptr_conv.inner = untag_ptr(this_ptr);
37950 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37951 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37952 this_ptr_conv.is_owned = false;
37953 LDKChannelUpdate ret_var = ChannelUpdateInfo_get_last_update_message(&this_ptr_conv);
37954 uint64_t ret_ref = 0;
37955 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37956 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37960 void __attribute__((export_name("TS_ChannelUpdateInfo_set_last_update_message"))) TS_ChannelUpdateInfo_set_last_update_message(uint64_t this_ptr, uint64_t val) {
37961 LDKChannelUpdateInfo this_ptr_conv;
37962 this_ptr_conv.inner = untag_ptr(this_ptr);
37963 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
37964 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
37965 this_ptr_conv.is_owned = false;
37966 LDKChannelUpdate val_conv;
37967 val_conv.inner = untag_ptr(val);
37968 val_conv.is_owned = ptr_is_owned(val);
37969 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
37970 val_conv = ChannelUpdate_clone(&val_conv);
37971 ChannelUpdateInfo_set_last_update_message(&this_ptr_conv, val_conv);
37974 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) {
37975 LDKRoutingFees fees_arg_conv;
37976 fees_arg_conv.inner = untag_ptr(fees_arg);
37977 fees_arg_conv.is_owned = ptr_is_owned(fees_arg);
37978 CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv);
37979 fees_arg_conv = RoutingFees_clone(&fees_arg_conv);
37980 LDKChannelUpdate last_update_message_arg_conv;
37981 last_update_message_arg_conv.inner = untag_ptr(last_update_message_arg);
37982 last_update_message_arg_conv.is_owned = ptr_is_owned(last_update_message_arg);
37983 CHECK_INNER_FIELD_ACCESS_OR_NULL(last_update_message_arg_conv);
37984 last_update_message_arg_conv = ChannelUpdate_clone(&last_update_message_arg_conv);
37985 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);
37986 uint64_t ret_ref = 0;
37987 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37988 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37992 static inline uint64_t ChannelUpdateInfo_clone_ptr(LDKChannelUpdateInfo *NONNULL_PTR arg) {
37993 LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_clone(arg);
37994 uint64_t ret_ref = 0;
37995 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
37996 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
37999 int64_t __attribute__((export_name("TS_ChannelUpdateInfo_clone_ptr"))) TS_ChannelUpdateInfo_clone_ptr(uint64_t arg) {
38000 LDKChannelUpdateInfo arg_conv;
38001 arg_conv.inner = untag_ptr(arg);
38002 arg_conv.is_owned = ptr_is_owned(arg);
38003 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
38004 arg_conv.is_owned = false;
38005 int64_t ret_conv = ChannelUpdateInfo_clone_ptr(&arg_conv);
38009 uint64_t __attribute__((export_name("TS_ChannelUpdateInfo_clone"))) TS_ChannelUpdateInfo_clone(uint64_t orig) {
38010 LDKChannelUpdateInfo orig_conv;
38011 orig_conv.inner = untag_ptr(orig);
38012 orig_conv.is_owned = ptr_is_owned(orig);
38013 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
38014 orig_conv.is_owned = false;
38015 LDKChannelUpdateInfo ret_var = ChannelUpdateInfo_clone(&orig_conv);
38016 uint64_t ret_ref = 0;
38017 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38018 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38022 int8_tArray __attribute__((export_name("TS_ChannelUpdateInfo_write"))) TS_ChannelUpdateInfo_write(uint64_t obj) {
38023 LDKChannelUpdateInfo obj_conv;
38024 obj_conv.inner = untag_ptr(obj);
38025 obj_conv.is_owned = ptr_is_owned(obj);
38026 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
38027 obj_conv.is_owned = false;
38028 LDKCVec_u8Z ret_var = ChannelUpdateInfo_write(&obj_conv);
38029 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
38030 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
38031 CVec_u8Z_free(ret_var);
38035 uint64_t __attribute__((export_name("TS_ChannelUpdateInfo_read"))) TS_ChannelUpdateInfo_read(int8_tArray ser) {
38036 LDKu8slice ser_ref;
38037 ser_ref.datalen = ser->arr_len;
38038 ser_ref.data = ser->elems;
38039 LDKCResult_ChannelUpdateInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelUpdateInfoDecodeErrorZ), "LDKCResult_ChannelUpdateInfoDecodeErrorZ");
38040 *ret_conv = ChannelUpdateInfo_read(ser_ref);
38042 return tag_ptr(ret_conv, true);
38045 void __attribute__((export_name("TS_ChannelInfo_free"))) TS_ChannelInfo_free(uint64_t this_obj) {
38046 LDKChannelInfo this_obj_conv;
38047 this_obj_conv.inner = untag_ptr(this_obj);
38048 this_obj_conv.is_owned = ptr_is_owned(this_obj);
38049 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
38050 ChannelInfo_free(this_obj_conv);
38053 uint64_t __attribute__((export_name("TS_ChannelInfo_get_features"))) TS_ChannelInfo_get_features(uint64_t this_ptr) {
38054 LDKChannelInfo this_ptr_conv;
38055 this_ptr_conv.inner = untag_ptr(this_ptr);
38056 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38057 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38058 this_ptr_conv.is_owned = false;
38059 LDKChannelFeatures ret_var = ChannelInfo_get_features(&this_ptr_conv);
38060 uint64_t ret_ref = 0;
38061 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38062 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38066 void __attribute__((export_name("TS_ChannelInfo_set_features"))) TS_ChannelInfo_set_features(uint64_t this_ptr, uint64_t val) {
38067 LDKChannelInfo this_ptr_conv;
38068 this_ptr_conv.inner = untag_ptr(this_ptr);
38069 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38070 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38071 this_ptr_conv.is_owned = false;
38072 LDKChannelFeatures val_conv;
38073 val_conv.inner = untag_ptr(val);
38074 val_conv.is_owned = ptr_is_owned(val);
38075 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38076 val_conv = ChannelFeatures_clone(&val_conv);
38077 ChannelInfo_set_features(&this_ptr_conv, val_conv);
38080 uint64_t __attribute__((export_name("TS_ChannelInfo_get_node_one"))) TS_ChannelInfo_get_node_one(uint64_t this_ptr) {
38081 LDKChannelInfo this_ptr_conv;
38082 this_ptr_conv.inner = untag_ptr(this_ptr);
38083 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38084 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38085 this_ptr_conv.is_owned = false;
38086 LDKNodeId ret_var = ChannelInfo_get_node_one(&this_ptr_conv);
38087 uint64_t ret_ref = 0;
38088 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38089 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38093 void __attribute__((export_name("TS_ChannelInfo_set_node_one"))) TS_ChannelInfo_set_node_one(uint64_t this_ptr, uint64_t val) {
38094 LDKChannelInfo 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 LDKNodeId val_conv;
38100 val_conv.inner = untag_ptr(val);
38101 val_conv.is_owned = ptr_is_owned(val);
38102 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38103 val_conv = NodeId_clone(&val_conv);
38104 ChannelInfo_set_node_one(&this_ptr_conv, val_conv);
38107 uint64_t __attribute__((export_name("TS_ChannelInfo_get_one_to_two"))) TS_ChannelInfo_get_one_to_two(uint64_t this_ptr) {
38108 LDKChannelInfo this_ptr_conv;
38109 this_ptr_conv.inner = untag_ptr(this_ptr);
38110 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38111 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38112 this_ptr_conv.is_owned = false;
38113 LDKChannelUpdateInfo ret_var = ChannelInfo_get_one_to_two(&this_ptr_conv);
38114 uint64_t ret_ref = 0;
38115 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38116 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38120 void __attribute__((export_name("TS_ChannelInfo_set_one_to_two"))) TS_ChannelInfo_set_one_to_two(uint64_t this_ptr, uint64_t val) {
38121 LDKChannelInfo this_ptr_conv;
38122 this_ptr_conv.inner = untag_ptr(this_ptr);
38123 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38124 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38125 this_ptr_conv.is_owned = false;
38126 LDKChannelUpdateInfo val_conv;
38127 val_conv.inner = untag_ptr(val);
38128 val_conv.is_owned = ptr_is_owned(val);
38129 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38130 val_conv = ChannelUpdateInfo_clone(&val_conv);
38131 ChannelInfo_set_one_to_two(&this_ptr_conv, val_conv);
38134 uint64_t __attribute__((export_name("TS_ChannelInfo_get_node_two"))) TS_ChannelInfo_get_node_two(uint64_t this_ptr) {
38135 LDKChannelInfo 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 LDKNodeId ret_var = ChannelInfo_get_node_two(&this_ptr_conv);
38141 uint64_t ret_ref = 0;
38142 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38143 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38147 void __attribute__((export_name("TS_ChannelInfo_set_node_two"))) TS_ChannelInfo_set_node_two(uint64_t this_ptr, uint64_t val) {
38148 LDKChannelInfo this_ptr_conv;
38149 this_ptr_conv.inner = untag_ptr(this_ptr);
38150 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38151 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38152 this_ptr_conv.is_owned = false;
38153 LDKNodeId val_conv;
38154 val_conv.inner = untag_ptr(val);
38155 val_conv.is_owned = ptr_is_owned(val);
38156 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38157 val_conv = NodeId_clone(&val_conv);
38158 ChannelInfo_set_node_two(&this_ptr_conv, val_conv);
38161 uint64_t __attribute__((export_name("TS_ChannelInfo_get_two_to_one"))) TS_ChannelInfo_get_two_to_one(uint64_t this_ptr) {
38162 LDKChannelInfo 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 LDKChannelUpdateInfo ret_var = ChannelInfo_get_two_to_one(&this_ptr_conv);
38168 uint64_t ret_ref = 0;
38169 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38170 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38174 void __attribute__((export_name("TS_ChannelInfo_set_two_to_one"))) TS_ChannelInfo_set_two_to_one(uint64_t this_ptr, uint64_t val) {
38175 LDKChannelInfo this_ptr_conv;
38176 this_ptr_conv.inner = untag_ptr(this_ptr);
38177 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38178 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38179 this_ptr_conv.is_owned = false;
38180 LDKChannelUpdateInfo val_conv;
38181 val_conv.inner = untag_ptr(val);
38182 val_conv.is_owned = ptr_is_owned(val);
38183 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38184 val_conv = ChannelUpdateInfo_clone(&val_conv);
38185 ChannelInfo_set_two_to_one(&this_ptr_conv, val_conv);
38188 uint64_t __attribute__((export_name("TS_ChannelInfo_get_capacity_sats"))) TS_ChannelInfo_get_capacity_sats(uint64_t this_ptr) {
38189 LDKChannelInfo this_ptr_conv;
38190 this_ptr_conv.inner = untag_ptr(this_ptr);
38191 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38192 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38193 this_ptr_conv.is_owned = false;
38194 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
38195 *ret_copy = ChannelInfo_get_capacity_sats(&this_ptr_conv);
38196 uint64_t ret_ref = tag_ptr(ret_copy, true);
38200 void __attribute__((export_name("TS_ChannelInfo_set_capacity_sats"))) TS_ChannelInfo_set_capacity_sats(uint64_t this_ptr, uint64_t val) {
38201 LDKChannelInfo this_ptr_conv;
38202 this_ptr_conv.inner = untag_ptr(this_ptr);
38203 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38204 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38205 this_ptr_conv.is_owned = false;
38206 void* val_ptr = untag_ptr(val);
38207 CHECK_ACCESS(val_ptr);
38208 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
38209 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
38210 ChannelInfo_set_capacity_sats(&this_ptr_conv, val_conv);
38213 uint64_t __attribute__((export_name("TS_ChannelInfo_get_announcement_message"))) TS_ChannelInfo_get_announcement_message(uint64_t this_ptr) {
38214 LDKChannelInfo this_ptr_conv;
38215 this_ptr_conv.inner = untag_ptr(this_ptr);
38216 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38217 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38218 this_ptr_conv.is_owned = false;
38219 LDKChannelAnnouncement ret_var = ChannelInfo_get_announcement_message(&this_ptr_conv);
38220 uint64_t ret_ref = 0;
38221 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38222 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38226 void __attribute__((export_name("TS_ChannelInfo_set_announcement_message"))) TS_ChannelInfo_set_announcement_message(uint64_t this_ptr, uint64_t val) {
38227 LDKChannelInfo this_ptr_conv;
38228 this_ptr_conv.inner = untag_ptr(this_ptr);
38229 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38230 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38231 this_ptr_conv.is_owned = false;
38232 LDKChannelAnnouncement val_conv;
38233 val_conv.inner = untag_ptr(val);
38234 val_conv.is_owned = ptr_is_owned(val);
38235 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38236 val_conv = ChannelAnnouncement_clone(&val_conv);
38237 ChannelInfo_set_announcement_message(&this_ptr_conv, val_conv);
38240 static inline uint64_t ChannelInfo_clone_ptr(LDKChannelInfo *NONNULL_PTR arg) {
38241 LDKChannelInfo ret_var = ChannelInfo_clone(arg);
38242 uint64_t ret_ref = 0;
38243 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38244 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38247 int64_t __attribute__((export_name("TS_ChannelInfo_clone_ptr"))) TS_ChannelInfo_clone_ptr(uint64_t arg) {
38248 LDKChannelInfo arg_conv;
38249 arg_conv.inner = untag_ptr(arg);
38250 arg_conv.is_owned = ptr_is_owned(arg);
38251 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
38252 arg_conv.is_owned = false;
38253 int64_t ret_conv = ChannelInfo_clone_ptr(&arg_conv);
38257 uint64_t __attribute__((export_name("TS_ChannelInfo_clone"))) TS_ChannelInfo_clone(uint64_t orig) {
38258 LDKChannelInfo orig_conv;
38259 orig_conv.inner = untag_ptr(orig);
38260 orig_conv.is_owned = ptr_is_owned(orig);
38261 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
38262 orig_conv.is_owned = false;
38263 LDKChannelInfo ret_var = ChannelInfo_clone(&orig_conv);
38264 uint64_t ret_ref = 0;
38265 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38266 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38270 uint64_t __attribute__((export_name("TS_ChannelInfo_get_directional_info"))) TS_ChannelInfo_get_directional_info(uint64_t this_arg, int8_t channel_flags) {
38271 LDKChannelInfo this_arg_conv;
38272 this_arg_conv.inner = untag_ptr(this_arg);
38273 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38274 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38275 this_arg_conv.is_owned = false;
38276 LDKChannelUpdateInfo ret_var = ChannelInfo_get_directional_info(&this_arg_conv, channel_flags);
38277 uint64_t ret_ref = 0;
38278 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38279 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38283 int8_tArray __attribute__((export_name("TS_ChannelInfo_write"))) TS_ChannelInfo_write(uint64_t obj) {
38284 LDKChannelInfo obj_conv;
38285 obj_conv.inner = untag_ptr(obj);
38286 obj_conv.is_owned = ptr_is_owned(obj);
38287 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
38288 obj_conv.is_owned = false;
38289 LDKCVec_u8Z ret_var = ChannelInfo_write(&obj_conv);
38290 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
38291 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
38292 CVec_u8Z_free(ret_var);
38296 uint64_t __attribute__((export_name("TS_ChannelInfo_read"))) TS_ChannelInfo_read(int8_tArray ser) {
38297 LDKu8slice ser_ref;
38298 ser_ref.datalen = ser->arr_len;
38299 ser_ref.data = ser->elems;
38300 LDKCResult_ChannelInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ChannelInfoDecodeErrorZ), "LDKCResult_ChannelInfoDecodeErrorZ");
38301 *ret_conv = ChannelInfo_read(ser_ref);
38303 return tag_ptr(ret_conv, true);
38306 void __attribute__((export_name("TS_DirectedChannelInfo_free"))) TS_DirectedChannelInfo_free(uint64_t this_obj) {
38307 LDKDirectedChannelInfo this_obj_conv;
38308 this_obj_conv.inner = untag_ptr(this_obj);
38309 this_obj_conv.is_owned = ptr_is_owned(this_obj);
38310 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
38311 DirectedChannelInfo_free(this_obj_conv);
38314 static inline uint64_t DirectedChannelInfo_clone_ptr(LDKDirectedChannelInfo *NONNULL_PTR arg) {
38315 LDKDirectedChannelInfo ret_var = DirectedChannelInfo_clone(arg);
38316 uint64_t ret_ref = 0;
38317 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38318 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38321 int64_t __attribute__((export_name("TS_DirectedChannelInfo_clone_ptr"))) TS_DirectedChannelInfo_clone_ptr(uint64_t arg) {
38322 LDKDirectedChannelInfo arg_conv;
38323 arg_conv.inner = untag_ptr(arg);
38324 arg_conv.is_owned = ptr_is_owned(arg);
38325 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
38326 arg_conv.is_owned = false;
38327 int64_t ret_conv = DirectedChannelInfo_clone_ptr(&arg_conv);
38331 uint64_t __attribute__((export_name("TS_DirectedChannelInfo_clone"))) TS_DirectedChannelInfo_clone(uint64_t orig) {
38332 LDKDirectedChannelInfo orig_conv;
38333 orig_conv.inner = untag_ptr(orig);
38334 orig_conv.is_owned = ptr_is_owned(orig);
38335 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
38336 orig_conv.is_owned = false;
38337 LDKDirectedChannelInfo ret_var = DirectedChannelInfo_clone(&orig_conv);
38338 uint64_t ret_ref = 0;
38339 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38340 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38344 uint64_t __attribute__((export_name("TS_DirectedChannelInfo_channel"))) TS_DirectedChannelInfo_channel(uint64_t this_arg) {
38345 LDKDirectedChannelInfo this_arg_conv;
38346 this_arg_conv.inner = untag_ptr(this_arg);
38347 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38348 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38349 this_arg_conv.is_owned = false;
38350 LDKChannelInfo ret_var = DirectedChannelInfo_channel(&this_arg_conv);
38351 uint64_t ret_ref = 0;
38352 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38353 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38357 uint64_t __attribute__((export_name("TS_DirectedChannelInfo_direction"))) TS_DirectedChannelInfo_direction(uint64_t this_arg) {
38358 LDKDirectedChannelInfo this_arg_conv;
38359 this_arg_conv.inner = untag_ptr(this_arg);
38360 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38361 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38362 this_arg_conv.is_owned = false;
38363 LDKChannelUpdateInfo ret_var = DirectedChannelInfo_direction(&this_arg_conv);
38364 uint64_t ret_ref = 0;
38365 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38366 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38370 int64_t __attribute__((export_name("TS_DirectedChannelInfo_htlc_maximum_msat"))) TS_DirectedChannelInfo_htlc_maximum_msat(uint64_t this_arg) {
38371 LDKDirectedChannelInfo this_arg_conv;
38372 this_arg_conv.inner = untag_ptr(this_arg);
38373 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38374 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38375 this_arg_conv.is_owned = false;
38376 int64_t ret_conv = DirectedChannelInfo_htlc_maximum_msat(&this_arg_conv);
38380 uint64_t __attribute__((export_name("TS_DirectedChannelInfo_effective_capacity"))) TS_DirectedChannelInfo_effective_capacity(uint64_t this_arg) {
38381 LDKDirectedChannelInfo this_arg_conv;
38382 this_arg_conv.inner = untag_ptr(this_arg);
38383 this_arg_conv.is_owned = ptr_is_owned(this_arg);
38384 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
38385 this_arg_conv.is_owned = false;
38386 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
38387 *ret_copy = DirectedChannelInfo_effective_capacity(&this_arg_conv);
38388 uint64_t ret_ref = tag_ptr(ret_copy, true);
38392 void __attribute__((export_name("TS_EffectiveCapacity_free"))) TS_EffectiveCapacity_free(uint64_t this_ptr) {
38393 if (!ptr_is_owned(this_ptr)) return;
38394 void* this_ptr_ptr = untag_ptr(this_ptr);
38395 CHECK_ACCESS(this_ptr_ptr);
38396 LDKEffectiveCapacity this_ptr_conv = *(LDKEffectiveCapacity*)(this_ptr_ptr);
38397 FREE(untag_ptr(this_ptr));
38398 EffectiveCapacity_free(this_ptr_conv);
38401 static inline uint64_t EffectiveCapacity_clone_ptr(LDKEffectiveCapacity *NONNULL_PTR arg) {
38402 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
38403 *ret_copy = EffectiveCapacity_clone(arg);
38404 uint64_t ret_ref = tag_ptr(ret_copy, true);
38407 int64_t __attribute__((export_name("TS_EffectiveCapacity_clone_ptr"))) TS_EffectiveCapacity_clone_ptr(uint64_t arg) {
38408 LDKEffectiveCapacity* arg_conv = (LDKEffectiveCapacity*)untag_ptr(arg);
38409 int64_t ret_conv = EffectiveCapacity_clone_ptr(arg_conv);
38413 uint64_t __attribute__((export_name("TS_EffectiveCapacity_clone"))) TS_EffectiveCapacity_clone(uint64_t orig) {
38414 LDKEffectiveCapacity* orig_conv = (LDKEffectiveCapacity*)untag_ptr(orig);
38415 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
38416 *ret_copy = EffectiveCapacity_clone(orig_conv);
38417 uint64_t ret_ref = tag_ptr(ret_copy, true);
38421 uint64_t __attribute__((export_name("TS_EffectiveCapacity_exact_liquidity"))) TS_EffectiveCapacity_exact_liquidity(int64_t liquidity_msat) {
38422 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
38423 *ret_copy = EffectiveCapacity_exact_liquidity(liquidity_msat);
38424 uint64_t ret_ref = tag_ptr(ret_copy, true);
38428 uint64_t __attribute__((export_name("TS_EffectiveCapacity_maximum_htlc"))) TS_EffectiveCapacity_maximum_htlc(int64_t amount_msat) {
38429 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
38430 *ret_copy = EffectiveCapacity_maximum_htlc(amount_msat);
38431 uint64_t ret_ref = tag_ptr(ret_copy, true);
38435 uint64_t __attribute__((export_name("TS_EffectiveCapacity_total"))) TS_EffectiveCapacity_total(int64_t capacity_msat, uint64_t htlc_maximum_msat) {
38436 void* htlc_maximum_msat_ptr = untag_ptr(htlc_maximum_msat);
38437 CHECK_ACCESS(htlc_maximum_msat_ptr);
38438 LDKCOption_u64Z htlc_maximum_msat_conv = *(LDKCOption_u64Z*)(htlc_maximum_msat_ptr);
38439 htlc_maximum_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_maximum_msat));
38440 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
38441 *ret_copy = EffectiveCapacity_total(capacity_msat, htlc_maximum_msat_conv);
38442 uint64_t ret_ref = tag_ptr(ret_copy, true);
38446 uint64_t __attribute__((export_name("TS_EffectiveCapacity_infinite"))) TS_EffectiveCapacity_infinite() {
38447 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
38448 *ret_copy = EffectiveCapacity_infinite();
38449 uint64_t ret_ref = tag_ptr(ret_copy, true);
38453 uint64_t __attribute__((export_name("TS_EffectiveCapacity_unknown"))) TS_EffectiveCapacity_unknown() {
38454 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
38455 *ret_copy = EffectiveCapacity_unknown();
38456 uint64_t ret_ref = tag_ptr(ret_copy, true);
38460 int64_t __attribute__((export_name("TS_EffectiveCapacity_as_msat"))) TS_EffectiveCapacity_as_msat(uint64_t this_arg) {
38461 LDKEffectiveCapacity* this_arg_conv = (LDKEffectiveCapacity*)untag_ptr(this_arg);
38462 int64_t ret_conv = EffectiveCapacity_as_msat(this_arg_conv);
38466 void __attribute__((export_name("TS_RoutingFees_free"))) TS_RoutingFees_free(uint64_t this_obj) {
38467 LDKRoutingFees this_obj_conv;
38468 this_obj_conv.inner = untag_ptr(this_obj);
38469 this_obj_conv.is_owned = ptr_is_owned(this_obj);
38470 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
38471 RoutingFees_free(this_obj_conv);
38474 int32_t __attribute__((export_name("TS_RoutingFees_get_base_msat"))) TS_RoutingFees_get_base_msat(uint64_t this_ptr) {
38475 LDKRoutingFees this_ptr_conv;
38476 this_ptr_conv.inner = untag_ptr(this_ptr);
38477 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38478 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38479 this_ptr_conv.is_owned = false;
38480 int32_t ret_conv = RoutingFees_get_base_msat(&this_ptr_conv);
38484 void __attribute__((export_name("TS_RoutingFees_set_base_msat"))) TS_RoutingFees_set_base_msat(uint64_t this_ptr, int32_t val) {
38485 LDKRoutingFees this_ptr_conv;
38486 this_ptr_conv.inner = untag_ptr(this_ptr);
38487 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38488 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38489 this_ptr_conv.is_owned = false;
38490 RoutingFees_set_base_msat(&this_ptr_conv, val);
38493 int32_t __attribute__((export_name("TS_RoutingFees_get_proportional_millionths"))) TS_RoutingFees_get_proportional_millionths(uint64_t this_ptr) {
38494 LDKRoutingFees this_ptr_conv;
38495 this_ptr_conv.inner = untag_ptr(this_ptr);
38496 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38497 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38498 this_ptr_conv.is_owned = false;
38499 int32_t ret_conv = RoutingFees_get_proportional_millionths(&this_ptr_conv);
38503 void __attribute__((export_name("TS_RoutingFees_set_proportional_millionths"))) TS_RoutingFees_set_proportional_millionths(uint64_t this_ptr, int32_t val) {
38504 LDKRoutingFees this_ptr_conv;
38505 this_ptr_conv.inner = untag_ptr(this_ptr);
38506 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38507 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38508 this_ptr_conv.is_owned = false;
38509 RoutingFees_set_proportional_millionths(&this_ptr_conv, val);
38512 uint64_t __attribute__((export_name("TS_RoutingFees_new"))) TS_RoutingFees_new(int32_t base_msat_arg, int32_t proportional_millionths_arg) {
38513 LDKRoutingFees ret_var = RoutingFees_new(base_msat_arg, proportional_millionths_arg);
38514 uint64_t ret_ref = 0;
38515 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38516 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38520 jboolean __attribute__((export_name("TS_RoutingFees_eq"))) TS_RoutingFees_eq(uint64_t a, uint64_t b) {
38521 LDKRoutingFees a_conv;
38522 a_conv.inner = untag_ptr(a);
38523 a_conv.is_owned = ptr_is_owned(a);
38524 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
38525 a_conv.is_owned = false;
38526 LDKRoutingFees b_conv;
38527 b_conv.inner = untag_ptr(b);
38528 b_conv.is_owned = ptr_is_owned(b);
38529 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
38530 b_conv.is_owned = false;
38531 jboolean ret_conv = RoutingFees_eq(&a_conv, &b_conv);
38535 static inline uint64_t RoutingFees_clone_ptr(LDKRoutingFees *NONNULL_PTR arg) {
38536 LDKRoutingFees ret_var = RoutingFees_clone(arg);
38537 uint64_t ret_ref = 0;
38538 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38539 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38542 int64_t __attribute__((export_name("TS_RoutingFees_clone_ptr"))) TS_RoutingFees_clone_ptr(uint64_t arg) {
38543 LDKRoutingFees arg_conv;
38544 arg_conv.inner = untag_ptr(arg);
38545 arg_conv.is_owned = ptr_is_owned(arg);
38546 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
38547 arg_conv.is_owned = false;
38548 int64_t ret_conv = RoutingFees_clone_ptr(&arg_conv);
38552 uint64_t __attribute__((export_name("TS_RoutingFees_clone"))) TS_RoutingFees_clone(uint64_t orig) {
38553 LDKRoutingFees orig_conv;
38554 orig_conv.inner = untag_ptr(orig);
38555 orig_conv.is_owned = ptr_is_owned(orig);
38556 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
38557 orig_conv.is_owned = false;
38558 LDKRoutingFees ret_var = RoutingFees_clone(&orig_conv);
38559 uint64_t ret_ref = 0;
38560 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38561 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38565 int64_t __attribute__((export_name("TS_RoutingFees_hash"))) TS_RoutingFees_hash(uint64_t o) {
38566 LDKRoutingFees o_conv;
38567 o_conv.inner = untag_ptr(o);
38568 o_conv.is_owned = ptr_is_owned(o);
38569 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
38570 o_conv.is_owned = false;
38571 int64_t ret_conv = RoutingFees_hash(&o_conv);
38575 int8_tArray __attribute__((export_name("TS_RoutingFees_write"))) TS_RoutingFees_write(uint64_t obj) {
38576 LDKRoutingFees obj_conv;
38577 obj_conv.inner = untag_ptr(obj);
38578 obj_conv.is_owned = ptr_is_owned(obj);
38579 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
38580 obj_conv.is_owned = false;
38581 LDKCVec_u8Z ret_var = RoutingFees_write(&obj_conv);
38582 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
38583 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
38584 CVec_u8Z_free(ret_var);
38588 uint64_t __attribute__((export_name("TS_RoutingFees_read"))) TS_RoutingFees_read(int8_tArray ser) {
38589 LDKu8slice ser_ref;
38590 ser_ref.datalen = ser->arr_len;
38591 ser_ref.data = ser->elems;
38592 LDKCResult_RoutingFeesDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RoutingFeesDecodeErrorZ), "LDKCResult_RoutingFeesDecodeErrorZ");
38593 *ret_conv = RoutingFees_read(ser_ref);
38595 return tag_ptr(ret_conv, true);
38598 void __attribute__((export_name("TS_NodeAnnouncementInfo_free"))) TS_NodeAnnouncementInfo_free(uint64_t this_obj) {
38599 LDKNodeAnnouncementInfo this_obj_conv;
38600 this_obj_conv.inner = untag_ptr(this_obj);
38601 this_obj_conv.is_owned = ptr_is_owned(this_obj);
38602 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
38603 NodeAnnouncementInfo_free(this_obj_conv);
38606 uint64_t __attribute__((export_name("TS_NodeAnnouncementInfo_get_features"))) TS_NodeAnnouncementInfo_get_features(uint64_t this_ptr) {
38607 LDKNodeAnnouncementInfo this_ptr_conv;
38608 this_ptr_conv.inner = untag_ptr(this_ptr);
38609 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38610 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38611 this_ptr_conv.is_owned = false;
38612 LDKNodeFeatures ret_var = NodeAnnouncementInfo_get_features(&this_ptr_conv);
38613 uint64_t ret_ref = 0;
38614 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38615 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38619 void __attribute__((export_name("TS_NodeAnnouncementInfo_set_features"))) TS_NodeAnnouncementInfo_set_features(uint64_t this_ptr, uint64_t val) {
38620 LDKNodeAnnouncementInfo this_ptr_conv;
38621 this_ptr_conv.inner = untag_ptr(this_ptr);
38622 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38623 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38624 this_ptr_conv.is_owned = false;
38625 LDKNodeFeatures val_conv;
38626 val_conv.inner = untag_ptr(val);
38627 val_conv.is_owned = ptr_is_owned(val);
38628 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38629 val_conv = NodeFeatures_clone(&val_conv);
38630 NodeAnnouncementInfo_set_features(&this_ptr_conv, val_conv);
38633 int32_t __attribute__((export_name("TS_NodeAnnouncementInfo_get_last_update"))) TS_NodeAnnouncementInfo_get_last_update(uint64_t this_ptr) {
38634 LDKNodeAnnouncementInfo this_ptr_conv;
38635 this_ptr_conv.inner = untag_ptr(this_ptr);
38636 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38637 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38638 this_ptr_conv.is_owned = false;
38639 int32_t ret_conv = NodeAnnouncementInfo_get_last_update(&this_ptr_conv);
38643 void __attribute__((export_name("TS_NodeAnnouncementInfo_set_last_update"))) TS_NodeAnnouncementInfo_set_last_update(uint64_t this_ptr, int32_t val) {
38644 LDKNodeAnnouncementInfo this_ptr_conv;
38645 this_ptr_conv.inner = untag_ptr(this_ptr);
38646 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38647 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38648 this_ptr_conv.is_owned = false;
38649 NodeAnnouncementInfo_set_last_update(&this_ptr_conv, val);
38652 int8_tArray __attribute__((export_name("TS_NodeAnnouncementInfo_get_rgb"))) TS_NodeAnnouncementInfo_get_rgb(uint64_t this_ptr) {
38653 LDKNodeAnnouncementInfo this_ptr_conv;
38654 this_ptr_conv.inner = untag_ptr(this_ptr);
38655 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38656 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38657 this_ptr_conv.is_owned = false;
38658 int8_tArray ret_arr = init_int8_tArray(3, __LINE__);
38659 memcpy(ret_arr->elems, *NodeAnnouncementInfo_get_rgb(&this_ptr_conv), 3);
38663 void __attribute__((export_name("TS_NodeAnnouncementInfo_set_rgb"))) TS_NodeAnnouncementInfo_set_rgb(uint64_t this_ptr, int8_tArray val) {
38664 LDKNodeAnnouncementInfo this_ptr_conv;
38665 this_ptr_conv.inner = untag_ptr(this_ptr);
38666 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38667 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38668 this_ptr_conv.is_owned = false;
38669 LDKThreeBytes val_ref;
38670 CHECK(val->arr_len == 3);
38671 memcpy(val_ref.data, val->elems, 3); FREE(val);
38672 NodeAnnouncementInfo_set_rgb(&this_ptr_conv, val_ref);
38675 uint64_t __attribute__((export_name("TS_NodeAnnouncementInfo_get_alias"))) TS_NodeAnnouncementInfo_get_alias(uint64_t this_ptr) {
38676 LDKNodeAnnouncementInfo 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 LDKNodeAlias ret_var = NodeAnnouncementInfo_get_alias(&this_ptr_conv);
38682 uint64_t ret_ref = 0;
38683 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38684 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38688 void __attribute__((export_name("TS_NodeAnnouncementInfo_set_alias"))) TS_NodeAnnouncementInfo_set_alias(uint64_t this_ptr, uint64_t val) {
38689 LDKNodeAnnouncementInfo this_ptr_conv;
38690 this_ptr_conv.inner = untag_ptr(this_ptr);
38691 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38692 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38693 this_ptr_conv.is_owned = false;
38694 LDKNodeAlias val_conv;
38695 val_conv.inner = untag_ptr(val);
38696 val_conv.is_owned = ptr_is_owned(val);
38697 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38698 val_conv = NodeAlias_clone(&val_conv);
38699 NodeAnnouncementInfo_set_alias(&this_ptr_conv, val_conv);
38702 uint64_tArray __attribute__((export_name("TS_NodeAnnouncementInfo_get_addresses"))) TS_NodeAnnouncementInfo_get_addresses(uint64_t this_ptr) {
38703 LDKNodeAnnouncementInfo this_ptr_conv;
38704 this_ptr_conv.inner = untag_ptr(this_ptr);
38705 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38706 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38707 this_ptr_conv.is_owned = false;
38708 LDKCVec_NetAddressZ ret_var = NodeAnnouncementInfo_get_addresses(&this_ptr_conv);
38709 uint64_tArray ret_arr = NULL;
38710 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
38711 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
38712 for (size_t m = 0; m < ret_var.datalen; m++) {
38713 LDKNetAddress *ret_conv_12_copy = MALLOC(sizeof(LDKNetAddress), "LDKNetAddress");
38714 *ret_conv_12_copy = ret_var.data[m];
38715 uint64_t ret_conv_12_ref = tag_ptr(ret_conv_12_copy, true);
38716 ret_arr_ptr[m] = ret_conv_12_ref;
38719 FREE(ret_var.data);
38723 void __attribute__((export_name("TS_NodeAnnouncementInfo_set_addresses"))) TS_NodeAnnouncementInfo_set_addresses(uint64_t this_ptr, uint64_tArray val) {
38724 LDKNodeAnnouncementInfo this_ptr_conv;
38725 this_ptr_conv.inner = untag_ptr(this_ptr);
38726 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38727 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38728 this_ptr_conv.is_owned = false;
38729 LDKCVec_NetAddressZ val_constr;
38730 val_constr.datalen = val->arr_len;
38731 if (val_constr.datalen > 0)
38732 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
38734 val_constr.data = NULL;
38735 uint64_t* val_vals = val->elems;
38736 for (size_t m = 0; m < val_constr.datalen; m++) {
38737 uint64_t val_conv_12 = val_vals[m];
38738 void* val_conv_12_ptr = untag_ptr(val_conv_12);
38739 CHECK_ACCESS(val_conv_12_ptr);
38740 LDKNetAddress val_conv_12_conv = *(LDKNetAddress*)(val_conv_12_ptr);
38741 val_conv_12_conv = NetAddress_clone((LDKNetAddress*)untag_ptr(val_conv_12));
38742 val_constr.data[m] = val_conv_12_conv;
38745 NodeAnnouncementInfo_set_addresses(&this_ptr_conv, val_constr);
38748 uint64_t __attribute__((export_name("TS_NodeAnnouncementInfo_get_announcement_message"))) TS_NodeAnnouncementInfo_get_announcement_message(uint64_t this_ptr) {
38749 LDKNodeAnnouncementInfo this_ptr_conv;
38750 this_ptr_conv.inner = untag_ptr(this_ptr);
38751 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38752 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38753 this_ptr_conv.is_owned = false;
38754 LDKNodeAnnouncement ret_var = NodeAnnouncementInfo_get_announcement_message(&this_ptr_conv);
38755 uint64_t ret_ref = 0;
38756 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38757 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38761 void __attribute__((export_name("TS_NodeAnnouncementInfo_set_announcement_message"))) TS_NodeAnnouncementInfo_set_announcement_message(uint64_t this_ptr, uint64_t val) {
38762 LDKNodeAnnouncementInfo this_ptr_conv;
38763 this_ptr_conv.inner = untag_ptr(this_ptr);
38764 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38765 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38766 this_ptr_conv.is_owned = false;
38767 LDKNodeAnnouncement val_conv;
38768 val_conv.inner = untag_ptr(val);
38769 val_conv.is_owned = ptr_is_owned(val);
38770 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
38771 val_conv = NodeAnnouncement_clone(&val_conv);
38772 NodeAnnouncementInfo_set_announcement_message(&this_ptr_conv, val_conv);
38775 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) {
38776 LDKNodeFeatures features_arg_conv;
38777 features_arg_conv.inner = untag_ptr(features_arg);
38778 features_arg_conv.is_owned = ptr_is_owned(features_arg);
38779 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv);
38780 features_arg_conv = NodeFeatures_clone(&features_arg_conv);
38781 LDKThreeBytes rgb_arg_ref;
38782 CHECK(rgb_arg->arr_len == 3);
38783 memcpy(rgb_arg_ref.data, rgb_arg->elems, 3); FREE(rgb_arg);
38784 LDKNodeAlias alias_arg_conv;
38785 alias_arg_conv.inner = untag_ptr(alias_arg);
38786 alias_arg_conv.is_owned = ptr_is_owned(alias_arg);
38787 CHECK_INNER_FIELD_ACCESS_OR_NULL(alias_arg_conv);
38788 alias_arg_conv = NodeAlias_clone(&alias_arg_conv);
38789 LDKCVec_NetAddressZ addresses_arg_constr;
38790 addresses_arg_constr.datalen = addresses_arg->arr_len;
38791 if (addresses_arg_constr.datalen > 0)
38792 addresses_arg_constr.data = MALLOC(addresses_arg_constr.datalen * sizeof(LDKNetAddress), "LDKCVec_NetAddressZ Elements");
38794 addresses_arg_constr.data = NULL;
38795 uint64_t* addresses_arg_vals = addresses_arg->elems;
38796 for (size_t m = 0; m < addresses_arg_constr.datalen; m++) {
38797 uint64_t addresses_arg_conv_12 = addresses_arg_vals[m];
38798 void* addresses_arg_conv_12_ptr = untag_ptr(addresses_arg_conv_12);
38799 CHECK_ACCESS(addresses_arg_conv_12_ptr);
38800 LDKNetAddress addresses_arg_conv_12_conv = *(LDKNetAddress*)(addresses_arg_conv_12_ptr);
38801 addresses_arg_constr.data[m] = addresses_arg_conv_12_conv;
38803 FREE(addresses_arg);
38804 LDKNodeAnnouncement announcement_message_arg_conv;
38805 announcement_message_arg_conv.inner = untag_ptr(announcement_message_arg);
38806 announcement_message_arg_conv.is_owned = ptr_is_owned(announcement_message_arg);
38807 CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_message_arg_conv);
38808 announcement_message_arg_conv = NodeAnnouncement_clone(&announcement_message_arg_conv);
38809 LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_new(features_arg_conv, last_update_arg, rgb_arg_ref, alias_arg_conv, addresses_arg_constr, announcement_message_arg_conv);
38810 uint64_t ret_ref = 0;
38811 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38812 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38816 static inline uint64_t NodeAnnouncementInfo_clone_ptr(LDKNodeAnnouncementInfo *NONNULL_PTR arg) {
38817 LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_clone(arg);
38818 uint64_t ret_ref = 0;
38819 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38820 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38823 int64_t __attribute__((export_name("TS_NodeAnnouncementInfo_clone_ptr"))) TS_NodeAnnouncementInfo_clone_ptr(uint64_t arg) {
38824 LDKNodeAnnouncementInfo arg_conv;
38825 arg_conv.inner = untag_ptr(arg);
38826 arg_conv.is_owned = ptr_is_owned(arg);
38827 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
38828 arg_conv.is_owned = false;
38829 int64_t ret_conv = NodeAnnouncementInfo_clone_ptr(&arg_conv);
38833 uint64_t __attribute__((export_name("TS_NodeAnnouncementInfo_clone"))) TS_NodeAnnouncementInfo_clone(uint64_t orig) {
38834 LDKNodeAnnouncementInfo orig_conv;
38835 orig_conv.inner = untag_ptr(orig);
38836 orig_conv.is_owned = ptr_is_owned(orig);
38837 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
38838 orig_conv.is_owned = false;
38839 LDKNodeAnnouncementInfo ret_var = NodeAnnouncementInfo_clone(&orig_conv);
38840 uint64_t ret_ref = 0;
38841 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38842 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38846 int8_tArray __attribute__((export_name("TS_NodeAnnouncementInfo_write"))) TS_NodeAnnouncementInfo_write(uint64_t obj) {
38847 LDKNodeAnnouncementInfo obj_conv;
38848 obj_conv.inner = untag_ptr(obj);
38849 obj_conv.is_owned = ptr_is_owned(obj);
38850 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
38851 obj_conv.is_owned = false;
38852 LDKCVec_u8Z ret_var = NodeAnnouncementInfo_write(&obj_conv);
38853 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
38854 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
38855 CVec_u8Z_free(ret_var);
38859 uint64_t __attribute__((export_name("TS_NodeAnnouncementInfo_read"))) TS_NodeAnnouncementInfo_read(int8_tArray ser) {
38860 LDKu8slice ser_ref;
38861 ser_ref.datalen = ser->arr_len;
38862 ser_ref.data = ser->elems;
38863 LDKCResult_NodeAnnouncementInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAnnouncementInfoDecodeErrorZ), "LDKCResult_NodeAnnouncementInfoDecodeErrorZ");
38864 *ret_conv = NodeAnnouncementInfo_read(ser_ref);
38866 return tag_ptr(ret_conv, true);
38869 void __attribute__((export_name("TS_NodeAlias_free"))) TS_NodeAlias_free(uint64_t this_obj) {
38870 LDKNodeAlias this_obj_conv;
38871 this_obj_conv.inner = untag_ptr(this_obj);
38872 this_obj_conv.is_owned = ptr_is_owned(this_obj);
38873 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
38874 NodeAlias_free(this_obj_conv);
38877 int8_tArray __attribute__((export_name("TS_NodeAlias_get_a"))) TS_NodeAlias_get_a(uint64_t this_ptr) {
38878 LDKNodeAlias this_ptr_conv;
38879 this_ptr_conv.inner = untag_ptr(this_ptr);
38880 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38881 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38882 this_ptr_conv.is_owned = false;
38883 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
38884 memcpy(ret_arr->elems, *NodeAlias_get_a(&this_ptr_conv), 32);
38888 void __attribute__((export_name("TS_NodeAlias_set_a"))) TS_NodeAlias_set_a(uint64_t this_ptr, int8_tArray val) {
38889 LDKNodeAlias this_ptr_conv;
38890 this_ptr_conv.inner = untag_ptr(this_ptr);
38891 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38892 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38893 this_ptr_conv.is_owned = false;
38894 LDKThirtyTwoBytes val_ref;
38895 CHECK(val->arr_len == 32);
38896 memcpy(val_ref.data, val->elems, 32); FREE(val);
38897 NodeAlias_set_a(&this_ptr_conv, val_ref);
38900 uint64_t __attribute__((export_name("TS_NodeAlias_new"))) TS_NodeAlias_new(int8_tArray a_arg) {
38901 LDKThirtyTwoBytes a_arg_ref;
38902 CHECK(a_arg->arr_len == 32);
38903 memcpy(a_arg_ref.data, a_arg->elems, 32); FREE(a_arg);
38904 LDKNodeAlias ret_var = NodeAlias_new(a_arg_ref);
38905 uint64_t ret_ref = 0;
38906 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38907 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38911 static inline uint64_t NodeAlias_clone_ptr(LDKNodeAlias *NONNULL_PTR arg) {
38912 LDKNodeAlias ret_var = NodeAlias_clone(arg);
38913 uint64_t ret_ref = 0;
38914 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38915 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38918 int64_t __attribute__((export_name("TS_NodeAlias_clone_ptr"))) TS_NodeAlias_clone_ptr(uint64_t arg) {
38919 LDKNodeAlias arg_conv;
38920 arg_conv.inner = untag_ptr(arg);
38921 arg_conv.is_owned = ptr_is_owned(arg);
38922 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
38923 arg_conv.is_owned = false;
38924 int64_t ret_conv = NodeAlias_clone_ptr(&arg_conv);
38928 uint64_t __attribute__((export_name("TS_NodeAlias_clone"))) TS_NodeAlias_clone(uint64_t orig) {
38929 LDKNodeAlias orig_conv;
38930 orig_conv.inner = untag_ptr(orig);
38931 orig_conv.is_owned = ptr_is_owned(orig);
38932 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
38933 orig_conv.is_owned = false;
38934 LDKNodeAlias ret_var = NodeAlias_clone(&orig_conv);
38935 uint64_t ret_ref = 0;
38936 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
38937 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
38941 int8_tArray __attribute__((export_name("TS_NodeAlias_write"))) TS_NodeAlias_write(uint64_t obj) {
38942 LDKNodeAlias obj_conv;
38943 obj_conv.inner = untag_ptr(obj);
38944 obj_conv.is_owned = ptr_is_owned(obj);
38945 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
38946 obj_conv.is_owned = false;
38947 LDKCVec_u8Z ret_var = NodeAlias_write(&obj_conv);
38948 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
38949 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
38950 CVec_u8Z_free(ret_var);
38954 uint64_t __attribute__((export_name("TS_NodeAlias_read"))) TS_NodeAlias_read(int8_tArray ser) {
38955 LDKu8slice ser_ref;
38956 ser_ref.datalen = ser->arr_len;
38957 ser_ref.data = ser->elems;
38958 LDKCResult_NodeAliasDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeAliasDecodeErrorZ), "LDKCResult_NodeAliasDecodeErrorZ");
38959 *ret_conv = NodeAlias_read(ser_ref);
38961 return tag_ptr(ret_conv, true);
38964 void __attribute__((export_name("TS_NodeInfo_free"))) TS_NodeInfo_free(uint64_t this_obj) {
38965 LDKNodeInfo this_obj_conv;
38966 this_obj_conv.inner = untag_ptr(this_obj);
38967 this_obj_conv.is_owned = ptr_is_owned(this_obj);
38968 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
38969 NodeInfo_free(this_obj_conv);
38972 int64_tArray __attribute__((export_name("TS_NodeInfo_get_channels"))) TS_NodeInfo_get_channels(uint64_t this_ptr) {
38973 LDKNodeInfo this_ptr_conv;
38974 this_ptr_conv.inner = untag_ptr(this_ptr);
38975 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38976 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38977 this_ptr_conv.is_owned = false;
38978 LDKCVec_u64Z ret_var = NodeInfo_get_channels(&this_ptr_conv);
38979 int64_tArray ret_arr = NULL;
38980 ret_arr = init_int64_tArray(ret_var.datalen, __LINE__);
38981 int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8);
38982 for (size_t i = 0; i < ret_var.datalen; i++) {
38983 int64_t ret_conv_8_conv = ret_var.data[i];
38984 ret_arr_ptr[i] = ret_conv_8_conv;
38987 FREE(ret_var.data);
38991 void __attribute__((export_name("TS_NodeInfo_set_channels"))) TS_NodeInfo_set_channels(uint64_t this_ptr, int64_tArray val) {
38992 LDKNodeInfo this_ptr_conv;
38993 this_ptr_conv.inner = untag_ptr(this_ptr);
38994 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
38995 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
38996 this_ptr_conv.is_owned = false;
38997 LDKCVec_u64Z val_constr;
38998 val_constr.datalen = val->arr_len;
38999 if (val_constr.datalen > 0)
39000 val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
39002 val_constr.data = NULL;
39003 int64_t* val_vals = val->elems;
39004 for (size_t i = 0; i < val_constr.datalen; i++) {
39005 int64_t val_conv_8 = val_vals[i];
39006 val_constr.data[i] = val_conv_8;
39009 NodeInfo_set_channels(&this_ptr_conv, val_constr);
39012 uint64_t __attribute__((export_name("TS_NodeInfo_get_lowest_inbound_channel_fees"))) TS_NodeInfo_get_lowest_inbound_channel_fees(uint64_t this_ptr) {
39013 LDKNodeInfo this_ptr_conv;
39014 this_ptr_conv.inner = untag_ptr(this_ptr);
39015 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39016 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39017 this_ptr_conv.is_owned = false;
39018 LDKRoutingFees ret_var = NodeInfo_get_lowest_inbound_channel_fees(&this_ptr_conv);
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);
39025 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) {
39026 LDKNodeInfo this_ptr_conv;
39027 this_ptr_conv.inner = untag_ptr(this_ptr);
39028 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39029 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39030 this_ptr_conv.is_owned = false;
39031 LDKRoutingFees val_conv;
39032 val_conv.inner = untag_ptr(val);
39033 val_conv.is_owned = ptr_is_owned(val);
39034 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
39035 val_conv = RoutingFees_clone(&val_conv);
39036 NodeInfo_set_lowest_inbound_channel_fees(&this_ptr_conv, val_conv);
39039 uint64_t __attribute__((export_name("TS_NodeInfo_get_announcement_info"))) TS_NodeInfo_get_announcement_info(uint64_t this_ptr) {
39040 LDKNodeInfo this_ptr_conv;
39041 this_ptr_conv.inner = untag_ptr(this_ptr);
39042 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39043 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39044 this_ptr_conv.is_owned = false;
39045 LDKNodeAnnouncementInfo ret_var = NodeInfo_get_announcement_info(&this_ptr_conv);
39046 uint64_t ret_ref = 0;
39047 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39048 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39052 void __attribute__((export_name("TS_NodeInfo_set_announcement_info"))) TS_NodeInfo_set_announcement_info(uint64_t this_ptr, uint64_t val) {
39053 LDKNodeInfo this_ptr_conv;
39054 this_ptr_conv.inner = untag_ptr(this_ptr);
39055 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39056 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39057 this_ptr_conv.is_owned = false;
39058 LDKNodeAnnouncementInfo val_conv;
39059 val_conv.inner = untag_ptr(val);
39060 val_conv.is_owned = ptr_is_owned(val);
39061 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
39062 val_conv = NodeAnnouncementInfo_clone(&val_conv);
39063 NodeInfo_set_announcement_info(&this_ptr_conv, val_conv);
39066 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) {
39067 LDKCVec_u64Z channels_arg_constr;
39068 channels_arg_constr.datalen = channels_arg->arr_len;
39069 if (channels_arg_constr.datalen > 0)
39070 channels_arg_constr.data = MALLOC(channels_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
39072 channels_arg_constr.data = NULL;
39073 int64_t* channels_arg_vals = channels_arg->elems;
39074 for (size_t i = 0; i < channels_arg_constr.datalen; i++) {
39075 int64_t channels_arg_conv_8 = channels_arg_vals[i];
39076 channels_arg_constr.data[i] = channels_arg_conv_8;
39078 FREE(channels_arg);
39079 LDKRoutingFees lowest_inbound_channel_fees_arg_conv;
39080 lowest_inbound_channel_fees_arg_conv.inner = untag_ptr(lowest_inbound_channel_fees_arg);
39081 lowest_inbound_channel_fees_arg_conv.is_owned = ptr_is_owned(lowest_inbound_channel_fees_arg);
39082 CHECK_INNER_FIELD_ACCESS_OR_NULL(lowest_inbound_channel_fees_arg_conv);
39083 lowest_inbound_channel_fees_arg_conv = RoutingFees_clone(&lowest_inbound_channel_fees_arg_conv);
39084 LDKNodeAnnouncementInfo announcement_info_arg_conv;
39085 announcement_info_arg_conv.inner = untag_ptr(announcement_info_arg);
39086 announcement_info_arg_conv.is_owned = ptr_is_owned(announcement_info_arg);
39087 CHECK_INNER_FIELD_ACCESS_OR_NULL(announcement_info_arg_conv);
39088 announcement_info_arg_conv = NodeAnnouncementInfo_clone(&announcement_info_arg_conv);
39089 LDKNodeInfo ret_var = NodeInfo_new(channels_arg_constr, lowest_inbound_channel_fees_arg_conv, announcement_info_arg_conv);
39090 uint64_t ret_ref = 0;
39091 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39092 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39096 static inline uint64_t NodeInfo_clone_ptr(LDKNodeInfo *NONNULL_PTR arg) {
39097 LDKNodeInfo ret_var = NodeInfo_clone(arg);
39098 uint64_t ret_ref = 0;
39099 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39100 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39103 int64_t __attribute__((export_name("TS_NodeInfo_clone_ptr"))) TS_NodeInfo_clone_ptr(uint64_t arg) {
39104 LDKNodeInfo arg_conv;
39105 arg_conv.inner = untag_ptr(arg);
39106 arg_conv.is_owned = ptr_is_owned(arg);
39107 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
39108 arg_conv.is_owned = false;
39109 int64_t ret_conv = NodeInfo_clone_ptr(&arg_conv);
39113 uint64_t __attribute__((export_name("TS_NodeInfo_clone"))) TS_NodeInfo_clone(uint64_t orig) {
39114 LDKNodeInfo orig_conv;
39115 orig_conv.inner = untag_ptr(orig);
39116 orig_conv.is_owned = ptr_is_owned(orig);
39117 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
39118 orig_conv.is_owned = false;
39119 LDKNodeInfo ret_var = NodeInfo_clone(&orig_conv);
39120 uint64_t ret_ref = 0;
39121 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39122 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39126 int8_tArray __attribute__((export_name("TS_NodeInfo_write"))) TS_NodeInfo_write(uint64_t obj) {
39127 LDKNodeInfo obj_conv;
39128 obj_conv.inner = untag_ptr(obj);
39129 obj_conv.is_owned = ptr_is_owned(obj);
39130 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39131 obj_conv.is_owned = false;
39132 LDKCVec_u8Z ret_var = NodeInfo_write(&obj_conv);
39133 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
39134 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
39135 CVec_u8Z_free(ret_var);
39139 uint64_t __attribute__((export_name("TS_NodeInfo_read"))) TS_NodeInfo_read(int8_tArray ser) {
39140 LDKu8slice ser_ref;
39141 ser_ref.datalen = ser->arr_len;
39142 ser_ref.data = ser->elems;
39143 LDKCResult_NodeInfoDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NodeInfoDecodeErrorZ), "LDKCResult_NodeInfoDecodeErrorZ");
39144 *ret_conv = NodeInfo_read(ser_ref);
39146 return tag_ptr(ret_conv, true);
39149 int8_tArray __attribute__((export_name("TS_NetworkGraph_write"))) TS_NetworkGraph_write(uint64_t obj) {
39150 LDKNetworkGraph obj_conv;
39151 obj_conv.inner = untag_ptr(obj);
39152 obj_conv.is_owned = ptr_is_owned(obj);
39153 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39154 obj_conv.is_owned = false;
39155 LDKCVec_u8Z ret_var = NetworkGraph_write(&obj_conv);
39156 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
39157 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
39158 CVec_u8Z_free(ret_var);
39162 uint64_t __attribute__((export_name("TS_NetworkGraph_read"))) TS_NetworkGraph_read(int8_tArray ser, uint64_t arg) {
39163 LDKu8slice ser_ref;
39164 ser_ref.datalen = ser->arr_len;
39165 ser_ref.data = ser->elems;
39166 void* arg_ptr = untag_ptr(arg);
39167 CHECK_ACCESS(arg_ptr);
39168 LDKLogger arg_conv = *(LDKLogger*)(arg_ptr);
39169 if (arg_conv.free == LDKLogger_JCalls_free) {
39170 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
39171 LDKLogger_JCalls_cloned(&arg_conv);
39173 LDKCResult_NetworkGraphDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NetworkGraphDecodeErrorZ), "LDKCResult_NetworkGraphDecodeErrorZ");
39174 *ret_conv = NetworkGraph_read(ser_ref, arg_conv);
39176 return tag_ptr(ret_conv, true);
39179 uint64_t __attribute__((export_name("TS_NetworkGraph_new"))) TS_NetworkGraph_new(int8_tArray genesis_hash, uint64_t logger) {
39180 LDKThirtyTwoBytes genesis_hash_ref;
39181 CHECK(genesis_hash->arr_len == 32);
39182 memcpy(genesis_hash_ref.data, genesis_hash->elems, 32); FREE(genesis_hash);
39183 void* logger_ptr = untag_ptr(logger);
39184 CHECK_ACCESS(logger_ptr);
39185 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
39186 if (logger_conv.free == LDKLogger_JCalls_free) {
39187 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
39188 LDKLogger_JCalls_cloned(&logger_conv);
39190 LDKNetworkGraph ret_var = NetworkGraph_new(genesis_hash_ref, logger_conv);
39191 uint64_t ret_ref = 0;
39192 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39193 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39197 uint64_t __attribute__((export_name("TS_NetworkGraph_read_only"))) TS_NetworkGraph_read_only(uint64_t this_arg) {
39198 LDKNetworkGraph this_arg_conv;
39199 this_arg_conv.inner = untag_ptr(this_arg);
39200 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39201 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39202 this_arg_conv.is_owned = false;
39203 LDKReadOnlyNetworkGraph ret_var = NetworkGraph_read_only(&this_arg_conv);
39204 uint64_t ret_ref = 0;
39205 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39206 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39210 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) {
39211 LDKNetworkGraph this_arg_conv;
39212 this_arg_conv.inner = untag_ptr(this_arg);
39213 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39214 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39215 this_arg_conv.is_owned = false;
39216 LDKCOption_u32Z *ret_copy = MALLOC(sizeof(LDKCOption_u32Z), "LDKCOption_u32Z");
39217 *ret_copy = NetworkGraph_get_last_rapid_gossip_sync_timestamp(&this_arg_conv);
39218 uint64_t ret_ref = tag_ptr(ret_copy, true);
39222 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) {
39223 LDKNetworkGraph this_arg_conv;
39224 this_arg_conv.inner = untag_ptr(this_arg);
39225 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39226 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39227 this_arg_conv.is_owned = false;
39228 NetworkGraph_set_last_rapid_gossip_sync_timestamp(&this_arg_conv, last_rapid_gossip_sync_timestamp);
39231 uint64_t __attribute__((export_name("TS_NetworkGraph_update_node_from_announcement"))) TS_NetworkGraph_update_node_from_announcement(uint64_t this_arg, uint64_t msg) {
39232 LDKNetworkGraph this_arg_conv;
39233 this_arg_conv.inner = untag_ptr(this_arg);
39234 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39235 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39236 this_arg_conv.is_owned = false;
39237 LDKNodeAnnouncement msg_conv;
39238 msg_conv.inner = untag_ptr(msg);
39239 msg_conv.is_owned = ptr_is_owned(msg);
39240 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
39241 msg_conv.is_owned = false;
39242 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
39243 *ret_conv = NetworkGraph_update_node_from_announcement(&this_arg_conv, &msg_conv);
39244 return tag_ptr(ret_conv, true);
39247 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) {
39248 LDKNetworkGraph this_arg_conv;
39249 this_arg_conv.inner = untag_ptr(this_arg);
39250 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39251 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39252 this_arg_conv.is_owned = false;
39253 LDKUnsignedNodeAnnouncement msg_conv;
39254 msg_conv.inner = untag_ptr(msg);
39255 msg_conv.is_owned = ptr_is_owned(msg);
39256 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
39257 msg_conv.is_owned = false;
39258 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
39259 *ret_conv = NetworkGraph_update_node_from_unsigned_announcement(&this_arg_conv, &msg_conv);
39260 return tag_ptr(ret_conv, true);
39263 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) {
39264 LDKNetworkGraph this_arg_conv;
39265 this_arg_conv.inner = untag_ptr(this_arg);
39266 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39267 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39268 this_arg_conv.is_owned = false;
39269 LDKChannelAnnouncement msg_conv;
39270 msg_conv.inner = untag_ptr(msg);
39271 msg_conv.is_owned = ptr_is_owned(msg);
39272 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
39273 msg_conv.is_owned = false;
39274 void* chain_access_ptr = untag_ptr(chain_access);
39275 CHECK_ACCESS(chain_access_ptr);
39276 LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
39277 // WARNING: we may need a move here but no clone is available for LDKCOption_AccessZ
39278 if (chain_access_conv.tag == LDKCOption_AccessZ_Some) {
39279 // Manually implement clone for Java trait instances
39280 if (chain_access_conv.some.free == LDKAccess_JCalls_free) {
39281 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
39282 LDKAccess_JCalls_cloned(&chain_access_conv.some);
39285 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
39286 *ret_conv = NetworkGraph_update_channel_from_announcement(&this_arg_conv, &msg_conv, chain_access_conv);
39287 return tag_ptr(ret_conv, true);
39290 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) {
39291 LDKNetworkGraph this_arg_conv;
39292 this_arg_conv.inner = untag_ptr(this_arg);
39293 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39294 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39295 this_arg_conv.is_owned = false;
39296 LDKUnsignedChannelAnnouncement msg_conv;
39297 msg_conv.inner = untag_ptr(msg);
39298 msg_conv.is_owned = ptr_is_owned(msg);
39299 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
39300 msg_conv.is_owned = false;
39301 void* chain_access_ptr = untag_ptr(chain_access);
39302 CHECK_ACCESS(chain_access_ptr);
39303 LDKCOption_AccessZ chain_access_conv = *(LDKCOption_AccessZ*)(chain_access_ptr);
39304 // WARNING: we may need a move here but no clone is available for LDKCOption_AccessZ
39305 if (chain_access_conv.tag == LDKCOption_AccessZ_Some) {
39306 // Manually implement clone for Java trait instances
39307 if (chain_access_conv.some.free == LDKAccess_JCalls_free) {
39308 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
39309 LDKAccess_JCalls_cloned(&chain_access_conv.some);
39312 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
39313 *ret_conv = NetworkGraph_update_channel_from_unsigned_announcement(&this_arg_conv, &msg_conv, chain_access_conv);
39314 return tag_ptr(ret_conv, true);
39317 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) {
39318 LDKNetworkGraph this_arg_conv;
39319 this_arg_conv.inner = untag_ptr(this_arg);
39320 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39321 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39322 this_arg_conv.is_owned = false;
39323 LDKChannelFeatures features_conv;
39324 features_conv.inner = untag_ptr(features);
39325 features_conv.is_owned = ptr_is_owned(features);
39326 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_conv);
39327 features_conv = ChannelFeatures_clone(&features_conv);
39328 LDKPublicKey node_id_1_ref;
39329 CHECK(node_id_1->arr_len == 33);
39330 memcpy(node_id_1_ref.compressed_form, node_id_1->elems, 33); FREE(node_id_1);
39331 LDKPublicKey node_id_2_ref;
39332 CHECK(node_id_2->arr_len == 33);
39333 memcpy(node_id_2_ref.compressed_form, node_id_2->elems, 33); FREE(node_id_2);
39334 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
39335 *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);
39336 return tag_ptr(ret_conv, true);
39339 void __attribute__((export_name("TS_NetworkGraph_channel_failed"))) TS_NetworkGraph_channel_failed(uint64_t this_arg, int64_t short_channel_id, jboolean is_permanent) {
39340 LDKNetworkGraph this_arg_conv;
39341 this_arg_conv.inner = untag_ptr(this_arg);
39342 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39343 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39344 this_arg_conv.is_owned = false;
39345 NetworkGraph_channel_failed(&this_arg_conv, short_channel_id, is_permanent);
39348 void __attribute__((export_name("TS_NetworkGraph_node_failed"))) TS_NetworkGraph_node_failed(uint64_t this_arg, int8_tArray _node_id, jboolean is_permanent) {
39349 LDKNetworkGraph this_arg_conv;
39350 this_arg_conv.inner = untag_ptr(this_arg);
39351 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39352 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39353 this_arg_conv.is_owned = false;
39354 LDKPublicKey _node_id_ref;
39355 CHECK(_node_id->arr_len == 33);
39356 memcpy(_node_id_ref.compressed_form, _node_id->elems, 33); FREE(_node_id);
39357 NetworkGraph_node_failed(&this_arg_conv, _node_id_ref, is_permanent);
39360 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) {
39361 LDKNetworkGraph this_arg_conv;
39362 this_arg_conv.inner = untag_ptr(this_arg);
39363 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39364 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39365 this_arg_conv.is_owned = false;
39366 NetworkGraph_remove_stale_channels_with_time(&this_arg_conv, current_time_unix);
39369 uint64_t __attribute__((export_name("TS_NetworkGraph_update_channel"))) TS_NetworkGraph_update_channel(uint64_t this_arg, uint64_t msg) {
39370 LDKNetworkGraph this_arg_conv;
39371 this_arg_conv.inner = untag_ptr(this_arg);
39372 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39373 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39374 this_arg_conv.is_owned = false;
39375 LDKChannelUpdate msg_conv;
39376 msg_conv.inner = untag_ptr(msg);
39377 msg_conv.is_owned = ptr_is_owned(msg);
39378 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
39379 msg_conv.is_owned = false;
39380 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
39381 *ret_conv = NetworkGraph_update_channel(&this_arg_conv, &msg_conv);
39382 return tag_ptr(ret_conv, true);
39385 uint64_t __attribute__((export_name("TS_NetworkGraph_update_channel_unsigned"))) TS_NetworkGraph_update_channel_unsigned(uint64_t this_arg, uint64_t msg) {
39386 LDKNetworkGraph this_arg_conv;
39387 this_arg_conv.inner = untag_ptr(this_arg);
39388 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39389 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39390 this_arg_conv.is_owned = false;
39391 LDKUnsignedChannelUpdate msg_conv;
39392 msg_conv.inner = untag_ptr(msg);
39393 msg_conv.is_owned = ptr_is_owned(msg);
39394 CHECK_INNER_FIELD_ACCESS_OR_NULL(msg_conv);
39395 msg_conv.is_owned = false;
39396 LDKCResult_NoneLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneLightningErrorZ), "LDKCResult_NoneLightningErrorZ");
39397 *ret_conv = NetworkGraph_update_channel_unsigned(&this_arg_conv, &msg_conv);
39398 return tag_ptr(ret_conv, true);
39401 uint64_t __attribute__((export_name("TS_ReadOnlyNetworkGraph_channel"))) TS_ReadOnlyNetworkGraph_channel(uint64_t this_arg, int64_t short_channel_id) {
39402 LDKReadOnlyNetworkGraph this_arg_conv;
39403 this_arg_conv.inner = untag_ptr(this_arg);
39404 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39405 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39406 this_arg_conv.is_owned = false;
39407 LDKChannelInfo ret_var = ReadOnlyNetworkGraph_channel(&this_arg_conv, short_channel_id);
39408 uint64_t ret_ref = 0;
39409 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39410 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39414 int64_tArray __attribute__((export_name("TS_ReadOnlyNetworkGraph_list_channels"))) TS_ReadOnlyNetworkGraph_list_channels(uint64_t this_arg) {
39415 LDKReadOnlyNetworkGraph this_arg_conv;
39416 this_arg_conv.inner = untag_ptr(this_arg);
39417 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39418 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39419 this_arg_conv.is_owned = false;
39420 LDKCVec_u64Z ret_var = ReadOnlyNetworkGraph_list_channels(&this_arg_conv);
39421 int64_tArray ret_arr = NULL;
39422 ret_arr = init_int64_tArray(ret_var.datalen, __LINE__);
39423 int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8);
39424 for (size_t i = 0; i < ret_var.datalen; i++) {
39425 int64_t ret_conv_8_conv = ret_var.data[i];
39426 ret_arr_ptr[i] = ret_conv_8_conv;
39429 FREE(ret_var.data);
39433 uint64_t __attribute__((export_name("TS_ReadOnlyNetworkGraph_node"))) TS_ReadOnlyNetworkGraph_node(uint64_t this_arg, uint64_t node_id) {
39434 LDKReadOnlyNetworkGraph this_arg_conv;
39435 this_arg_conv.inner = untag_ptr(this_arg);
39436 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39437 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39438 this_arg_conv.is_owned = false;
39439 LDKNodeId node_id_conv;
39440 node_id_conv.inner = untag_ptr(node_id);
39441 node_id_conv.is_owned = ptr_is_owned(node_id);
39442 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv);
39443 node_id_conv.is_owned = false;
39444 LDKNodeInfo ret_var = ReadOnlyNetworkGraph_node(&this_arg_conv, &node_id_conv);
39445 uint64_t ret_ref = 0;
39446 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39447 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39451 uint64_tArray __attribute__((export_name("TS_ReadOnlyNetworkGraph_list_nodes"))) TS_ReadOnlyNetworkGraph_list_nodes(uint64_t this_arg) {
39452 LDKReadOnlyNetworkGraph this_arg_conv;
39453 this_arg_conv.inner = untag_ptr(this_arg);
39454 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39455 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39456 this_arg_conv.is_owned = false;
39457 LDKCVec_NodeIdZ ret_var = ReadOnlyNetworkGraph_list_nodes(&this_arg_conv);
39458 uint64_tArray ret_arr = NULL;
39459 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
39460 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
39461 for (size_t i = 0; i < ret_var.datalen; i++) {
39462 LDKNodeId ret_conv_8_var = ret_var.data[i];
39463 uint64_t ret_conv_8_ref = 0;
39464 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_8_var);
39465 ret_conv_8_ref = tag_ptr(ret_conv_8_var.inner, ret_conv_8_var.is_owned);
39466 ret_arr_ptr[i] = ret_conv_8_ref;
39469 FREE(ret_var.data);
39473 uint64_t __attribute__((export_name("TS_ReadOnlyNetworkGraph_get_addresses"))) TS_ReadOnlyNetworkGraph_get_addresses(uint64_t this_arg, int8_tArray pubkey) {
39474 LDKReadOnlyNetworkGraph this_arg_conv;
39475 this_arg_conv.inner = untag_ptr(this_arg);
39476 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39477 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39478 this_arg_conv.is_owned = false;
39479 LDKPublicKey pubkey_ref;
39480 CHECK(pubkey->arr_len == 33);
39481 memcpy(pubkey_ref.compressed_form, pubkey->elems, 33); FREE(pubkey);
39482 LDKCOption_CVec_NetAddressZZ *ret_copy = MALLOC(sizeof(LDKCOption_CVec_NetAddressZZ), "LDKCOption_CVec_NetAddressZZ");
39483 *ret_copy = ReadOnlyNetworkGraph_get_addresses(&this_arg_conv, pubkey_ref);
39484 uint64_t ret_ref = tag_ptr(ret_copy, true);
39488 void __attribute__((export_name("TS_RouteHop_free"))) TS_RouteHop_free(uint64_t this_obj) {
39489 LDKRouteHop this_obj_conv;
39490 this_obj_conv.inner = untag_ptr(this_obj);
39491 this_obj_conv.is_owned = ptr_is_owned(this_obj);
39492 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
39493 RouteHop_free(this_obj_conv);
39496 int8_tArray __attribute__((export_name("TS_RouteHop_get_pubkey"))) TS_RouteHop_get_pubkey(uint64_t this_ptr) {
39497 LDKRouteHop this_ptr_conv;
39498 this_ptr_conv.inner = untag_ptr(this_ptr);
39499 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39500 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39501 this_ptr_conv.is_owned = false;
39502 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
39503 memcpy(ret_arr->elems, RouteHop_get_pubkey(&this_ptr_conv).compressed_form, 33);
39507 void __attribute__((export_name("TS_RouteHop_set_pubkey"))) TS_RouteHop_set_pubkey(uint64_t this_ptr, int8_tArray val) {
39508 LDKRouteHop this_ptr_conv;
39509 this_ptr_conv.inner = untag_ptr(this_ptr);
39510 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39511 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39512 this_ptr_conv.is_owned = false;
39513 LDKPublicKey val_ref;
39514 CHECK(val->arr_len == 33);
39515 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
39516 RouteHop_set_pubkey(&this_ptr_conv, val_ref);
39519 uint64_t __attribute__((export_name("TS_RouteHop_get_node_features"))) TS_RouteHop_get_node_features(uint64_t this_ptr) {
39520 LDKRouteHop this_ptr_conv;
39521 this_ptr_conv.inner = untag_ptr(this_ptr);
39522 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39523 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39524 this_ptr_conv.is_owned = false;
39525 LDKNodeFeatures ret_var = RouteHop_get_node_features(&this_ptr_conv);
39526 uint64_t ret_ref = 0;
39527 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39528 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39532 void __attribute__((export_name("TS_RouteHop_set_node_features"))) TS_RouteHop_set_node_features(uint64_t this_ptr, uint64_t val) {
39533 LDKRouteHop this_ptr_conv;
39534 this_ptr_conv.inner = untag_ptr(this_ptr);
39535 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39536 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39537 this_ptr_conv.is_owned = false;
39538 LDKNodeFeatures val_conv;
39539 val_conv.inner = untag_ptr(val);
39540 val_conv.is_owned = ptr_is_owned(val);
39541 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
39542 val_conv = NodeFeatures_clone(&val_conv);
39543 RouteHop_set_node_features(&this_ptr_conv, val_conv);
39546 int64_t __attribute__((export_name("TS_RouteHop_get_short_channel_id"))) TS_RouteHop_get_short_channel_id(uint64_t this_ptr) {
39547 LDKRouteHop this_ptr_conv;
39548 this_ptr_conv.inner = untag_ptr(this_ptr);
39549 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39550 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39551 this_ptr_conv.is_owned = false;
39552 int64_t ret_conv = RouteHop_get_short_channel_id(&this_ptr_conv);
39556 void __attribute__((export_name("TS_RouteHop_set_short_channel_id"))) TS_RouteHop_set_short_channel_id(uint64_t this_ptr, int64_t val) {
39557 LDKRouteHop this_ptr_conv;
39558 this_ptr_conv.inner = untag_ptr(this_ptr);
39559 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39560 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39561 this_ptr_conv.is_owned = false;
39562 RouteHop_set_short_channel_id(&this_ptr_conv, val);
39565 uint64_t __attribute__((export_name("TS_RouteHop_get_channel_features"))) TS_RouteHop_get_channel_features(uint64_t this_ptr) {
39566 LDKRouteHop this_ptr_conv;
39567 this_ptr_conv.inner = untag_ptr(this_ptr);
39568 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39569 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39570 this_ptr_conv.is_owned = false;
39571 LDKChannelFeatures ret_var = RouteHop_get_channel_features(&this_ptr_conv);
39572 uint64_t ret_ref = 0;
39573 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39574 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39578 void __attribute__((export_name("TS_RouteHop_set_channel_features"))) TS_RouteHop_set_channel_features(uint64_t this_ptr, uint64_t val) {
39579 LDKRouteHop this_ptr_conv;
39580 this_ptr_conv.inner = untag_ptr(this_ptr);
39581 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39582 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39583 this_ptr_conv.is_owned = false;
39584 LDKChannelFeatures val_conv;
39585 val_conv.inner = untag_ptr(val);
39586 val_conv.is_owned = ptr_is_owned(val);
39587 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
39588 val_conv = ChannelFeatures_clone(&val_conv);
39589 RouteHop_set_channel_features(&this_ptr_conv, val_conv);
39592 int64_t __attribute__((export_name("TS_RouteHop_get_fee_msat"))) TS_RouteHop_get_fee_msat(uint64_t this_ptr) {
39593 LDKRouteHop this_ptr_conv;
39594 this_ptr_conv.inner = untag_ptr(this_ptr);
39595 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39596 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39597 this_ptr_conv.is_owned = false;
39598 int64_t ret_conv = RouteHop_get_fee_msat(&this_ptr_conv);
39602 void __attribute__((export_name("TS_RouteHop_set_fee_msat"))) TS_RouteHop_set_fee_msat(uint64_t this_ptr, int64_t val) {
39603 LDKRouteHop this_ptr_conv;
39604 this_ptr_conv.inner = untag_ptr(this_ptr);
39605 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39606 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39607 this_ptr_conv.is_owned = false;
39608 RouteHop_set_fee_msat(&this_ptr_conv, val);
39611 int32_t __attribute__((export_name("TS_RouteHop_get_cltv_expiry_delta"))) TS_RouteHop_get_cltv_expiry_delta(uint64_t this_ptr) {
39612 LDKRouteHop this_ptr_conv;
39613 this_ptr_conv.inner = untag_ptr(this_ptr);
39614 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39615 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39616 this_ptr_conv.is_owned = false;
39617 int32_t ret_conv = RouteHop_get_cltv_expiry_delta(&this_ptr_conv);
39621 void __attribute__((export_name("TS_RouteHop_set_cltv_expiry_delta"))) TS_RouteHop_set_cltv_expiry_delta(uint64_t this_ptr, int32_t val) {
39622 LDKRouteHop this_ptr_conv;
39623 this_ptr_conv.inner = untag_ptr(this_ptr);
39624 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39625 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39626 this_ptr_conv.is_owned = false;
39627 RouteHop_set_cltv_expiry_delta(&this_ptr_conv, val);
39630 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) {
39631 LDKPublicKey pubkey_arg_ref;
39632 CHECK(pubkey_arg->arr_len == 33);
39633 memcpy(pubkey_arg_ref.compressed_form, pubkey_arg->elems, 33); FREE(pubkey_arg);
39634 LDKNodeFeatures node_features_arg_conv;
39635 node_features_arg_conv.inner = untag_ptr(node_features_arg);
39636 node_features_arg_conv.is_owned = ptr_is_owned(node_features_arg);
39637 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_features_arg_conv);
39638 node_features_arg_conv = NodeFeatures_clone(&node_features_arg_conv);
39639 LDKChannelFeatures channel_features_arg_conv;
39640 channel_features_arg_conv.inner = untag_ptr(channel_features_arg);
39641 channel_features_arg_conv.is_owned = ptr_is_owned(channel_features_arg);
39642 CHECK_INNER_FIELD_ACCESS_OR_NULL(channel_features_arg_conv);
39643 channel_features_arg_conv = ChannelFeatures_clone(&channel_features_arg_conv);
39644 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);
39645 uint64_t ret_ref = 0;
39646 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39647 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39651 static inline uint64_t RouteHop_clone_ptr(LDKRouteHop *NONNULL_PTR arg) {
39652 LDKRouteHop ret_var = RouteHop_clone(arg);
39653 uint64_t ret_ref = 0;
39654 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39655 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39658 int64_t __attribute__((export_name("TS_RouteHop_clone_ptr"))) TS_RouteHop_clone_ptr(uint64_t arg) {
39659 LDKRouteHop arg_conv;
39660 arg_conv.inner = untag_ptr(arg);
39661 arg_conv.is_owned = ptr_is_owned(arg);
39662 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
39663 arg_conv.is_owned = false;
39664 int64_t ret_conv = RouteHop_clone_ptr(&arg_conv);
39668 uint64_t __attribute__((export_name("TS_RouteHop_clone"))) TS_RouteHop_clone(uint64_t orig) {
39669 LDKRouteHop orig_conv;
39670 orig_conv.inner = untag_ptr(orig);
39671 orig_conv.is_owned = ptr_is_owned(orig);
39672 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
39673 orig_conv.is_owned = false;
39674 LDKRouteHop ret_var = RouteHop_clone(&orig_conv);
39675 uint64_t ret_ref = 0;
39676 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39677 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39681 int64_t __attribute__((export_name("TS_RouteHop_hash"))) TS_RouteHop_hash(uint64_t o) {
39682 LDKRouteHop o_conv;
39683 o_conv.inner = untag_ptr(o);
39684 o_conv.is_owned = ptr_is_owned(o);
39685 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
39686 o_conv.is_owned = false;
39687 int64_t ret_conv = RouteHop_hash(&o_conv);
39691 jboolean __attribute__((export_name("TS_RouteHop_eq"))) TS_RouteHop_eq(uint64_t a, uint64_t b) {
39692 LDKRouteHop a_conv;
39693 a_conv.inner = untag_ptr(a);
39694 a_conv.is_owned = ptr_is_owned(a);
39695 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
39696 a_conv.is_owned = false;
39697 LDKRouteHop b_conv;
39698 b_conv.inner = untag_ptr(b);
39699 b_conv.is_owned = ptr_is_owned(b);
39700 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
39701 b_conv.is_owned = false;
39702 jboolean ret_conv = RouteHop_eq(&a_conv, &b_conv);
39706 int8_tArray __attribute__((export_name("TS_RouteHop_write"))) TS_RouteHop_write(uint64_t obj) {
39707 LDKRouteHop obj_conv;
39708 obj_conv.inner = untag_ptr(obj);
39709 obj_conv.is_owned = ptr_is_owned(obj);
39710 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39711 obj_conv.is_owned = false;
39712 LDKCVec_u8Z ret_var = RouteHop_write(&obj_conv);
39713 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
39714 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
39715 CVec_u8Z_free(ret_var);
39719 uint64_t __attribute__((export_name("TS_RouteHop_read"))) TS_RouteHop_read(int8_tArray ser) {
39720 LDKu8slice ser_ref;
39721 ser_ref.datalen = ser->arr_len;
39722 ser_ref.data = ser->elems;
39723 LDKCResult_RouteHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHopDecodeErrorZ), "LDKCResult_RouteHopDecodeErrorZ");
39724 *ret_conv = RouteHop_read(ser_ref);
39726 return tag_ptr(ret_conv, true);
39729 void __attribute__((export_name("TS_Route_free"))) TS_Route_free(uint64_t this_obj) {
39730 LDKRoute this_obj_conv;
39731 this_obj_conv.inner = untag_ptr(this_obj);
39732 this_obj_conv.is_owned = ptr_is_owned(this_obj);
39733 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
39734 Route_free(this_obj_conv);
39737 ptrArray __attribute__((export_name("TS_Route_get_paths"))) TS_Route_get_paths(uint64_t this_ptr) {
39738 LDKRoute this_ptr_conv;
39739 this_ptr_conv.inner = untag_ptr(this_ptr);
39740 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39741 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39742 this_ptr_conv.is_owned = false;
39743 LDKCVec_CVec_RouteHopZZ ret_var = Route_get_paths(&this_ptr_conv);
39744 ptrArray ret_arr = NULL;
39745 ret_arr = init_ptrArray(ret_var.datalen, __LINE__);
39746 uint64_tArray *ret_arr_ptr = (uint64_tArray*)(((uint8_t*)ret_arr) + 8);
39747 for (size_t m = 0; m < ret_var.datalen; m++) {
39748 LDKCVec_RouteHopZ ret_conv_12_var = ret_var.data[m];
39749 uint64_tArray ret_conv_12_arr = NULL;
39750 ret_conv_12_arr = init_uint64_tArray(ret_conv_12_var.datalen, __LINE__);
39751 uint64_t *ret_conv_12_arr_ptr = (uint64_t*)(((uint8_t*)ret_conv_12_arr) + 8);
39752 for (size_t k = 0; k < ret_conv_12_var.datalen; k++) {
39753 LDKRouteHop ret_conv_12_conv_10_var = ret_conv_12_var.data[k];
39754 uint64_t ret_conv_12_conv_10_ref = 0;
39755 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_12_conv_10_var);
39756 ret_conv_12_conv_10_ref = tag_ptr(ret_conv_12_conv_10_var.inner, ret_conv_12_conv_10_var.is_owned);
39757 ret_conv_12_arr_ptr[k] = ret_conv_12_conv_10_ref;
39760 FREE(ret_conv_12_var.data);
39761 ret_arr_ptr[m] = ret_conv_12_arr;
39764 FREE(ret_var.data);
39768 void __attribute__((export_name("TS_Route_set_paths"))) TS_Route_set_paths(uint64_t this_ptr, ptrArray val) {
39769 LDKRoute this_ptr_conv;
39770 this_ptr_conv.inner = untag_ptr(this_ptr);
39771 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39772 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39773 this_ptr_conv.is_owned = false;
39774 LDKCVec_CVec_RouteHopZZ val_constr;
39775 val_constr.datalen = val->arr_len;
39776 if (val_constr.datalen > 0)
39777 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKCVec_RouteHopZ), "LDKCVec_CVec_RouteHopZZ Elements");
39779 val_constr.data = NULL;
39780 uint64_tArray* val_vals = (void*) val->elems;
39781 for (size_t m = 0; m < val_constr.datalen; m++) {
39782 uint64_tArray val_conv_12 = val_vals[m];
39783 LDKCVec_RouteHopZ val_conv_12_constr;
39784 val_conv_12_constr.datalen = val_conv_12->arr_len;
39785 if (val_conv_12_constr.datalen > 0)
39786 val_conv_12_constr.data = MALLOC(val_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
39788 val_conv_12_constr.data = NULL;
39789 uint64_t* val_conv_12_vals = val_conv_12->elems;
39790 for (size_t k = 0; k < val_conv_12_constr.datalen; k++) {
39791 uint64_t val_conv_12_conv_10 = val_conv_12_vals[k];
39792 LDKRouteHop val_conv_12_conv_10_conv;
39793 val_conv_12_conv_10_conv.inner = untag_ptr(val_conv_12_conv_10);
39794 val_conv_12_conv_10_conv.is_owned = ptr_is_owned(val_conv_12_conv_10);
39795 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_12_conv_10_conv);
39796 val_conv_12_conv_10_conv = RouteHop_clone(&val_conv_12_conv_10_conv);
39797 val_conv_12_constr.data[k] = val_conv_12_conv_10_conv;
39800 val_constr.data[m] = val_conv_12_constr;
39803 Route_set_paths(&this_ptr_conv, val_constr);
39806 uint64_t __attribute__((export_name("TS_Route_get_payment_params"))) TS_Route_get_payment_params(uint64_t this_ptr) {
39807 LDKRoute this_ptr_conv;
39808 this_ptr_conv.inner = untag_ptr(this_ptr);
39809 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39810 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39811 this_ptr_conv.is_owned = false;
39812 LDKPaymentParameters ret_var = Route_get_payment_params(&this_ptr_conv);
39813 uint64_t ret_ref = 0;
39814 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39815 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39819 void __attribute__((export_name("TS_Route_set_payment_params"))) TS_Route_set_payment_params(uint64_t this_ptr, uint64_t val) {
39820 LDKRoute this_ptr_conv;
39821 this_ptr_conv.inner = untag_ptr(this_ptr);
39822 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39823 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39824 this_ptr_conv.is_owned = false;
39825 LDKPaymentParameters val_conv;
39826 val_conv.inner = untag_ptr(val);
39827 val_conv.is_owned = ptr_is_owned(val);
39828 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
39829 val_conv = PaymentParameters_clone(&val_conv);
39830 Route_set_payment_params(&this_ptr_conv, val_conv);
39833 uint64_t __attribute__((export_name("TS_Route_new"))) TS_Route_new(ptrArray paths_arg, uint64_t payment_params_arg) {
39834 LDKCVec_CVec_RouteHopZZ paths_arg_constr;
39835 paths_arg_constr.datalen = paths_arg->arr_len;
39836 if (paths_arg_constr.datalen > 0)
39837 paths_arg_constr.data = MALLOC(paths_arg_constr.datalen * sizeof(LDKCVec_RouteHopZ), "LDKCVec_CVec_RouteHopZZ Elements");
39839 paths_arg_constr.data = NULL;
39840 uint64_tArray* paths_arg_vals = (void*) paths_arg->elems;
39841 for (size_t m = 0; m < paths_arg_constr.datalen; m++) {
39842 uint64_tArray paths_arg_conv_12 = paths_arg_vals[m];
39843 LDKCVec_RouteHopZ paths_arg_conv_12_constr;
39844 paths_arg_conv_12_constr.datalen = paths_arg_conv_12->arr_len;
39845 if (paths_arg_conv_12_constr.datalen > 0)
39846 paths_arg_conv_12_constr.data = MALLOC(paths_arg_conv_12_constr.datalen * sizeof(LDKRouteHop), "LDKCVec_RouteHopZ Elements");
39848 paths_arg_conv_12_constr.data = NULL;
39849 uint64_t* paths_arg_conv_12_vals = paths_arg_conv_12->elems;
39850 for (size_t k = 0; k < paths_arg_conv_12_constr.datalen; k++) {
39851 uint64_t paths_arg_conv_12_conv_10 = paths_arg_conv_12_vals[k];
39852 LDKRouteHop paths_arg_conv_12_conv_10_conv;
39853 paths_arg_conv_12_conv_10_conv.inner = untag_ptr(paths_arg_conv_12_conv_10);
39854 paths_arg_conv_12_conv_10_conv.is_owned = ptr_is_owned(paths_arg_conv_12_conv_10);
39855 CHECK_INNER_FIELD_ACCESS_OR_NULL(paths_arg_conv_12_conv_10_conv);
39856 paths_arg_conv_12_conv_10_conv = RouteHop_clone(&paths_arg_conv_12_conv_10_conv);
39857 paths_arg_conv_12_constr.data[k] = paths_arg_conv_12_conv_10_conv;
39859 FREE(paths_arg_conv_12);
39860 paths_arg_constr.data[m] = paths_arg_conv_12_constr;
39863 LDKPaymentParameters payment_params_arg_conv;
39864 payment_params_arg_conv.inner = untag_ptr(payment_params_arg);
39865 payment_params_arg_conv.is_owned = ptr_is_owned(payment_params_arg);
39866 CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_params_arg_conv);
39867 payment_params_arg_conv = PaymentParameters_clone(&payment_params_arg_conv);
39868 LDKRoute ret_var = Route_new(paths_arg_constr, payment_params_arg_conv);
39869 uint64_t ret_ref = 0;
39870 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39871 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39875 static inline uint64_t Route_clone_ptr(LDKRoute *NONNULL_PTR arg) {
39876 LDKRoute ret_var = Route_clone(arg);
39877 uint64_t ret_ref = 0;
39878 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39879 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39882 int64_t __attribute__((export_name("TS_Route_clone_ptr"))) TS_Route_clone_ptr(uint64_t arg) {
39884 arg_conv.inner = untag_ptr(arg);
39885 arg_conv.is_owned = ptr_is_owned(arg);
39886 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
39887 arg_conv.is_owned = false;
39888 int64_t ret_conv = Route_clone_ptr(&arg_conv);
39892 uint64_t __attribute__((export_name("TS_Route_clone"))) TS_Route_clone(uint64_t orig) {
39893 LDKRoute orig_conv;
39894 orig_conv.inner = untag_ptr(orig);
39895 orig_conv.is_owned = ptr_is_owned(orig);
39896 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
39897 orig_conv.is_owned = false;
39898 LDKRoute ret_var = Route_clone(&orig_conv);
39899 uint64_t ret_ref = 0;
39900 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39901 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39905 int64_t __attribute__((export_name("TS_Route_hash"))) TS_Route_hash(uint64_t o) {
39907 o_conv.inner = untag_ptr(o);
39908 o_conv.is_owned = ptr_is_owned(o);
39909 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
39910 o_conv.is_owned = false;
39911 int64_t ret_conv = Route_hash(&o_conv);
39915 jboolean __attribute__((export_name("TS_Route_eq"))) TS_Route_eq(uint64_t a, uint64_t b) {
39917 a_conv.inner = untag_ptr(a);
39918 a_conv.is_owned = ptr_is_owned(a);
39919 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
39920 a_conv.is_owned = false;
39922 b_conv.inner = untag_ptr(b);
39923 b_conv.is_owned = ptr_is_owned(b);
39924 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
39925 b_conv.is_owned = false;
39926 jboolean ret_conv = Route_eq(&a_conv, &b_conv);
39930 int64_t __attribute__((export_name("TS_Route_get_total_fees"))) TS_Route_get_total_fees(uint64_t this_arg) {
39931 LDKRoute this_arg_conv;
39932 this_arg_conv.inner = untag_ptr(this_arg);
39933 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39934 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39935 this_arg_conv.is_owned = false;
39936 int64_t ret_conv = Route_get_total_fees(&this_arg_conv);
39940 int64_t __attribute__((export_name("TS_Route_get_total_amount"))) TS_Route_get_total_amount(uint64_t this_arg) {
39941 LDKRoute this_arg_conv;
39942 this_arg_conv.inner = untag_ptr(this_arg);
39943 this_arg_conv.is_owned = ptr_is_owned(this_arg);
39944 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
39945 this_arg_conv.is_owned = false;
39946 int64_t ret_conv = Route_get_total_amount(&this_arg_conv);
39950 int8_tArray __attribute__((export_name("TS_Route_write"))) TS_Route_write(uint64_t obj) {
39952 obj_conv.inner = untag_ptr(obj);
39953 obj_conv.is_owned = ptr_is_owned(obj);
39954 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
39955 obj_conv.is_owned = false;
39956 LDKCVec_u8Z ret_var = Route_write(&obj_conv);
39957 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
39958 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
39959 CVec_u8Z_free(ret_var);
39963 uint64_t __attribute__((export_name("TS_Route_read"))) TS_Route_read(int8_tArray ser) {
39964 LDKu8slice ser_ref;
39965 ser_ref.datalen = ser->arr_len;
39966 ser_ref.data = ser->elems;
39967 LDKCResult_RouteDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteDecodeErrorZ), "LDKCResult_RouteDecodeErrorZ");
39968 *ret_conv = Route_read(ser_ref);
39970 return tag_ptr(ret_conv, true);
39973 void __attribute__((export_name("TS_RouteParameters_free"))) TS_RouteParameters_free(uint64_t this_obj) {
39974 LDKRouteParameters this_obj_conv;
39975 this_obj_conv.inner = untag_ptr(this_obj);
39976 this_obj_conv.is_owned = ptr_is_owned(this_obj);
39977 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
39978 RouteParameters_free(this_obj_conv);
39981 uint64_t __attribute__((export_name("TS_RouteParameters_get_payment_params"))) TS_RouteParameters_get_payment_params(uint64_t this_ptr) {
39982 LDKRouteParameters this_ptr_conv;
39983 this_ptr_conv.inner = untag_ptr(this_ptr);
39984 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39985 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39986 this_ptr_conv.is_owned = false;
39987 LDKPaymentParameters ret_var = RouteParameters_get_payment_params(&this_ptr_conv);
39988 uint64_t ret_ref = 0;
39989 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
39990 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
39994 void __attribute__((export_name("TS_RouteParameters_set_payment_params"))) TS_RouteParameters_set_payment_params(uint64_t this_ptr, uint64_t val) {
39995 LDKRouteParameters this_ptr_conv;
39996 this_ptr_conv.inner = untag_ptr(this_ptr);
39997 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
39998 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
39999 this_ptr_conv.is_owned = false;
40000 LDKPaymentParameters val_conv;
40001 val_conv.inner = untag_ptr(val);
40002 val_conv.is_owned = ptr_is_owned(val);
40003 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
40004 val_conv = PaymentParameters_clone(&val_conv);
40005 RouteParameters_set_payment_params(&this_ptr_conv, val_conv);
40008 int64_t __attribute__((export_name("TS_RouteParameters_get_final_value_msat"))) TS_RouteParameters_get_final_value_msat(uint64_t this_ptr) {
40009 LDKRouteParameters this_ptr_conv;
40010 this_ptr_conv.inner = untag_ptr(this_ptr);
40011 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40012 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40013 this_ptr_conv.is_owned = false;
40014 int64_t ret_conv = RouteParameters_get_final_value_msat(&this_ptr_conv);
40018 void __attribute__((export_name("TS_RouteParameters_set_final_value_msat"))) TS_RouteParameters_set_final_value_msat(uint64_t this_ptr, int64_t val) {
40019 LDKRouteParameters this_ptr_conv;
40020 this_ptr_conv.inner = untag_ptr(this_ptr);
40021 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40022 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40023 this_ptr_conv.is_owned = false;
40024 RouteParameters_set_final_value_msat(&this_ptr_conv, val);
40027 int32_t __attribute__((export_name("TS_RouteParameters_get_final_cltv_expiry_delta"))) TS_RouteParameters_get_final_cltv_expiry_delta(uint64_t this_ptr) {
40028 LDKRouteParameters this_ptr_conv;
40029 this_ptr_conv.inner = untag_ptr(this_ptr);
40030 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40031 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40032 this_ptr_conv.is_owned = false;
40033 int32_t ret_conv = RouteParameters_get_final_cltv_expiry_delta(&this_ptr_conv);
40037 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) {
40038 LDKRouteParameters this_ptr_conv;
40039 this_ptr_conv.inner = untag_ptr(this_ptr);
40040 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40041 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40042 this_ptr_conv.is_owned = false;
40043 RouteParameters_set_final_cltv_expiry_delta(&this_ptr_conv, val);
40046 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) {
40047 LDKPaymentParameters payment_params_arg_conv;
40048 payment_params_arg_conv.inner = untag_ptr(payment_params_arg);
40049 payment_params_arg_conv.is_owned = ptr_is_owned(payment_params_arg);
40050 CHECK_INNER_FIELD_ACCESS_OR_NULL(payment_params_arg_conv);
40051 payment_params_arg_conv = PaymentParameters_clone(&payment_params_arg_conv);
40052 LDKRouteParameters ret_var = RouteParameters_new(payment_params_arg_conv, final_value_msat_arg, final_cltv_expiry_delta_arg);
40053 uint64_t ret_ref = 0;
40054 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40055 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40059 static inline uint64_t RouteParameters_clone_ptr(LDKRouteParameters *NONNULL_PTR arg) {
40060 LDKRouteParameters ret_var = RouteParameters_clone(arg);
40061 uint64_t ret_ref = 0;
40062 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40063 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40066 int64_t __attribute__((export_name("TS_RouteParameters_clone_ptr"))) TS_RouteParameters_clone_ptr(uint64_t arg) {
40067 LDKRouteParameters arg_conv;
40068 arg_conv.inner = untag_ptr(arg);
40069 arg_conv.is_owned = ptr_is_owned(arg);
40070 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
40071 arg_conv.is_owned = false;
40072 int64_t ret_conv = RouteParameters_clone_ptr(&arg_conv);
40076 uint64_t __attribute__((export_name("TS_RouteParameters_clone"))) TS_RouteParameters_clone(uint64_t orig) {
40077 LDKRouteParameters orig_conv;
40078 orig_conv.inner = untag_ptr(orig);
40079 orig_conv.is_owned = ptr_is_owned(orig);
40080 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
40081 orig_conv.is_owned = false;
40082 LDKRouteParameters ret_var = RouteParameters_clone(&orig_conv);
40083 uint64_t ret_ref = 0;
40084 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40085 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40089 int8_tArray __attribute__((export_name("TS_RouteParameters_write"))) TS_RouteParameters_write(uint64_t obj) {
40090 LDKRouteParameters obj_conv;
40091 obj_conv.inner = untag_ptr(obj);
40092 obj_conv.is_owned = ptr_is_owned(obj);
40093 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
40094 obj_conv.is_owned = false;
40095 LDKCVec_u8Z ret_var = RouteParameters_write(&obj_conv);
40096 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
40097 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
40098 CVec_u8Z_free(ret_var);
40102 uint64_t __attribute__((export_name("TS_RouteParameters_read"))) TS_RouteParameters_read(int8_tArray ser) {
40103 LDKu8slice ser_ref;
40104 ser_ref.datalen = ser->arr_len;
40105 ser_ref.data = ser->elems;
40106 LDKCResult_RouteParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteParametersDecodeErrorZ), "LDKCResult_RouteParametersDecodeErrorZ");
40107 *ret_conv = RouteParameters_read(ser_ref);
40109 return tag_ptr(ret_conv, true);
40112 void __attribute__((export_name("TS_PaymentParameters_free"))) TS_PaymentParameters_free(uint64_t this_obj) {
40113 LDKPaymentParameters this_obj_conv;
40114 this_obj_conv.inner = untag_ptr(this_obj);
40115 this_obj_conv.is_owned = ptr_is_owned(this_obj);
40116 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
40117 PaymentParameters_free(this_obj_conv);
40120 int8_tArray __attribute__((export_name("TS_PaymentParameters_get_payee_pubkey"))) TS_PaymentParameters_get_payee_pubkey(uint64_t this_ptr) {
40121 LDKPaymentParameters this_ptr_conv;
40122 this_ptr_conv.inner = untag_ptr(this_ptr);
40123 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40124 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40125 this_ptr_conv.is_owned = false;
40126 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
40127 memcpy(ret_arr->elems, PaymentParameters_get_payee_pubkey(&this_ptr_conv).compressed_form, 33);
40131 void __attribute__((export_name("TS_PaymentParameters_set_payee_pubkey"))) TS_PaymentParameters_set_payee_pubkey(uint64_t this_ptr, int8_tArray val) {
40132 LDKPaymentParameters this_ptr_conv;
40133 this_ptr_conv.inner = untag_ptr(this_ptr);
40134 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40135 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40136 this_ptr_conv.is_owned = false;
40137 LDKPublicKey val_ref;
40138 CHECK(val->arr_len == 33);
40139 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
40140 PaymentParameters_set_payee_pubkey(&this_ptr_conv, val_ref);
40143 uint64_t __attribute__((export_name("TS_PaymentParameters_get_features"))) TS_PaymentParameters_get_features(uint64_t this_ptr) {
40144 LDKPaymentParameters this_ptr_conv;
40145 this_ptr_conv.inner = untag_ptr(this_ptr);
40146 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40147 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40148 this_ptr_conv.is_owned = false;
40149 LDKInvoiceFeatures ret_var = PaymentParameters_get_features(&this_ptr_conv);
40150 uint64_t ret_ref = 0;
40151 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40152 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40156 void __attribute__((export_name("TS_PaymentParameters_set_features"))) TS_PaymentParameters_set_features(uint64_t this_ptr, uint64_t val) {
40157 LDKPaymentParameters this_ptr_conv;
40158 this_ptr_conv.inner = untag_ptr(this_ptr);
40159 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40160 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40161 this_ptr_conv.is_owned = false;
40162 LDKInvoiceFeatures val_conv;
40163 val_conv.inner = untag_ptr(val);
40164 val_conv.is_owned = ptr_is_owned(val);
40165 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
40166 val_conv = InvoiceFeatures_clone(&val_conv);
40167 PaymentParameters_set_features(&this_ptr_conv, val_conv);
40170 uint64_tArray __attribute__((export_name("TS_PaymentParameters_get_route_hints"))) TS_PaymentParameters_get_route_hints(uint64_t this_ptr) {
40171 LDKPaymentParameters this_ptr_conv;
40172 this_ptr_conv.inner = untag_ptr(this_ptr);
40173 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40174 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40175 this_ptr_conv.is_owned = false;
40176 LDKCVec_RouteHintZ ret_var = PaymentParameters_get_route_hints(&this_ptr_conv);
40177 uint64_tArray ret_arr = NULL;
40178 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
40179 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
40180 for (size_t l = 0; l < ret_var.datalen; l++) {
40181 LDKRouteHint ret_conv_11_var = ret_var.data[l];
40182 uint64_t ret_conv_11_ref = 0;
40183 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_11_var);
40184 ret_conv_11_ref = tag_ptr(ret_conv_11_var.inner, ret_conv_11_var.is_owned);
40185 ret_arr_ptr[l] = ret_conv_11_ref;
40188 FREE(ret_var.data);
40192 void __attribute__((export_name("TS_PaymentParameters_set_route_hints"))) TS_PaymentParameters_set_route_hints(uint64_t this_ptr, uint64_tArray val) {
40193 LDKPaymentParameters this_ptr_conv;
40194 this_ptr_conv.inner = untag_ptr(this_ptr);
40195 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40196 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40197 this_ptr_conv.is_owned = false;
40198 LDKCVec_RouteHintZ val_constr;
40199 val_constr.datalen = val->arr_len;
40200 if (val_constr.datalen > 0)
40201 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
40203 val_constr.data = NULL;
40204 uint64_t* val_vals = val->elems;
40205 for (size_t l = 0; l < val_constr.datalen; l++) {
40206 uint64_t val_conv_11 = val_vals[l];
40207 LDKRouteHint val_conv_11_conv;
40208 val_conv_11_conv.inner = untag_ptr(val_conv_11);
40209 val_conv_11_conv.is_owned = ptr_is_owned(val_conv_11);
40210 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_11_conv);
40211 val_conv_11_conv = RouteHint_clone(&val_conv_11_conv);
40212 val_constr.data[l] = val_conv_11_conv;
40215 PaymentParameters_set_route_hints(&this_ptr_conv, val_constr);
40218 uint64_t __attribute__((export_name("TS_PaymentParameters_get_expiry_time"))) TS_PaymentParameters_get_expiry_time(uint64_t this_ptr) {
40219 LDKPaymentParameters this_ptr_conv;
40220 this_ptr_conv.inner = untag_ptr(this_ptr);
40221 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40222 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40223 this_ptr_conv.is_owned = false;
40224 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
40225 *ret_copy = PaymentParameters_get_expiry_time(&this_ptr_conv);
40226 uint64_t ret_ref = tag_ptr(ret_copy, true);
40230 void __attribute__((export_name("TS_PaymentParameters_set_expiry_time"))) TS_PaymentParameters_set_expiry_time(uint64_t this_ptr, uint64_t val) {
40231 LDKPaymentParameters this_ptr_conv;
40232 this_ptr_conv.inner = untag_ptr(this_ptr);
40233 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40234 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40235 this_ptr_conv.is_owned = false;
40236 void* val_ptr = untag_ptr(val);
40237 CHECK_ACCESS(val_ptr);
40238 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
40239 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
40240 PaymentParameters_set_expiry_time(&this_ptr_conv, val_conv);
40243 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) {
40244 LDKPaymentParameters this_ptr_conv;
40245 this_ptr_conv.inner = untag_ptr(this_ptr);
40246 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40247 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40248 this_ptr_conv.is_owned = false;
40249 int32_t ret_conv = PaymentParameters_get_max_total_cltv_expiry_delta(&this_ptr_conv);
40253 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) {
40254 LDKPaymentParameters this_ptr_conv;
40255 this_ptr_conv.inner = untag_ptr(this_ptr);
40256 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40257 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40258 this_ptr_conv.is_owned = false;
40259 PaymentParameters_set_max_total_cltv_expiry_delta(&this_ptr_conv, val);
40262 int8_t __attribute__((export_name("TS_PaymentParameters_get_max_path_count"))) TS_PaymentParameters_get_max_path_count(uint64_t this_ptr) {
40263 LDKPaymentParameters this_ptr_conv;
40264 this_ptr_conv.inner = untag_ptr(this_ptr);
40265 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40266 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40267 this_ptr_conv.is_owned = false;
40268 int8_t ret_conv = PaymentParameters_get_max_path_count(&this_ptr_conv);
40272 void __attribute__((export_name("TS_PaymentParameters_set_max_path_count"))) TS_PaymentParameters_set_max_path_count(uint64_t this_ptr, int8_t val) {
40273 LDKPaymentParameters this_ptr_conv;
40274 this_ptr_conv.inner = untag_ptr(this_ptr);
40275 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40276 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40277 this_ptr_conv.is_owned = false;
40278 PaymentParameters_set_max_path_count(&this_ptr_conv, val);
40281 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) {
40282 LDKPaymentParameters this_ptr_conv;
40283 this_ptr_conv.inner = untag_ptr(this_ptr);
40284 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40285 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40286 this_ptr_conv.is_owned = false;
40287 int8_t ret_conv = PaymentParameters_get_max_channel_saturation_power_of_half(&this_ptr_conv);
40291 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) {
40292 LDKPaymentParameters this_ptr_conv;
40293 this_ptr_conv.inner = untag_ptr(this_ptr);
40294 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40295 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40296 this_ptr_conv.is_owned = false;
40297 PaymentParameters_set_max_channel_saturation_power_of_half(&this_ptr_conv, val);
40300 int64_tArray __attribute__((export_name("TS_PaymentParameters_get_previously_failed_channels"))) TS_PaymentParameters_get_previously_failed_channels(uint64_t this_ptr) {
40301 LDKPaymentParameters this_ptr_conv;
40302 this_ptr_conv.inner = untag_ptr(this_ptr);
40303 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40304 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40305 this_ptr_conv.is_owned = false;
40306 LDKCVec_u64Z ret_var = PaymentParameters_get_previously_failed_channels(&this_ptr_conv);
40307 int64_tArray ret_arr = NULL;
40308 ret_arr = init_int64_tArray(ret_var.datalen, __LINE__);
40309 int64_t *ret_arr_ptr = (int64_t*)(((uint8_t*)ret_arr) + 8);
40310 for (size_t i = 0; i < ret_var.datalen; i++) {
40311 int64_t ret_conv_8_conv = ret_var.data[i];
40312 ret_arr_ptr[i] = ret_conv_8_conv;
40315 FREE(ret_var.data);
40319 void __attribute__((export_name("TS_PaymentParameters_set_previously_failed_channels"))) TS_PaymentParameters_set_previously_failed_channels(uint64_t this_ptr, int64_tArray val) {
40320 LDKPaymentParameters this_ptr_conv;
40321 this_ptr_conv.inner = untag_ptr(this_ptr);
40322 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40323 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40324 this_ptr_conv.is_owned = false;
40325 LDKCVec_u64Z val_constr;
40326 val_constr.datalen = val->arr_len;
40327 if (val_constr.datalen > 0)
40328 val_constr.data = MALLOC(val_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
40330 val_constr.data = NULL;
40331 int64_t* val_vals = val->elems;
40332 for (size_t i = 0; i < val_constr.datalen; i++) {
40333 int64_t val_conv_8 = val_vals[i];
40334 val_constr.data[i] = val_conv_8;
40337 PaymentParameters_set_previously_failed_channels(&this_ptr_conv, val_constr);
40340 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) {
40341 LDKPublicKey payee_pubkey_arg_ref;
40342 CHECK(payee_pubkey_arg->arr_len == 33);
40343 memcpy(payee_pubkey_arg_ref.compressed_form, payee_pubkey_arg->elems, 33); FREE(payee_pubkey_arg);
40344 LDKInvoiceFeatures features_arg_conv;
40345 features_arg_conv.inner = untag_ptr(features_arg);
40346 features_arg_conv.is_owned = ptr_is_owned(features_arg);
40347 CHECK_INNER_FIELD_ACCESS_OR_NULL(features_arg_conv);
40348 features_arg_conv = InvoiceFeatures_clone(&features_arg_conv);
40349 LDKCVec_RouteHintZ route_hints_arg_constr;
40350 route_hints_arg_constr.datalen = route_hints_arg->arr_len;
40351 if (route_hints_arg_constr.datalen > 0)
40352 route_hints_arg_constr.data = MALLOC(route_hints_arg_constr.datalen * sizeof(LDKRouteHint), "LDKCVec_RouteHintZ Elements");
40354 route_hints_arg_constr.data = NULL;
40355 uint64_t* route_hints_arg_vals = route_hints_arg->elems;
40356 for (size_t l = 0; l < route_hints_arg_constr.datalen; l++) {
40357 uint64_t route_hints_arg_conv_11 = route_hints_arg_vals[l];
40358 LDKRouteHint route_hints_arg_conv_11_conv;
40359 route_hints_arg_conv_11_conv.inner = untag_ptr(route_hints_arg_conv_11);
40360 route_hints_arg_conv_11_conv.is_owned = ptr_is_owned(route_hints_arg_conv_11);
40361 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_hints_arg_conv_11_conv);
40362 route_hints_arg_conv_11_conv = RouteHint_clone(&route_hints_arg_conv_11_conv);
40363 route_hints_arg_constr.data[l] = route_hints_arg_conv_11_conv;
40365 FREE(route_hints_arg);
40366 void* expiry_time_arg_ptr = untag_ptr(expiry_time_arg);
40367 CHECK_ACCESS(expiry_time_arg_ptr);
40368 LDKCOption_u64Z expiry_time_arg_conv = *(LDKCOption_u64Z*)(expiry_time_arg_ptr);
40369 expiry_time_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(expiry_time_arg));
40370 LDKCVec_u64Z previously_failed_channels_arg_constr;
40371 previously_failed_channels_arg_constr.datalen = previously_failed_channels_arg->arr_len;
40372 if (previously_failed_channels_arg_constr.datalen > 0)
40373 previously_failed_channels_arg_constr.data = MALLOC(previously_failed_channels_arg_constr.datalen * sizeof(int64_t), "LDKCVec_u64Z Elements");
40375 previously_failed_channels_arg_constr.data = NULL;
40376 int64_t* previously_failed_channels_arg_vals = previously_failed_channels_arg->elems;
40377 for (size_t i = 0; i < previously_failed_channels_arg_constr.datalen; i++) {
40378 int64_t previously_failed_channels_arg_conv_8 = previously_failed_channels_arg_vals[i];
40379 previously_failed_channels_arg_constr.data[i] = previously_failed_channels_arg_conv_8;
40381 FREE(previously_failed_channels_arg);
40382 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);
40383 uint64_t ret_ref = 0;
40384 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40385 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40389 static inline uint64_t PaymentParameters_clone_ptr(LDKPaymentParameters *NONNULL_PTR arg) {
40390 LDKPaymentParameters ret_var = PaymentParameters_clone(arg);
40391 uint64_t ret_ref = 0;
40392 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40393 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40396 int64_t __attribute__((export_name("TS_PaymentParameters_clone_ptr"))) TS_PaymentParameters_clone_ptr(uint64_t arg) {
40397 LDKPaymentParameters arg_conv;
40398 arg_conv.inner = untag_ptr(arg);
40399 arg_conv.is_owned = ptr_is_owned(arg);
40400 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
40401 arg_conv.is_owned = false;
40402 int64_t ret_conv = PaymentParameters_clone_ptr(&arg_conv);
40406 uint64_t __attribute__((export_name("TS_PaymentParameters_clone"))) TS_PaymentParameters_clone(uint64_t orig) {
40407 LDKPaymentParameters orig_conv;
40408 orig_conv.inner = untag_ptr(orig);
40409 orig_conv.is_owned = ptr_is_owned(orig);
40410 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
40411 orig_conv.is_owned = false;
40412 LDKPaymentParameters ret_var = PaymentParameters_clone(&orig_conv);
40413 uint64_t ret_ref = 0;
40414 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40415 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40419 int64_t __attribute__((export_name("TS_PaymentParameters_hash"))) TS_PaymentParameters_hash(uint64_t o) {
40420 LDKPaymentParameters o_conv;
40421 o_conv.inner = untag_ptr(o);
40422 o_conv.is_owned = ptr_is_owned(o);
40423 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
40424 o_conv.is_owned = false;
40425 int64_t ret_conv = PaymentParameters_hash(&o_conv);
40429 jboolean __attribute__((export_name("TS_PaymentParameters_eq"))) TS_PaymentParameters_eq(uint64_t a, uint64_t b) {
40430 LDKPaymentParameters a_conv;
40431 a_conv.inner = untag_ptr(a);
40432 a_conv.is_owned = ptr_is_owned(a);
40433 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
40434 a_conv.is_owned = false;
40435 LDKPaymentParameters b_conv;
40436 b_conv.inner = untag_ptr(b);
40437 b_conv.is_owned = ptr_is_owned(b);
40438 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
40439 b_conv.is_owned = false;
40440 jboolean ret_conv = PaymentParameters_eq(&a_conv, &b_conv);
40444 int8_tArray __attribute__((export_name("TS_PaymentParameters_write"))) TS_PaymentParameters_write(uint64_t obj) {
40445 LDKPaymentParameters obj_conv;
40446 obj_conv.inner = untag_ptr(obj);
40447 obj_conv.is_owned = ptr_is_owned(obj);
40448 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
40449 obj_conv.is_owned = false;
40450 LDKCVec_u8Z ret_var = PaymentParameters_write(&obj_conv);
40451 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
40452 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
40453 CVec_u8Z_free(ret_var);
40457 uint64_t __attribute__((export_name("TS_PaymentParameters_read"))) TS_PaymentParameters_read(int8_tArray ser) {
40458 LDKu8slice ser_ref;
40459 ser_ref.datalen = ser->arr_len;
40460 ser_ref.data = ser->elems;
40461 LDKCResult_PaymentParametersDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentParametersDecodeErrorZ), "LDKCResult_PaymentParametersDecodeErrorZ");
40462 *ret_conv = PaymentParameters_read(ser_ref);
40464 return tag_ptr(ret_conv, true);
40467 uint64_t __attribute__((export_name("TS_PaymentParameters_from_node_id"))) TS_PaymentParameters_from_node_id(int8_tArray payee_pubkey) {
40468 LDKPublicKey payee_pubkey_ref;
40469 CHECK(payee_pubkey->arr_len == 33);
40470 memcpy(payee_pubkey_ref.compressed_form, payee_pubkey->elems, 33); FREE(payee_pubkey);
40471 LDKPaymentParameters ret_var = PaymentParameters_from_node_id(payee_pubkey_ref);
40472 uint64_t ret_ref = 0;
40473 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40474 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40478 uint64_t __attribute__((export_name("TS_PaymentParameters_for_keysend"))) TS_PaymentParameters_for_keysend(int8_tArray payee_pubkey) {
40479 LDKPublicKey payee_pubkey_ref;
40480 CHECK(payee_pubkey->arr_len == 33);
40481 memcpy(payee_pubkey_ref.compressed_form, payee_pubkey->elems, 33); FREE(payee_pubkey);
40482 LDKPaymentParameters ret_var = PaymentParameters_for_keysend(payee_pubkey_ref);
40483 uint64_t ret_ref = 0;
40484 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40485 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40489 void __attribute__((export_name("TS_RouteHint_free"))) TS_RouteHint_free(uint64_t this_obj) {
40490 LDKRouteHint this_obj_conv;
40491 this_obj_conv.inner = untag_ptr(this_obj);
40492 this_obj_conv.is_owned = ptr_is_owned(this_obj);
40493 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
40494 RouteHint_free(this_obj_conv);
40497 uint64_tArray __attribute__((export_name("TS_RouteHint_get_a"))) TS_RouteHint_get_a(uint64_t this_ptr) {
40498 LDKRouteHint this_ptr_conv;
40499 this_ptr_conv.inner = untag_ptr(this_ptr);
40500 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40501 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40502 this_ptr_conv.is_owned = false;
40503 LDKCVec_RouteHintHopZ ret_var = RouteHint_get_a(&this_ptr_conv);
40504 uint64_tArray ret_arr = NULL;
40505 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
40506 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
40507 for (size_t o = 0; o < ret_var.datalen; o++) {
40508 LDKRouteHintHop ret_conv_14_var = ret_var.data[o];
40509 uint64_t ret_conv_14_ref = 0;
40510 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var);
40511 ret_conv_14_ref = tag_ptr(ret_conv_14_var.inner, ret_conv_14_var.is_owned);
40512 ret_arr_ptr[o] = ret_conv_14_ref;
40515 FREE(ret_var.data);
40519 void __attribute__((export_name("TS_RouteHint_set_a"))) TS_RouteHint_set_a(uint64_t this_ptr, uint64_tArray val) {
40520 LDKRouteHint this_ptr_conv;
40521 this_ptr_conv.inner = untag_ptr(this_ptr);
40522 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40523 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40524 this_ptr_conv.is_owned = false;
40525 LDKCVec_RouteHintHopZ val_constr;
40526 val_constr.datalen = val->arr_len;
40527 if (val_constr.datalen > 0)
40528 val_constr.data = MALLOC(val_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements");
40530 val_constr.data = NULL;
40531 uint64_t* val_vals = val->elems;
40532 for (size_t o = 0; o < val_constr.datalen; o++) {
40533 uint64_t val_conv_14 = val_vals[o];
40534 LDKRouteHintHop val_conv_14_conv;
40535 val_conv_14_conv.inner = untag_ptr(val_conv_14);
40536 val_conv_14_conv.is_owned = ptr_is_owned(val_conv_14);
40537 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv_14_conv);
40538 val_conv_14_conv = RouteHintHop_clone(&val_conv_14_conv);
40539 val_constr.data[o] = val_conv_14_conv;
40542 RouteHint_set_a(&this_ptr_conv, val_constr);
40545 uint64_t __attribute__((export_name("TS_RouteHint_new"))) TS_RouteHint_new(uint64_tArray a_arg) {
40546 LDKCVec_RouteHintHopZ a_arg_constr;
40547 a_arg_constr.datalen = a_arg->arr_len;
40548 if (a_arg_constr.datalen > 0)
40549 a_arg_constr.data = MALLOC(a_arg_constr.datalen * sizeof(LDKRouteHintHop), "LDKCVec_RouteHintHopZ Elements");
40551 a_arg_constr.data = NULL;
40552 uint64_t* a_arg_vals = a_arg->elems;
40553 for (size_t o = 0; o < a_arg_constr.datalen; o++) {
40554 uint64_t a_arg_conv_14 = a_arg_vals[o];
40555 LDKRouteHintHop a_arg_conv_14_conv;
40556 a_arg_conv_14_conv.inner = untag_ptr(a_arg_conv_14);
40557 a_arg_conv_14_conv.is_owned = ptr_is_owned(a_arg_conv_14);
40558 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_arg_conv_14_conv);
40559 a_arg_conv_14_conv = RouteHintHop_clone(&a_arg_conv_14_conv);
40560 a_arg_constr.data[o] = a_arg_conv_14_conv;
40563 LDKRouteHint ret_var = RouteHint_new(a_arg_constr);
40564 uint64_t ret_ref = 0;
40565 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40566 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40570 static inline uint64_t RouteHint_clone_ptr(LDKRouteHint *NONNULL_PTR arg) {
40571 LDKRouteHint ret_var = RouteHint_clone(arg);
40572 uint64_t ret_ref = 0;
40573 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40574 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40577 int64_t __attribute__((export_name("TS_RouteHint_clone_ptr"))) TS_RouteHint_clone_ptr(uint64_t arg) {
40578 LDKRouteHint arg_conv;
40579 arg_conv.inner = untag_ptr(arg);
40580 arg_conv.is_owned = ptr_is_owned(arg);
40581 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
40582 arg_conv.is_owned = false;
40583 int64_t ret_conv = RouteHint_clone_ptr(&arg_conv);
40587 uint64_t __attribute__((export_name("TS_RouteHint_clone"))) TS_RouteHint_clone(uint64_t orig) {
40588 LDKRouteHint orig_conv;
40589 orig_conv.inner = untag_ptr(orig);
40590 orig_conv.is_owned = ptr_is_owned(orig);
40591 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
40592 orig_conv.is_owned = false;
40593 LDKRouteHint ret_var = RouteHint_clone(&orig_conv);
40594 uint64_t ret_ref = 0;
40595 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40596 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40600 int64_t __attribute__((export_name("TS_RouteHint_hash"))) TS_RouteHint_hash(uint64_t o) {
40601 LDKRouteHint o_conv;
40602 o_conv.inner = untag_ptr(o);
40603 o_conv.is_owned = ptr_is_owned(o);
40604 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
40605 o_conv.is_owned = false;
40606 int64_t ret_conv = RouteHint_hash(&o_conv);
40610 jboolean __attribute__((export_name("TS_RouteHint_eq"))) TS_RouteHint_eq(uint64_t a, uint64_t b) {
40611 LDKRouteHint a_conv;
40612 a_conv.inner = untag_ptr(a);
40613 a_conv.is_owned = ptr_is_owned(a);
40614 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
40615 a_conv.is_owned = false;
40616 LDKRouteHint b_conv;
40617 b_conv.inner = untag_ptr(b);
40618 b_conv.is_owned = ptr_is_owned(b);
40619 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
40620 b_conv.is_owned = false;
40621 jboolean ret_conv = RouteHint_eq(&a_conv, &b_conv);
40625 int8_tArray __attribute__((export_name("TS_RouteHint_write"))) TS_RouteHint_write(uint64_t obj) {
40626 LDKRouteHint obj_conv;
40627 obj_conv.inner = untag_ptr(obj);
40628 obj_conv.is_owned = ptr_is_owned(obj);
40629 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
40630 obj_conv.is_owned = false;
40631 LDKCVec_u8Z ret_var = RouteHint_write(&obj_conv);
40632 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
40633 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
40634 CVec_u8Z_free(ret_var);
40638 uint64_t __attribute__((export_name("TS_RouteHint_read"))) TS_RouteHint_read(int8_tArray ser) {
40639 LDKu8slice ser_ref;
40640 ser_ref.datalen = ser->arr_len;
40641 ser_ref.data = ser->elems;
40642 LDKCResult_RouteHintDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintDecodeErrorZ), "LDKCResult_RouteHintDecodeErrorZ");
40643 *ret_conv = RouteHint_read(ser_ref);
40645 return tag_ptr(ret_conv, true);
40648 void __attribute__((export_name("TS_RouteHintHop_free"))) TS_RouteHintHop_free(uint64_t this_obj) {
40649 LDKRouteHintHop this_obj_conv;
40650 this_obj_conv.inner = untag_ptr(this_obj);
40651 this_obj_conv.is_owned = ptr_is_owned(this_obj);
40652 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
40653 RouteHintHop_free(this_obj_conv);
40656 int8_tArray __attribute__((export_name("TS_RouteHintHop_get_src_node_id"))) TS_RouteHintHop_get_src_node_id(uint64_t this_ptr) {
40657 LDKRouteHintHop this_ptr_conv;
40658 this_ptr_conv.inner = untag_ptr(this_ptr);
40659 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40660 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40661 this_ptr_conv.is_owned = false;
40662 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
40663 memcpy(ret_arr->elems, RouteHintHop_get_src_node_id(&this_ptr_conv).compressed_form, 33);
40667 void __attribute__((export_name("TS_RouteHintHop_set_src_node_id"))) TS_RouteHintHop_set_src_node_id(uint64_t this_ptr, int8_tArray val) {
40668 LDKRouteHintHop this_ptr_conv;
40669 this_ptr_conv.inner = untag_ptr(this_ptr);
40670 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40671 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40672 this_ptr_conv.is_owned = false;
40673 LDKPublicKey val_ref;
40674 CHECK(val->arr_len == 33);
40675 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
40676 RouteHintHop_set_src_node_id(&this_ptr_conv, val_ref);
40679 int64_t __attribute__((export_name("TS_RouteHintHop_get_short_channel_id"))) TS_RouteHintHop_get_short_channel_id(uint64_t this_ptr) {
40680 LDKRouteHintHop this_ptr_conv;
40681 this_ptr_conv.inner = untag_ptr(this_ptr);
40682 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40683 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40684 this_ptr_conv.is_owned = false;
40685 int64_t ret_conv = RouteHintHop_get_short_channel_id(&this_ptr_conv);
40689 void __attribute__((export_name("TS_RouteHintHop_set_short_channel_id"))) TS_RouteHintHop_set_short_channel_id(uint64_t this_ptr, int64_t val) {
40690 LDKRouteHintHop this_ptr_conv;
40691 this_ptr_conv.inner = untag_ptr(this_ptr);
40692 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40693 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40694 this_ptr_conv.is_owned = false;
40695 RouteHintHop_set_short_channel_id(&this_ptr_conv, val);
40698 uint64_t __attribute__((export_name("TS_RouteHintHop_get_fees"))) TS_RouteHintHop_get_fees(uint64_t this_ptr) {
40699 LDKRouteHintHop 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 LDKRoutingFees ret_var = RouteHintHop_get_fees(&this_ptr_conv);
40705 uint64_t ret_ref = 0;
40706 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40707 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40711 void __attribute__((export_name("TS_RouteHintHop_set_fees"))) TS_RouteHintHop_set_fees(uint64_t this_ptr, uint64_t val) {
40712 LDKRouteHintHop this_ptr_conv;
40713 this_ptr_conv.inner = untag_ptr(this_ptr);
40714 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40715 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40716 this_ptr_conv.is_owned = false;
40717 LDKRoutingFees val_conv;
40718 val_conv.inner = untag_ptr(val);
40719 val_conv.is_owned = ptr_is_owned(val);
40720 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
40721 val_conv = RoutingFees_clone(&val_conv);
40722 RouteHintHop_set_fees(&this_ptr_conv, val_conv);
40725 int16_t __attribute__((export_name("TS_RouteHintHop_get_cltv_expiry_delta"))) TS_RouteHintHop_get_cltv_expiry_delta(uint64_t this_ptr) {
40726 LDKRouteHintHop this_ptr_conv;
40727 this_ptr_conv.inner = untag_ptr(this_ptr);
40728 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40729 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40730 this_ptr_conv.is_owned = false;
40731 int16_t ret_conv = RouteHintHop_get_cltv_expiry_delta(&this_ptr_conv);
40735 void __attribute__((export_name("TS_RouteHintHop_set_cltv_expiry_delta"))) TS_RouteHintHop_set_cltv_expiry_delta(uint64_t this_ptr, int16_t val) {
40736 LDKRouteHintHop this_ptr_conv;
40737 this_ptr_conv.inner = untag_ptr(this_ptr);
40738 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40739 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40740 this_ptr_conv.is_owned = false;
40741 RouteHintHop_set_cltv_expiry_delta(&this_ptr_conv, val);
40744 uint64_t __attribute__((export_name("TS_RouteHintHop_get_htlc_minimum_msat"))) TS_RouteHintHop_get_htlc_minimum_msat(uint64_t this_ptr) {
40745 LDKRouteHintHop this_ptr_conv;
40746 this_ptr_conv.inner = untag_ptr(this_ptr);
40747 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40748 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40749 this_ptr_conv.is_owned = false;
40750 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
40751 *ret_copy = RouteHintHop_get_htlc_minimum_msat(&this_ptr_conv);
40752 uint64_t ret_ref = tag_ptr(ret_copy, true);
40756 void __attribute__((export_name("TS_RouteHintHop_set_htlc_minimum_msat"))) TS_RouteHintHop_set_htlc_minimum_msat(uint64_t this_ptr, uint64_t val) {
40757 LDKRouteHintHop this_ptr_conv;
40758 this_ptr_conv.inner = untag_ptr(this_ptr);
40759 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40760 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40761 this_ptr_conv.is_owned = false;
40762 void* val_ptr = untag_ptr(val);
40763 CHECK_ACCESS(val_ptr);
40764 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
40765 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
40766 RouteHintHop_set_htlc_minimum_msat(&this_ptr_conv, val_conv);
40769 uint64_t __attribute__((export_name("TS_RouteHintHop_get_htlc_maximum_msat"))) TS_RouteHintHop_get_htlc_maximum_msat(uint64_t this_ptr) {
40770 LDKRouteHintHop this_ptr_conv;
40771 this_ptr_conv.inner = untag_ptr(this_ptr);
40772 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40773 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40774 this_ptr_conv.is_owned = false;
40775 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
40776 *ret_copy = RouteHintHop_get_htlc_maximum_msat(&this_ptr_conv);
40777 uint64_t ret_ref = tag_ptr(ret_copy, true);
40781 void __attribute__((export_name("TS_RouteHintHop_set_htlc_maximum_msat"))) TS_RouteHintHop_set_htlc_maximum_msat(uint64_t this_ptr, uint64_t val) {
40782 LDKRouteHintHop this_ptr_conv;
40783 this_ptr_conv.inner = untag_ptr(this_ptr);
40784 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
40785 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
40786 this_ptr_conv.is_owned = false;
40787 void* val_ptr = untag_ptr(val);
40788 CHECK_ACCESS(val_ptr);
40789 LDKCOption_u64Z val_conv = *(LDKCOption_u64Z*)(val_ptr);
40790 val_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(val));
40791 RouteHintHop_set_htlc_maximum_msat(&this_ptr_conv, val_conv);
40794 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) {
40795 LDKPublicKey src_node_id_arg_ref;
40796 CHECK(src_node_id_arg->arr_len == 33);
40797 memcpy(src_node_id_arg_ref.compressed_form, src_node_id_arg->elems, 33); FREE(src_node_id_arg);
40798 LDKRoutingFees fees_arg_conv;
40799 fees_arg_conv.inner = untag_ptr(fees_arg);
40800 fees_arg_conv.is_owned = ptr_is_owned(fees_arg);
40801 CHECK_INNER_FIELD_ACCESS_OR_NULL(fees_arg_conv);
40802 fees_arg_conv = RoutingFees_clone(&fees_arg_conv);
40803 void* htlc_minimum_msat_arg_ptr = untag_ptr(htlc_minimum_msat_arg);
40804 CHECK_ACCESS(htlc_minimum_msat_arg_ptr);
40805 LDKCOption_u64Z htlc_minimum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_minimum_msat_arg_ptr);
40806 htlc_minimum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_minimum_msat_arg));
40807 void* htlc_maximum_msat_arg_ptr = untag_ptr(htlc_maximum_msat_arg);
40808 CHECK_ACCESS(htlc_maximum_msat_arg_ptr);
40809 LDKCOption_u64Z htlc_maximum_msat_arg_conv = *(LDKCOption_u64Z*)(htlc_maximum_msat_arg_ptr);
40810 htlc_maximum_msat_arg_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(htlc_maximum_msat_arg));
40811 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);
40812 uint64_t ret_ref = 0;
40813 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40814 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40818 static inline uint64_t RouteHintHop_clone_ptr(LDKRouteHintHop *NONNULL_PTR arg) {
40819 LDKRouteHintHop ret_var = RouteHintHop_clone(arg);
40820 uint64_t ret_ref = 0;
40821 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40822 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40825 int64_t __attribute__((export_name("TS_RouteHintHop_clone_ptr"))) TS_RouteHintHop_clone_ptr(uint64_t arg) {
40826 LDKRouteHintHop arg_conv;
40827 arg_conv.inner = untag_ptr(arg);
40828 arg_conv.is_owned = ptr_is_owned(arg);
40829 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
40830 arg_conv.is_owned = false;
40831 int64_t ret_conv = RouteHintHop_clone_ptr(&arg_conv);
40835 uint64_t __attribute__((export_name("TS_RouteHintHop_clone"))) TS_RouteHintHop_clone(uint64_t orig) {
40836 LDKRouteHintHop orig_conv;
40837 orig_conv.inner = untag_ptr(orig);
40838 orig_conv.is_owned = ptr_is_owned(orig);
40839 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
40840 orig_conv.is_owned = false;
40841 LDKRouteHintHop ret_var = RouteHintHop_clone(&orig_conv);
40842 uint64_t ret_ref = 0;
40843 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
40844 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
40848 int64_t __attribute__((export_name("TS_RouteHintHop_hash"))) TS_RouteHintHop_hash(uint64_t o) {
40849 LDKRouteHintHop o_conv;
40850 o_conv.inner = untag_ptr(o);
40851 o_conv.is_owned = ptr_is_owned(o);
40852 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
40853 o_conv.is_owned = false;
40854 int64_t ret_conv = RouteHintHop_hash(&o_conv);
40858 jboolean __attribute__((export_name("TS_RouteHintHop_eq"))) TS_RouteHintHop_eq(uint64_t a, uint64_t b) {
40859 LDKRouteHintHop a_conv;
40860 a_conv.inner = untag_ptr(a);
40861 a_conv.is_owned = ptr_is_owned(a);
40862 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
40863 a_conv.is_owned = false;
40864 LDKRouteHintHop b_conv;
40865 b_conv.inner = untag_ptr(b);
40866 b_conv.is_owned = ptr_is_owned(b);
40867 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
40868 b_conv.is_owned = false;
40869 jboolean ret_conv = RouteHintHop_eq(&a_conv, &b_conv);
40873 int8_tArray __attribute__((export_name("TS_RouteHintHop_write"))) TS_RouteHintHop_write(uint64_t obj) {
40874 LDKRouteHintHop obj_conv;
40875 obj_conv.inner = untag_ptr(obj);
40876 obj_conv.is_owned = ptr_is_owned(obj);
40877 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
40878 obj_conv.is_owned = false;
40879 LDKCVec_u8Z ret_var = RouteHintHop_write(&obj_conv);
40880 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
40881 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
40882 CVec_u8Z_free(ret_var);
40886 uint64_t __attribute__((export_name("TS_RouteHintHop_read"))) TS_RouteHintHop_read(int8_tArray ser) {
40887 LDKu8slice ser_ref;
40888 ser_ref.datalen = ser->arr_len;
40889 ser_ref.data = ser->elems;
40890 LDKCResult_RouteHintHopDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteHintHopDecodeErrorZ), "LDKCResult_RouteHintHopDecodeErrorZ");
40891 *ret_conv = RouteHintHop_read(ser_ref);
40893 return tag_ptr(ret_conv, true);
40896 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) {
40897 LDKPublicKey our_node_pubkey_ref;
40898 CHECK(our_node_pubkey->arr_len == 33);
40899 memcpy(our_node_pubkey_ref.compressed_form, our_node_pubkey->elems, 33); FREE(our_node_pubkey);
40900 LDKRouteParameters route_params_conv;
40901 route_params_conv.inner = untag_ptr(route_params);
40902 route_params_conv.is_owned = ptr_is_owned(route_params);
40903 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv);
40904 route_params_conv.is_owned = false;
40905 LDKNetworkGraph network_graph_conv;
40906 network_graph_conv.inner = untag_ptr(network_graph);
40907 network_graph_conv.is_owned = ptr_is_owned(network_graph);
40908 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
40909 network_graph_conv.is_owned = false;
40910 LDKCVec_ChannelDetailsZ first_hops_constr;
40911 LDKCVec_ChannelDetailsZ *first_hops_ptr = NULL;
40912 if (first_hops != 0) {
40913 first_hops_constr.datalen = first_hops->arr_len;
40914 if (first_hops_constr.datalen > 0)
40915 first_hops_constr.data = MALLOC(first_hops_constr.datalen * sizeof(LDKChannelDetails), "LDKCVec_ChannelDetailsZ Elements");
40917 first_hops_constr.data = NULL;
40918 uint64_t* first_hops_vals = first_hops->elems;
40919 for (size_t q = 0; q < first_hops_constr.datalen; q++) {
40920 uint64_t first_hops_conv_16 = first_hops_vals[q];
40921 LDKChannelDetails first_hops_conv_16_conv;
40922 first_hops_conv_16_conv.inner = untag_ptr(first_hops_conv_16);
40923 first_hops_conv_16_conv.is_owned = ptr_is_owned(first_hops_conv_16);
40924 CHECK_INNER_FIELD_ACCESS_OR_NULL(first_hops_conv_16_conv);
40925 first_hops_conv_16_conv.is_owned = false;
40926 first_hops_constr.data[q] = first_hops_conv_16_conv;
40929 first_hops_ptr = &first_hops_constr;
40931 void* logger_ptr = untag_ptr(logger);
40932 CHECK_ACCESS(logger_ptr);
40933 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
40934 if (logger_conv.free == LDKLogger_JCalls_free) {
40935 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
40936 LDKLogger_JCalls_cloned(&logger_conv);
40938 void* scorer_ptr = untag_ptr(scorer);
40939 if (ptr_is_owned(scorer)) { CHECK_ACCESS(scorer_ptr); }
40940 LDKScore* scorer_conv = (LDKScore*)scorer_ptr;
40941 unsigned char random_seed_bytes_arr[32];
40942 CHECK(random_seed_bytes->arr_len == 32);
40943 memcpy(random_seed_bytes_arr, random_seed_bytes->elems, 32); FREE(random_seed_bytes);
40944 unsigned char (*random_seed_bytes_ref)[32] = &random_seed_bytes_arr;
40945 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
40946 *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);
40947 if (first_hops_ptr != NULL) { FREE(first_hops_constr.data); }
40948 return tag_ptr(ret_conv, true);
40951 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) {
40952 LDKPublicKey our_node_pubkey_ref;
40953 CHECK(our_node_pubkey->arr_len == 33);
40954 memcpy(our_node_pubkey_ref.compressed_form, our_node_pubkey->elems, 33); FREE(our_node_pubkey);
40955 LDKCVec_PublicKeyZ hops_constr;
40956 hops_constr.datalen = hops->arr_len;
40957 if (hops_constr.datalen > 0)
40958 hops_constr.data = MALLOC(hops_constr.datalen * sizeof(LDKPublicKey), "LDKCVec_PublicKeyZ Elements");
40960 hops_constr.data = NULL;
40961 int8_tArray* hops_vals = (void*) hops->elems;
40962 for (size_t m = 0; m < hops_constr.datalen; m++) {
40963 int8_tArray hops_conv_12 = hops_vals[m];
40964 LDKPublicKey hops_conv_12_ref;
40965 CHECK(hops_conv_12->arr_len == 33);
40966 memcpy(hops_conv_12_ref.compressed_form, hops_conv_12->elems, 33); FREE(hops_conv_12);
40967 hops_constr.data[m] = hops_conv_12_ref;
40970 LDKRouteParameters route_params_conv;
40971 route_params_conv.inner = untag_ptr(route_params);
40972 route_params_conv.is_owned = ptr_is_owned(route_params);
40973 CHECK_INNER_FIELD_ACCESS_OR_NULL(route_params_conv);
40974 route_params_conv.is_owned = false;
40975 LDKNetworkGraph network_graph_conv;
40976 network_graph_conv.inner = untag_ptr(network_graph);
40977 network_graph_conv.is_owned = ptr_is_owned(network_graph);
40978 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
40979 network_graph_conv.is_owned = false;
40980 void* logger_ptr = untag_ptr(logger);
40981 CHECK_ACCESS(logger_ptr);
40982 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
40983 if (logger_conv.free == LDKLogger_JCalls_free) {
40984 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
40985 LDKLogger_JCalls_cloned(&logger_conv);
40987 unsigned char random_seed_bytes_arr[32];
40988 CHECK(random_seed_bytes->arr_len == 32);
40989 memcpy(random_seed_bytes_arr, random_seed_bytes->elems, 32); FREE(random_seed_bytes);
40990 unsigned char (*random_seed_bytes_ref)[32] = &random_seed_bytes_arr;
40991 LDKCResult_RouteLightningErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_RouteLightningErrorZ), "LDKCResult_RouteLightningErrorZ");
40992 *ret_conv = build_route_from_hops(our_node_pubkey_ref, hops_constr, &route_params_conv, &network_graph_conv, logger_conv, random_seed_bytes_ref);
40993 return tag_ptr(ret_conv, true);
40996 void __attribute__((export_name("TS_Score_free"))) TS_Score_free(uint64_t this_ptr) {
40997 if (!ptr_is_owned(this_ptr)) return;
40998 void* this_ptr_ptr = untag_ptr(this_ptr);
40999 CHECK_ACCESS(this_ptr_ptr);
41000 LDKScore this_ptr_conv = *(LDKScore*)(this_ptr_ptr);
41001 FREE(untag_ptr(this_ptr));
41002 Score_free(this_ptr_conv);
41005 void __attribute__((export_name("TS_LockableScore_free"))) TS_LockableScore_free(uint64_t this_ptr) {
41006 if (!ptr_is_owned(this_ptr)) return;
41007 void* this_ptr_ptr = untag_ptr(this_ptr);
41008 CHECK_ACCESS(this_ptr_ptr);
41009 LDKLockableScore this_ptr_conv = *(LDKLockableScore*)(this_ptr_ptr);
41010 FREE(untag_ptr(this_ptr));
41011 LockableScore_free(this_ptr_conv);
41014 void __attribute__((export_name("TS_MultiThreadedLockableScore_free"))) TS_MultiThreadedLockableScore_free(uint64_t this_obj) {
41015 LDKMultiThreadedLockableScore this_obj_conv;
41016 this_obj_conv.inner = untag_ptr(this_obj);
41017 this_obj_conv.is_owned = ptr_is_owned(this_obj);
41018 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
41019 MultiThreadedLockableScore_free(this_obj_conv);
41022 int8_tArray __attribute__((export_name("TS_MultiThreadedLockableScore_write"))) TS_MultiThreadedLockableScore_write(uint64_t obj) {
41023 LDKMultiThreadedLockableScore obj_conv;
41024 obj_conv.inner = untag_ptr(obj);
41025 obj_conv.is_owned = ptr_is_owned(obj);
41026 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41027 obj_conv.is_owned = false;
41028 LDKCVec_u8Z ret_var = MultiThreadedLockableScore_write(&obj_conv);
41029 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
41030 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
41031 CVec_u8Z_free(ret_var);
41035 uint64_t __attribute__((export_name("TS_MultiThreadedLockableScore_new"))) TS_MultiThreadedLockableScore_new(uint64_t score) {
41036 void* score_ptr = untag_ptr(score);
41037 CHECK_ACCESS(score_ptr);
41038 LDKScore score_conv = *(LDKScore*)(score_ptr);
41039 if (score_conv.free == LDKScore_JCalls_free) {
41040 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
41041 LDKScore_JCalls_cloned(&score_conv);
41043 LDKMultiThreadedLockableScore ret_var = MultiThreadedLockableScore_new(score_conv);
41044 uint64_t ret_ref = 0;
41045 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41046 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41050 void __attribute__((export_name("TS_ChannelUsage_free"))) TS_ChannelUsage_free(uint64_t this_obj) {
41051 LDKChannelUsage this_obj_conv;
41052 this_obj_conv.inner = untag_ptr(this_obj);
41053 this_obj_conv.is_owned = ptr_is_owned(this_obj);
41054 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
41055 ChannelUsage_free(this_obj_conv);
41058 int64_t __attribute__((export_name("TS_ChannelUsage_get_amount_msat"))) TS_ChannelUsage_get_amount_msat(uint64_t this_ptr) {
41059 LDKChannelUsage this_ptr_conv;
41060 this_ptr_conv.inner = untag_ptr(this_ptr);
41061 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41062 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41063 this_ptr_conv.is_owned = false;
41064 int64_t ret_conv = ChannelUsage_get_amount_msat(&this_ptr_conv);
41068 void __attribute__((export_name("TS_ChannelUsage_set_amount_msat"))) TS_ChannelUsage_set_amount_msat(uint64_t this_ptr, int64_t val) {
41069 LDKChannelUsage this_ptr_conv;
41070 this_ptr_conv.inner = untag_ptr(this_ptr);
41071 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41072 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41073 this_ptr_conv.is_owned = false;
41074 ChannelUsage_set_amount_msat(&this_ptr_conv, val);
41077 int64_t __attribute__((export_name("TS_ChannelUsage_get_inflight_htlc_msat"))) TS_ChannelUsage_get_inflight_htlc_msat(uint64_t this_ptr) {
41078 LDKChannelUsage this_ptr_conv;
41079 this_ptr_conv.inner = untag_ptr(this_ptr);
41080 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41081 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41082 this_ptr_conv.is_owned = false;
41083 int64_t ret_conv = ChannelUsage_get_inflight_htlc_msat(&this_ptr_conv);
41087 void __attribute__((export_name("TS_ChannelUsage_set_inflight_htlc_msat"))) TS_ChannelUsage_set_inflight_htlc_msat(uint64_t this_ptr, int64_t val) {
41088 LDKChannelUsage this_ptr_conv;
41089 this_ptr_conv.inner = untag_ptr(this_ptr);
41090 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41091 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41092 this_ptr_conv.is_owned = false;
41093 ChannelUsage_set_inflight_htlc_msat(&this_ptr_conv, val);
41096 uint64_t __attribute__((export_name("TS_ChannelUsage_get_effective_capacity"))) TS_ChannelUsage_get_effective_capacity(uint64_t this_ptr) {
41097 LDKChannelUsage this_ptr_conv;
41098 this_ptr_conv.inner = untag_ptr(this_ptr);
41099 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41100 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41101 this_ptr_conv.is_owned = false;
41102 LDKEffectiveCapacity *ret_copy = MALLOC(sizeof(LDKEffectiveCapacity), "LDKEffectiveCapacity");
41103 *ret_copy = ChannelUsage_get_effective_capacity(&this_ptr_conv);
41104 uint64_t ret_ref = tag_ptr(ret_copy, true);
41108 void __attribute__((export_name("TS_ChannelUsage_set_effective_capacity"))) TS_ChannelUsage_set_effective_capacity(uint64_t this_ptr, uint64_t val) {
41109 LDKChannelUsage this_ptr_conv;
41110 this_ptr_conv.inner = untag_ptr(this_ptr);
41111 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41112 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41113 this_ptr_conv.is_owned = false;
41114 void* val_ptr = untag_ptr(val);
41115 CHECK_ACCESS(val_ptr);
41116 LDKEffectiveCapacity val_conv = *(LDKEffectiveCapacity*)(val_ptr);
41117 val_conv = EffectiveCapacity_clone((LDKEffectiveCapacity*)untag_ptr(val));
41118 ChannelUsage_set_effective_capacity(&this_ptr_conv, val_conv);
41121 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) {
41122 void* effective_capacity_arg_ptr = untag_ptr(effective_capacity_arg);
41123 CHECK_ACCESS(effective_capacity_arg_ptr);
41124 LDKEffectiveCapacity effective_capacity_arg_conv = *(LDKEffectiveCapacity*)(effective_capacity_arg_ptr);
41125 effective_capacity_arg_conv = EffectiveCapacity_clone((LDKEffectiveCapacity*)untag_ptr(effective_capacity_arg));
41126 LDKChannelUsage ret_var = ChannelUsage_new(amount_msat_arg, inflight_htlc_msat_arg, effective_capacity_arg_conv);
41127 uint64_t ret_ref = 0;
41128 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41129 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41133 static inline uint64_t ChannelUsage_clone_ptr(LDKChannelUsage *NONNULL_PTR arg) {
41134 LDKChannelUsage ret_var = ChannelUsage_clone(arg);
41135 uint64_t ret_ref = 0;
41136 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41137 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41140 int64_t __attribute__((export_name("TS_ChannelUsage_clone_ptr"))) TS_ChannelUsage_clone_ptr(uint64_t arg) {
41141 LDKChannelUsage arg_conv;
41142 arg_conv.inner = untag_ptr(arg);
41143 arg_conv.is_owned = ptr_is_owned(arg);
41144 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
41145 arg_conv.is_owned = false;
41146 int64_t ret_conv = ChannelUsage_clone_ptr(&arg_conv);
41150 uint64_t __attribute__((export_name("TS_ChannelUsage_clone"))) TS_ChannelUsage_clone(uint64_t orig) {
41151 LDKChannelUsage orig_conv;
41152 orig_conv.inner = untag_ptr(orig);
41153 orig_conv.is_owned = ptr_is_owned(orig);
41154 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
41155 orig_conv.is_owned = false;
41156 LDKChannelUsage ret_var = ChannelUsage_clone(&orig_conv);
41157 uint64_t ret_ref = 0;
41158 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41159 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41163 void __attribute__((export_name("TS_FixedPenaltyScorer_free"))) TS_FixedPenaltyScorer_free(uint64_t this_obj) {
41164 LDKFixedPenaltyScorer this_obj_conv;
41165 this_obj_conv.inner = untag_ptr(this_obj);
41166 this_obj_conv.is_owned = ptr_is_owned(this_obj);
41167 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
41168 FixedPenaltyScorer_free(this_obj_conv);
41171 static inline uint64_t FixedPenaltyScorer_clone_ptr(LDKFixedPenaltyScorer *NONNULL_PTR arg) {
41172 LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_clone(arg);
41173 uint64_t ret_ref = 0;
41174 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41175 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41178 int64_t __attribute__((export_name("TS_FixedPenaltyScorer_clone_ptr"))) TS_FixedPenaltyScorer_clone_ptr(uint64_t arg) {
41179 LDKFixedPenaltyScorer arg_conv;
41180 arg_conv.inner = untag_ptr(arg);
41181 arg_conv.is_owned = ptr_is_owned(arg);
41182 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
41183 arg_conv.is_owned = false;
41184 int64_t ret_conv = FixedPenaltyScorer_clone_ptr(&arg_conv);
41188 uint64_t __attribute__((export_name("TS_FixedPenaltyScorer_clone"))) TS_FixedPenaltyScorer_clone(uint64_t orig) {
41189 LDKFixedPenaltyScorer orig_conv;
41190 orig_conv.inner = untag_ptr(orig);
41191 orig_conv.is_owned = ptr_is_owned(orig);
41192 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
41193 orig_conv.is_owned = false;
41194 LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_clone(&orig_conv);
41195 uint64_t ret_ref = 0;
41196 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41197 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41201 uint64_t __attribute__((export_name("TS_FixedPenaltyScorer_with_penalty"))) TS_FixedPenaltyScorer_with_penalty(int64_t penalty_msat) {
41202 LDKFixedPenaltyScorer ret_var = FixedPenaltyScorer_with_penalty(penalty_msat);
41203 uint64_t ret_ref = 0;
41204 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41205 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41209 uint64_t __attribute__((export_name("TS_FixedPenaltyScorer_as_Score"))) TS_FixedPenaltyScorer_as_Score(uint64_t this_arg) {
41210 LDKFixedPenaltyScorer this_arg_conv;
41211 this_arg_conv.inner = untag_ptr(this_arg);
41212 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41213 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41214 this_arg_conv.is_owned = false;
41215 LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore");
41216 *ret_ret = FixedPenaltyScorer_as_Score(&this_arg_conv);
41217 return tag_ptr(ret_ret, true);
41220 int8_tArray __attribute__((export_name("TS_FixedPenaltyScorer_write"))) TS_FixedPenaltyScorer_write(uint64_t obj) {
41221 LDKFixedPenaltyScorer obj_conv;
41222 obj_conv.inner = untag_ptr(obj);
41223 obj_conv.is_owned = ptr_is_owned(obj);
41224 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41225 obj_conv.is_owned = false;
41226 LDKCVec_u8Z ret_var = FixedPenaltyScorer_write(&obj_conv);
41227 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
41228 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
41229 CVec_u8Z_free(ret_var);
41233 uint64_t __attribute__((export_name("TS_FixedPenaltyScorer_read"))) TS_FixedPenaltyScorer_read(int8_tArray ser, int64_t arg) {
41234 LDKu8slice ser_ref;
41235 ser_ref.datalen = ser->arr_len;
41236 ser_ref.data = ser->elems;
41237 LDKCResult_FixedPenaltyScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_FixedPenaltyScorerDecodeErrorZ), "LDKCResult_FixedPenaltyScorerDecodeErrorZ");
41238 *ret_conv = FixedPenaltyScorer_read(ser_ref, arg);
41240 return tag_ptr(ret_conv, true);
41243 void __attribute__((export_name("TS_ProbabilisticScorer_free"))) TS_ProbabilisticScorer_free(uint64_t this_obj) {
41244 LDKProbabilisticScorer this_obj_conv;
41245 this_obj_conv.inner = untag_ptr(this_obj);
41246 this_obj_conv.is_owned = ptr_is_owned(this_obj);
41247 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
41248 ProbabilisticScorer_free(this_obj_conv);
41251 void __attribute__((export_name("TS_ProbabilisticScoringParameters_free"))) TS_ProbabilisticScoringParameters_free(uint64_t this_obj) {
41252 LDKProbabilisticScoringParameters 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 ProbabilisticScoringParameters_free(this_obj_conv);
41259 int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_base_penalty_msat"))) TS_ProbabilisticScoringParameters_get_base_penalty_msat(uint64_t this_ptr) {
41260 LDKProbabilisticScoringParameters 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 = ProbabilisticScoringParameters_get_base_penalty_msat(&this_ptr_conv);
41269 void __attribute__((export_name("TS_ProbabilisticScoringParameters_set_base_penalty_msat"))) TS_ProbabilisticScoringParameters_set_base_penalty_msat(uint64_t this_ptr, int64_t val) {
41270 LDKProbabilisticScoringParameters 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 ProbabilisticScoringParameters_set_base_penalty_msat(&this_ptr_conv, val);
41278 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) {
41279 LDKProbabilisticScoringParameters 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 = ProbabilisticScoringParameters_get_base_penalty_amount_multiplier_msat(&this_ptr_conv);
41288 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) {
41289 LDKProbabilisticScoringParameters 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 ProbabilisticScoringParameters_set_base_penalty_amount_multiplier_msat(&this_ptr_conv, val);
41297 int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_liquidity_penalty_multiplier_msat"))) TS_ProbabilisticScoringParameters_get_liquidity_penalty_multiplier_msat(uint64_t this_ptr) {
41298 LDKProbabilisticScoringParameters 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 int64_t ret_conv = ProbabilisticScoringParameters_get_liquidity_penalty_multiplier_msat(&this_ptr_conv);
41307 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) {
41308 LDKProbabilisticScoringParameters this_ptr_conv;
41309 this_ptr_conv.inner = untag_ptr(this_ptr);
41310 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41311 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41312 this_ptr_conv.is_owned = false;
41313 ProbabilisticScoringParameters_set_liquidity_penalty_multiplier_msat(&this_ptr_conv, val);
41316 int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_liquidity_offset_half_life"))) TS_ProbabilisticScoringParameters_get_liquidity_offset_half_life(uint64_t this_ptr) {
41317 LDKProbabilisticScoringParameters this_ptr_conv;
41318 this_ptr_conv.inner = untag_ptr(this_ptr);
41319 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41320 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41321 this_ptr_conv.is_owned = false;
41322 int64_t ret_conv = ProbabilisticScoringParameters_get_liquidity_offset_half_life(&this_ptr_conv);
41326 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) {
41327 LDKProbabilisticScoringParameters this_ptr_conv;
41328 this_ptr_conv.inner = untag_ptr(this_ptr);
41329 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41330 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41331 this_ptr_conv.is_owned = false;
41332 ProbabilisticScoringParameters_set_liquidity_offset_half_life(&this_ptr_conv, val);
41335 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) {
41336 LDKProbabilisticScoringParameters this_ptr_conv;
41337 this_ptr_conv.inner = untag_ptr(this_ptr);
41338 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41339 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41340 this_ptr_conv.is_owned = false;
41341 int64_t ret_conv = ProbabilisticScoringParameters_get_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv);
41345 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) {
41346 LDKProbabilisticScoringParameters this_ptr_conv;
41347 this_ptr_conv.inner = untag_ptr(this_ptr);
41348 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41349 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41350 this_ptr_conv.is_owned = false;
41351 ProbabilisticScoringParameters_set_liquidity_penalty_amount_multiplier_msat(&this_ptr_conv, val);
41354 int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_anti_probing_penalty_msat"))) TS_ProbabilisticScoringParameters_get_anti_probing_penalty_msat(uint64_t this_ptr) {
41355 LDKProbabilisticScoringParameters this_ptr_conv;
41356 this_ptr_conv.inner = untag_ptr(this_ptr);
41357 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41358 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41359 this_ptr_conv.is_owned = false;
41360 int64_t ret_conv = ProbabilisticScoringParameters_get_anti_probing_penalty_msat(&this_ptr_conv);
41364 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) {
41365 LDKProbabilisticScoringParameters this_ptr_conv;
41366 this_ptr_conv.inner = untag_ptr(this_ptr);
41367 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41368 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41369 this_ptr_conv.is_owned = false;
41370 ProbabilisticScoringParameters_set_anti_probing_penalty_msat(&this_ptr_conv, val);
41373 int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_get_considered_impossible_penalty_msat"))) TS_ProbabilisticScoringParameters_get_considered_impossible_penalty_msat(uint64_t this_ptr) {
41374 LDKProbabilisticScoringParameters this_ptr_conv;
41375 this_ptr_conv.inner = untag_ptr(this_ptr);
41376 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41377 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41378 this_ptr_conv.is_owned = false;
41379 int64_t ret_conv = ProbabilisticScoringParameters_get_considered_impossible_penalty_msat(&this_ptr_conv);
41383 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) {
41384 LDKProbabilisticScoringParameters this_ptr_conv;
41385 this_ptr_conv.inner = untag_ptr(this_ptr);
41386 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41387 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41388 this_ptr_conv.is_owned = false;
41389 ProbabilisticScoringParameters_set_considered_impossible_penalty_msat(&this_ptr_conv, val);
41392 static inline uint64_t ProbabilisticScoringParameters_clone_ptr(LDKProbabilisticScoringParameters *NONNULL_PTR arg) {
41393 LDKProbabilisticScoringParameters ret_var = ProbabilisticScoringParameters_clone(arg);
41394 uint64_t ret_ref = 0;
41395 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41396 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41399 int64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_clone_ptr"))) TS_ProbabilisticScoringParameters_clone_ptr(uint64_t arg) {
41400 LDKProbabilisticScoringParameters arg_conv;
41401 arg_conv.inner = untag_ptr(arg);
41402 arg_conv.is_owned = ptr_is_owned(arg);
41403 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
41404 arg_conv.is_owned = false;
41405 int64_t ret_conv = ProbabilisticScoringParameters_clone_ptr(&arg_conv);
41409 uint64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_clone"))) TS_ProbabilisticScoringParameters_clone(uint64_t orig) {
41410 LDKProbabilisticScoringParameters orig_conv;
41411 orig_conv.inner = untag_ptr(orig);
41412 orig_conv.is_owned = ptr_is_owned(orig);
41413 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
41414 orig_conv.is_owned = false;
41415 LDKProbabilisticScoringParameters ret_var = ProbabilisticScoringParameters_clone(&orig_conv);
41416 uint64_t ret_ref = 0;
41417 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41418 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41422 uint64_t __attribute__((export_name("TS_ProbabilisticScorer_new"))) TS_ProbabilisticScorer_new(uint64_t params, uint64_t network_graph, uint64_t logger) {
41423 LDKProbabilisticScoringParameters params_conv;
41424 params_conv.inner = untag_ptr(params);
41425 params_conv.is_owned = ptr_is_owned(params);
41426 CHECK_INNER_FIELD_ACCESS_OR_NULL(params_conv);
41427 params_conv = ProbabilisticScoringParameters_clone(¶ms_conv);
41428 LDKNetworkGraph network_graph_conv;
41429 network_graph_conv.inner = untag_ptr(network_graph);
41430 network_graph_conv.is_owned = ptr_is_owned(network_graph);
41431 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
41432 network_graph_conv.is_owned = false;
41433 void* logger_ptr = untag_ptr(logger);
41434 CHECK_ACCESS(logger_ptr);
41435 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
41436 if (logger_conv.free == LDKLogger_JCalls_free) {
41437 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
41438 LDKLogger_JCalls_cloned(&logger_conv);
41440 LDKProbabilisticScorer ret_var = ProbabilisticScorer_new(params_conv, &network_graph_conv, logger_conv);
41441 uint64_t ret_ref = 0;
41442 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41443 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41447 void __attribute__((export_name("TS_ProbabilisticScorer_debug_log_liquidity_stats"))) TS_ProbabilisticScorer_debug_log_liquidity_stats(uint64_t this_arg) {
41448 LDKProbabilisticScorer this_arg_conv;
41449 this_arg_conv.inner = untag_ptr(this_arg);
41450 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41451 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41452 this_arg_conv.is_owned = false;
41453 ProbabilisticScorer_debug_log_liquidity_stats(&this_arg_conv);
41456 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) {
41457 LDKProbabilisticScorer this_arg_conv;
41458 this_arg_conv.inner = untag_ptr(this_arg);
41459 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41460 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41461 this_arg_conv.is_owned = false;
41462 LDKNodeId target_conv;
41463 target_conv.inner = untag_ptr(target);
41464 target_conv.is_owned = ptr_is_owned(target);
41465 CHECK_INNER_FIELD_ACCESS_OR_NULL(target_conv);
41466 target_conv.is_owned = false;
41467 LDKCOption_C2Tuple_u64u64ZZ *ret_copy = MALLOC(sizeof(LDKCOption_C2Tuple_u64u64ZZ), "LDKCOption_C2Tuple_u64u64ZZ");
41468 *ret_copy = ProbabilisticScorer_estimated_channel_liquidity_range(&this_arg_conv, scid, &target_conv);
41469 uint64_t ret_ref = tag_ptr(ret_copy, true);
41473 void __attribute__((export_name("TS_ProbabilisticScorer_add_banned"))) TS_ProbabilisticScorer_add_banned(uint64_t this_arg, uint64_t node_id) {
41474 LDKProbabilisticScorer this_arg_conv;
41475 this_arg_conv.inner = untag_ptr(this_arg);
41476 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41477 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41478 this_arg_conv.is_owned = false;
41479 LDKNodeId node_id_conv;
41480 node_id_conv.inner = untag_ptr(node_id);
41481 node_id_conv.is_owned = ptr_is_owned(node_id);
41482 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv);
41483 node_id_conv.is_owned = false;
41484 ProbabilisticScorer_add_banned(&this_arg_conv, &node_id_conv);
41487 void __attribute__((export_name("TS_ProbabilisticScorer_remove_banned"))) TS_ProbabilisticScorer_remove_banned(uint64_t this_arg, uint64_t node_id) {
41488 LDKProbabilisticScorer this_arg_conv;
41489 this_arg_conv.inner = untag_ptr(this_arg);
41490 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41491 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41492 this_arg_conv.is_owned = false;
41493 LDKNodeId node_id_conv;
41494 node_id_conv.inner = untag_ptr(node_id);
41495 node_id_conv.is_owned = ptr_is_owned(node_id);
41496 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv);
41497 node_id_conv.is_owned = false;
41498 ProbabilisticScorer_remove_banned(&this_arg_conv, &node_id_conv);
41501 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) {
41502 LDKProbabilisticScorer this_arg_conv;
41503 this_arg_conv.inner = untag_ptr(this_arg);
41504 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41505 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41506 this_arg_conv.is_owned = false;
41507 LDKNodeId node_id_conv;
41508 node_id_conv.inner = untag_ptr(node_id);
41509 node_id_conv.is_owned = ptr_is_owned(node_id);
41510 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv);
41511 node_id_conv.is_owned = false;
41512 ProbabilisticScorer_set_manual_penalty(&this_arg_conv, &node_id_conv, penalty);
41515 void __attribute__((export_name("TS_ProbabilisticScorer_remove_manual_penalty"))) TS_ProbabilisticScorer_remove_manual_penalty(uint64_t this_arg, uint64_t node_id) {
41516 LDKProbabilisticScorer this_arg_conv;
41517 this_arg_conv.inner = untag_ptr(this_arg);
41518 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41519 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41520 this_arg_conv.is_owned = false;
41521 LDKNodeId node_id_conv;
41522 node_id_conv.inner = untag_ptr(node_id);
41523 node_id_conv.is_owned = ptr_is_owned(node_id);
41524 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_id_conv);
41525 node_id_conv.is_owned = false;
41526 ProbabilisticScorer_remove_manual_penalty(&this_arg_conv, &node_id_conv);
41529 void __attribute__((export_name("TS_ProbabilisticScorer_clear_manual_penalties"))) TS_ProbabilisticScorer_clear_manual_penalties(uint64_t this_arg) {
41530 LDKProbabilisticScorer this_arg_conv;
41531 this_arg_conv.inner = untag_ptr(this_arg);
41532 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41533 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41534 this_arg_conv.is_owned = false;
41535 ProbabilisticScorer_clear_manual_penalties(&this_arg_conv);
41538 void __attribute__((export_name("TS_ProbabilisticScoringParameters_add_banned_from_list"))) TS_ProbabilisticScoringParameters_add_banned_from_list(uint64_t this_arg, uint64_tArray node_ids) {
41539 LDKProbabilisticScoringParameters this_arg_conv;
41540 this_arg_conv.inner = untag_ptr(this_arg);
41541 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41542 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41543 this_arg_conv.is_owned = false;
41544 LDKCVec_NodeIdZ node_ids_constr;
41545 node_ids_constr.datalen = node_ids->arr_len;
41546 if (node_ids_constr.datalen > 0)
41547 node_ids_constr.data = MALLOC(node_ids_constr.datalen * sizeof(LDKNodeId), "LDKCVec_NodeIdZ Elements");
41549 node_ids_constr.data = NULL;
41550 uint64_t* node_ids_vals = node_ids->elems;
41551 for (size_t i = 0; i < node_ids_constr.datalen; i++) {
41552 uint64_t node_ids_conv_8 = node_ids_vals[i];
41553 LDKNodeId node_ids_conv_8_conv;
41554 node_ids_conv_8_conv.inner = untag_ptr(node_ids_conv_8);
41555 node_ids_conv_8_conv.is_owned = ptr_is_owned(node_ids_conv_8);
41556 CHECK_INNER_FIELD_ACCESS_OR_NULL(node_ids_conv_8_conv);
41557 node_ids_conv_8_conv = NodeId_clone(&node_ids_conv_8_conv);
41558 node_ids_constr.data[i] = node_ids_conv_8_conv;
41561 ProbabilisticScoringParameters_add_banned_from_list(&this_arg_conv, node_ids_constr);
41564 uint64_t __attribute__((export_name("TS_ProbabilisticScoringParameters_default"))) TS_ProbabilisticScoringParameters_default() {
41565 LDKProbabilisticScoringParameters ret_var = ProbabilisticScoringParameters_default();
41566 uint64_t ret_ref = 0;
41567 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41568 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41572 uint64_t __attribute__((export_name("TS_ProbabilisticScorer_as_Score"))) TS_ProbabilisticScorer_as_Score(uint64_t this_arg) {
41573 LDKProbabilisticScorer this_arg_conv;
41574 this_arg_conv.inner = untag_ptr(this_arg);
41575 this_arg_conv.is_owned = ptr_is_owned(this_arg);
41576 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
41577 this_arg_conv.is_owned = false;
41578 LDKScore* ret_ret = MALLOC(sizeof(LDKScore), "LDKScore");
41579 *ret_ret = ProbabilisticScorer_as_Score(&this_arg_conv);
41580 return tag_ptr(ret_ret, true);
41583 int8_tArray __attribute__((export_name("TS_ProbabilisticScorer_write"))) TS_ProbabilisticScorer_write(uint64_t obj) {
41584 LDKProbabilisticScorer obj_conv;
41585 obj_conv.inner = untag_ptr(obj);
41586 obj_conv.is_owned = ptr_is_owned(obj);
41587 CHECK_INNER_FIELD_ACCESS_OR_NULL(obj_conv);
41588 obj_conv.is_owned = false;
41589 LDKCVec_u8Z ret_var = ProbabilisticScorer_write(&obj_conv);
41590 int8_tArray ret_arr = init_int8_tArray(ret_var.datalen, __LINE__);
41591 memcpy(ret_arr->elems, ret_var.data, ret_var.datalen);
41592 CVec_u8Z_free(ret_var);
41596 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) {
41597 LDKu8slice ser_ref;
41598 ser_ref.datalen = ser->arr_len;
41599 ser_ref.data = ser->elems;
41600 LDKProbabilisticScoringParameters arg_a_conv;
41601 arg_a_conv.inner = untag_ptr(arg_a);
41602 arg_a_conv.is_owned = ptr_is_owned(arg_a);
41603 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_a_conv);
41604 arg_a_conv = ProbabilisticScoringParameters_clone(&arg_a_conv);
41605 LDKNetworkGraph arg_b_conv;
41606 arg_b_conv.inner = untag_ptr(arg_b);
41607 arg_b_conv.is_owned = ptr_is_owned(arg_b);
41608 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_b_conv);
41609 arg_b_conv.is_owned = false;
41610 void* arg_c_ptr = untag_ptr(arg_c);
41611 CHECK_ACCESS(arg_c_ptr);
41612 LDKLogger arg_c_conv = *(LDKLogger*)(arg_c_ptr);
41613 if (arg_c_conv.free == LDKLogger_JCalls_free) {
41614 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
41615 LDKLogger_JCalls_cloned(&arg_c_conv);
41617 LDKCResult_ProbabilisticScorerDecodeErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_ProbabilisticScorerDecodeErrorZ), "LDKCResult_ProbabilisticScorerDecodeErrorZ");
41618 *ret_conv = ProbabilisticScorer_read(ser_ref, arg_a_conv, &arg_b_conv, arg_c_conv);
41620 return tag_ptr(ret_conv, true);
41623 void __attribute__((export_name("TS_ParseError_free"))) TS_ParseError_free(uint64_t this_ptr) {
41624 if (!ptr_is_owned(this_ptr)) return;
41625 void* this_ptr_ptr = untag_ptr(this_ptr);
41626 CHECK_ACCESS(this_ptr_ptr);
41627 LDKParseError this_ptr_conv = *(LDKParseError*)(this_ptr_ptr);
41628 FREE(untag_ptr(this_ptr));
41629 ParseError_free(this_ptr_conv);
41632 static inline uint64_t ParseError_clone_ptr(LDKParseError *NONNULL_PTR arg) {
41633 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41634 *ret_copy = ParseError_clone(arg);
41635 uint64_t ret_ref = tag_ptr(ret_copy, true);
41638 int64_t __attribute__((export_name("TS_ParseError_clone_ptr"))) TS_ParseError_clone_ptr(uint64_t arg) {
41639 LDKParseError* arg_conv = (LDKParseError*)untag_ptr(arg);
41640 int64_t ret_conv = ParseError_clone_ptr(arg_conv);
41644 uint64_t __attribute__((export_name("TS_ParseError_clone"))) TS_ParseError_clone(uint64_t orig) {
41645 LDKParseError* orig_conv = (LDKParseError*)untag_ptr(orig);
41646 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41647 *ret_copy = ParseError_clone(orig_conv);
41648 uint64_t ret_ref = tag_ptr(ret_copy, true);
41652 uint64_t __attribute__((export_name("TS_ParseError_bech32_error"))) TS_ParseError_bech32_error(uint64_t a) {
41653 void* a_ptr = untag_ptr(a);
41654 CHECK_ACCESS(a_ptr);
41655 LDKBech32Error a_conv = *(LDKBech32Error*)(a_ptr);
41656 a_conv = Bech32Error_clone((LDKBech32Error*)untag_ptr(a));
41657 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41658 *ret_copy = ParseError_bech32_error(a_conv);
41659 uint64_t ret_ref = tag_ptr(ret_copy, true);
41663 uint64_t __attribute__((export_name("TS_ParseError_parse_amount_error"))) TS_ParseError_parse_amount_error(int32_t a) {
41665 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41666 *ret_copy = ParseError_parse_amount_error((LDKError){ ._dummy = 0 });
41667 uint64_t ret_ref = tag_ptr(ret_copy, true);
41671 uint64_t __attribute__((export_name("TS_ParseError_malformed_signature"))) TS_ParseError_malformed_signature(uint32_t a) {
41672 LDKSecp256k1Error a_conv = LDKSecp256k1Error_from_js(a);
41673 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41674 *ret_copy = ParseError_malformed_signature(a_conv);
41675 uint64_t ret_ref = tag_ptr(ret_copy, true);
41679 uint64_t __attribute__((export_name("TS_ParseError_bad_prefix"))) TS_ParseError_bad_prefix() {
41680 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41681 *ret_copy = ParseError_bad_prefix();
41682 uint64_t ret_ref = tag_ptr(ret_copy, true);
41686 uint64_t __attribute__((export_name("TS_ParseError_unknown_currency"))) TS_ParseError_unknown_currency() {
41687 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41688 *ret_copy = ParseError_unknown_currency();
41689 uint64_t ret_ref = tag_ptr(ret_copy, true);
41693 uint64_t __attribute__((export_name("TS_ParseError_unknown_si_prefix"))) TS_ParseError_unknown_si_prefix() {
41694 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41695 *ret_copy = ParseError_unknown_si_prefix();
41696 uint64_t ret_ref = tag_ptr(ret_copy, true);
41700 uint64_t __attribute__((export_name("TS_ParseError_malformed_hrp"))) TS_ParseError_malformed_hrp() {
41701 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41702 *ret_copy = ParseError_malformed_hrp();
41703 uint64_t ret_ref = tag_ptr(ret_copy, true);
41707 uint64_t __attribute__((export_name("TS_ParseError_too_short_data_part"))) TS_ParseError_too_short_data_part() {
41708 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41709 *ret_copy = ParseError_too_short_data_part();
41710 uint64_t ret_ref = tag_ptr(ret_copy, true);
41714 uint64_t __attribute__((export_name("TS_ParseError_unexpected_end_of_tagged_fields"))) TS_ParseError_unexpected_end_of_tagged_fields() {
41715 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41716 *ret_copy = ParseError_unexpected_end_of_tagged_fields();
41717 uint64_t ret_ref = tag_ptr(ret_copy, true);
41721 uint64_t __attribute__((export_name("TS_ParseError_description_decode_error"))) TS_ParseError_description_decode_error(int32_t a) {
41723 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41724 *ret_copy = ParseError_description_decode_error((LDKError){ ._dummy = 0 });
41725 uint64_t ret_ref = tag_ptr(ret_copy, true);
41729 uint64_t __attribute__((export_name("TS_ParseError_padding_error"))) TS_ParseError_padding_error() {
41730 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41731 *ret_copy = ParseError_padding_error();
41732 uint64_t ret_ref = tag_ptr(ret_copy, true);
41736 uint64_t __attribute__((export_name("TS_ParseError_integer_overflow_error"))) TS_ParseError_integer_overflow_error() {
41737 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41738 *ret_copy = ParseError_integer_overflow_error();
41739 uint64_t ret_ref = tag_ptr(ret_copy, true);
41743 uint64_t __attribute__((export_name("TS_ParseError_invalid_seg_wit_program_length"))) TS_ParseError_invalid_seg_wit_program_length() {
41744 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41745 *ret_copy = ParseError_invalid_seg_wit_program_length();
41746 uint64_t ret_ref = tag_ptr(ret_copy, true);
41750 uint64_t __attribute__((export_name("TS_ParseError_invalid_pub_key_hash_length"))) TS_ParseError_invalid_pub_key_hash_length() {
41751 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41752 *ret_copy = ParseError_invalid_pub_key_hash_length();
41753 uint64_t ret_ref = tag_ptr(ret_copy, true);
41757 uint64_t __attribute__((export_name("TS_ParseError_invalid_script_hash_length"))) TS_ParseError_invalid_script_hash_length() {
41758 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41759 *ret_copy = ParseError_invalid_script_hash_length();
41760 uint64_t ret_ref = tag_ptr(ret_copy, true);
41764 uint64_t __attribute__((export_name("TS_ParseError_invalid_recovery_id"))) TS_ParseError_invalid_recovery_id() {
41765 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41766 *ret_copy = ParseError_invalid_recovery_id();
41767 uint64_t ret_ref = tag_ptr(ret_copy, true);
41771 uint64_t __attribute__((export_name("TS_ParseError_invalid_slice_length"))) TS_ParseError_invalid_slice_length(jstring a) {
41772 LDKStr a_conv = str_ref_to_owned_c(a);
41773 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41774 *ret_copy = ParseError_invalid_slice_length(a_conv);
41775 uint64_t ret_ref = tag_ptr(ret_copy, true);
41779 uint64_t __attribute__((export_name("TS_ParseError_skip"))) TS_ParseError_skip() {
41780 LDKParseError *ret_copy = MALLOC(sizeof(LDKParseError), "LDKParseError");
41781 *ret_copy = ParseError_skip();
41782 uint64_t ret_ref = tag_ptr(ret_copy, true);
41786 void __attribute__((export_name("TS_ParseOrSemanticError_free"))) TS_ParseOrSemanticError_free(uint64_t this_ptr) {
41787 if (!ptr_is_owned(this_ptr)) return;
41788 void* this_ptr_ptr = untag_ptr(this_ptr);
41789 CHECK_ACCESS(this_ptr_ptr);
41790 LDKParseOrSemanticError this_ptr_conv = *(LDKParseOrSemanticError*)(this_ptr_ptr);
41791 FREE(untag_ptr(this_ptr));
41792 ParseOrSemanticError_free(this_ptr_conv);
41795 static inline uint64_t ParseOrSemanticError_clone_ptr(LDKParseOrSemanticError *NONNULL_PTR arg) {
41796 LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError");
41797 *ret_copy = ParseOrSemanticError_clone(arg);
41798 uint64_t ret_ref = tag_ptr(ret_copy, true);
41801 int64_t __attribute__((export_name("TS_ParseOrSemanticError_clone_ptr"))) TS_ParseOrSemanticError_clone_ptr(uint64_t arg) {
41802 LDKParseOrSemanticError* arg_conv = (LDKParseOrSemanticError*)untag_ptr(arg);
41803 int64_t ret_conv = ParseOrSemanticError_clone_ptr(arg_conv);
41807 uint64_t __attribute__((export_name("TS_ParseOrSemanticError_clone"))) TS_ParseOrSemanticError_clone(uint64_t orig) {
41808 LDKParseOrSemanticError* orig_conv = (LDKParseOrSemanticError*)untag_ptr(orig);
41809 LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError");
41810 *ret_copy = ParseOrSemanticError_clone(orig_conv);
41811 uint64_t ret_ref = tag_ptr(ret_copy, true);
41815 uint64_t __attribute__((export_name("TS_ParseOrSemanticError_parse_error"))) TS_ParseOrSemanticError_parse_error(uint64_t a) {
41816 void* a_ptr = untag_ptr(a);
41817 CHECK_ACCESS(a_ptr);
41818 LDKParseError a_conv = *(LDKParseError*)(a_ptr);
41819 a_conv = ParseError_clone((LDKParseError*)untag_ptr(a));
41820 LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError");
41821 *ret_copy = ParseOrSemanticError_parse_error(a_conv);
41822 uint64_t ret_ref = tag_ptr(ret_copy, true);
41826 uint64_t __attribute__((export_name("TS_ParseOrSemanticError_semantic_error"))) TS_ParseOrSemanticError_semantic_error(uint32_t a) {
41827 LDKSemanticError a_conv = LDKSemanticError_from_js(a);
41828 LDKParseOrSemanticError *ret_copy = MALLOC(sizeof(LDKParseOrSemanticError), "LDKParseOrSemanticError");
41829 *ret_copy = ParseOrSemanticError_semantic_error(a_conv);
41830 uint64_t ret_ref = tag_ptr(ret_copy, true);
41834 void __attribute__((export_name("TS_Invoice_free"))) TS_Invoice_free(uint64_t this_obj) {
41835 LDKInvoice this_obj_conv;
41836 this_obj_conv.inner = untag_ptr(this_obj);
41837 this_obj_conv.is_owned = ptr_is_owned(this_obj);
41838 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
41839 Invoice_free(this_obj_conv);
41842 jboolean __attribute__((export_name("TS_Invoice_eq"))) TS_Invoice_eq(uint64_t a, uint64_t b) {
41844 a_conv.inner = untag_ptr(a);
41845 a_conv.is_owned = ptr_is_owned(a);
41846 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
41847 a_conv.is_owned = false;
41849 b_conv.inner = untag_ptr(b);
41850 b_conv.is_owned = ptr_is_owned(b);
41851 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
41852 b_conv.is_owned = false;
41853 jboolean ret_conv = Invoice_eq(&a_conv, &b_conv);
41857 static inline uint64_t Invoice_clone_ptr(LDKInvoice *NONNULL_PTR arg) {
41858 LDKInvoice ret_var = Invoice_clone(arg);
41859 uint64_t ret_ref = 0;
41860 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41861 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41864 int64_t __attribute__((export_name("TS_Invoice_clone_ptr"))) TS_Invoice_clone_ptr(uint64_t arg) {
41865 LDKInvoice arg_conv;
41866 arg_conv.inner = untag_ptr(arg);
41867 arg_conv.is_owned = ptr_is_owned(arg);
41868 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
41869 arg_conv.is_owned = false;
41870 int64_t ret_conv = Invoice_clone_ptr(&arg_conv);
41874 uint64_t __attribute__((export_name("TS_Invoice_clone"))) TS_Invoice_clone(uint64_t orig) {
41875 LDKInvoice orig_conv;
41876 orig_conv.inner = untag_ptr(orig);
41877 orig_conv.is_owned = ptr_is_owned(orig);
41878 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
41879 orig_conv.is_owned = false;
41880 LDKInvoice ret_var = Invoice_clone(&orig_conv);
41881 uint64_t ret_ref = 0;
41882 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41883 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41887 void __attribute__((export_name("TS_SignedRawInvoice_free"))) TS_SignedRawInvoice_free(uint64_t this_obj) {
41888 LDKSignedRawInvoice this_obj_conv;
41889 this_obj_conv.inner = untag_ptr(this_obj);
41890 this_obj_conv.is_owned = ptr_is_owned(this_obj);
41891 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
41892 SignedRawInvoice_free(this_obj_conv);
41895 jboolean __attribute__((export_name("TS_SignedRawInvoice_eq"))) TS_SignedRawInvoice_eq(uint64_t a, uint64_t b) {
41896 LDKSignedRawInvoice a_conv;
41897 a_conv.inner = untag_ptr(a);
41898 a_conv.is_owned = ptr_is_owned(a);
41899 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
41900 a_conv.is_owned = false;
41901 LDKSignedRawInvoice b_conv;
41902 b_conv.inner = untag_ptr(b);
41903 b_conv.is_owned = ptr_is_owned(b);
41904 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
41905 b_conv.is_owned = false;
41906 jboolean ret_conv = SignedRawInvoice_eq(&a_conv, &b_conv);
41910 static inline uint64_t SignedRawInvoice_clone_ptr(LDKSignedRawInvoice *NONNULL_PTR arg) {
41911 LDKSignedRawInvoice ret_var = SignedRawInvoice_clone(arg);
41912 uint64_t ret_ref = 0;
41913 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41914 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41917 int64_t __attribute__((export_name("TS_SignedRawInvoice_clone_ptr"))) TS_SignedRawInvoice_clone_ptr(uint64_t arg) {
41918 LDKSignedRawInvoice arg_conv;
41919 arg_conv.inner = untag_ptr(arg);
41920 arg_conv.is_owned = ptr_is_owned(arg);
41921 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
41922 arg_conv.is_owned = false;
41923 int64_t ret_conv = SignedRawInvoice_clone_ptr(&arg_conv);
41927 uint64_t __attribute__((export_name("TS_SignedRawInvoice_clone"))) TS_SignedRawInvoice_clone(uint64_t orig) {
41928 LDKSignedRawInvoice orig_conv;
41929 orig_conv.inner = untag_ptr(orig);
41930 orig_conv.is_owned = ptr_is_owned(orig);
41931 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
41932 orig_conv.is_owned = false;
41933 LDKSignedRawInvoice ret_var = SignedRawInvoice_clone(&orig_conv);
41934 uint64_t ret_ref = 0;
41935 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41936 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41940 void __attribute__((export_name("TS_RawInvoice_free"))) TS_RawInvoice_free(uint64_t this_obj) {
41941 LDKRawInvoice this_obj_conv;
41942 this_obj_conv.inner = untag_ptr(this_obj);
41943 this_obj_conv.is_owned = ptr_is_owned(this_obj);
41944 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
41945 RawInvoice_free(this_obj_conv);
41948 uint64_t __attribute__((export_name("TS_RawInvoice_get_data"))) TS_RawInvoice_get_data(uint64_t this_ptr) {
41949 LDKRawInvoice this_ptr_conv;
41950 this_ptr_conv.inner = untag_ptr(this_ptr);
41951 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41952 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41953 this_ptr_conv.is_owned = false;
41954 LDKRawDataPart ret_var = RawInvoice_get_data(&this_ptr_conv);
41955 uint64_t ret_ref = 0;
41956 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41957 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41961 void __attribute__((export_name("TS_RawInvoice_set_data"))) TS_RawInvoice_set_data(uint64_t this_ptr, uint64_t val) {
41962 LDKRawInvoice this_ptr_conv;
41963 this_ptr_conv.inner = untag_ptr(this_ptr);
41964 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
41965 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
41966 this_ptr_conv.is_owned = false;
41967 LDKRawDataPart val_conv;
41968 val_conv.inner = untag_ptr(val);
41969 val_conv.is_owned = ptr_is_owned(val);
41970 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
41971 val_conv = RawDataPart_clone(&val_conv);
41972 RawInvoice_set_data(&this_ptr_conv, val_conv);
41975 jboolean __attribute__((export_name("TS_RawInvoice_eq"))) TS_RawInvoice_eq(uint64_t a, uint64_t b) {
41976 LDKRawInvoice a_conv;
41977 a_conv.inner = untag_ptr(a);
41978 a_conv.is_owned = ptr_is_owned(a);
41979 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
41980 a_conv.is_owned = false;
41981 LDKRawInvoice b_conv;
41982 b_conv.inner = untag_ptr(b);
41983 b_conv.is_owned = ptr_is_owned(b);
41984 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
41985 b_conv.is_owned = false;
41986 jboolean ret_conv = RawInvoice_eq(&a_conv, &b_conv);
41990 static inline uint64_t RawInvoice_clone_ptr(LDKRawInvoice *NONNULL_PTR arg) {
41991 LDKRawInvoice ret_var = RawInvoice_clone(arg);
41992 uint64_t ret_ref = 0;
41993 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
41994 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
41997 int64_t __attribute__((export_name("TS_RawInvoice_clone_ptr"))) TS_RawInvoice_clone_ptr(uint64_t arg) {
41998 LDKRawInvoice arg_conv;
41999 arg_conv.inner = untag_ptr(arg);
42000 arg_conv.is_owned = ptr_is_owned(arg);
42001 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42002 arg_conv.is_owned = false;
42003 int64_t ret_conv = RawInvoice_clone_ptr(&arg_conv);
42007 uint64_t __attribute__((export_name("TS_RawInvoice_clone"))) TS_RawInvoice_clone(uint64_t orig) {
42008 LDKRawInvoice orig_conv;
42009 orig_conv.inner = untag_ptr(orig);
42010 orig_conv.is_owned = ptr_is_owned(orig);
42011 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42012 orig_conv.is_owned = false;
42013 LDKRawInvoice ret_var = RawInvoice_clone(&orig_conv);
42014 uint64_t ret_ref = 0;
42015 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42016 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42020 void __attribute__((export_name("TS_RawDataPart_free"))) TS_RawDataPart_free(uint64_t this_obj) {
42021 LDKRawDataPart this_obj_conv;
42022 this_obj_conv.inner = untag_ptr(this_obj);
42023 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42024 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42025 RawDataPart_free(this_obj_conv);
42028 uint64_t __attribute__((export_name("TS_RawDataPart_get_timestamp"))) TS_RawDataPart_get_timestamp(uint64_t this_ptr) {
42029 LDKRawDataPart this_ptr_conv;
42030 this_ptr_conv.inner = untag_ptr(this_ptr);
42031 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42032 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42033 this_ptr_conv.is_owned = false;
42034 LDKPositiveTimestamp ret_var = RawDataPart_get_timestamp(&this_ptr_conv);
42035 uint64_t ret_ref = 0;
42036 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42037 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42041 void __attribute__((export_name("TS_RawDataPart_set_timestamp"))) TS_RawDataPart_set_timestamp(uint64_t this_ptr, uint64_t val) {
42042 LDKRawDataPart this_ptr_conv;
42043 this_ptr_conv.inner = untag_ptr(this_ptr);
42044 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42045 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42046 this_ptr_conv.is_owned = false;
42047 LDKPositiveTimestamp val_conv;
42048 val_conv.inner = untag_ptr(val);
42049 val_conv.is_owned = ptr_is_owned(val);
42050 CHECK_INNER_FIELD_ACCESS_OR_NULL(val_conv);
42051 val_conv = PositiveTimestamp_clone(&val_conv);
42052 RawDataPart_set_timestamp(&this_ptr_conv, val_conv);
42055 jboolean __attribute__((export_name("TS_RawDataPart_eq"))) TS_RawDataPart_eq(uint64_t a, uint64_t b) {
42056 LDKRawDataPart a_conv;
42057 a_conv.inner = untag_ptr(a);
42058 a_conv.is_owned = ptr_is_owned(a);
42059 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42060 a_conv.is_owned = false;
42061 LDKRawDataPart b_conv;
42062 b_conv.inner = untag_ptr(b);
42063 b_conv.is_owned = ptr_is_owned(b);
42064 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42065 b_conv.is_owned = false;
42066 jboolean ret_conv = RawDataPart_eq(&a_conv, &b_conv);
42070 static inline uint64_t RawDataPart_clone_ptr(LDKRawDataPart *NONNULL_PTR arg) {
42071 LDKRawDataPart ret_var = RawDataPart_clone(arg);
42072 uint64_t ret_ref = 0;
42073 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42074 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42077 int64_t __attribute__((export_name("TS_RawDataPart_clone_ptr"))) TS_RawDataPart_clone_ptr(uint64_t arg) {
42078 LDKRawDataPart arg_conv;
42079 arg_conv.inner = untag_ptr(arg);
42080 arg_conv.is_owned = ptr_is_owned(arg);
42081 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42082 arg_conv.is_owned = false;
42083 int64_t ret_conv = RawDataPart_clone_ptr(&arg_conv);
42087 uint64_t __attribute__((export_name("TS_RawDataPart_clone"))) TS_RawDataPart_clone(uint64_t orig) {
42088 LDKRawDataPart orig_conv;
42089 orig_conv.inner = untag_ptr(orig);
42090 orig_conv.is_owned = ptr_is_owned(orig);
42091 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42092 orig_conv.is_owned = false;
42093 LDKRawDataPart ret_var = RawDataPart_clone(&orig_conv);
42094 uint64_t ret_ref = 0;
42095 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42096 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42100 void __attribute__((export_name("TS_PositiveTimestamp_free"))) TS_PositiveTimestamp_free(uint64_t this_obj) {
42101 LDKPositiveTimestamp this_obj_conv;
42102 this_obj_conv.inner = untag_ptr(this_obj);
42103 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42104 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42105 PositiveTimestamp_free(this_obj_conv);
42108 jboolean __attribute__((export_name("TS_PositiveTimestamp_eq"))) TS_PositiveTimestamp_eq(uint64_t a, uint64_t b) {
42109 LDKPositiveTimestamp a_conv;
42110 a_conv.inner = untag_ptr(a);
42111 a_conv.is_owned = ptr_is_owned(a);
42112 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42113 a_conv.is_owned = false;
42114 LDKPositiveTimestamp b_conv;
42115 b_conv.inner = untag_ptr(b);
42116 b_conv.is_owned = ptr_is_owned(b);
42117 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42118 b_conv.is_owned = false;
42119 jboolean ret_conv = PositiveTimestamp_eq(&a_conv, &b_conv);
42123 static inline uint64_t PositiveTimestamp_clone_ptr(LDKPositiveTimestamp *NONNULL_PTR arg) {
42124 LDKPositiveTimestamp ret_var = PositiveTimestamp_clone(arg);
42125 uint64_t ret_ref = 0;
42126 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42127 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42130 int64_t __attribute__((export_name("TS_PositiveTimestamp_clone_ptr"))) TS_PositiveTimestamp_clone_ptr(uint64_t arg) {
42131 LDKPositiveTimestamp arg_conv;
42132 arg_conv.inner = untag_ptr(arg);
42133 arg_conv.is_owned = ptr_is_owned(arg);
42134 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42135 arg_conv.is_owned = false;
42136 int64_t ret_conv = PositiveTimestamp_clone_ptr(&arg_conv);
42140 uint64_t __attribute__((export_name("TS_PositiveTimestamp_clone"))) TS_PositiveTimestamp_clone(uint64_t orig) {
42141 LDKPositiveTimestamp orig_conv;
42142 orig_conv.inner = untag_ptr(orig);
42143 orig_conv.is_owned = ptr_is_owned(orig);
42144 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42145 orig_conv.is_owned = false;
42146 LDKPositiveTimestamp ret_var = PositiveTimestamp_clone(&orig_conv);
42147 uint64_t ret_ref = 0;
42148 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42149 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42153 uint32_t __attribute__((export_name("TS_SiPrefix_clone"))) TS_SiPrefix_clone(uint64_t orig) {
42154 LDKSiPrefix* orig_conv = (LDKSiPrefix*)untag_ptr(orig);
42155 uint32_t ret_conv = LDKSiPrefix_to_js(SiPrefix_clone(orig_conv));
42159 uint32_t __attribute__((export_name("TS_SiPrefix_milli"))) TS_SiPrefix_milli() {
42160 uint32_t ret_conv = LDKSiPrefix_to_js(SiPrefix_milli());
42164 uint32_t __attribute__((export_name("TS_SiPrefix_micro"))) TS_SiPrefix_micro() {
42165 uint32_t ret_conv = LDKSiPrefix_to_js(SiPrefix_micro());
42169 uint32_t __attribute__((export_name("TS_SiPrefix_nano"))) TS_SiPrefix_nano() {
42170 uint32_t ret_conv = LDKSiPrefix_to_js(SiPrefix_nano());
42174 uint32_t __attribute__((export_name("TS_SiPrefix_pico"))) TS_SiPrefix_pico() {
42175 uint32_t ret_conv = LDKSiPrefix_to_js(SiPrefix_pico());
42179 jboolean __attribute__((export_name("TS_SiPrefix_eq"))) TS_SiPrefix_eq(uint64_t a, uint64_t b) {
42180 LDKSiPrefix* a_conv = (LDKSiPrefix*)untag_ptr(a);
42181 LDKSiPrefix* b_conv = (LDKSiPrefix*)untag_ptr(b);
42182 jboolean ret_conv = SiPrefix_eq(a_conv, b_conv);
42186 int64_t __attribute__((export_name("TS_SiPrefix_multiplier"))) TS_SiPrefix_multiplier(uint64_t this_arg) {
42187 LDKSiPrefix* this_arg_conv = (LDKSiPrefix*)untag_ptr(this_arg);
42188 int64_t ret_conv = SiPrefix_multiplier(this_arg_conv);
42192 uint32_t __attribute__((export_name("TS_Currency_clone"))) TS_Currency_clone(uint64_t orig) {
42193 LDKCurrency* orig_conv = (LDKCurrency*)untag_ptr(orig);
42194 uint32_t ret_conv = LDKCurrency_to_js(Currency_clone(orig_conv));
42198 uint32_t __attribute__((export_name("TS_Currency_bitcoin"))) TS_Currency_bitcoin() {
42199 uint32_t ret_conv = LDKCurrency_to_js(Currency_bitcoin());
42203 uint32_t __attribute__((export_name("TS_Currency_bitcoin_testnet"))) TS_Currency_bitcoin_testnet() {
42204 uint32_t ret_conv = LDKCurrency_to_js(Currency_bitcoin_testnet());
42208 uint32_t __attribute__((export_name("TS_Currency_regtest"))) TS_Currency_regtest() {
42209 uint32_t ret_conv = LDKCurrency_to_js(Currency_regtest());
42213 uint32_t __attribute__((export_name("TS_Currency_simnet"))) TS_Currency_simnet() {
42214 uint32_t ret_conv = LDKCurrency_to_js(Currency_simnet());
42218 uint32_t __attribute__((export_name("TS_Currency_signet"))) TS_Currency_signet() {
42219 uint32_t ret_conv = LDKCurrency_to_js(Currency_signet());
42223 int64_t __attribute__((export_name("TS_Currency_hash"))) TS_Currency_hash(uint64_t o) {
42224 LDKCurrency* o_conv = (LDKCurrency*)untag_ptr(o);
42225 int64_t ret_conv = Currency_hash(o_conv);
42229 jboolean __attribute__((export_name("TS_Currency_eq"))) TS_Currency_eq(uint64_t a, uint64_t b) {
42230 LDKCurrency* a_conv = (LDKCurrency*)untag_ptr(a);
42231 LDKCurrency* b_conv = (LDKCurrency*)untag_ptr(b);
42232 jboolean ret_conv = Currency_eq(a_conv, b_conv);
42236 void __attribute__((export_name("TS_Sha256_free"))) TS_Sha256_free(uint64_t this_obj) {
42237 LDKSha256 this_obj_conv;
42238 this_obj_conv.inner = untag_ptr(this_obj);
42239 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42240 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42241 Sha256_free(this_obj_conv);
42244 static inline uint64_t Sha256_clone_ptr(LDKSha256 *NONNULL_PTR arg) {
42245 LDKSha256 ret_var = Sha256_clone(arg);
42246 uint64_t ret_ref = 0;
42247 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42248 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42251 int64_t __attribute__((export_name("TS_Sha256_clone_ptr"))) TS_Sha256_clone_ptr(uint64_t arg) {
42252 LDKSha256 arg_conv;
42253 arg_conv.inner = untag_ptr(arg);
42254 arg_conv.is_owned = ptr_is_owned(arg);
42255 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42256 arg_conv.is_owned = false;
42257 int64_t ret_conv = Sha256_clone_ptr(&arg_conv);
42261 uint64_t __attribute__((export_name("TS_Sha256_clone"))) TS_Sha256_clone(uint64_t orig) {
42262 LDKSha256 orig_conv;
42263 orig_conv.inner = untag_ptr(orig);
42264 orig_conv.is_owned = ptr_is_owned(orig);
42265 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42266 orig_conv.is_owned = false;
42267 LDKSha256 ret_var = Sha256_clone(&orig_conv);
42268 uint64_t ret_ref = 0;
42269 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42270 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42274 int64_t __attribute__((export_name("TS_Sha256_hash"))) TS_Sha256_hash(uint64_t o) {
42276 o_conv.inner = untag_ptr(o);
42277 o_conv.is_owned = ptr_is_owned(o);
42278 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
42279 o_conv.is_owned = false;
42280 int64_t ret_conv = Sha256_hash(&o_conv);
42284 jboolean __attribute__((export_name("TS_Sha256_eq"))) TS_Sha256_eq(uint64_t a, uint64_t b) {
42286 a_conv.inner = untag_ptr(a);
42287 a_conv.is_owned = ptr_is_owned(a);
42288 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42289 a_conv.is_owned = false;
42291 b_conv.inner = untag_ptr(b);
42292 b_conv.is_owned = ptr_is_owned(b);
42293 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42294 b_conv.is_owned = false;
42295 jboolean ret_conv = Sha256_eq(&a_conv, &b_conv);
42299 void __attribute__((export_name("TS_Description_free"))) TS_Description_free(uint64_t this_obj) {
42300 LDKDescription this_obj_conv;
42301 this_obj_conv.inner = untag_ptr(this_obj);
42302 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42303 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42304 Description_free(this_obj_conv);
42307 static inline uint64_t Description_clone_ptr(LDKDescription *NONNULL_PTR arg) {
42308 LDKDescription ret_var = Description_clone(arg);
42309 uint64_t ret_ref = 0;
42310 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42311 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42314 int64_t __attribute__((export_name("TS_Description_clone_ptr"))) TS_Description_clone_ptr(uint64_t arg) {
42315 LDKDescription arg_conv;
42316 arg_conv.inner = untag_ptr(arg);
42317 arg_conv.is_owned = ptr_is_owned(arg);
42318 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42319 arg_conv.is_owned = false;
42320 int64_t ret_conv = Description_clone_ptr(&arg_conv);
42324 uint64_t __attribute__((export_name("TS_Description_clone"))) TS_Description_clone(uint64_t orig) {
42325 LDKDescription orig_conv;
42326 orig_conv.inner = untag_ptr(orig);
42327 orig_conv.is_owned = ptr_is_owned(orig);
42328 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42329 orig_conv.is_owned = false;
42330 LDKDescription ret_var = Description_clone(&orig_conv);
42331 uint64_t ret_ref = 0;
42332 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42333 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42337 int64_t __attribute__((export_name("TS_Description_hash"))) TS_Description_hash(uint64_t o) {
42338 LDKDescription o_conv;
42339 o_conv.inner = untag_ptr(o);
42340 o_conv.is_owned = ptr_is_owned(o);
42341 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
42342 o_conv.is_owned = false;
42343 int64_t ret_conv = Description_hash(&o_conv);
42347 jboolean __attribute__((export_name("TS_Description_eq"))) TS_Description_eq(uint64_t a, uint64_t b) {
42348 LDKDescription a_conv;
42349 a_conv.inner = untag_ptr(a);
42350 a_conv.is_owned = ptr_is_owned(a);
42351 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42352 a_conv.is_owned = false;
42353 LDKDescription b_conv;
42354 b_conv.inner = untag_ptr(b);
42355 b_conv.is_owned = ptr_is_owned(b);
42356 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42357 b_conv.is_owned = false;
42358 jboolean ret_conv = Description_eq(&a_conv, &b_conv);
42362 void __attribute__((export_name("TS_PayeePubKey_free"))) TS_PayeePubKey_free(uint64_t this_obj) {
42363 LDKPayeePubKey this_obj_conv;
42364 this_obj_conv.inner = untag_ptr(this_obj);
42365 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42366 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42367 PayeePubKey_free(this_obj_conv);
42370 int8_tArray __attribute__((export_name("TS_PayeePubKey_get_a"))) TS_PayeePubKey_get_a(uint64_t this_ptr) {
42371 LDKPayeePubKey this_ptr_conv;
42372 this_ptr_conv.inner = untag_ptr(this_ptr);
42373 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42374 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42375 this_ptr_conv.is_owned = false;
42376 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
42377 memcpy(ret_arr->elems, PayeePubKey_get_a(&this_ptr_conv).compressed_form, 33);
42381 void __attribute__((export_name("TS_PayeePubKey_set_a"))) TS_PayeePubKey_set_a(uint64_t this_ptr, int8_tArray val) {
42382 LDKPayeePubKey this_ptr_conv;
42383 this_ptr_conv.inner = untag_ptr(this_ptr);
42384 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42385 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42386 this_ptr_conv.is_owned = false;
42387 LDKPublicKey val_ref;
42388 CHECK(val->arr_len == 33);
42389 memcpy(val_ref.compressed_form, val->elems, 33); FREE(val);
42390 PayeePubKey_set_a(&this_ptr_conv, val_ref);
42393 uint64_t __attribute__((export_name("TS_PayeePubKey_new"))) TS_PayeePubKey_new(int8_tArray a_arg) {
42394 LDKPublicKey a_arg_ref;
42395 CHECK(a_arg->arr_len == 33);
42396 memcpy(a_arg_ref.compressed_form, a_arg->elems, 33); FREE(a_arg);
42397 LDKPayeePubKey ret_var = PayeePubKey_new(a_arg_ref);
42398 uint64_t ret_ref = 0;
42399 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42400 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42404 static inline uint64_t PayeePubKey_clone_ptr(LDKPayeePubKey *NONNULL_PTR arg) {
42405 LDKPayeePubKey ret_var = PayeePubKey_clone(arg);
42406 uint64_t ret_ref = 0;
42407 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42408 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42411 int64_t __attribute__((export_name("TS_PayeePubKey_clone_ptr"))) TS_PayeePubKey_clone_ptr(uint64_t arg) {
42412 LDKPayeePubKey arg_conv;
42413 arg_conv.inner = untag_ptr(arg);
42414 arg_conv.is_owned = ptr_is_owned(arg);
42415 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42416 arg_conv.is_owned = false;
42417 int64_t ret_conv = PayeePubKey_clone_ptr(&arg_conv);
42421 uint64_t __attribute__((export_name("TS_PayeePubKey_clone"))) TS_PayeePubKey_clone(uint64_t orig) {
42422 LDKPayeePubKey orig_conv;
42423 orig_conv.inner = untag_ptr(orig);
42424 orig_conv.is_owned = ptr_is_owned(orig);
42425 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42426 orig_conv.is_owned = false;
42427 LDKPayeePubKey ret_var = PayeePubKey_clone(&orig_conv);
42428 uint64_t ret_ref = 0;
42429 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42430 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42434 int64_t __attribute__((export_name("TS_PayeePubKey_hash"))) TS_PayeePubKey_hash(uint64_t o) {
42435 LDKPayeePubKey o_conv;
42436 o_conv.inner = untag_ptr(o);
42437 o_conv.is_owned = ptr_is_owned(o);
42438 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
42439 o_conv.is_owned = false;
42440 int64_t ret_conv = PayeePubKey_hash(&o_conv);
42444 jboolean __attribute__((export_name("TS_PayeePubKey_eq"))) TS_PayeePubKey_eq(uint64_t a, uint64_t b) {
42445 LDKPayeePubKey a_conv;
42446 a_conv.inner = untag_ptr(a);
42447 a_conv.is_owned = ptr_is_owned(a);
42448 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42449 a_conv.is_owned = false;
42450 LDKPayeePubKey b_conv;
42451 b_conv.inner = untag_ptr(b);
42452 b_conv.is_owned = ptr_is_owned(b);
42453 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42454 b_conv.is_owned = false;
42455 jboolean ret_conv = PayeePubKey_eq(&a_conv, &b_conv);
42459 void __attribute__((export_name("TS_ExpiryTime_free"))) TS_ExpiryTime_free(uint64_t this_obj) {
42460 LDKExpiryTime this_obj_conv;
42461 this_obj_conv.inner = untag_ptr(this_obj);
42462 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42463 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42464 ExpiryTime_free(this_obj_conv);
42467 static inline uint64_t ExpiryTime_clone_ptr(LDKExpiryTime *NONNULL_PTR arg) {
42468 LDKExpiryTime ret_var = ExpiryTime_clone(arg);
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);
42474 int64_t __attribute__((export_name("TS_ExpiryTime_clone_ptr"))) TS_ExpiryTime_clone_ptr(uint64_t arg) {
42475 LDKExpiryTime arg_conv;
42476 arg_conv.inner = untag_ptr(arg);
42477 arg_conv.is_owned = ptr_is_owned(arg);
42478 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42479 arg_conv.is_owned = false;
42480 int64_t ret_conv = ExpiryTime_clone_ptr(&arg_conv);
42484 uint64_t __attribute__((export_name("TS_ExpiryTime_clone"))) TS_ExpiryTime_clone(uint64_t orig) {
42485 LDKExpiryTime orig_conv;
42486 orig_conv.inner = untag_ptr(orig);
42487 orig_conv.is_owned = ptr_is_owned(orig);
42488 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42489 orig_conv.is_owned = false;
42490 LDKExpiryTime ret_var = ExpiryTime_clone(&orig_conv);
42491 uint64_t ret_ref = 0;
42492 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42493 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42497 int64_t __attribute__((export_name("TS_ExpiryTime_hash"))) TS_ExpiryTime_hash(uint64_t o) {
42498 LDKExpiryTime o_conv;
42499 o_conv.inner = untag_ptr(o);
42500 o_conv.is_owned = ptr_is_owned(o);
42501 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
42502 o_conv.is_owned = false;
42503 int64_t ret_conv = ExpiryTime_hash(&o_conv);
42507 jboolean __attribute__((export_name("TS_ExpiryTime_eq"))) TS_ExpiryTime_eq(uint64_t a, uint64_t b) {
42508 LDKExpiryTime a_conv;
42509 a_conv.inner = untag_ptr(a);
42510 a_conv.is_owned = ptr_is_owned(a);
42511 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42512 a_conv.is_owned = false;
42513 LDKExpiryTime b_conv;
42514 b_conv.inner = untag_ptr(b);
42515 b_conv.is_owned = ptr_is_owned(b);
42516 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42517 b_conv.is_owned = false;
42518 jboolean ret_conv = ExpiryTime_eq(&a_conv, &b_conv);
42522 void __attribute__((export_name("TS_MinFinalCltvExpiry_free"))) TS_MinFinalCltvExpiry_free(uint64_t this_obj) {
42523 LDKMinFinalCltvExpiry this_obj_conv;
42524 this_obj_conv.inner = untag_ptr(this_obj);
42525 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42526 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42527 MinFinalCltvExpiry_free(this_obj_conv);
42530 int64_t __attribute__((export_name("TS_MinFinalCltvExpiry_get_a"))) TS_MinFinalCltvExpiry_get_a(uint64_t this_ptr) {
42531 LDKMinFinalCltvExpiry this_ptr_conv;
42532 this_ptr_conv.inner = untag_ptr(this_ptr);
42533 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42534 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42535 this_ptr_conv.is_owned = false;
42536 int64_t ret_conv = MinFinalCltvExpiry_get_a(&this_ptr_conv);
42540 void __attribute__((export_name("TS_MinFinalCltvExpiry_set_a"))) TS_MinFinalCltvExpiry_set_a(uint64_t this_ptr, int64_t val) {
42541 LDKMinFinalCltvExpiry this_ptr_conv;
42542 this_ptr_conv.inner = untag_ptr(this_ptr);
42543 this_ptr_conv.is_owned = ptr_is_owned(this_ptr);
42544 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_ptr_conv);
42545 this_ptr_conv.is_owned = false;
42546 MinFinalCltvExpiry_set_a(&this_ptr_conv, val);
42549 uint64_t __attribute__((export_name("TS_MinFinalCltvExpiry_new"))) TS_MinFinalCltvExpiry_new(int64_t a_arg) {
42550 LDKMinFinalCltvExpiry ret_var = MinFinalCltvExpiry_new(a_arg);
42551 uint64_t ret_ref = 0;
42552 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42553 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42557 static inline uint64_t MinFinalCltvExpiry_clone_ptr(LDKMinFinalCltvExpiry *NONNULL_PTR arg) {
42558 LDKMinFinalCltvExpiry ret_var = MinFinalCltvExpiry_clone(arg);
42559 uint64_t ret_ref = 0;
42560 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42561 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42564 int64_t __attribute__((export_name("TS_MinFinalCltvExpiry_clone_ptr"))) TS_MinFinalCltvExpiry_clone_ptr(uint64_t arg) {
42565 LDKMinFinalCltvExpiry arg_conv;
42566 arg_conv.inner = untag_ptr(arg);
42567 arg_conv.is_owned = ptr_is_owned(arg);
42568 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42569 arg_conv.is_owned = false;
42570 int64_t ret_conv = MinFinalCltvExpiry_clone_ptr(&arg_conv);
42574 uint64_t __attribute__((export_name("TS_MinFinalCltvExpiry_clone"))) TS_MinFinalCltvExpiry_clone(uint64_t orig) {
42575 LDKMinFinalCltvExpiry orig_conv;
42576 orig_conv.inner = untag_ptr(orig);
42577 orig_conv.is_owned = ptr_is_owned(orig);
42578 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42579 orig_conv.is_owned = false;
42580 LDKMinFinalCltvExpiry ret_var = MinFinalCltvExpiry_clone(&orig_conv);
42581 uint64_t ret_ref = 0;
42582 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42583 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42587 int64_t __attribute__((export_name("TS_MinFinalCltvExpiry_hash"))) TS_MinFinalCltvExpiry_hash(uint64_t o) {
42588 LDKMinFinalCltvExpiry o_conv;
42589 o_conv.inner = untag_ptr(o);
42590 o_conv.is_owned = ptr_is_owned(o);
42591 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
42592 o_conv.is_owned = false;
42593 int64_t ret_conv = MinFinalCltvExpiry_hash(&o_conv);
42597 jboolean __attribute__((export_name("TS_MinFinalCltvExpiry_eq"))) TS_MinFinalCltvExpiry_eq(uint64_t a, uint64_t b) {
42598 LDKMinFinalCltvExpiry a_conv;
42599 a_conv.inner = untag_ptr(a);
42600 a_conv.is_owned = ptr_is_owned(a);
42601 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42602 a_conv.is_owned = false;
42603 LDKMinFinalCltvExpiry b_conv;
42604 b_conv.inner = untag_ptr(b);
42605 b_conv.is_owned = ptr_is_owned(b);
42606 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42607 b_conv.is_owned = false;
42608 jboolean ret_conv = MinFinalCltvExpiry_eq(&a_conv, &b_conv);
42612 void __attribute__((export_name("TS_Fallback_free"))) TS_Fallback_free(uint64_t this_ptr) {
42613 if (!ptr_is_owned(this_ptr)) return;
42614 void* this_ptr_ptr = untag_ptr(this_ptr);
42615 CHECK_ACCESS(this_ptr_ptr);
42616 LDKFallback this_ptr_conv = *(LDKFallback*)(this_ptr_ptr);
42617 FREE(untag_ptr(this_ptr));
42618 Fallback_free(this_ptr_conv);
42621 static inline uint64_t Fallback_clone_ptr(LDKFallback *NONNULL_PTR arg) {
42622 LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
42623 *ret_copy = Fallback_clone(arg);
42624 uint64_t ret_ref = tag_ptr(ret_copy, true);
42627 int64_t __attribute__((export_name("TS_Fallback_clone_ptr"))) TS_Fallback_clone_ptr(uint64_t arg) {
42628 LDKFallback* arg_conv = (LDKFallback*)untag_ptr(arg);
42629 int64_t ret_conv = Fallback_clone_ptr(arg_conv);
42633 uint64_t __attribute__((export_name("TS_Fallback_clone"))) TS_Fallback_clone(uint64_t orig) {
42634 LDKFallback* orig_conv = (LDKFallback*)untag_ptr(orig);
42635 LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
42636 *ret_copy = Fallback_clone(orig_conv);
42637 uint64_t ret_ref = tag_ptr(ret_copy, true);
42641 uint64_t __attribute__((export_name("TS_Fallback_seg_wit_program"))) TS_Fallback_seg_wit_program(int8_t version, int8_tArray program) {
42643 LDKCVec_u8Z program_ref;
42644 program_ref.datalen = program->arr_len;
42645 program_ref.data = MALLOC(program_ref.datalen, "LDKCVec_u8Z Bytes");
42646 memcpy(program_ref.data, program->elems, program_ref.datalen); FREE(program);
42647 LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
42648 *ret_copy = Fallback_seg_wit_program((LDKu5){ ._0 = version }, program_ref);
42649 uint64_t ret_ref = tag_ptr(ret_copy, true);
42653 uint64_t __attribute__((export_name("TS_Fallback_pub_key_hash"))) TS_Fallback_pub_key_hash(int8_tArray a) {
42654 LDKTwentyBytes a_ref;
42655 CHECK(a->arr_len == 20);
42656 memcpy(a_ref.data, a->elems, 20); FREE(a);
42657 LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
42658 *ret_copy = Fallback_pub_key_hash(a_ref);
42659 uint64_t ret_ref = tag_ptr(ret_copy, true);
42663 uint64_t __attribute__((export_name("TS_Fallback_script_hash"))) TS_Fallback_script_hash(int8_tArray a) {
42664 LDKTwentyBytes a_ref;
42665 CHECK(a->arr_len == 20);
42666 memcpy(a_ref.data, a->elems, 20); FREE(a);
42667 LDKFallback *ret_copy = MALLOC(sizeof(LDKFallback), "LDKFallback");
42668 *ret_copy = Fallback_script_hash(a_ref);
42669 uint64_t ret_ref = tag_ptr(ret_copy, true);
42673 int64_t __attribute__((export_name("TS_Fallback_hash"))) TS_Fallback_hash(uint64_t o) {
42674 LDKFallback* o_conv = (LDKFallback*)untag_ptr(o);
42675 int64_t ret_conv = Fallback_hash(o_conv);
42679 jboolean __attribute__((export_name("TS_Fallback_eq"))) TS_Fallback_eq(uint64_t a, uint64_t b) {
42680 LDKFallback* a_conv = (LDKFallback*)untag_ptr(a);
42681 LDKFallback* b_conv = (LDKFallback*)untag_ptr(b);
42682 jboolean ret_conv = Fallback_eq(a_conv, b_conv);
42686 void __attribute__((export_name("TS_InvoiceSignature_free"))) TS_InvoiceSignature_free(uint64_t this_obj) {
42687 LDKInvoiceSignature this_obj_conv;
42688 this_obj_conv.inner = untag_ptr(this_obj);
42689 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42690 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42691 InvoiceSignature_free(this_obj_conv);
42694 static inline uint64_t InvoiceSignature_clone_ptr(LDKInvoiceSignature *NONNULL_PTR arg) {
42695 LDKInvoiceSignature ret_var = InvoiceSignature_clone(arg);
42696 uint64_t ret_ref = 0;
42697 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42698 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42701 int64_t __attribute__((export_name("TS_InvoiceSignature_clone_ptr"))) TS_InvoiceSignature_clone_ptr(uint64_t arg) {
42702 LDKInvoiceSignature arg_conv;
42703 arg_conv.inner = untag_ptr(arg);
42704 arg_conv.is_owned = ptr_is_owned(arg);
42705 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42706 arg_conv.is_owned = false;
42707 int64_t ret_conv = InvoiceSignature_clone_ptr(&arg_conv);
42711 uint64_t __attribute__((export_name("TS_InvoiceSignature_clone"))) TS_InvoiceSignature_clone(uint64_t orig) {
42712 LDKInvoiceSignature orig_conv;
42713 orig_conv.inner = untag_ptr(orig);
42714 orig_conv.is_owned = ptr_is_owned(orig);
42715 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42716 orig_conv.is_owned = false;
42717 LDKInvoiceSignature ret_var = InvoiceSignature_clone(&orig_conv);
42718 uint64_t ret_ref = 0;
42719 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42720 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42724 jboolean __attribute__((export_name("TS_InvoiceSignature_eq"))) TS_InvoiceSignature_eq(uint64_t a, uint64_t b) {
42725 LDKInvoiceSignature a_conv;
42726 a_conv.inner = untag_ptr(a);
42727 a_conv.is_owned = ptr_is_owned(a);
42728 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42729 a_conv.is_owned = false;
42730 LDKInvoiceSignature b_conv;
42731 b_conv.inner = untag_ptr(b);
42732 b_conv.is_owned = ptr_is_owned(b);
42733 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42734 b_conv.is_owned = false;
42735 jboolean ret_conv = InvoiceSignature_eq(&a_conv, &b_conv);
42739 void __attribute__((export_name("TS_PrivateRoute_free"))) TS_PrivateRoute_free(uint64_t this_obj) {
42740 LDKPrivateRoute this_obj_conv;
42741 this_obj_conv.inner = untag_ptr(this_obj);
42742 this_obj_conv.is_owned = ptr_is_owned(this_obj);
42743 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
42744 PrivateRoute_free(this_obj_conv);
42747 static inline uint64_t PrivateRoute_clone_ptr(LDKPrivateRoute *NONNULL_PTR arg) {
42748 LDKPrivateRoute ret_var = PrivateRoute_clone(arg);
42749 uint64_t ret_ref = 0;
42750 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42751 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42754 int64_t __attribute__((export_name("TS_PrivateRoute_clone_ptr"))) TS_PrivateRoute_clone_ptr(uint64_t arg) {
42755 LDKPrivateRoute arg_conv;
42756 arg_conv.inner = untag_ptr(arg);
42757 arg_conv.is_owned = ptr_is_owned(arg);
42758 CHECK_INNER_FIELD_ACCESS_OR_NULL(arg_conv);
42759 arg_conv.is_owned = false;
42760 int64_t ret_conv = PrivateRoute_clone_ptr(&arg_conv);
42764 uint64_t __attribute__((export_name("TS_PrivateRoute_clone"))) TS_PrivateRoute_clone(uint64_t orig) {
42765 LDKPrivateRoute orig_conv;
42766 orig_conv.inner = untag_ptr(orig);
42767 orig_conv.is_owned = ptr_is_owned(orig);
42768 CHECK_INNER_FIELD_ACCESS_OR_NULL(orig_conv);
42769 orig_conv.is_owned = false;
42770 LDKPrivateRoute ret_var = PrivateRoute_clone(&orig_conv);
42771 uint64_t ret_ref = 0;
42772 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42773 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42777 int64_t __attribute__((export_name("TS_PrivateRoute_hash"))) TS_PrivateRoute_hash(uint64_t o) {
42778 LDKPrivateRoute o_conv;
42779 o_conv.inner = untag_ptr(o);
42780 o_conv.is_owned = ptr_is_owned(o);
42781 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
42782 o_conv.is_owned = false;
42783 int64_t ret_conv = PrivateRoute_hash(&o_conv);
42787 jboolean __attribute__((export_name("TS_PrivateRoute_eq"))) TS_PrivateRoute_eq(uint64_t a, uint64_t b) {
42788 LDKPrivateRoute a_conv;
42789 a_conv.inner = untag_ptr(a);
42790 a_conv.is_owned = ptr_is_owned(a);
42791 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
42792 a_conv.is_owned = false;
42793 LDKPrivateRoute b_conv;
42794 b_conv.inner = untag_ptr(b);
42795 b_conv.is_owned = ptr_is_owned(b);
42796 CHECK_INNER_FIELD_ACCESS_OR_NULL(b_conv);
42797 b_conv.is_owned = false;
42798 jboolean ret_conv = PrivateRoute_eq(&a_conv, &b_conv);
42802 uint64_t __attribute__((export_name("TS_SignedRawInvoice_into_parts"))) TS_SignedRawInvoice_into_parts(uint64_t this_arg) {
42803 LDKSignedRawInvoice this_arg_conv;
42804 this_arg_conv.inner = untag_ptr(this_arg);
42805 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42806 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42807 this_arg_conv = SignedRawInvoice_clone(&this_arg_conv);
42808 LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ* ret_conv = MALLOC(sizeof(LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ), "LDKC3Tuple_RawInvoice_u832InvoiceSignatureZ");
42809 *ret_conv = SignedRawInvoice_into_parts(this_arg_conv);
42810 return tag_ptr(ret_conv, true);
42813 uint64_t __attribute__((export_name("TS_SignedRawInvoice_raw_invoice"))) TS_SignedRawInvoice_raw_invoice(uint64_t this_arg) {
42814 LDKSignedRawInvoice this_arg_conv;
42815 this_arg_conv.inner = untag_ptr(this_arg);
42816 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42817 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42818 this_arg_conv.is_owned = false;
42819 LDKRawInvoice ret_var = SignedRawInvoice_raw_invoice(&this_arg_conv);
42820 uint64_t ret_ref = 0;
42821 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42822 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42826 int8_tArray __attribute__((export_name("TS_SignedRawInvoice_hash"))) TS_SignedRawInvoice_hash(uint64_t this_arg) {
42827 LDKSignedRawInvoice this_arg_conv;
42828 this_arg_conv.inner = untag_ptr(this_arg);
42829 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42830 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42831 this_arg_conv.is_owned = false;
42832 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
42833 memcpy(ret_arr->elems, *SignedRawInvoice_hash(&this_arg_conv), 32);
42837 uint64_t __attribute__((export_name("TS_SignedRawInvoice_signature"))) TS_SignedRawInvoice_signature(uint64_t this_arg) {
42838 LDKSignedRawInvoice this_arg_conv;
42839 this_arg_conv.inner = untag_ptr(this_arg);
42840 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42841 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42842 this_arg_conv.is_owned = false;
42843 LDKInvoiceSignature ret_var = SignedRawInvoice_signature(&this_arg_conv);
42844 uint64_t ret_ref = 0;
42845 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42846 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42850 uint64_t __attribute__((export_name("TS_SignedRawInvoice_recover_payee_pub_key"))) TS_SignedRawInvoice_recover_payee_pub_key(uint64_t this_arg) {
42851 LDKSignedRawInvoice this_arg_conv;
42852 this_arg_conv.inner = untag_ptr(this_arg);
42853 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42854 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42855 this_arg_conv.is_owned = false;
42856 LDKCResult_PayeePubKeyErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PayeePubKeyErrorZ), "LDKCResult_PayeePubKeyErrorZ");
42857 *ret_conv = SignedRawInvoice_recover_payee_pub_key(&this_arg_conv);
42858 return tag_ptr(ret_conv, true);
42861 jboolean __attribute__((export_name("TS_SignedRawInvoice_check_signature"))) TS_SignedRawInvoice_check_signature(uint64_t this_arg) {
42862 LDKSignedRawInvoice this_arg_conv;
42863 this_arg_conv.inner = untag_ptr(this_arg);
42864 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42865 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42866 this_arg_conv.is_owned = false;
42867 jboolean ret_conv = SignedRawInvoice_check_signature(&this_arg_conv);
42871 int8_tArray __attribute__((export_name("TS_RawInvoice_hash"))) TS_RawInvoice_hash(uint64_t this_arg) {
42872 LDKRawInvoice this_arg_conv;
42873 this_arg_conv.inner = untag_ptr(this_arg);
42874 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42875 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42876 this_arg_conv.is_owned = false;
42877 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
42878 memcpy(ret_arr->elems, RawInvoice_hash(&this_arg_conv).data, 32);
42882 uint64_t __attribute__((export_name("TS_RawInvoice_payment_hash"))) TS_RawInvoice_payment_hash(uint64_t this_arg) {
42883 LDKRawInvoice this_arg_conv;
42884 this_arg_conv.inner = untag_ptr(this_arg);
42885 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42886 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42887 this_arg_conv.is_owned = false;
42888 LDKSha256 ret_var = RawInvoice_payment_hash(&this_arg_conv);
42889 uint64_t ret_ref = 0;
42890 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42891 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42895 uint64_t __attribute__((export_name("TS_RawInvoice_description"))) TS_RawInvoice_description(uint64_t this_arg) {
42896 LDKRawInvoice this_arg_conv;
42897 this_arg_conv.inner = untag_ptr(this_arg);
42898 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42899 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42900 this_arg_conv.is_owned = false;
42901 LDKDescription ret_var = RawInvoice_description(&this_arg_conv);
42902 uint64_t ret_ref = 0;
42903 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42904 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42908 uint64_t __attribute__((export_name("TS_RawInvoice_payee_pub_key"))) TS_RawInvoice_payee_pub_key(uint64_t this_arg) {
42909 LDKRawInvoice this_arg_conv;
42910 this_arg_conv.inner = untag_ptr(this_arg);
42911 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42912 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42913 this_arg_conv.is_owned = false;
42914 LDKPayeePubKey ret_var = RawInvoice_payee_pub_key(&this_arg_conv);
42915 uint64_t ret_ref = 0;
42916 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42917 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42921 uint64_t __attribute__((export_name("TS_RawInvoice_description_hash"))) TS_RawInvoice_description_hash(uint64_t this_arg) {
42922 LDKRawInvoice this_arg_conv;
42923 this_arg_conv.inner = untag_ptr(this_arg);
42924 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42925 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42926 this_arg_conv.is_owned = false;
42927 LDKSha256 ret_var = RawInvoice_description_hash(&this_arg_conv);
42928 uint64_t ret_ref = 0;
42929 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42930 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42934 uint64_t __attribute__((export_name("TS_RawInvoice_expiry_time"))) TS_RawInvoice_expiry_time(uint64_t this_arg) {
42935 LDKRawInvoice this_arg_conv;
42936 this_arg_conv.inner = untag_ptr(this_arg);
42937 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42938 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42939 this_arg_conv.is_owned = false;
42940 LDKExpiryTime ret_var = RawInvoice_expiry_time(&this_arg_conv);
42941 uint64_t ret_ref = 0;
42942 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42943 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42947 uint64_t __attribute__((export_name("TS_RawInvoice_min_final_cltv_expiry"))) TS_RawInvoice_min_final_cltv_expiry(uint64_t this_arg) {
42948 LDKRawInvoice this_arg_conv;
42949 this_arg_conv.inner = untag_ptr(this_arg);
42950 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42951 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42952 this_arg_conv.is_owned = false;
42953 LDKMinFinalCltvExpiry ret_var = RawInvoice_min_final_cltv_expiry(&this_arg_conv);
42954 uint64_t ret_ref = 0;
42955 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42956 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42960 int8_tArray __attribute__((export_name("TS_RawInvoice_payment_secret"))) TS_RawInvoice_payment_secret(uint64_t this_arg) {
42961 LDKRawInvoice this_arg_conv;
42962 this_arg_conv.inner = untag_ptr(this_arg);
42963 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42964 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42965 this_arg_conv.is_owned = false;
42966 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
42967 memcpy(ret_arr->elems, RawInvoice_payment_secret(&this_arg_conv).data, 32);
42971 uint64_t __attribute__((export_name("TS_RawInvoice_features"))) TS_RawInvoice_features(uint64_t this_arg) {
42972 LDKRawInvoice this_arg_conv;
42973 this_arg_conv.inner = untag_ptr(this_arg);
42974 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42975 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42976 this_arg_conv.is_owned = false;
42977 LDKInvoiceFeatures ret_var = RawInvoice_features(&this_arg_conv);
42978 uint64_t ret_ref = 0;
42979 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
42980 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
42984 uint64_tArray __attribute__((export_name("TS_RawInvoice_private_routes"))) TS_RawInvoice_private_routes(uint64_t this_arg) {
42985 LDKRawInvoice this_arg_conv;
42986 this_arg_conv.inner = untag_ptr(this_arg);
42987 this_arg_conv.is_owned = ptr_is_owned(this_arg);
42988 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
42989 this_arg_conv.is_owned = false;
42990 LDKCVec_PrivateRouteZ ret_var = RawInvoice_private_routes(&this_arg_conv);
42991 uint64_tArray ret_arr = NULL;
42992 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
42993 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
42994 for (size_t o = 0; o < ret_var.datalen; o++) {
42995 LDKPrivateRoute ret_conv_14_var = ret_var.data[o];
42996 uint64_t ret_conv_14_ref = 0;
42997 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var);
42998 ret_conv_14_ref = tag_ptr(ret_conv_14_var.inner, ret_conv_14_var.is_owned);
42999 ret_arr_ptr[o] = ret_conv_14_ref;
43002 FREE(ret_var.data);
43006 uint64_t __attribute__((export_name("TS_RawInvoice_amount_pico_btc"))) TS_RawInvoice_amount_pico_btc(uint64_t this_arg) {
43007 LDKRawInvoice this_arg_conv;
43008 this_arg_conv.inner = untag_ptr(this_arg);
43009 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43010 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43011 this_arg_conv.is_owned = false;
43012 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
43013 *ret_copy = RawInvoice_amount_pico_btc(&this_arg_conv);
43014 uint64_t ret_ref = tag_ptr(ret_copy, true);
43018 uint32_t __attribute__((export_name("TS_RawInvoice_currency"))) TS_RawInvoice_currency(uint64_t this_arg) {
43019 LDKRawInvoice this_arg_conv;
43020 this_arg_conv.inner = untag_ptr(this_arg);
43021 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43022 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43023 this_arg_conv.is_owned = false;
43024 uint32_t ret_conv = LDKCurrency_to_js(RawInvoice_currency(&this_arg_conv));
43028 uint64_t __attribute__((export_name("TS_PositiveTimestamp_from_unix_timestamp"))) TS_PositiveTimestamp_from_unix_timestamp(int64_t unix_seconds) {
43029 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
43030 *ret_conv = PositiveTimestamp_from_unix_timestamp(unix_seconds);
43031 return tag_ptr(ret_conv, true);
43034 uint64_t __attribute__((export_name("TS_PositiveTimestamp_from_duration_since_epoch"))) TS_PositiveTimestamp_from_duration_since_epoch(int64_t duration) {
43035 LDKCResult_PositiveTimestampCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PositiveTimestampCreationErrorZ), "LDKCResult_PositiveTimestampCreationErrorZ");
43036 *ret_conv = PositiveTimestamp_from_duration_since_epoch(duration);
43037 return tag_ptr(ret_conv, true);
43040 int64_t __attribute__((export_name("TS_PositiveTimestamp_as_unix_timestamp"))) TS_PositiveTimestamp_as_unix_timestamp(uint64_t this_arg) {
43041 LDKPositiveTimestamp this_arg_conv;
43042 this_arg_conv.inner = untag_ptr(this_arg);
43043 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43044 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43045 this_arg_conv.is_owned = false;
43046 int64_t ret_conv = PositiveTimestamp_as_unix_timestamp(&this_arg_conv);
43050 int64_t __attribute__((export_name("TS_PositiveTimestamp_as_duration_since_epoch"))) TS_PositiveTimestamp_as_duration_since_epoch(uint64_t this_arg) {
43051 LDKPositiveTimestamp this_arg_conv;
43052 this_arg_conv.inner = untag_ptr(this_arg);
43053 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43054 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43055 this_arg_conv.is_owned = false;
43056 int64_t ret_conv = PositiveTimestamp_as_duration_since_epoch(&this_arg_conv);
43060 uint64_t __attribute__((export_name("TS_Invoice_into_signed_raw"))) TS_Invoice_into_signed_raw(uint64_t this_arg) {
43061 LDKInvoice this_arg_conv;
43062 this_arg_conv.inner = untag_ptr(this_arg);
43063 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43064 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43065 this_arg_conv = Invoice_clone(&this_arg_conv);
43066 LDKSignedRawInvoice ret_var = Invoice_into_signed_raw(this_arg_conv);
43067 uint64_t ret_ref = 0;
43068 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43069 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43073 uint64_t __attribute__((export_name("TS_Invoice_check_signature"))) TS_Invoice_check_signature(uint64_t this_arg) {
43074 LDKInvoice this_arg_conv;
43075 this_arg_conv.inner = untag_ptr(this_arg);
43076 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43077 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43078 this_arg_conv.is_owned = false;
43079 LDKCResult_NoneSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_NoneSemanticErrorZ), "LDKCResult_NoneSemanticErrorZ");
43080 *ret_conv = Invoice_check_signature(&this_arg_conv);
43081 return tag_ptr(ret_conv, true);
43084 uint64_t __attribute__((export_name("TS_Invoice_from_signed"))) TS_Invoice_from_signed(uint64_t signed_invoice) {
43085 LDKSignedRawInvoice signed_invoice_conv;
43086 signed_invoice_conv.inner = untag_ptr(signed_invoice);
43087 signed_invoice_conv.is_owned = ptr_is_owned(signed_invoice);
43088 CHECK_INNER_FIELD_ACCESS_OR_NULL(signed_invoice_conv);
43089 signed_invoice_conv = SignedRawInvoice_clone(&signed_invoice_conv);
43090 LDKCResult_InvoiceSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSemanticErrorZ), "LDKCResult_InvoiceSemanticErrorZ");
43091 *ret_conv = Invoice_from_signed(signed_invoice_conv);
43092 return tag_ptr(ret_conv, true);
43095 int64_t __attribute__((export_name("TS_Invoice_duration_since_epoch"))) TS_Invoice_duration_since_epoch(uint64_t this_arg) {
43096 LDKInvoice this_arg_conv;
43097 this_arg_conv.inner = untag_ptr(this_arg);
43098 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43099 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43100 this_arg_conv.is_owned = false;
43101 int64_t ret_conv = Invoice_duration_since_epoch(&this_arg_conv);
43105 int8_tArray __attribute__((export_name("TS_Invoice_payment_hash"))) TS_Invoice_payment_hash(uint64_t this_arg) {
43106 LDKInvoice this_arg_conv;
43107 this_arg_conv.inner = untag_ptr(this_arg);
43108 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43109 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43110 this_arg_conv.is_owned = false;
43111 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
43112 memcpy(ret_arr->elems, *Invoice_payment_hash(&this_arg_conv), 32);
43116 int8_tArray __attribute__((export_name("TS_Invoice_payee_pub_key"))) TS_Invoice_payee_pub_key(uint64_t this_arg) {
43117 LDKInvoice this_arg_conv;
43118 this_arg_conv.inner = untag_ptr(this_arg);
43119 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43120 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43121 this_arg_conv.is_owned = false;
43122 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
43123 memcpy(ret_arr->elems, Invoice_payee_pub_key(&this_arg_conv).compressed_form, 33);
43127 int8_tArray __attribute__((export_name("TS_Invoice_payment_secret"))) TS_Invoice_payment_secret(uint64_t this_arg) {
43128 LDKInvoice this_arg_conv;
43129 this_arg_conv.inner = untag_ptr(this_arg);
43130 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43131 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43132 this_arg_conv.is_owned = false;
43133 int8_tArray ret_arr = init_int8_tArray(32, __LINE__);
43134 memcpy(ret_arr->elems, *Invoice_payment_secret(&this_arg_conv), 32);
43138 uint64_t __attribute__((export_name("TS_Invoice_features"))) TS_Invoice_features(uint64_t this_arg) {
43139 LDKInvoice this_arg_conv;
43140 this_arg_conv.inner = untag_ptr(this_arg);
43141 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43142 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43143 this_arg_conv.is_owned = false;
43144 LDKInvoiceFeatures ret_var = Invoice_features(&this_arg_conv);
43145 uint64_t ret_ref = 0;
43146 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43147 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43151 int8_tArray __attribute__((export_name("TS_Invoice_recover_payee_pub_key"))) TS_Invoice_recover_payee_pub_key(uint64_t this_arg) {
43152 LDKInvoice this_arg_conv;
43153 this_arg_conv.inner = untag_ptr(this_arg);
43154 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43155 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43156 this_arg_conv.is_owned = false;
43157 int8_tArray ret_arr = init_int8_tArray(33, __LINE__);
43158 memcpy(ret_arr->elems, Invoice_recover_payee_pub_key(&this_arg_conv).compressed_form, 33);
43162 int64_t __attribute__((export_name("TS_Invoice_expiry_time"))) TS_Invoice_expiry_time(uint64_t this_arg) {
43163 LDKInvoice this_arg_conv;
43164 this_arg_conv.inner = untag_ptr(this_arg);
43165 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43166 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43167 this_arg_conv.is_owned = false;
43168 int64_t ret_conv = Invoice_expiry_time(&this_arg_conv);
43172 jboolean __attribute__((export_name("TS_Invoice_would_expire"))) TS_Invoice_would_expire(uint64_t this_arg, int64_t at_time) {
43173 LDKInvoice 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 jboolean ret_conv = Invoice_would_expire(&this_arg_conv, at_time);
43182 int64_t __attribute__((export_name("TS_Invoice_min_final_cltv_expiry"))) TS_Invoice_min_final_cltv_expiry(uint64_t this_arg) {
43183 LDKInvoice this_arg_conv;
43184 this_arg_conv.inner = untag_ptr(this_arg);
43185 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43186 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43187 this_arg_conv.is_owned = false;
43188 int64_t ret_conv = Invoice_min_final_cltv_expiry(&this_arg_conv);
43192 uint64_tArray __attribute__((export_name("TS_Invoice_private_routes"))) TS_Invoice_private_routes(uint64_t this_arg) {
43193 LDKInvoice this_arg_conv;
43194 this_arg_conv.inner = untag_ptr(this_arg);
43195 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43196 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43197 this_arg_conv.is_owned = false;
43198 LDKCVec_PrivateRouteZ ret_var = Invoice_private_routes(&this_arg_conv);
43199 uint64_tArray ret_arr = NULL;
43200 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
43201 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
43202 for (size_t o = 0; o < ret_var.datalen; o++) {
43203 LDKPrivateRoute ret_conv_14_var = ret_var.data[o];
43204 uint64_t ret_conv_14_ref = 0;
43205 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_14_var);
43206 ret_conv_14_ref = tag_ptr(ret_conv_14_var.inner, ret_conv_14_var.is_owned);
43207 ret_arr_ptr[o] = ret_conv_14_ref;
43210 FREE(ret_var.data);
43214 uint64_tArray __attribute__((export_name("TS_Invoice_route_hints"))) TS_Invoice_route_hints(uint64_t this_arg) {
43215 LDKInvoice this_arg_conv;
43216 this_arg_conv.inner = untag_ptr(this_arg);
43217 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43218 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43219 this_arg_conv.is_owned = false;
43220 LDKCVec_RouteHintZ ret_var = Invoice_route_hints(&this_arg_conv);
43221 uint64_tArray ret_arr = NULL;
43222 ret_arr = init_uint64_tArray(ret_var.datalen, __LINE__);
43223 uint64_t *ret_arr_ptr = (uint64_t*)(((uint8_t*)ret_arr) + 8);
43224 for (size_t l = 0; l < ret_var.datalen; l++) {
43225 LDKRouteHint ret_conv_11_var = ret_var.data[l];
43226 uint64_t ret_conv_11_ref = 0;
43227 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_conv_11_var);
43228 ret_conv_11_ref = tag_ptr(ret_conv_11_var.inner, ret_conv_11_var.is_owned);
43229 ret_arr_ptr[l] = ret_conv_11_ref;
43232 FREE(ret_var.data);
43236 uint32_t __attribute__((export_name("TS_Invoice_currency"))) TS_Invoice_currency(uint64_t this_arg) {
43237 LDKInvoice this_arg_conv;
43238 this_arg_conv.inner = untag_ptr(this_arg);
43239 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43240 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43241 this_arg_conv.is_owned = false;
43242 uint32_t ret_conv = LDKCurrency_to_js(Invoice_currency(&this_arg_conv));
43246 uint64_t __attribute__((export_name("TS_Invoice_amount_milli_satoshis"))) TS_Invoice_amount_milli_satoshis(uint64_t this_arg) {
43247 LDKInvoice this_arg_conv;
43248 this_arg_conv.inner = untag_ptr(this_arg);
43249 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43250 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43251 this_arg_conv.is_owned = false;
43252 LDKCOption_u64Z *ret_copy = MALLOC(sizeof(LDKCOption_u64Z), "LDKCOption_u64Z");
43253 *ret_copy = Invoice_amount_milli_satoshis(&this_arg_conv);
43254 uint64_t ret_ref = tag_ptr(ret_copy, true);
43258 uint64_t __attribute__((export_name("TS_Description_new"))) TS_Description_new(jstring description) {
43259 LDKStr description_conv = str_ref_to_owned_c(description);
43260 LDKCResult_DescriptionCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_DescriptionCreationErrorZ), "LDKCResult_DescriptionCreationErrorZ");
43261 *ret_conv = Description_new(description_conv);
43262 return tag_ptr(ret_conv, true);
43265 jstring __attribute__((export_name("TS_Description_into_inner"))) TS_Description_into_inner(uint64_t this_arg) {
43266 LDKDescription this_arg_conv;
43267 this_arg_conv.inner = untag_ptr(this_arg);
43268 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43269 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43270 this_arg_conv = Description_clone(&this_arg_conv);
43271 LDKStr ret_str = Description_into_inner(this_arg_conv);
43272 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
43277 uint64_t __attribute__((export_name("TS_ExpiryTime_from_seconds"))) TS_ExpiryTime_from_seconds(int64_t seconds) {
43278 LDKExpiryTime ret_var = ExpiryTime_from_seconds(seconds);
43279 uint64_t ret_ref = 0;
43280 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43281 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43285 uint64_t __attribute__((export_name("TS_ExpiryTime_from_duration"))) TS_ExpiryTime_from_duration(int64_t duration) {
43286 LDKExpiryTime ret_var = ExpiryTime_from_duration(duration);
43287 uint64_t ret_ref = 0;
43288 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43289 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43293 int64_t __attribute__((export_name("TS_ExpiryTime_as_seconds"))) TS_ExpiryTime_as_seconds(uint64_t this_arg) {
43294 LDKExpiryTime this_arg_conv;
43295 this_arg_conv.inner = untag_ptr(this_arg);
43296 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43297 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43298 this_arg_conv.is_owned = false;
43299 int64_t ret_conv = ExpiryTime_as_seconds(&this_arg_conv);
43303 int64_t __attribute__((export_name("TS_ExpiryTime_as_duration"))) TS_ExpiryTime_as_duration(uint64_t this_arg) {
43304 LDKExpiryTime this_arg_conv;
43305 this_arg_conv.inner = untag_ptr(this_arg);
43306 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43307 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43308 this_arg_conv.is_owned = false;
43309 int64_t ret_conv = ExpiryTime_as_duration(&this_arg_conv);
43313 uint64_t __attribute__((export_name("TS_PrivateRoute_new"))) TS_PrivateRoute_new(uint64_t hops) {
43314 LDKRouteHint hops_conv;
43315 hops_conv.inner = untag_ptr(hops);
43316 hops_conv.is_owned = ptr_is_owned(hops);
43317 CHECK_INNER_FIELD_ACCESS_OR_NULL(hops_conv);
43318 hops_conv = RouteHint_clone(&hops_conv);
43319 LDKCResult_PrivateRouteCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PrivateRouteCreationErrorZ), "LDKCResult_PrivateRouteCreationErrorZ");
43320 *ret_conv = PrivateRoute_new(hops_conv);
43321 return tag_ptr(ret_conv, true);
43324 uint64_t __attribute__((export_name("TS_PrivateRoute_into_inner"))) TS_PrivateRoute_into_inner(uint64_t this_arg) {
43325 LDKPrivateRoute this_arg_conv;
43326 this_arg_conv.inner = untag_ptr(this_arg);
43327 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43328 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43329 this_arg_conv = PrivateRoute_clone(&this_arg_conv);
43330 LDKRouteHint ret_var = PrivateRoute_into_inner(this_arg_conv);
43331 uint64_t ret_ref = 0;
43332 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43333 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43337 uint32_t __attribute__((export_name("TS_CreationError_clone"))) TS_CreationError_clone(uint64_t orig) {
43338 LDKCreationError* orig_conv = (LDKCreationError*)untag_ptr(orig);
43339 uint32_t ret_conv = LDKCreationError_to_js(CreationError_clone(orig_conv));
43343 uint32_t __attribute__((export_name("TS_CreationError_description_too_long"))) TS_CreationError_description_too_long() {
43344 uint32_t ret_conv = LDKCreationError_to_js(CreationError_description_too_long());
43348 uint32_t __attribute__((export_name("TS_CreationError_route_too_long"))) TS_CreationError_route_too_long() {
43349 uint32_t ret_conv = LDKCreationError_to_js(CreationError_route_too_long());
43353 uint32_t __attribute__((export_name("TS_CreationError_timestamp_out_of_bounds"))) TS_CreationError_timestamp_out_of_bounds() {
43354 uint32_t ret_conv = LDKCreationError_to_js(CreationError_timestamp_out_of_bounds());
43358 uint32_t __attribute__((export_name("TS_CreationError_invalid_amount"))) TS_CreationError_invalid_amount() {
43359 uint32_t ret_conv = LDKCreationError_to_js(CreationError_invalid_amount());
43363 uint32_t __attribute__((export_name("TS_CreationError_missing_route_hints"))) TS_CreationError_missing_route_hints() {
43364 uint32_t ret_conv = LDKCreationError_to_js(CreationError_missing_route_hints());
43368 jboolean __attribute__((export_name("TS_CreationError_eq"))) TS_CreationError_eq(uint64_t a, uint64_t b) {
43369 LDKCreationError* a_conv = (LDKCreationError*)untag_ptr(a);
43370 LDKCreationError* b_conv = (LDKCreationError*)untag_ptr(b);
43371 jboolean ret_conv = CreationError_eq(a_conv, b_conv);
43375 jstring __attribute__((export_name("TS_CreationError_to_str"))) TS_CreationError_to_str(uint64_t o) {
43376 LDKCreationError* o_conv = (LDKCreationError*)untag_ptr(o);
43377 LDKStr ret_str = CreationError_to_str(o_conv);
43378 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
43383 uint32_t __attribute__((export_name("TS_SemanticError_clone"))) TS_SemanticError_clone(uint64_t orig) {
43384 LDKSemanticError* orig_conv = (LDKSemanticError*)untag_ptr(orig);
43385 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_clone(orig_conv));
43389 uint32_t __attribute__((export_name("TS_SemanticError_no_payment_hash"))) TS_SemanticError_no_payment_hash() {
43390 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_no_payment_hash());
43394 uint32_t __attribute__((export_name("TS_SemanticError_multiple_payment_hashes"))) TS_SemanticError_multiple_payment_hashes() {
43395 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_multiple_payment_hashes());
43399 uint32_t __attribute__((export_name("TS_SemanticError_no_description"))) TS_SemanticError_no_description() {
43400 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_no_description());
43404 uint32_t __attribute__((export_name("TS_SemanticError_multiple_descriptions"))) TS_SemanticError_multiple_descriptions() {
43405 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_multiple_descriptions());
43409 uint32_t __attribute__((export_name("TS_SemanticError_no_payment_secret"))) TS_SemanticError_no_payment_secret() {
43410 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_no_payment_secret());
43414 uint32_t __attribute__((export_name("TS_SemanticError_multiple_payment_secrets"))) TS_SemanticError_multiple_payment_secrets() {
43415 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_multiple_payment_secrets());
43419 uint32_t __attribute__((export_name("TS_SemanticError_invalid_features"))) TS_SemanticError_invalid_features() {
43420 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_invalid_features());
43424 uint32_t __attribute__((export_name("TS_SemanticError_invalid_recovery_id"))) TS_SemanticError_invalid_recovery_id() {
43425 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_invalid_recovery_id());
43429 uint32_t __attribute__((export_name("TS_SemanticError_invalid_signature"))) TS_SemanticError_invalid_signature() {
43430 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_invalid_signature());
43434 uint32_t __attribute__((export_name("TS_SemanticError_imprecise_amount"))) TS_SemanticError_imprecise_amount() {
43435 uint32_t ret_conv = LDKSemanticError_to_js(SemanticError_imprecise_amount());
43439 jboolean __attribute__((export_name("TS_SemanticError_eq"))) TS_SemanticError_eq(uint64_t a, uint64_t b) {
43440 LDKSemanticError* a_conv = (LDKSemanticError*)untag_ptr(a);
43441 LDKSemanticError* b_conv = (LDKSemanticError*)untag_ptr(b);
43442 jboolean ret_conv = SemanticError_eq(a_conv, b_conv);
43446 jstring __attribute__((export_name("TS_SemanticError_to_str"))) TS_SemanticError_to_str(uint64_t o) {
43447 LDKSemanticError* o_conv = (LDKSemanticError*)untag_ptr(o);
43448 LDKStr ret_str = SemanticError_to_str(o_conv);
43449 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
43454 void __attribute__((export_name("TS_SignOrCreationError_free"))) TS_SignOrCreationError_free(uint64_t this_ptr) {
43455 if (!ptr_is_owned(this_ptr)) return;
43456 void* this_ptr_ptr = untag_ptr(this_ptr);
43457 CHECK_ACCESS(this_ptr_ptr);
43458 LDKSignOrCreationError this_ptr_conv = *(LDKSignOrCreationError*)(this_ptr_ptr);
43459 FREE(untag_ptr(this_ptr));
43460 SignOrCreationError_free(this_ptr_conv);
43463 static inline uint64_t SignOrCreationError_clone_ptr(LDKSignOrCreationError *NONNULL_PTR arg) {
43464 LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
43465 *ret_copy = SignOrCreationError_clone(arg);
43466 uint64_t ret_ref = tag_ptr(ret_copy, true);
43469 int64_t __attribute__((export_name("TS_SignOrCreationError_clone_ptr"))) TS_SignOrCreationError_clone_ptr(uint64_t arg) {
43470 LDKSignOrCreationError* arg_conv = (LDKSignOrCreationError*)untag_ptr(arg);
43471 int64_t ret_conv = SignOrCreationError_clone_ptr(arg_conv);
43475 uint64_t __attribute__((export_name("TS_SignOrCreationError_clone"))) TS_SignOrCreationError_clone(uint64_t orig) {
43476 LDKSignOrCreationError* orig_conv = (LDKSignOrCreationError*)untag_ptr(orig);
43477 LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
43478 *ret_copy = SignOrCreationError_clone(orig_conv);
43479 uint64_t ret_ref = tag_ptr(ret_copy, true);
43483 uint64_t __attribute__((export_name("TS_SignOrCreationError_sign_error"))) TS_SignOrCreationError_sign_error() {
43484 LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
43485 *ret_copy = SignOrCreationError_sign_error();
43486 uint64_t ret_ref = tag_ptr(ret_copy, true);
43490 uint64_t __attribute__((export_name("TS_SignOrCreationError_creation_error"))) TS_SignOrCreationError_creation_error(uint32_t a) {
43491 LDKCreationError a_conv = LDKCreationError_from_js(a);
43492 LDKSignOrCreationError *ret_copy = MALLOC(sizeof(LDKSignOrCreationError), "LDKSignOrCreationError");
43493 *ret_copy = SignOrCreationError_creation_error(a_conv);
43494 uint64_t ret_ref = tag_ptr(ret_copy, true);
43498 jboolean __attribute__((export_name("TS_SignOrCreationError_eq"))) TS_SignOrCreationError_eq(uint64_t a, uint64_t b) {
43499 LDKSignOrCreationError* a_conv = (LDKSignOrCreationError*)untag_ptr(a);
43500 LDKSignOrCreationError* b_conv = (LDKSignOrCreationError*)untag_ptr(b);
43501 jboolean ret_conv = SignOrCreationError_eq(a_conv, b_conv);
43505 jstring __attribute__((export_name("TS_SignOrCreationError_to_str"))) TS_SignOrCreationError_to_str(uint64_t o) {
43506 LDKSignOrCreationError* o_conv = (LDKSignOrCreationError*)untag_ptr(o);
43507 LDKStr ret_str = SignOrCreationError_to_str(o_conv);
43508 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
43513 void __attribute__((export_name("TS_InvoicePayer_free"))) TS_InvoicePayer_free(uint64_t this_obj) {
43514 LDKInvoicePayer this_obj_conv;
43515 this_obj_conv.inner = untag_ptr(this_obj);
43516 this_obj_conv.is_owned = ptr_is_owned(this_obj);
43517 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
43518 InvoicePayer_free(this_obj_conv);
43521 void __attribute__((export_name("TS_Payer_free"))) TS_Payer_free(uint64_t this_ptr) {
43522 if (!ptr_is_owned(this_ptr)) return;
43523 void* this_ptr_ptr = untag_ptr(this_ptr);
43524 CHECK_ACCESS(this_ptr_ptr);
43525 LDKPayer this_ptr_conv = *(LDKPayer*)(this_ptr_ptr);
43526 FREE(untag_ptr(this_ptr));
43527 Payer_free(this_ptr_conv);
43530 void __attribute__((export_name("TS_Router_free"))) TS_Router_free(uint64_t this_ptr) {
43531 if (!ptr_is_owned(this_ptr)) return;
43532 void* this_ptr_ptr = untag_ptr(this_ptr);
43533 CHECK_ACCESS(this_ptr_ptr);
43534 LDKRouter this_ptr_conv = *(LDKRouter*)(this_ptr_ptr);
43535 FREE(untag_ptr(this_ptr));
43536 Router_free(this_ptr_conv);
43539 void __attribute__((export_name("TS_Retry_free"))) TS_Retry_free(uint64_t this_ptr) {
43540 if (!ptr_is_owned(this_ptr)) return;
43541 void* this_ptr_ptr = untag_ptr(this_ptr);
43542 CHECK_ACCESS(this_ptr_ptr);
43543 LDKRetry this_ptr_conv = *(LDKRetry*)(this_ptr_ptr);
43544 FREE(untag_ptr(this_ptr));
43545 Retry_free(this_ptr_conv);
43548 static inline uint64_t Retry_clone_ptr(LDKRetry *NONNULL_PTR arg) {
43549 LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry");
43550 *ret_copy = Retry_clone(arg);
43551 uint64_t ret_ref = tag_ptr(ret_copy, true);
43554 int64_t __attribute__((export_name("TS_Retry_clone_ptr"))) TS_Retry_clone_ptr(uint64_t arg) {
43555 LDKRetry* arg_conv = (LDKRetry*)untag_ptr(arg);
43556 int64_t ret_conv = Retry_clone_ptr(arg_conv);
43560 uint64_t __attribute__((export_name("TS_Retry_clone"))) TS_Retry_clone(uint64_t orig) {
43561 LDKRetry* orig_conv = (LDKRetry*)untag_ptr(orig);
43562 LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry");
43563 *ret_copy = Retry_clone(orig_conv);
43564 uint64_t ret_ref = tag_ptr(ret_copy, true);
43568 uint64_t __attribute__((export_name("TS_Retry_attempts"))) TS_Retry_attempts(uint32_t a) {
43569 LDKRetry *ret_copy = MALLOC(sizeof(LDKRetry), "LDKRetry");
43570 *ret_copy = Retry_attempts(a);
43571 uint64_t ret_ref = tag_ptr(ret_copy, true);
43575 jboolean __attribute__((export_name("TS_Retry_eq"))) TS_Retry_eq(uint64_t a, uint64_t b) {
43576 LDKRetry* a_conv = (LDKRetry*)untag_ptr(a);
43577 LDKRetry* b_conv = (LDKRetry*)untag_ptr(b);
43578 jboolean ret_conv = Retry_eq(a_conv, b_conv);
43582 int64_t __attribute__((export_name("TS_Retry_hash"))) TS_Retry_hash(uint64_t o) {
43583 LDKRetry* o_conv = (LDKRetry*)untag_ptr(o);
43584 int64_t ret_conv = Retry_hash(o_conv);
43588 void __attribute__((export_name("TS_PaymentError_free"))) TS_PaymentError_free(uint64_t this_ptr) {
43589 if (!ptr_is_owned(this_ptr)) return;
43590 void* this_ptr_ptr = untag_ptr(this_ptr);
43591 CHECK_ACCESS(this_ptr_ptr);
43592 LDKPaymentError this_ptr_conv = *(LDKPaymentError*)(this_ptr_ptr);
43593 FREE(untag_ptr(this_ptr));
43594 PaymentError_free(this_ptr_conv);
43597 static inline uint64_t PaymentError_clone_ptr(LDKPaymentError *NONNULL_PTR arg) {
43598 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
43599 *ret_copy = PaymentError_clone(arg);
43600 uint64_t ret_ref = tag_ptr(ret_copy, true);
43603 int64_t __attribute__((export_name("TS_PaymentError_clone_ptr"))) TS_PaymentError_clone_ptr(uint64_t arg) {
43604 LDKPaymentError* arg_conv = (LDKPaymentError*)untag_ptr(arg);
43605 int64_t ret_conv = PaymentError_clone_ptr(arg_conv);
43609 uint64_t __attribute__((export_name("TS_PaymentError_clone"))) TS_PaymentError_clone(uint64_t orig) {
43610 LDKPaymentError* orig_conv = (LDKPaymentError*)untag_ptr(orig);
43611 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
43612 *ret_copy = PaymentError_clone(orig_conv);
43613 uint64_t ret_ref = tag_ptr(ret_copy, true);
43617 uint64_t __attribute__((export_name("TS_PaymentError_invoice"))) TS_PaymentError_invoice(jstring a) {
43618 LDKStr a_conv = str_ref_to_owned_c(a);
43619 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
43620 *ret_copy = PaymentError_invoice(a_conv);
43621 uint64_t ret_ref = tag_ptr(ret_copy, true);
43625 uint64_t __attribute__((export_name("TS_PaymentError_routing"))) TS_PaymentError_routing(uint64_t a) {
43626 LDKLightningError a_conv;
43627 a_conv.inner = untag_ptr(a);
43628 a_conv.is_owned = ptr_is_owned(a);
43629 CHECK_INNER_FIELD_ACCESS_OR_NULL(a_conv);
43630 a_conv = LightningError_clone(&a_conv);
43631 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
43632 *ret_copy = PaymentError_routing(a_conv);
43633 uint64_t ret_ref = tag_ptr(ret_copy, true);
43637 uint64_t __attribute__((export_name("TS_PaymentError_sending"))) TS_PaymentError_sending(uint64_t a) {
43638 void* a_ptr = untag_ptr(a);
43639 CHECK_ACCESS(a_ptr);
43640 LDKPaymentSendFailure a_conv = *(LDKPaymentSendFailure*)(a_ptr);
43641 a_conv = PaymentSendFailure_clone((LDKPaymentSendFailure*)untag_ptr(a));
43642 LDKPaymentError *ret_copy = MALLOC(sizeof(LDKPaymentError), "LDKPaymentError");
43643 *ret_copy = PaymentError_sending(a_conv);
43644 uint64_t ret_ref = tag_ptr(ret_copy, true);
43648 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) {
43649 void* payer_ptr = untag_ptr(payer);
43650 CHECK_ACCESS(payer_ptr);
43651 LDKPayer payer_conv = *(LDKPayer*)(payer_ptr);
43652 if (payer_conv.free == LDKPayer_JCalls_free) {
43653 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
43654 LDKPayer_JCalls_cloned(&payer_conv);
43656 void* router_ptr = untag_ptr(router);
43657 CHECK_ACCESS(router_ptr);
43658 LDKRouter router_conv = *(LDKRouter*)(router_ptr);
43659 if (router_conv.free == LDKRouter_JCalls_free) {
43660 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
43661 LDKRouter_JCalls_cloned(&router_conv);
43663 LDKMultiThreadedLockableScore scorer_conv;
43664 scorer_conv.inner = untag_ptr(scorer);
43665 scorer_conv.is_owned = ptr_is_owned(scorer);
43666 CHECK_INNER_FIELD_ACCESS_OR_NULL(scorer_conv);
43667 scorer_conv.is_owned = false;
43668 void* logger_ptr = untag_ptr(logger);
43669 CHECK_ACCESS(logger_ptr);
43670 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
43671 if (logger_conv.free == LDKLogger_JCalls_free) {
43672 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
43673 LDKLogger_JCalls_cloned(&logger_conv);
43675 void* event_handler_ptr = untag_ptr(event_handler);
43676 CHECK_ACCESS(event_handler_ptr);
43677 LDKEventHandler event_handler_conv = *(LDKEventHandler*)(event_handler_ptr);
43678 if (event_handler_conv.free == LDKEventHandler_JCalls_free) {
43679 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
43680 LDKEventHandler_JCalls_cloned(&event_handler_conv);
43682 void* retry_ptr = untag_ptr(retry);
43683 CHECK_ACCESS(retry_ptr);
43684 LDKRetry retry_conv = *(LDKRetry*)(retry_ptr);
43685 retry_conv = Retry_clone((LDKRetry*)untag_ptr(retry));
43686 LDKInvoicePayer ret_var = InvoicePayer_new(payer_conv, router_conv, &scorer_conv, logger_conv, event_handler_conv, retry_conv);
43687 uint64_t ret_ref = 0;
43688 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43689 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43693 uint64_t __attribute__((export_name("TS_InvoicePayer_pay_invoice"))) TS_InvoicePayer_pay_invoice(uint64_t this_arg, uint64_t invoice) {
43694 LDKInvoicePayer this_arg_conv;
43695 this_arg_conv.inner = untag_ptr(this_arg);
43696 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43697 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43698 this_arg_conv.is_owned = false;
43699 LDKInvoice invoice_conv;
43700 invoice_conv.inner = untag_ptr(invoice);
43701 invoice_conv.is_owned = ptr_is_owned(invoice);
43702 CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv);
43703 invoice_conv.is_owned = false;
43704 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
43705 *ret_conv = InvoicePayer_pay_invoice(&this_arg_conv, &invoice_conv);
43706 return tag_ptr(ret_conv, true);
43709 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) {
43710 LDKInvoicePayer this_arg_conv;
43711 this_arg_conv.inner = untag_ptr(this_arg);
43712 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43713 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43714 this_arg_conv.is_owned = false;
43715 LDKInvoice invoice_conv;
43716 invoice_conv.inner = untag_ptr(invoice);
43717 invoice_conv.is_owned = ptr_is_owned(invoice);
43718 CHECK_INNER_FIELD_ACCESS_OR_NULL(invoice_conv);
43719 invoice_conv.is_owned = false;
43720 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
43721 *ret_conv = InvoicePayer_pay_zero_value_invoice(&this_arg_conv, &invoice_conv, amount_msats);
43722 return tag_ptr(ret_conv, true);
43725 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) {
43726 LDKInvoicePayer this_arg_conv;
43727 this_arg_conv.inner = untag_ptr(this_arg);
43728 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43729 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43730 this_arg_conv.is_owned = false;
43731 LDKPublicKey pubkey_ref;
43732 CHECK(pubkey->arr_len == 33);
43733 memcpy(pubkey_ref.compressed_form, pubkey->elems, 33); FREE(pubkey);
43734 LDKThirtyTwoBytes payment_preimage_ref;
43735 CHECK(payment_preimage->arr_len == 32);
43736 memcpy(payment_preimage_ref.data, payment_preimage->elems, 32); FREE(payment_preimage);
43737 LDKCResult_PaymentIdPaymentErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_PaymentIdPaymentErrorZ), "LDKCResult_PaymentIdPaymentErrorZ");
43738 *ret_conv = InvoicePayer_pay_pubkey(&this_arg_conv, pubkey_ref, payment_preimage_ref, amount_msats, final_cltv_expiry_delta);
43739 return tag_ptr(ret_conv, true);
43742 void __attribute__((export_name("TS_InvoicePayer_remove_cached_payment"))) TS_InvoicePayer_remove_cached_payment(uint64_t this_arg, int8_tArray payment_hash) {
43743 LDKInvoicePayer this_arg_conv;
43744 this_arg_conv.inner = untag_ptr(this_arg);
43745 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43746 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43747 this_arg_conv.is_owned = false;
43748 unsigned char payment_hash_arr[32];
43749 CHECK(payment_hash->arr_len == 32);
43750 memcpy(payment_hash_arr, payment_hash->elems, 32); FREE(payment_hash);
43751 unsigned char (*payment_hash_ref)[32] = &payment_hash_arr;
43752 InvoicePayer_remove_cached_payment(&this_arg_conv, payment_hash_ref);
43755 uint64_t __attribute__((export_name("TS_InvoicePayer_as_EventHandler"))) TS_InvoicePayer_as_EventHandler(uint64_t this_arg) {
43756 LDKInvoicePayer this_arg_conv;
43757 this_arg_conv.inner = untag_ptr(this_arg);
43758 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43759 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43760 this_arg_conv.is_owned = false;
43761 LDKEventHandler* ret_ret = MALLOC(sizeof(LDKEventHandler), "LDKEventHandler");
43762 *ret_ret = InvoicePayer_as_EventHandler(&this_arg_conv);
43763 return tag_ptr(ret_ret, true);
43766 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) {
43767 LDKChannelManager channelmanager_conv;
43768 channelmanager_conv.inner = untag_ptr(channelmanager);
43769 channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
43770 CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv);
43771 channelmanager_conv.is_owned = false;
43772 void* keys_manager_ptr = untag_ptr(keys_manager);
43773 CHECK_ACCESS(keys_manager_ptr);
43774 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
43775 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
43776 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
43777 LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
43779 LDKCurrency network_conv = LDKCurrency_from_js(network);
43780 void* amt_msat_ptr = untag_ptr(amt_msat);
43781 CHECK_ACCESS(amt_msat_ptr);
43782 LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr);
43783 amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat));
43784 LDKSha256 description_hash_conv;
43785 description_hash_conv.inner = untag_ptr(description_hash);
43786 description_hash_conv.is_owned = ptr_is_owned(description_hash);
43787 CHECK_INNER_FIELD_ACCESS_OR_NULL(description_hash_conv);
43788 description_hash_conv = Sha256_clone(&description_hash_conv);
43789 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
43790 *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);
43791 return tag_ptr(ret_conv, true);
43794 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) {
43795 LDKChannelManager channelmanager_conv;
43796 channelmanager_conv.inner = untag_ptr(channelmanager);
43797 channelmanager_conv.is_owned = ptr_is_owned(channelmanager);
43798 CHECK_INNER_FIELD_ACCESS_OR_NULL(channelmanager_conv);
43799 channelmanager_conv.is_owned = false;
43800 void* keys_manager_ptr = untag_ptr(keys_manager);
43801 CHECK_ACCESS(keys_manager_ptr);
43802 LDKKeysInterface keys_manager_conv = *(LDKKeysInterface*)(keys_manager_ptr);
43803 if (keys_manager_conv.free == LDKKeysInterface_JCalls_free) {
43804 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
43805 LDKKeysInterface_JCalls_cloned(&keys_manager_conv);
43807 LDKCurrency network_conv = LDKCurrency_from_js(network);
43808 void* amt_msat_ptr = untag_ptr(amt_msat);
43809 CHECK_ACCESS(amt_msat_ptr);
43810 LDKCOption_u64Z amt_msat_conv = *(LDKCOption_u64Z*)(amt_msat_ptr);
43811 amt_msat_conv = COption_u64Z_clone((LDKCOption_u64Z*)untag_ptr(amt_msat));
43812 LDKStr description_conv = str_ref_to_owned_c(description);
43813 LDKCResult_InvoiceSignOrCreationErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceSignOrCreationErrorZ), "LDKCResult_InvoiceSignOrCreationErrorZ");
43814 *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);
43815 return tag_ptr(ret_conv, true);
43818 void __attribute__((export_name("TS_DefaultRouter_free"))) TS_DefaultRouter_free(uint64_t this_obj) {
43819 LDKDefaultRouter this_obj_conv;
43820 this_obj_conv.inner = untag_ptr(this_obj);
43821 this_obj_conv.is_owned = ptr_is_owned(this_obj);
43822 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_obj_conv);
43823 DefaultRouter_free(this_obj_conv);
43826 uint64_t __attribute__((export_name("TS_DefaultRouter_new"))) TS_DefaultRouter_new(uint64_t network_graph, uint64_t logger, int8_tArray random_seed_bytes) {
43827 LDKNetworkGraph network_graph_conv;
43828 network_graph_conv.inner = untag_ptr(network_graph);
43829 network_graph_conv.is_owned = ptr_is_owned(network_graph);
43830 CHECK_INNER_FIELD_ACCESS_OR_NULL(network_graph_conv);
43831 network_graph_conv.is_owned = false;
43832 void* logger_ptr = untag_ptr(logger);
43833 CHECK_ACCESS(logger_ptr);
43834 LDKLogger logger_conv = *(LDKLogger*)(logger_ptr);
43835 if (logger_conv.free == LDKLogger_JCalls_free) {
43836 // If this_arg is a JCalls struct, then we need to increment the refcnt in it.
43837 LDKLogger_JCalls_cloned(&logger_conv);
43839 LDKThirtyTwoBytes random_seed_bytes_ref;
43840 CHECK(random_seed_bytes->arr_len == 32);
43841 memcpy(random_seed_bytes_ref.data, random_seed_bytes->elems, 32); FREE(random_seed_bytes);
43842 LDKDefaultRouter ret_var = DefaultRouter_new(&network_graph_conv, logger_conv, random_seed_bytes_ref);
43843 uint64_t ret_ref = 0;
43844 CHECK_INNER_FIELD_ACCESS_OR_NULL(ret_var);
43845 ret_ref = tag_ptr(ret_var.inner, ret_var.is_owned);
43849 uint64_t __attribute__((export_name("TS_DefaultRouter_as_Router"))) TS_DefaultRouter_as_Router(uint64_t this_arg) {
43850 LDKDefaultRouter this_arg_conv;
43851 this_arg_conv.inner = untag_ptr(this_arg);
43852 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43853 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43854 this_arg_conv.is_owned = false;
43855 LDKRouter* ret_ret = MALLOC(sizeof(LDKRouter), "LDKRouter");
43856 *ret_ret = DefaultRouter_as_Router(&this_arg_conv);
43857 return tag_ptr(ret_ret, true);
43860 uint64_t __attribute__((export_name("TS_ChannelManager_as_Payer"))) TS_ChannelManager_as_Payer(uint64_t this_arg) {
43861 LDKChannelManager this_arg_conv;
43862 this_arg_conv.inner = untag_ptr(this_arg);
43863 this_arg_conv.is_owned = ptr_is_owned(this_arg);
43864 CHECK_INNER_FIELD_ACCESS_OR_NULL(this_arg_conv);
43865 this_arg_conv.is_owned = false;
43866 LDKPayer* ret_ret = MALLOC(sizeof(LDKPayer), "LDKPayer");
43867 *ret_ret = ChannelManager_as_Payer(&this_arg_conv);
43868 return tag_ptr(ret_ret, true);
43871 uint64_t __attribute__((export_name("TS_SiPrefix_from_str"))) TS_SiPrefix_from_str(jstring s) {
43872 LDKStr s_conv = str_ref_to_owned_c(s);
43873 LDKCResult_SiPrefixParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SiPrefixParseErrorZ), "LDKCResult_SiPrefixParseErrorZ");
43874 *ret_conv = SiPrefix_from_str(s_conv);
43875 return tag_ptr(ret_conv, true);
43878 uint64_t __attribute__((export_name("TS_Invoice_from_str"))) TS_Invoice_from_str(jstring s) {
43879 LDKStr s_conv = str_ref_to_owned_c(s);
43880 LDKCResult_InvoiceParseOrSemanticErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_InvoiceParseOrSemanticErrorZ), "LDKCResult_InvoiceParseOrSemanticErrorZ");
43881 *ret_conv = Invoice_from_str(s_conv);
43882 return tag_ptr(ret_conv, true);
43885 uint64_t __attribute__((export_name("TS_SignedRawInvoice_from_str"))) TS_SignedRawInvoice_from_str(jstring s) {
43886 LDKStr s_conv = str_ref_to_owned_c(s);
43887 LDKCResult_SignedRawInvoiceParseErrorZ* ret_conv = MALLOC(sizeof(LDKCResult_SignedRawInvoiceParseErrorZ), "LDKCResult_SignedRawInvoiceParseErrorZ");
43888 *ret_conv = SignedRawInvoice_from_str(s_conv);
43889 return tag_ptr(ret_conv, true);
43892 jstring __attribute__((export_name("TS_ParseError_to_str"))) TS_ParseError_to_str(uint64_t o) {
43893 LDKParseError* o_conv = (LDKParseError*)untag_ptr(o);
43894 LDKStr ret_str = ParseError_to_str(o_conv);
43895 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
43900 jstring __attribute__((export_name("TS_ParseOrSemanticError_to_str"))) TS_ParseOrSemanticError_to_str(uint64_t o) {
43901 LDKParseOrSemanticError* o_conv = (LDKParseOrSemanticError*)untag_ptr(o);
43902 LDKStr ret_str = ParseOrSemanticError_to_str(o_conv);
43903 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
43908 jstring __attribute__((export_name("TS_Invoice_to_str"))) TS_Invoice_to_str(uint64_t o) {
43910 o_conv.inner = untag_ptr(o);
43911 o_conv.is_owned = ptr_is_owned(o);
43912 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
43913 o_conv.is_owned = false;
43914 LDKStr ret_str = Invoice_to_str(&o_conv);
43915 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
43920 jstring __attribute__((export_name("TS_SignedRawInvoice_to_str"))) TS_SignedRawInvoice_to_str(uint64_t o) {
43921 LDKSignedRawInvoice o_conv;
43922 o_conv.inner = untag_ptr(o);
43923 o_conv.is_owned = ptr_is_owned(o);
43924 CHECK_INNER_FIELD_ACCESS_OR_NULL(o_conv);
43925 o_conv.is_owned = false;
43926 LDKStr ret_str = SignedRawInvoice_to_str(&o_conv);
43927 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
43932 jstring __attribute__((export_name("TS_Currency_to_str"))) TS_Currency_to_str(uint64_t o) {
43933 LDKCurrency* o_conv = (LDKCurrency*)untag_ptr(o);
43934 LDKStr ret_str = Currency_to_str(o_conv);
43935 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);
43940 jstring __attribute__((export_name("TS_SiPrefix_to_str"))) TS_SiPrefix_to_str(uint64_t o) {
43941 LDKSiPrefix* o_conv = (LDKSiPrefix*)untag_ptr(o);
43942 LDKStr ret_str = SiPrefix_to_str(o_conv);
43943 jstring ret_conv = str_ref_to_ts(ret_str.chars, ret_str.len);